From e204a0ecd0cedf4cd68e9228a4fab358e246cab6 Mon Sep 17 00:00:00 2001 From: lax1dude Date: Sun, 3 Nov 2024 14:12:00 -0800 Subject: [PATCH] Got it to compile to WASM --- .../backend/wasm/generate/gc/classes/WasmGCTypeMapper.java | 3 ++- .../teavm/backend/wasm/intrinsics/gc/WasmGCIntrinsics.java | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/org/teavm/backend/wasm/generate/gc/classes/WasmGCTypeMapper.java b/core/src/main/java/org/teavm/backend/wasm/generate/gc/classes/WasmGCTypeMapper.java index 3f9aeaa3b..6bc07335e 100644 --- a/core/src/main/java/org/teavm/backend/wasm/generate/gc/classes/WasmGCTypeMapper.java +++ b/core/src/main/java/org/teavm/backend/wasm/generate/gc/classes/WasmGCTypeMapper.java @@ -129,7 +129,8 @@ public class WasmGCTypeMapper { } if (result == null) { if (className.equals(Address.class.getName())) { - typeCache.put(className, WasmType.INT32); + result = WasmType.INT32; + typeCache.put(className, result); } else { var cls = classes.get(className); if (cls == null) { diff --git a/core/src/main/java/org/teavm/backend/wasm/intrinsics/gc/WasmGCIntrinsics.java b/core/src/main/java/org/teavm/backend/wasm/intrinsics/gc/WasmGCIntrinsics.java index 348ee01d0..4276a79c0 100644 --- a/core/src/main/java/org/teavm/backend/wasm/intrinsics/gc/WasmGCIntrinsics.java +++ b/core/src/main/java/org/teavm/backend/wasm/intrinsics/gc/WasmGCIntrinsics.java @@ -187,9 +187,8 @@ public class WasmGCIntrinsics implements WasmGCIntrinsicProvider { private void fillLaxMalloc() { laxMallocIntrinsic = new LaxMallocIntrinsic(); - add(new MethodReference(LaxMalloc.class, "laxMalloc", int.class, Address.class), laxMallocIntrinsic); - add(new MethodReference(LaxMalloc.class, "laxCalloc", int.class, Address.class), laxMallocIntrinsic); - add(new MethodReference(LaxMalloc.class, "laxFree", Address.class, void.class), laxMallocIntrinsic); + add(new MethodReference(LaxMalloc.class, "addrHeap", int.class, Address.class), laxMallocIntrinsic); + add(new MethodReference(LaxMalloc.class, "growHeapOuter", int.class, int.class), laxMallocIntrinsic); add(new MethodReference(LaxMalloc.class, "getHeapMinAddr", Address.class), laxMallocIntrinsic); add(new MethodReference(LaxMalloc.class, "getHeapMaxAddr", Address.class), laxMallocIntrinsic); }