From 5caa400eb7fe6c60a51e1e25132fd68a5ade74cd Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Tue, 13 Sep 2016 23:06:15 +0300 Subject: [PATCH] Mark several low-level methods as NoGC --- .../src/main/java/org/teavm/classlib/java/lang/TSystem.java | 2 ++ .../main/java/org/teavm/classlib/java/lang/reflect/TArray.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/classlib/src/main/java/org/teavm/classlib/java/lang/TSystem.java b/classlib/src/main/java/org/teavm/classlib/java/lang/TSystem.java index 100e18f86..cbe3d6f94 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/lang/TSystem.java +++ b/classlib/src/main/java/org/teavm/classlib/java/lang/TSystem.java @@ -23,6 +23,7 @@ import org.teavm.dependency.PluggableDependency; import org.teavm.backend.javascript.spi.GeneratedBy; import org.teavm.interop.Address; import org.teavm.interop.DelegateTo; +import org.teavm.interop.NoGC; import org.teavm.interop.Structure; import org.teavm.runtime.Allocator; import org.teavm.runtime.RuntimeArray; @@ -79,6 +80,7 @@ public final class TSystem extends TObject { @DelegateTo("doArrayCopyLowLevel") private static native void doArrayCopy(Object src, int srcPos, Object dest, int destPos, int length); + @NoGC static void doArrayCopyLowLevel(RuntimeArray src, int srcPos, RuntimeArray dest, int destPos, int length) { RuntimeClass type = RuntimeClass.getClass(src); int itemSize = type.itemType.size; diff --git a/classlib/src/main/java/org/teavm/classlib/java/lang/reflect/TArray.java b/classlib/src/main/java/org/teavm/classlib/java/lang/reflect/TArray.java index db4d58827..49b4565f4 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/lang/reflect/TArray.java +++ b/classlib/src/main/java/org/teavm/classlib/java/lang/reflect/TArray.java @@ -19,6 +19,7 @@ import org.teavm.classlib.java.lang.*; import org.teavm.dependency.PluggableDependency; import org.teavm.interop.DelegateTo; import org.teavm.backend.javascript.spi.GeneratedBy; +import org.teavm.interop.NoGC; import org.teavm.platform.PlatformClass; import org.teavm.runtime.Allocator; import org.teavm.runtime.RuntimeArray; @@ -60,6 +61,7 @@ public final class TArray extends TObject { private static native TObject newInstanceImpl(PlatformClass componentType, int length); @SuppressWarnings("unused") + @NoGC private static RuntimeObject newInstanceLowLevel(RuntimeClass cls, int length) { return Allocator.allocateArray(cls.arrayType, length).toStructure(); }