Mark several low-level methods as NoGC

This commit is contained in:
Alexey Andreev 2016-09-13 23:06:15 +03:00
parent 582177654a
commit 5caa400eb7
2 changed files with 4 additions and 0 deletions

View File

@ -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;

View File

@ -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();
}