@Override @DelegateTo("fillInStackTraceLowLevel") public Throwable fillInStackTrace() { return this; }
/** * Returns the total amount of memory in the Java Virtual Machine. The value * returned by this method may vary over time, depending on the host * environment. Note that the amount of memory required to hold an object of * any given type may be implementation-dependent. */ @DelegateTo("totalMemoryLowLevel") public long totalMemory() { return Integer.MAX_VALUE; }
/** * Returns the amount of free memory in the system. Calling the gc method * may result in increasing the value returned by freeMemory. */ @DelegateTo("freeMemoryLowLevel") public long freeMemory() { return Integer.MAX_VALUE; }
@DelegateTo("getSimpleNameCacheLowLevel") private TString getSimpleNameCache() { return simpleName; }
@DelegateTo("gcLowLevel") public static void gc() { // Do nothing }
@Override @DelegateTo("writeLowLevel") public void write(int b) throws TIOException { writeJs(b); }
@Override @DelegateTo("writeLowLevel") public void write(int b) throws TIOException { writeJs(b); }
@GeneratedBy(ArrayNativeGenerator.class) @PluggableDependency(ArrayNativeGenerator.class) @DelegateTo("getLengthLowLevel") public static native int getLength(TObject array) throws TIllegalArgumentException;
@DelegateTo("isPrimitiveLowLevel") public static boolean isPrimitive(PlatformClass cls) { return cls.getMetadata().isPrimitive(); }
@PluggableDependency(PlatformGenerator.class) @InjectedBy(PlatformGenerator.class) @DelegateTo("initClassLowLevel") public static native void initClass(PlatformClass cls);
@GeneratedBy(PlatformGenerator.class) @PluggableDependency(PlatformGenerator.class) @DelegateTo("getEnumConstantsLowLevel") public static native Enum<?>[] getEnumConstants(PlatformClass cls);
@DelegateTo("isInstanceLowLevel") public boolean isInstance(TObject obj) { return Platform.isInstance(Platform.getPlatformObject(obj), platformClass); }
@DelegateTo("isEnumLowLevel") public static boolean isEnum(PlatformClass cls) { return cls.getMetadata().isEnum(); }
@DelegateTo("isAssignableFromLowLevel") public boolean isAssignableFrom(TClass<?> obj) { return Platform.isAssignable(obj.getPlatformClass(), platformClass); }
@DelegateTo("toUpperCaseLowLevel") public static int toUpperCase(int codePoint) { return Platform.stringFromCharCode(codePoint).toUpperCase().charCodeAt(0); }
@DelegateTo("toLowerCaseLowLevel") public static int toLowerCase(int ch) { return Platform.stringFromCharCode(ch).toLowerCase().charCodeAt(0); }
@DelegateTo("isInstanceLowLevel") public static boolean isInstance(PlatformObject obj, PlatformClass cls) { return obj != null && !isUndefined(obj.getPlatformClass().getMetadata()) && isAssignable(obj.getPlatformClass(), cls); }
@DelegateTo("isAssignableLowLevel") public static boolean isAssignable(PlatformClass from, PlatformClass to) { if (from == to) { return true; } PlatformSequence<PlatformClass> supertypes = from.getMetadata().getSupertypes(); for (int i = 0; i < supertypes.getLength(); ++i) { if (isAssignable(supertypes.get(i), to)) { return true; } } return false; }
@DelegateTo("identityLowLevel") int identity() { PlatformObject platformThis = Platform.getPlatformObject(this); if (platformThis.getId() == 0) { platformThis.setId(Platform.nextObjectId()); } return Platform.getPlatformObject(this).getId(); }
@Override @DelegateTo("cloneLowLevel") @PluggableDependency(ObjectDependencyPlugin.class) protected Object clone() throws TCloneNotSupportedException { if (!(this instanceof TCloneable) && Platform.getPlatformObject(this) .getPlatformClass().getMetadata().getArrayItem() == null) { throw new TCloneNotSupportedException(); } Object result = Platform.clone(this); Platform.getPlatformObject(result).setId(Platform.nextObjectId()); return result; }