From 2b498843c212ac7deb9af3e9752ac1b767ac4c2a Mon Sep 17 00:00:00 2001 From: Stephanie Gawroriski Date: Tue, 30 May 2023 16:00:23 +0000 Subject: [PATCH] Remove Assembly. --- emulators/emulator-base/src/main/cpp/mle_math.cpp | 42 + .../emulator-base/src/main/cpp/nativebinding.cpp | 249 +-- .../emulator-base/src/main/headers/squirreljme.h | 1 + .../java/cc/squirreljme/vm/springcoat/MLEMath.java | 42 + .../vm/springcoat/SpringThreadWorker.java | 21 +- .../src/main/java/cc/squirreljme/jvm/Assembly.java | 1591 -------------------- .../squirreljme/jvm/ClassLoadingAdjustments.java | 1 - .../main/java/cc/squirreljme/jvm/SoftDouble.java | 11 - .../main/java/cc/squirreljme/jvm/SoftFloat.java | 22 +- .../main/java/cc/squirreljme/jvm/SoftInteger.java | 6 +- .../src/main/java/cc/squirreljme/jvm/SoftLong.java | 39 +- .../java/cc/squirreljme/jvm/mle/MathShelf.java | 61 +- .../cldc-compact/src/main/java/java/lang/Long.java | 8 +- 13 files changed, 230 insertions(+), 1864 deletions(-) create mode 100644 emulators/emulator-base/src/main/cpp/mle_math.cpp rewrite emulators/emulator-base/src/main/cpp/nativebinding.cpp (84%) delete mode 100644 modules/cldc-compact/src/main/java/cc/squirreljme/jvm/Assembly.java diff --git a/emulators/emulator-base/src/main/cpp/mle_math.cpp b/emulators/emulator-base/src/main/cpp/mle_math.cpp new file mode 100644 index 0000000000..4e372867c5 --- /dev/null +++ b/emulators/emulator-base/src/main/cpp/mle_math.cpp @@ -0,0 +1,42 @@ +/* -*- Mode: C++; indent-tabs-mode: t; tab-width: 4 -*- +// --------------------------------------------------------------------------- +// SquirrelJME +// Copyright (C) Stephanie Gawroriski +// --------------------------------------------------------------------------- +// SquirrelJME is under the GNU General Public License v3+, or later. +// See license.mkd for licensing and copyright information. +// ------------------------------------------------------------------------ */ + +#include + +#include "squirreljme.h" + +JNIEXPORT jlong JNICALL longPack(JNIEnv* env, jclass classy, jint al, jint ah) +{ + return (((jlong)al) & UINT64_C(0xFFFFFFFF)) | + ((((jlong)ah) & UINT64_C(0xFFFFFFFF)) << UINT64_C(32)); +} + +JNIEXPORT jint JNICALL longUnpackHigh(JNIEnv* env, jclass classy, jlong v) +{ + return (jint)(v >> UINT64_C(32)); +} + +JNIEXPORT jint JNICALL longUnpackLow(JNIEnv* env, jclass classy, jlong v) +{ + return (jint)(v); +} + +static const JNINativeMethod mleMathMethods[] = +{ + {"longPack", "(II)J", (void*)longPack}, + {"longUnpackHigh", "(J)I", (void*)longUnpackHigh}, + {"longUnpackLow", "(J)I", (void*)longUnpackLow}, +}; + +jint JNICALL mleMathInit(JNIEnv* env, jclass classy) +{ + return env->RegisterNatives( + env->FindClass("cc/squirreljme/jvm/mle/MathShelf"), + mleMathMethods, sizeof(mleMathMethods) / sizeof(JNINativeMethod)); +} diff --git a/emulators/emulator-base/src/main/cpp/nativebinding.cpp b/emulators/emulator-base/src/main/cpp/nativebinding.cpp dissimilarity index 84% index 0632c8b7c1..8df8d57d0c 100644 --- a/emulators/emulator-base/src/main/cpp/nativebinding.cpp +++ b/emulators/emulator-base/src/main/cpp/nativebinding.cpp @@ -1,196 +1,53 @@ -/* --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the GNU General Public License v3+, or later. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------*/ - -#include -#include -#include - -#include "jni.h" -#include "cc_squirreljme_emulator_NativeBinding.h" -#include "cc_squirreljme_jvm_Assembly.h" -#include "squirreljme.h" - -JNIEXPORT jlong JNICALL longPack(JNIEnv* env, jclass classy, jint al, jint ah) -{ - return (((jlong)al) & UINT64_C(0xFFFFFFFF)) | - ((((jlong)ah) & UINT64_C(0xFFFFFFFF)) << UINT64_C(32)); -} - -JNIEXPORT jint JNICALL longUnpackHigh(JNIEnv* env, jclass classy, jlong v) -{ - return (jint)(v >> UINT64_C(32)); -} - -JNIEXPORT jint JNICALL longUnpackLow(JNIEnv* env, jclass classy, jlong v) -{ - return (jint)(v); -} - -// Method handler for special functions -JNIEXPORT void JNICALL restrictedFunction(JNIEnv* env, jclass classy); - -// Assembly method mappings -static const JNINativeMethod assemblyMethods[] = -{ - {"arrayLength", "(I)I", (void*)restrictedFunction}, - {"arrayLength", "(Ljava/lang/Object;)I", (void*)restrictedFunction}, - {"atomicCompareGetAndSet", "(IIJ)I", (void*)restrictedFunction}, - {"atomicDecrementAndGet", "(J)I", (void*)restrictedFunction}, - {"atomicIncrement", "(J)V", (void*)restrictedFunction}, - {"breakpoint", "()V", (void*)restrictedFunction}, - {"doublePack", "(II)D", (void*)restrictedFunction}, - {"doubleToRawLongBits", "(D)J", (void*)restrictedFunction}, - {"doubleUnpackHigh", "(D)I", (void*)restrictedFunction}, - {"doubleUnpackLow", "(D)I", (void*)restrictedFunction}, - {"exceptionHandle", "()V", (void*)restrictedFunction}, - {"floatToRawIntBits", "(F)I", (void*)restrictedFunction}, - {"intBitsToFloat", "(I)F", (void*)restrictedFunction}, - {"invoke", "(II)V", (void*)restrictedFunction}, - {"invoke", "(III)V", (void*)restrictedFunction}, - {"invoke", "(IIII)V", (void*)restrictedFunction}, - {"invoke", "(IIIII)V", (void*)restrictedFunction}, - {"invoke", "(IIIIII)V", (void*)restrictedFunction}, - {"invoke", "(IIIIIII)V", (void*)restrictedFunction}, - {"invoke", "(IIIIIIII)V", (void*)restrictedFunction}, - {"invoke", "(IIIIIIIII)V", (void*)restrictedFunction}, - {"invoke", "(IIIIIIIIII)V", (void*)restrictedFunction}, - {"invokeV", "(II)I", (void*)restrictedFunction}, - {"invokeV", "(III)I", (void*)restrictedFunction}, - {"invokeV", "(IIII)I", (void*)restrictedFunction}, - {"invokeV", "(IIIII)I", (void*)restrictedFunction}, - {"invokeV", "(IIIIII)I", (void*)restrictedFunction}, - {"invokeV", "(IIIIIII)I", (void*)restrictedFunction}, - {"invokeV", "(IIIIIIII)I", (void*)restrictedFunction}, - {"invokeV", "(IIIIIIIII)I", (void*)restrictedFunction}, - {"invokeV", "(IIIIIIIIII)I", (void*)restrictedFunction}, - {"invokeVL", "(II)J", (void*)restrictedFunction}, - {"invokeVL", "(III)J", (void*)restrictedFunction}, - {"invokeVL", "(IIII)J", (void*)restrictedFunction}, - {"invokeVL", "(IIIII)J", (void*)restrictedFunction}, - {"invokeVL", "(IIIIII)J", (void*)restrictedFunction}, - {"invokeVL", "(IIIIIII)J", (void*)restrictedFunction}, - {"invokeVL", "(IIIIIIII)J", (void*)restrictedFunction}, - {"invokeVL", "(IIIIIIIII)J", (void*)restrictedFunction}, - {"invokeVL", "(IIIIIIIIII)J", (void*)restrictedFunction}, - {"longBitsToDouble", "(J)D", (void*)restrictedFunction}, - {"longPack", "(II)J", (void*)longPack}, - {"longUnpackHigh", "(J)I", (void*)longUnpackHigh}, - {"longUnpackLow", "(J)I", (void*)longUnpackLow}, - {"memReadByte", "(JI)I", (void*)restrictedFunction}, - {"memReadInt", "(JI)I", (void*)restrictedFunction}, - {"memReadLong", "(JI)J", (void*)restrictedFunction}, - {"memReadShort", "(JI)I", (void*)restrictedFunction}, - {"memWriteByte", "(JII)V", (void*)restrictedFunction}, - {"memWriteInt", "(JII)V", (void*)restrictedFunction}, - {"memWriteLong", "(JIJ)V", (void*)restrictedFunction}, - {"memWriteShort", "(JII)V", (void*)restrictedFunction}, - {"monitorCountDecrementAndGetAtomic", "(J)I", (void*)restrictedFunction}, - {"monitorCountDecrementAndGetAtomic", "(Ljava/lang/Object;)I", (void*)restrictedFunction}, - {"monitorCountIncrementAndGetAtomic", "(J)I", (void*)restrictedFunction}, - {"monitorCountIncrementAndGetAtomic", "(Ljava/lang/Object;)I", (void*)restrictedFunction}, - {"monitorCountGetAtomic", "(J)I", (void*)restrictedFunction}, - {"monitorCountGetAtomic", "(Ljava/lang/Object;)I", (void*)restrictedFunction}, - {"monitorCountSetAtomic", "(JI)V", (void*)restrictedFunction}, - {"monitorCountSetAtomic", "(Ljava/lang/Object;I)V", (void*)restrictedFunction}, - {"monitorOwnerCompareGetAndSetAtomic", "(JJJ)Ljava/lang/Thread;", (void*)restrictedFunction}, - {"monitorOwnerCompareGetAndSetAtomic", "(Ljava/lang/Object;JJ)Ljava/lang/Thread;", (void*)restrictedFunction}, - {"monitorOwnerCompareGetAndSetAtomic", "(JLjava/lang/Thread;Ljava/lang/Thread;)Ljava/lang/Thread;", (void*)restrictedFunction}, - {"monitorOwnerCompareGetAndSetAtomic", "(Ljava/lang/Object;Ljava/lang/Thread;Ljava/lang/Thread;)Ljava/lang/Thread;", (void*)restrictedFunction}, - {"monitorOwnerCompareGetAndSetAtomicPointer", "(JJJ)J", (void*)restrictedFunction}, - {"monitorOwnerCompareGetAndSetAtomicPointer", "(Ljava/lang/Object;JJ)J", (void*)restrictedFunction}, - {"monitorOwnerCompareGetAndSetAtomicPointer", "(JLjava/lang/Thread;Ljava/lang/Thread;)J", (void*)restrictedFunction}, - {"monitorOwnerCompareGetAndSetAtomicPointer", "(Ljava/lang/Object;Ljava/lang/Thread;Ljava/lang/Thread;)J", (void*)restrictedFunction}, - {"monitorOwnerGetAtomic", "(J)Ljava/lang/Thread;", (void*)restrictedFunction}, - {"monitorOwnerGetAtomic", "(Ljava/lang/Object;)Ljava/lang/Thread;", (void*)restrictedFunction}, - {"monitorOwnerGetPointerAtomic", "(J)J", (void*)restrictedFunction}, - {"monitorOwnerGetPointerAtomic", "(Ljava/lang/Object;)J", (void*)restrictedFunction}, - {"monitorOwnerSetAtomic", "(JJ)V", (void*)restrictedFunction}, - {"monitorOwnerSetAtomic", "(JLjava/lang/Thread;)V", (void*)restrictedFunction}, - {"monitorOwnerSetAtomic", "(Ljava/lang/Object;J)V", (void*)restrictedFunction}, - {"monitorOwnerSetAtomic", "(Ljava/lang/Object;Ljava/lang/Thread;)V", (void*)restrictedFunction}, - {"objectToPointer", "(Ljava/lang/Object;)I", (void*)restrictedFunction}, - {"objectToPointerRefQueue", "(Ljava/lang/Object;)I", (void*)restrictedFunction}, - {"pointerToObject", "(I)Ljava/lang/Object;", (void*)restrictedFunction}, - {"poolLoad", "(II)I", (void*)restrictedFunction}, - {"poolLoad", "(Ljava/lang/Object;I)I", (void*)restrictedFunction}, - {"refCount", "(I)V", (void*)restrictedFunction}, - {"refCount", "(Ljava/lang/Object;)V", (void*)restrictedFunction}, - {"refGetCount", "(I)I", (void*)restrictedFunction}, - {"refGetCount", "(Ljava/lang/Object;)I", (void*)restrictedFunction}, - {"refSetCount", "(II)V", (void*)restrictedFunction}, - {"refSetCount", "(Ljava/lang/Object;I)V", (void*)restrictedFunction}, - {"refUncount", "(I)V", (void*)restrictedFunction}, - {"refUncount", "(Ljava/lang/Object;)V", (void*)restrictedFunction}, - {"returnFrame", "()V", (void*)restrictedFunction}, - {"returnFrame", "(I)V", (void*)restrictedFunction}, - {"returnFrame", "(II)V", (void*)restrictedFunction}, - {"returnFrameLong", "(J)V", (void*)restrictedFunction}, - {"specialGetExceptionRegister", "()Ljava/lang/Object;", (void*)restrictedFunction}, - {"specialGetExceptionRegisterThrowable", "()Ljava/lang/Throwable;", (void*)restrictedFunction}, - {"specialGetExceptionRegisterPointer", "()J", (void*)restrictedFunction}, - {"specialGetPoolRegister", "()Ljava/lang/Object;", (void*)restrictedFunction}, - {"specialGetPoolRegisterPointer", "()J", (void*)restrictedFunction}, - {"specialGetReturnRegister", "()I", (void*)restrictedFunction}, - {"specialGetReturnRegisterLong", "()J", (void*)restrictedFunction}, - {"specialGetThreadRegister", "()Ljava/lang/Thread;", (void*)restrictedFunction}, - {"specialGetThreadRegisterPointer", "()J", (void*)restrictedFunction}, - {"specialSetExceptionRegister", "(J)V", (void*)restrictedFunction}, - {"specialSetExceptionRegister", "(Ljava/lang/Object;)V", (void*)restrictedFunction}, - {"specialSetPoolRegister", "(J)V", (void*)restrictedFunction}, - {"specialSetPoolRegister", "(Ljava/lang/Object;)V", (void*)restrictedFunction}, - {"specialSetThreadRegister", "(J)V", (void*)restrictedFunction}, - {"specialSetThreadRegister", "(Ljava/lang/Thread;)V", (void*)restrictedFunction}, -}; - -JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved) -{ - JNIEnv* env; - - // Used to indicate that something might be happened - fprintf(stderr, "JNI Sub-Level: Loading Library...\n"); - - // Support Java 7! - return JNI_VERSION_1_6; -} - -JNIEXPORT void JNICALL restrictedFunction(JNIEnv* env, jclass classy) -{ - // Call the oops method, so we can get a reasonable stack trace - env->Throw((jthrowable)forwardCallStaticObject(env, - "cc.squirreljme.runtime.cldc.debug.Debugging", - "oops", "()java/lang/Error")); -} - -JNIEXPORT jint JNICALL Java_cc_squirreljme_emulator_NativeBinding__1_1bindMethods - (JNIEnv* env, jclass classy) -{ - jint rv = 0; - - // It is happening! - fprintf(stderr, "JNI Sub-Level: Binding Methods...\n"); - - rv |= env->RegisterNatives(env->FindClass("cc/squirreljme/jvm/Assembly"), - assemblyMethods, sizeof(assemblyMethods) / sizeof(JNINativeMethod)); - - rv |= mleDebugInit(env, classy); - rv |= mleFormInit(env, classy); - rv |= mleJarInit(env, classy); - rv |= mleObjectInit(env, classy); - rv |= mlePencilInit(env, classy); - rv |= mleReflectionInit(env, classy); - rv |= mleRuntimeInit(env, classy); - rv |= mleTaskInit(env, classy); - rv |= mleTerminalInit(env, classy); - rv |= mleTypeInit(env, classy); - rv |= mleThreadInit(env, classy); - - // It happened! - fprintf(stderr, "JNI Sub-Level: Methods are now bound!\n"); - - return rv; -} +/* --------------------------------------------------------------------------- +// SquirrelJME +// Copyright (C) Stephanie Gawroriski +// --------------------------------------------------------------------------- +// SquirrelJME is under the GNU General Public License v3+, or later. +// See license.mkd for licensing and copyright information. +// --------------------------------------------------------------------------*/ + +#include +#include +#include + +#include "jni.h" +#include "cc_squirreljme_emulator_NativeBinding.h" +#include "squirreljme.h" + +JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved) +{ + JNIEnv* env; + + // Used to indicate that something might be happened + fprintf(stderr, "JNI Sub-Level: Loading Library...\n"); + + // Support Java 7! + return JNI_VERSION_1_6; +} + +JNIEXPORT jint JNICALL Java_cc_squirreljme_emulator_NativeBinding__1_1bindMethods + (JNIEnv* env, jclass classy) +{ + jint rv = 0; + + // It is happening! + fprintf(stderr, "JNI Sub-Level: Binding Methods...\n"); + + rv |= mleDebugInit(env, classy); + rv |= mleFormInit(env, classy); + rv |= mleJarInit(env, classy); + rv |= mleMathInit(env, classy); + rv |= mleObjectInit(env, classy); + rv |= mlePencilInit(env, classy); + rv |= mleReflectionInit(env, classy); + rv |= mleRuntimeInit(env, classy); + rv |= mleTaskInit(env, classy); + rv |= mleTerminalInit(env, classy); + rv |= mleTypeInit(env, classy); + rv |= mleThreadInit(env, classy); + + // It happened! + fprintf(stderr, "JNI Sub-Level: Methods are now bound!\n"); + + return rv; +} diff --git a/emulators/emulator-base/src/main/headers/squirreljme.h b/emulators/emulator-base/src/main/headers/squirreljme.h index ddd7bba8e1..a025dbed03 100644 --- a/emulators/emulator-base/src/main/headers/squirreljme.h +++ b/emulators/emulator-base/src/main/headers/squirreljme.h @@ -16,6 +16,7 @@ jint JNICALL mleDebugInit(JNIEnv* env, jclass classy); jint JNICALL mleFormInit(JNIEnv* env, jclass classy); jint JNICALL mleJarInit(JNIEnv* env, jclass classy); +jint JNICALL mleMathInit(JNIEnv* env, jclass classy); jint JNICALL mleObjectInit(JNIEnv* env, jclass classy); jint JNICALL mlePencilInit(JNIEnv* env, jclass classy); jint JNICALL mleReflectionInit(JNIEnv* env, jclass classy); diff --git a/emulators/springcoat-vm/src/main/java/cc/squirreljme/vm/springcoat/MLEMath.java b/emulators/springcoat-vm/src/main/java/cc/squirreljme/vm/springcoat/MLEMath.java index 9b070b4f1e..51c78b3dc5 100644 --- a/emulators/springcoat-vm/src/main/java/cc/squirreljme/vm/springcoat/MLEMath.java +++ b/emulators/springcoat-vm/src/main/java/cc/squirreljme/vm/springcoat/MLEMath.java @@ -19,6 +19,48 @@ import cc.squirreljme.jvm.mle.MathShelf; public enum MLEMath implements MLEFunction { + /** {@link MathShelf#longPack(int, int)}. */ + LONG_PACK("longPack:(II)J") + { + /** + * {@inheritDoc} + * @since 2023/05/30 + */ + @Override + public Object handle(SpringThreadWorker __thread, Object... __args) + { + return MathShelf.longPack((int)__args[0], (int)__args[1]); + } + }, + + /** {@link MathShelf#longUnpackHigh(long)}. */ + LONG_UNPACK_HIGH("longUnpackHigh:(J)I") + { + /** + * {@inheritDoc} + * @since 2023/05/30 + */ + @Override + public Object handle(SpringThreadWorker __thread, Object... __args) + { + return MathShelf.longUnpackHigh((long)__args[0]); + } + }, + + /** {@link MathShelf#longUnpackLow(long)}. */ + LONG_UNPACK_LOW("longUnpackLow:(J)I") + { + /** + * {@inheritDoc} + * @since 2023/05/30 + */ + @Override + public Object handle(SpringThreadWorker __thread, Object... __args) + { + return MathShelf.longUnpackLow((long)__args[0]); + } + }, + /** {@link MathShelf#rawDoubleToLong(double)}. */ RAW_DOUBLE_TO_LONG("rawDoubleToLong:(D)J") { diff --git a/emulators/springcoat-vm/src/main/java/cc/squirreljme/vm/springcoat/SpringThreadWorker.java b/emulators/springcoat-vm/src/main/java/cc/squirreljme/vm/springcoat/SpringThreadWorker.java index f2a08121b9..a0b911dc14 100644 --- a/emulators/springcoat-vm/src/main/java/cc/squirreljme/vm/springcoat/SpringThreadWorker.java +++ b/emulators/springcoat-vm/src/main/java/cc/squirreljme/vm/springcoat/SpringThreadWorker.java @@ -21,10 +21,9 @@ import cc.squirreljme.jdwp.trips.JDWPTripBreakpoint; import cc.squirreljme.jdwp.trips.JDWPTripClassStatus; import cc.squirreljme.jdwp.trips.JDWPTripField; import cc.squirreljme.jdwp.trips.JDWPTripThread; -import cc.squirreljme.jvm.Assembly; +import cc.squirreljme.jvm.mle.MathShelf; import cc.squirreljme.jvm.mle.constants.VerboseDebugFlag; import cc.squirreljme.runtime.cldc.debug.Debugging; -import cc.squirreljme.vm.springcoat.brackets.TaskObject; import cc.squirreljme.vm.springcoat.brackets.TypeObject; import cc.squirreljme.vm.springcoat.exceptions.SpringArithmeticException; import cc.squirreljme.vm.springcoat.exceptions.SpringClassCastException; @@ -1086,24 +1085,8 @@ public final class SpringThreadWorker // All low-level calls are considered invalid in SpringCoat because // it does not have the given functionality. - if (__class.toString().startsWith("cc/squirreljme/jvm/Assembly") || - __class.toString().startsWith("cc/squirreljme/jvm/pack/lle/")) + if (__class.toString().startsWith("cc/squirreljme/jvm/pack/lle/")) { - // The only exception is made for packing/unpacking longs - if (__class.toString().startsWith("cc/squirreljme/jvm/Assembly")) - switch (__method.name().toString()) - { - case "longPack": - return Assembly.longPack( - (int)__args[0], (int)__args[1]); - - case "longUnpackHigh": - return Assembly.longUnpackHigh((long)__args[0]); - - case "longUnpackLow": - return Assembly.longUnpackLow((long)__args[0]); - } - // Otherwise fail throw new SpringVirtualMachineException(String.format( "Invalid LLE native call: %s:%s %s", __class, __method, diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/Assembly.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/Assembly.java deleted file mode 100644 index 320ffbbddf..0000000000 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/Assembly.java +++ /dev/null @@ -1,1591 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the GNU General Public License v3+, or later. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package cc.squirreljme.jvm; - -import cc.squirreljme.jvm.mle.brackets.TypeBracket; -import cc.squirreljme.runtime.cldc.annotation.Api; -import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; - -/** - * This class is used special by the compiler to transform all the various - * operations into regular instructions rather than method calls. - * - * The compiler will take all of the method arguments and instead use their - * inputs and outputs from the values of registers instead. However due to - * this, this means that these instructions are purely primitive in that - * they must not depend on any aspect of the virtual machine. - * - * @since 2019/04/20 - */ -@SquirrelJMEVendorApi -@SuppressWarnings({"NewMethodNamingConvention", "OverlyComplexClass"}) -public final class Assembly -{ - /** - * Not used. - * - * @since 2019/04/20 - */ - private Assembly() - { - } - - /** - * Returns the array length of the given object. - * - * @param __o The object to get the length of. - * @return The length of the array, will return a negative value if not - * an array. - * @since 2020/02/23 - */ - public static native int arrayLength(int __o); - - /** - * Returns the array length of the given object. - * - * @param __o The object to get the length of. - * @return The length of the array, will return a negative value if not - * an array. - * @since 2019/05/24 - */ - public static native int arrayLength(Object __o); - - /** - * Atomic comparison and set. - * - * @param __comp The value to compare and if matches, {@code __set} is - * written. - * @param __set The value to set if matched. - * @param __addr The address to write to. - * @return The value that was read before the set. - * @since 2019/07/01 - */ - public static native int atomicCompareGetAndSet(int __comp, int __set, - long __addr); - - /** - * Atomically decrements a value and returns the result. - * - * @param __addr The address to decrement. - * @return The get value. - * @since 2019/07/01 - */ - public static native int atomicDecrementAndGet(long __addr); - - /** - * Atomically increments a value. - * - * @param __addr The address to increment. - * @since 2019/07/01 - */ - public static native void atomicIncrement(long __addr); - - /** - * Trigger breakpoint within the virtual machine. - * - * @since 2019/04/21 - */ - public static native void breakpoint(); - - /** - * Packs the given two integers to a double value. - * - * @param __lo The low value. - * @param __hi The high value. - * @return The double value. - * @since 2019/06/21 - */ - public static native double doublePack(int __lo, int __hi); - - /** - * Double to raw long bits. - * - * @param __d The input double. - * @return The raw long bits. - * @since 2018/11/03 - */ - public static native long doubleToRawLongBits(double __d); - - /** - * Unpacks the high value of a double. - * - * @param __d The double to unpack. - * @return The unpacked high value. - * @since 2020/02/24 - */ - @SquirrelJMEVendorApi - public static native int doubleUnpackHigh(double __d); - - /** - * Unpacks the low value of a double. - * - * @param __d The double to unpack. - * @return The unpacked low value. - * @since 2020/02/24 - */ - @SquirrelJMEVendorApi - public static native int doubleUnpackLow(double __d); - - /** - * Performs explicit exception handling. - * - * @since 2019/04/28 - */ - public static native void exceptionHandle(); - - /** - * Float to raw int bits. - * - * @param __f The input float. - * @return The raw int bits. - * @since 2018/11/04 - */ - public static native int floatToRawIntBits(float __f); - - /** - * Integer bits to float. - * - * @param __b The input bits. - * @return The resulting float. - * @since 2018/11/04 - */ - public static native float intBitsToFloat(int __b); - - /** - * Invoke method at pointer. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @since 2019/04/28 - */ - public static native void invoke(int __addr, int __pool); - - /** - * Invoke method at pointer, with arguments. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @param __a Argument. - * @since 2019/04/28 - */ - public static native void invoke(int __addr, int __pool, int __a); - - /** - * Invoke method at pointer, with arguments. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @param __a Argument. - * @param __b Argument. - * @since 2019/04/28 - */ - public static native void invoke(int __addr, int __pool, int __a, - int __b); - - /** - * Invoke method at pointer, with arguments. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @param __a Argument. - * @param __b Argument. - * @param __c Argument. - * @since 2019/04/28 - */ - public static native void invoke(int __addr, int __pool, int __a, - int __b, int __c); - - /** - * Invoke method at pointer, with arguments. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @param __a Argument. - * @param __b Argument. - * @param __c Argument. - * @param __d Argument. - * @since 2019/04/28 - */ - public static native void invoke(int __addr, int __pool, int __a, - int __b, int __c, int __d); - - /** - * Invoke method at pointer, with arguments. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @param __a Argument. - * @param __b Argument. - * @param __c Argument. - * @param __d Argument. - * @param __e Argument. - * @since 2019/04/28 - */ - public static native void invoke(int __addr, int __pool, int __a, - int __b, int __c, int __d, int __e); - - /** - * Invoke method at pointer, with arguments. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @param __a Argument. - * @param __b Argument. - * @param __c Argument. - * @param __d Argument. - * @param __e Argument. - * @param __f Argument. - * @since 2019/04/28 - */ - public static native void invoke(int __addr, int __pool, int __a, - int __b, int __c, int __d, int __e, int __f); - - /** - * Invoke method at pointer, with arguments. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @param __a Argument. - * @param __b Argument. - * @param __c Argument. - * @param __d Argument. - * @param __e Argument. - * @param __f Argument. - * @param __g Argument. - * @since 2019/04/28 - */ - public static native void invoke(int __addr, int __pool, int __a, - int __b, int __c, int __d, int __e, int __f, int __g); - - /** - * Invoke method at pointer, with arguments. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @param __a Argument. - * @param __b Argument. - * @param __c Argument. - * @param __d Argument. - * @param __e Argument. - * @param __f Argument. - * @param __g Argument. - * @param __h Argument. - * @since 2019/04/28 - */ - public static native void invoke(int __addr, int __pool, int __a, - int __b, int __c, int __d, int __e, int __f, int __g, int __h); - - /** - * Invoke method at pointer. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @return The result of the invocation. - * @since 2019/04/28 - */ - public static native int invokeV(int __addr, int __pool); - - /** - * Invoke method at pointer, with arguments. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @param __a Argument. - * @return The result of the invocation. - * @since 2019/04/28 - */ - public static native int invokeV(int __addr, int __pool, int __a); - - /** - * Invoke method at pointer, with arguments. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @param __a Argument. - * @param __b Argument. - * @return The result of the invocation. - * @since 2019/04/28 - */ - public static native int invokeV(int __addr, int __pool, int __a, - int __b); - - /** - * Invoke method at pointer, with arguments. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @param __a Argument. - * @param __b Argument. - * @param __c Argument. - * @return The result of the invocation. - * @since 2019/04/28 - */ - public static native int invokeV(int __addr, int __pool, int __a, - int __b, int __c); - - /** - * Invoke method at pointer, with arguments. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @param __a Argument. - * @param __b Argument. - * @param __c Argument. - * @param __d Argument. - * @return The result of the invocation. - * @since 2019/04/28 - */ - public static native int invokeV(int __addr, int __pool, int __a, - int __b, int __c, int __d); - - /** - * Invoke method at pointer, with arguments. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @param __a Argument. - * @param __b Argument. - * @param __c Argument. - * @param __d Argument. - * @param __e Argument. - * @return The result of the invocation. - * @since 2019/04/28 - */ - public static native int invokeV(int __addr, int __pool, int __a, - int __b, int __c, int __d, int __e); - - /** - * Invoke method at pointer, with arguments. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @param __a Argument. - * @param __b Argument. - * @param __c Argument. - * @param __d Argument. - * @param __e Argument. - * @param __f Argument. - * @return The result of the invocation. - * @since 2019/04/28 - */ - public static native int invokeV(int __addr, int __pool, int __a, - int __b, int __c, int __d, int __e, int __f); - - /** - * Invoke method at pointer, with arguments. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @param __a Argument. - * @param __b Argument. - * @param __c Argument. - * @param __d Argument. - * @param __e Argument. - * @param __f Argument. - * @param __g Argument. - * @return The result of the invocation. - * @since 2019/04/28 - */ - public static native int invokeV(int __addr, int __pool, int __a, - int __b, int __c, int __d, int __e, int __f, int __g); - - /** - * Invoke method at pointer, with arguments. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @param __a Argument. - * @param __b Argument. - * @param __c Argument. - * @param __d Argument. - * @param __e Argument. - * @param __f Argument. - * @param __g Argument. - * @param __h Argument. - * @return The result of the invocation. - * @since 2019/04/28 - */ - public static native int invokeV(int __addr, int __pool, int __a, - int __b, int __c, int __d, int __e, int __f, int __g, int __h); - - /** - * Invoke method at pointer. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @return The result of the invocation. - * @since 2019/12/08 - */ - public static native long invokeVL(int __addr, int __pool); - - /** - * Invoke method at pointer, with arguments. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @param __a Argument. - * @return The result of the invocation. - * @since 2019/12/08 - */ - public static native long invokeVL(int __addr, int __pool, int __a); - - /** - * Invoke method at pointer, with arguments. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @param __a Argument. - * @param __b Argument. - * @return The result of the invocation. - * @since 2019/12/08 - */ - public static native long invokeVL(int __addr, int __pool, int __a, - int __b); - - /** - * Invoke method at pointer, with arguments. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @param __a Argument. - * @param __b Argument. - * @param __c Argument. - * @return The result of the invocation. - * @since 2019/12/08 - */ - public static native long invokeVL(int __addr, int __pool, int __a, - int __b, int __c); - - /** - * Invoke method at pointer, with arguments. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @param __a Argument. - * @param __b Argument. - * @param __c Argument. - * @param __d Argument. - * @return The result of the invocation. - * @since 2019/12/08 - */ - public static native long invokeVL(int __addr, int __pool, int __a, - int __b, int __c, int __d); - - /** - * Invoke method at pointer, with arguments. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @param __a Argument. - * @param __b Argument. - * @param __c Argument. - * @param __d Argument. - * @param __e Argument. - * @return The result of the invocation. - * @since 2019/12/08 - */ - public static native long invokeVL(int __addr, int __pool, int __a, - int __b, int __c, int __d, int __e); - - /** - * Invoke method at pointer, with arguments. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @param __a Argument. - * @param __b Argument. - * @param __c Argument. - * @param __d Argument. - * @param __e Argument. - * @param __f Argument. - * @return The result of the invocation. - * @since 2019/12/08 - */ - public static native long invokeVL(int __addr, int __pool, int __a, - int __b, int __c, int __d, int __e, int __f); - - /** - * Invoke method at pointer, with arguments. - * - * @param __addr The address to invoke. - * @param __pool The pool address to load. - * @param __a Argument. - * @param __b Argument. - * @param __c Argument. - * @param __d Argument. - * @param __e Argument. - * @param __f Argument. - * @param __g Argument. - * @return The result of the invocation. - * @since 2019/12/08 - */ - public static native long invokeVL(int __addr, int __pool, int __a, - int __b, int __c, int __d, int __e, int __f, int __g); - - /** - * Invoke method at pointer, with arguments. - * - * @param __addr The address to invoke. - * @param __pool The pool pointer to load. - * @param __a Argument. - * @param __b Argument. - * @param __c Argument. - * @param __d Argument. - * @param __e Argument. - * @param __f Argument. - * @param __g Argument. - * @param __h Argument. - * @return The result of the invocation. - * @since 2019/12/08 - */ - public static native long invokeVL(int __addr, int __pool, int __a, - int __b, int __c, int __d, int __e, int __f, int __g, int __h); - - /** - * Long bits to double. - * - * @param __b The input bits. - * @return The resulting double. - * @since 2018/11/03 - */ - public static native double longBitsToDouble(long __b); - - /** - * Packs the given two integers to a long value. - * - * @param __lo The low value. - * @param __hi The high value. - * @return The long value. - * @since 2019/06/21 - */ - @SquirrelJMEVendorApi - public static native long longPack(int __lo, int __hi); - - /** - * Unpack high value from long. - * - * @param __v The long value. - * @return The unpacked fragment. - * @since 2019/06/21 - */ - @SquirrelJMEVendorApi - public static native int longUnpackHigh(long __v); - - /** - * Unpack low value from long. - * - * @param __v The long value. - * @return The unpacked fragment. - * @since 2019/06/21 - */ - @SquirrelJMEVendorApi - public static native int longUnpackLow(long __v); - - /** - * Reads the given value from the memory handle. - * - * @param __mh The handle to read from. - * @param __off The offset into the handle. - * @return The value that was read. - * @since 2021/01/23 - */ - public static native int memHandleReadByte(Object __mh, int __off); - - /** - * Reads the given value from the memory handle. - * - * @param __mh The handle to read from. - * @param __off The offset into the handle. - * @return The value that was read. - * @since 2021/01/23 - */ - public static native int memHandleReadByte(int __mh, int __off); - - /** - * Reads the given value from the memory handle. - * - * @param __mh The handle to read from. - * @param __off The offset into the handle. - * @return The value that was read. - * @since 2021/01/23 - */ - public static native double memHandleReadDouble(Object __mh, int __off); - - /** - * Reads the given value from the memory handle. - * - * @param __mh The handle to read from. - * @param __off The offset into the handle. - * @return The value that was read. - * @since 2021/01/23 - */ - public static native double memHandleReadDouble(int __mh, int __off); - - /** - * Reads the given value from the memory handle. - * - * @param __mh The handle to read from. - * @param __off The offset into the handle. - * @return The value that was read. - * @since 2021/01/23 - */ - public static native float memHandleReadFloat(Object __mh, int __off); - - /** - * Reads the given value from the memory handle. - * - * @param __mh The handle to read from. - * @param __off The offset into the handle. - * @return The value that was read. - * @since 2021/01/23 - */ - public static native float memHandleReadFloat(int __mh, int __off); - - /** - * Reads the given value from the memory handle. - * - * @param __mh The handle to read from. - * @param __off The offset into the handle. - * @return The value that was read. - * @since 2021/01/23 - */ - public static native int memHandleReadInt(Object __mh, int __off); - - /** - * Reads the given value from the memory handle. - * - * @param __mh The handle to read from. - * @param __off The offset into the handle. - * @return The value that was read. - * @since 2021/01/23 - */ - public static native int memHandleReadInt(int __mh, int __off); - - /** - * Reads the given value from the memory handle. - * - * @param __mh The handle to read from. - * @param __off The offset into the handle. - * @return The value that was read. - * @since 2021/01/23 - */ - public static native long memHandleReadLong(Object __mh, int __off); - - /** - * Reads the given value from the memory handle. - * - * @param __mh The handle to read from. - * @param __off The offset into the handle. - * @return The value that was read. - * @since 2021/01/23 - */ - public static native long memHandleReadLong(int __mh, int __off); - - /** - * Reads the given value from the memory handle. - * - * @param __mh The handle to read from. - * @param __off The offset into the handle. - * @return The value that was read. - * @since 2021/01/23 - */ - public static native Object memHandleReadObject(Object __mh, int __off); - - /** - * Reads the given value from the memory handle. - * - * @param __mh The handle to read from. - * @param __off The offset into the handle. - * @return The value that was read. - * @since 2021/01/23 - */ - public static native Object memHandleReadObject(int __mh, int __off); - - /** - * Reads the given value from the memory handle. - * - * @param __mh The handle to read from. - * @param __off The offset into the handle. - * @return The value that was read. - * @since 2021/01/23 - */ - public static native int memHandleReadShort(Object __mh, int __off); - - /** - * Reads the given value from the memory handle. - * - * @param __mh The handle to read from. - * @param __off The offset into the handle. - * @return The value that was read. - * @since 2021/01/23 - */ - public static native int memHandleReadShort(int __mh, int __off); - - /** - * Writes the given value to the memory handle. - * - * @param __mh The handle to write to. - * @param __off The offset into the handle. - * @param __v The value to write. - * @since 2021/01/23 - */ - public static native void memHandleWriteByte(Object __mh, int __off, - int __v); - - /** - * Writes the given value to the memory handle. - * - * @param __mh The handle to write to. - * @param __off The offset into the handle. - * @param __v The value to write. - * @since 2021/01/23 - */ - public static native void memHandleWriteByte(int __mh, int __off, - int __v); - - /** - * Writes the given value to the memory handle. - * - * @param __mh The handle to write to. - * @param __off The offset into the handle. - * @param __v The value to write. - * @since 2021/01/23 - */ - public static native void memHandleWriteCharacter(Object __mh, int __off, - char __v); - - /** - * Writes the given value to the memory handle. - * - * @param __mh The handle to write to. - * @param __off The offset into the handle. - * @param __v The value to write. - * @since 2021/01/23 - */ - public static native void memHandleWriteCharacter(int __mh, int __off, - char __v); - - /** - * Writes the given value to the memory handle. - * - * @param __mh The handle to write to. - * @param __off The offset into the handle. - * @param __v The value to write. - * @since 2021/01/23 - */ - public static native void memHandleWriteDouble(Object __mh, int __off, - double __v); - - /** - * Writes the given value to the memory handle. - * - * @param __mh The handle to write to. - * @param __off The offset into the handle. - * @param __v The value to write. - * @since 2021/01/23 - */ - public static native void memHandleWriteDouble(int __mh, int __off, - double __v); - - /** - * Writes the given value to the memory handle. - * - * @param __mh The handle to write to. - * @param __off The offset into the handle. - * @param __v The value to write. - * @since 2021/01/23 - */ - public static native void memHandleWriteFloat(Object __mh, int __off, - float __v); - - /** - * Writes the given value to the memory handle. - * - * @param __mh The handle to write to. - * @param __off The offset into the handle. - * @param __v The value to write. - * @since 2021/01/23 - */ - public static native void memHandleWriteFloat(int __mh, int __off, - float __v); - - /** - * Writes the given value to the memory handle. - * - * @param __mh The handle to write to. - * @param __off The offset into the handle. - * @param __v The value to write. - * @since 2021/01/23 - */ - public static native void memHandleWriteInt(Object __mh, int __off, - int __v); - - /** - * Writes the given value to the memory handle. - * - * @param __mh The handle to write to. - * @param __off The offset into the handle. - * @param __v The value to write. - * @since 2021/01/23 - */ - public static native void memHandleWriteInt(int __mh, int __off, - int __v); - - /** - * Writes the given value to the memory handle. - * - * @param __mh The handle to write to. - * @param __off The offset into the handle. - * @param __v The value to write. - * @since 2021/01/23 - */ - public static native void memHandleWriteLong(Object __mh, int __off, - long __v); - - /** - * Writes the given value to the memory handle. - * - * @param __mh The handle to write to. - * @param __off The offset into the handle. - * @param __v The value to write. - * @since 2021/01/23 - */ - public static native void memHandleWriteLong(int __mh, int __off, - long __v); - - /** - * Writes the given value to the memory handle. - * - * @param __mh The handle to write to. - * @param __off The offset into the handle. - * @param __v The value to write. - * @since 2021/01/23 - */ - public static native void memHandleWriteObject(Object __mh, int __off, - Object __v); - - /** - * Writes the given value to the memory handle. - * - * @param __mh The handle to write to. - * @param __off The offset into the handle. - * @param __v The value to write. - * @since 2021/01/23 - */ - public static native void memHandleWriteObject(int __mh, int __off, - Object __v); - - /** - * Writes the given value to the memory handle. - * - * @param __mh The handle to write to. - * @param __off The offset into the handle. - * @param __v The value to write. - * @since 2021/01/23 - */ - public static native void memHandleWriteShort(Object __mh, int __off, - int __v); - - /** - * Writes the given value to the memory handle. - * - * @param __mh The handle to write to. - * @param __off The offset into the handle. - * @param __v The value to write. - * @since 2021/01/23 - */ - public static native void memHandleWriteShort(int __mh, int __off, - int __v); - - /** - * Reads byte from address. - * - * @param __p The pointer. - * @param __o The offset. - * @return The result of the read. - * @since 2019/04/22 - */ - public static native int memReadByte(long __p, int __o); - - /** - * Reads character from address. - * - * @param __p The pointer. - * @param __o The offset. - * @return The result of the read. - * @since 2021/02/14 - */ - public static native char memReadCharacter(long __p, int __o); - - /** - * Reads double from address. - * - * @param __p The pointer. - * @param __o The offset. - * @return The result of the read. - * @since 2021/02/14 - */ - public static native double memReadDouble(long __p, int __o); - - /** - * Reads float from address. - * - * @param __p The pointer. - * @param __o The offset. - * @return The result of the read. - * @since 2021/02/14 - */ - public static native float memReadFloat(long __p, int __o); - - /** - * Reads integer from address. - * - * @param __p The pointer. - * @param __o The offset. - * @return The result of the read. - * @since 2019/04/21 - */ - public static native int memReadInt(long __p, int __o); - - /** - * Reads long from address. - * - * @param __p The pointer. - * @param __o The offset. - * @return The result of the read. - * @since 2019/04/22 - */ - public static native long memReadLong(long __p, int __o); - - /** - * Reads object from address. - * - * @param __p The pointer. - * @param __o The offset. - * @return The result of the read. - * @since 2021/02/14 - */ - public static native Object memReadObject(long __p, int __o); - - /** - * Reads short from address. - * - * @param __p The pointer. - * @param __o The offset. - * @return The result of the read. - * @since 2019/04/22 - */ - public static native int memReadShort(long __p, int __o); - - /** - * Writes byte to address. - * - * @param __p The pointer. - * @param __o The offset. - * @param __v The value to write. - * @since 2019/04/21 - */ - public static native void memWriteByte(long __p, int __o, int __v); - - /** - * Writes double to address. - * - * @param __p The pointer. - * @param __o The offset. - * @param __v The value to write. - * @since 2020/02/14 - */ - public static native void memWriteDouble(long __p, int __o, double __v); - - /** - * Writes float to address. - * - * @param __p The pointer. - * @param __o The offset. - * @param __v The value to write. - * @since 2020/02/14 - */ - public static native void memWriteFloat(long __p, int __o, double __v); - - /** - * Writes integer to address. - * - * @param __p The pointer. - * @param __o The offset. - * @param __v The value to write. - * @since 2019/04/21 - */ - public static native void memWriteInt(long __p, int __o, int __v); - - /** - * Writes long to address. - * - * @param __p The pointer. - * @param __o The offset. - * @param __v The value to write. - * @since 2020/02/24 - */ - public static native void memWriteLong(long __p, int __o, long __v); - - /** - * Writes object to address. - * - * @param __p The pointer. - * @param __o The offset. - * @param __v The value to write. - * @since 2020/02/14 - */ - public static native void memWriteObject(long __p, int __o, Object __v); - - /** - * Writes short to address. - * - * @param __p The pointer. - * @param __o The offset. - * @param __v The value to write. - * @since 2019/04/21 - */ - public static native void memWriteShort(long __p, int __o, int __v); - - /** - * Atomically decrements an object's monitor count. - * - * @param __p The object to count. - * @return The resulting value. - * @since 2020/02/24 - */ - public static native int monitorCountDecrementAndGetAtomic(long __p); - - /** - * Atomically decrements an object's monitor count. - * - * @param __p The object to count. - * @return The resulting value. - * @since 2020/02/24 - */ - public static native int monitorCountDecrementAndGetAtomic(Object __p); - - /** - * Atomically increments an object's monitor count. - * - * @param __p The object to count. - * @return The resulting value. - * @since 2020/02/24 - */ - public static native int monitorCountIncrementAndGetAtomic(long __p); - - /** - * Atomically increments an object's monitor count. - * - * @param __p The object to count. - * @return The resulting value. - * @since 2020/02/24 - */ - public static native int monitorCountIncrementAndGetAtomic(Object __p); - - /** - * Atomically reads the object's monitor count. - * - * @param __p The object to read. - * @return The current monitor count. - * @since 2020/02/24 - */ - public static native int monitorCountGetAtomic(long __p); - - /** - * Atomically reads the object's monitor count. - * - * @param __p The object to read. - * @return The current monitor count. - * @since 2020/02/24 - */ - public static native int monitorCountGetAtomic(Object __p); - - /** - * Atomically writes the object's monitor count. - * - * @param __p The object to write. - * @param __v The count to write. - * @since 2020/02/24 - */ - public static native void monitorCountSetAtomic(long __p, int __v); - - /** - * Atomically writes the object's monitor count. - * - * @param __p The object to write. - * @param __v The count to write. - * @since 2020/02/24 - */ - public static native void monitorCountSetAtomic(Object __p, int __v); - - /** - * Atomically compares the owner of the object's monitor and sets it, - * returning the value before it was set (or was unchanged). - * - * @param __p The object to potentially modify. - * @param __comp The owner to compare against. - * @param __set The owner to set to, if the comparison succeeds. - * @return The owner that originally was set. - * @since 2020/02/24 - */ - public static native Thread monitorOwnerCompareGetAndSetAtomic( - long __p, long __comp, long __set); - - /** - * Atomically compares the owner of the object's monitor and sets it, - * returning the value before it was set (or was unchanged). - * - * @param __p The object to potentially modify. - * @param __comp The owner to compare against. - * @param __set The owner to set to, if the comparison succeeds. - * @return The owner that originally was set. - * @since 2020/02/24 - */ - public static native Thread monitorOwnerCompareGetAndSetAtomic( - Object __p, long __comp, long __set); - - /** - * Atomically compares the owner of the object's monitor and sets it, - * returning the value before it was set (or was unchanged). - * - * @param __p The object to potentially modify. - * @param __comp The owner to compare against. - * @param __set The owner to set to, if the comparison succeeds. - * @return The owner that originally was set. - * @since 2020/02/24 - */ - public static native Thread monitorOwnerCompareGetAndSetAtomic( - long __p, Thread __comp, Thread __set); - - /** - * Atomically compares the owner of the object's monitor and sets it, - * returning the value before it was set (or was unchanged). - * - * @param __p The object to potentially modify. - * @param __comp The owner to compare against. - * @param __set The owner to set to, if the comparison succeeds. - * @return The owner that originally was set. - * @since 2020/02/24 - */ - public static native Thread monitorOwnerCompareGetAndSetAtomic( - Object __p, Thread __comp, Thread __set); - - /** - * Atomically compares the owner of the object's monitor and sets it, - * returning the value before it was set (or was unchanged). - * - * @param __p The object to potentially modify. - * @param __comp The owner to compare against. - * @param __set The owner to set to, if the comparison succeeds. - * @return The owner that originally was set. - * @since 2020/02/24 - */ - public static native long monitorOwnerCompareGetAndSetAtomicPointer( - long __p, long __comp, long __set); - - /** - * Atomically compares the owner of the object's monitor and sets it, - * returning the value before it was set (or was unchanged). - * - * @param __p The object to potentially modify. - * @param __comp The owner to compare against. - * @param __set The owner to set to, if the comparison succeeds. - * @return The owner that originally was set. - * @since 2020/02/24 - */ - public static native long monitorOwnerCompareGetAndSetAtomicPointer( - Object __p, long __comp, long __set); - - /** - * Atomically compares the owner of the object's monitor and sets it, - * returning the value before it was set (or was unchanged). - * - * @param __p The object to potentially modify. - * @param __comp The owner to compare against. - * @param __set The owner to set to, if the comparison succeeds. - * @return The owner that originally was set. - * @since 2020/02/24 - */ - public static native long monitorOwnerCompareGetAndSetAtomicPointer( - long __p, Thread __comp, Thread __set); - - /** - * Atomically compares the owner of the object's monitor and sets it, - * returning the value before it was set (or was unchanged). - * - * @param __p The object to potentially modify. - * @param __comp The owner to compare against. - * @param __set The owner to set to, if the comparison succeeds. - * @return The owner that originally was set. - * @since 2020/02/24 - */ - public static native long monitorOwnerCompareGetAndSetAtomicPointer( - Object __p, Thread __comp, Thread __set); - - /** - * Returns the owner of an object's monitor. - * - * @param __p The object to get the owner from. - * @return The owner of the object's monitor. - * @since 2020/02/24 - */ - public static native Thread monitorOwnerGetAtomic(long __p); - - /** - * Returns the owner of an object's monitor. - * - * @param __p The object to get the owner from. - * @return The owner of the object's monitor. - * @since 2020/02/24 - */ - public static native Thread monitorOwnerGetAtomic(Object __p); - - /** - * Returns the owner of an object's monitor. - * - * @param __p The object to get the owner from. - * @return The owner of the object's monitor. - * @since 2020/02/24 - */ - public static native long monitorOwnerGetPointerAtomic(long __p); - - /** - * Returns the owner of an object's monitor. - * - * @param __p The object to get the owner from. - * @return The owner of the object's monitor. - * @since 2020/02/24 - */ - public static native long monitorOwnerGetPointerAtomic(Object __p); - - /** - * Sets the owner of an object's monitor. - * - * @param __p The object which will be set the new owner. - * @param __t The owner to set. - * @since 2020/02/24 - */ - public static native void monitorOwnerSetAtomic(long __p, long __t); - - /** - * Sets the owner of an object's monitor. - * - * @param __p The object which will be set the new owner. - * @param __t The owner to set. - * @since 2020/02/24 - */ - public static native void monitorOwnerSetAtomic(long __p, Thread __t); - - /** - * Sets the owner of an object's monitor. - * - * @param __p The object which will be set the new owner. - * @param __t The owner to set. - * @since 2020/02/24 - */ - public static native void monitorOwnerSetAtomic(Object __p, long __t); - - /** - * Sets the owner of an object's monitor. - * - * @param __p The object which will be set the new owner. - * @param __t The owner to set. - * @since 2020/02/24 - */ - public static native void monitorOwnerSetAtomic(Object __p, Thread __t); - - /** - * Used to convert an object to a pointer. - * - * @param __o The object. - * @return The pointer of the object. - * @since 2020/11/29 - */ - public static native int objectToPointer(Object __o); - - /** - * Used to convert an object to a pointer, do use reference queing for it - * so that if the object is a candidate for reference counting it will - * be uncounted. - * - * @param __o The object. - * @return The pointer of the object. - * @since 2019/04/21 - */ - public static native int objectToPointerRefQueue(Object __o); - - /** - * Generates a ping, similar to a breakpoint but not fatal. - * - * @since 2021/01/24 - */ - public static native void ping(); - - /** - * Converts a pointer to {@link TypeBracket}. - * - * @param __p The pointer. - * @return The object of the pointer. - * @since 2021/01/24 - */ - public static native TypeBracket pointerToTypeBracket(int __p); - - /** - * Used to convert a pointer to an object. - * - * @param __p The pointer. - * @return The object of the pointer. - * @since 2019/04/21 - */ - public static native Object pointerToObject(int __p); - - /** - * Loads a value from the constant pool at the given index. - * - * @param __p The memory address of the pool to access. - * @param __i The index to load. - * @return The read value. - * @since 2020/02/24 - */ - public static native int poolLoad(int __p, int __i); - - /** - * Loads a value from the constant pool at the given index. - * - * @param __p The object representation of the pool to access. - * @param __i The index to load. - * @return The read value. - * @since 2020/02/24 - */ - public static native int poolLoad(Object __p, int __i); - - /** - * Perform reference counting logic on object. - * - * @param __p The object to count up. - * @since 2019/05/25 - */ - public static native void refCount(int __p); - - /** - * Perform reference counting logic on object. - * - * @param __p The object to count up. - * @since 2020/02/24 - */ - public static native void refCount(Object __p); - - /** - * Get reference count of object. - * - * @param __p The object to get the count for. - * @return The reference count of the object. - * @since 2020/02/24 - */ - public static native int refGetCount(int __p); - - /** - * Get reference count of object. - * - * @param __p The object to get the count for. - * @return The reference count of the object. - * @since 2020/02/24 - */ - public static native int refGetCount(Object __p); - - /** - * Set reference count of object. - * - * @param __p The object to set the count for. - * @param __v The value to set. - * @since 2020/02/24 - */ - public static native void refSetCount(int __p, int __v); - - /** - * Set reference count of object. - * - * @param __p The object to set the count for. - * @param __v The value to set. - * @since 2020/02/24 - */ - public static native void refSetCount(Object __p, int __v); - - /** - * Perform reference uncounting logic on object. - * - * @param __p The object to count down. - * @since 2019/05/25 - */ - public static native void refUncount(int __p); - - /** - * Perform reference uncounting logic on object. - * - * @param __p The object to count down. - * @since 2020/02/24 - */ - public static native void refUncount(Object __p); - - /** - * Return from the current frame. - * - * @since 2019/04/21 - */ - public static native void returnFrame(); - - /** - * Returns from the current frame, returning the given value. - * - * @param __v The value to return. - * @since 2019/04/28 - */ - public static native void returnFrame(int __v); - - /** - * Returns from the current frame, returning both values. - * - * @param __h The high value. - * @param __l The low value. - * @since 2019/04/28 - */ - public static native void returnFrame(int __h, int __l); - - /** - * Returns from the current frame, returning a long value. - * - * @param __v The value. - * @since 2020/02/24 - */ - public static native void returnFrameLong(long __v); - - /** - * Returns the exception register. - * - * @return The exception register. - * @since 2020/02/24 - */ - public static native Object specialGetExceptionRegister(); - - /** - * Returns the exception register. - * - * @return The exception register. - * @since 2020/02/24 - */ - public static native Throwable specialGetExceptionRegisterThrowable(); - - /** - * Returns the exception register. - * - * @return The exception register. - * @since 2019/04/28 - */ - public static native long specialGetExceptionRegisterPointer(); - - /** - * Returns the value of the current pool register. - * - * @return The value of the pool register. - * @since 2020/02/24 - */ - public static native Object specialGetPoolRegister(); - - /** - * Returns the value of the current pool register. - * - * @return The value of the pool register. - * @since 2019/05/01 - */ - public static native long specialGetPoolRegisterPointer(); - - /** - * Returns the value of the return register, for long return values this - * is the first high register. - * - * @return The value of the return register. - * @since 2019/04/28 - */ - public static native int specialGetReturnRegister(); - - /** - * Reads the long value from the return register, treating it as a long - * value. - * - * @return The value of the return register. - * @since 2020/02/24 - */ - public static native long specialGetReturnRegisterLong(); - - /** - * Returns the register representing the current thread. - * - * @return The current thread register. - * @since 2019/04/22 - */ - public static native Thread specialGetThreadRegister(); - - /** - * Returns the register representing the current thread. - * - * @return The current thread register. - * @since 2020/02/24 - */ - public static native long specialGetThreadRegisterPointer(); - - /** - * Sets the value of the exception register. - * - * @param __v The value to use. - * @since 2019/04/28 - */ - public static native void specialSetExceptionRegister(long __v); - - /** - * Sets the value of the exception register. - * - * @param __v The value to use. - * @since 2020/02/24 - */ - public static native void specialSetExceptionRegister(Object __v); - - /** - * Sets the value of the constant pool register. - * - * @param __v The new value of the constant pool register. - * @since 2019/05/01 - */ - public static native void specialSetPoolRegister(long __v); - - /** - * Sets the value of the constant pool register. - * - * @param __v The new value of the constant pool register. - * @since 2020/02/24 - */ - public static native void specialSetPoolRegister(Object __v); - - /** - * Sets the current thread pointer. - * - * @param __v The value to use. - * @since 2019/04/27 - */ - public static native void specialSetThreadRegister(long __v); - - /** - * Sets the current thread pointer. - * - * @param __v The value to use. - * @since 2020/02/24 - */ - public static native void specialSetThreadRegister(Thread __v); -} diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/ClassLoadingAdjustments.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/ClassLoadingAdjustments.java index 31f50753e4..473e3dc8f3 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/ClassLoadingAdjustments.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/ClassLoadingAdjustments.java @@ -128,7 +128,6 @@ public final class ClassLoadingAdjustments case "todo/DEBUG": case "todo/OOPS": case "todo/TODO": - case "cc/squirreljme/jvm/Assembly": case "cc/squirreljme/jvm/Constants": case "cc/squirreljme/runtime/cldc/debug/Debugging": case "cc/squirreljme/jvm/IPCCallback": diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/SoftDouble.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/SoftDouble.java index 99b5ed9a22..b42b7fa1b3 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/SoftDouble.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/SoftDouble.java @@ -50,7 +50,6 @@ public final class SoftDouble @SquirrelJMEVendorApi public static double add(long __a, long __b) { - Assembly.breakpoint(); throw Debugging.todo(); } @@ -65,7 +64,6 @@ public final class SoftDouble @SquirrelJMEVendorApi public static int cmpl(long __a, long __b) { - Assembly.breakpoint(); throw Debugging.todo(); } @@ -80,7 +78,6 @@ public final class SoftDouble @SquirrelJMEVendorApi public static int cmpg(long __a, long __b) { - Assembly.breakpoint(); throw Debugging.todo(); } @@ -95,7 +92,6 @@ public final class SoftDouble @SquirrelJMEVendorApi public static double div(long __a, long __b) { - Assembly.breakpoint(); throw Debugging.todo(); } @@ -123,7 +119,6 @@ public final class SoftDouble @SquirrelJMEVendorApi public static double mul(long __a, long __b) { - Assembly.breakpoint(); throw Debugging.todo(); } @@ -137,7 +132,6 @@ public final class SoftDouble @SquirrelJMEVendorApi public static double neg(long __a) { - Assembly.breakpoint(); throw Debugging.todo(); } @@ -166,7 +160,6 @@ public final class SoftDouble @SquirrelJMEVendorApi public static double rem(long __a, long __b) { - Assembly.breakpoint(); throw Debugging.todo(); } @@ -181,7 +174,6 @@ public final class SoftDouble @SquirrelJMEVendorApi public static double sub(long __a, long __b) { - Assembly.breakpoint(); throw Debugging.todo(); } @@ -195,7 +187,6 @@ public final class SoftDouble @SquirrelJMEVendorApi public static float toFloat(long __a) { - Assembly.breakpoint(); throw Debugging.todo(); } @@ -209,7 +200,6 @@ public final class SoftDouble @SquirrelJMEVendorApi public static int toInteger(long __a) { - Assembly.breakpoint(); throw Debugging.todo(); } @@ -223,7 +213,6 @@ public final class SoftDouble @SquirrelJMEVendorApi public static long toLong(long __a) { - Assembly.breakpoint(); throw Debugging.todo(); } } diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/SoftFloat.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/SoftFloat.java index 5ee823149f..30aa6a4858 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/SoftFloat.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/SoftFloat.java @@ -9,6 +9,7 @@ package cc.squirreljme.jvm; +import cc.squirreljme.jvm.mle.MathShelf; import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; import cc.squirreljme.runtime.cldc.debug.Debugging; import cc.squirreljme.runtime.cldc.util.UnsignedInteger; @@ -90,7 +91,6 @@ public final class SoftFloat @SquirrelJMEVendorApi public static float add(int __a, int __b) { - Assembly.breakpoint(); throw Debugging.todo(); } @@ -141,7 +141,6 @@ public final class SoftFloat @SquirrelJMEVendorApi public static float div(int __a, int __b) { - Assembly.breakpoint(); throw Debugging.todo(); } @@ -225,8 +224,8 @@ public final class SoftFloat SoftFloat.__packToF32UI(signZ, 0, 0)); long normExpSig = SoftFloat.__normSubnormalF32Sig(sigA); - expA = (short)Assembly.longUnpackHigh(normExpSig); - sigA = Assembly.longUnpackLow(normExpSig); + expA = (short)MathShelf.longUnpackHigh(normExpSig); + sigA = MathShelf.longUnpackLow(normExpSig); } // if ( ! expB ) @@ -238,8 +237,8 @@ public final class SoftFloat SoftFloat.__packToF32UI(signZ, 0, 0)); long normExpSig = SoftFloat.__normSubnormalF32Sig(sigB); - expB = (short)Assembly.longUnpackHigh(normExpSig); - sigB = Assembly.longUnpackLow(normExpSig); + expB = (short)MathShelf.longUnpackHigh(normExpSig); + sigB = MathShelf.longUnpackLow(normExpSig); } int expZ = (short)(expA + expB - 0x7F); @@ -272,7 +271,6 @@ public final class SoftFloat @SquirrelJMEVendorApi public static float neg(int __a) { - Assembly.breakpoint(); throw Debugging.todo(); } @@ -287,7 +285,7 @@ public final class SoftFloat @SquirrelJMEVendorApi public static float or(int __a, int __b) { - return Assembly.intBitsToFloat(__a | __b); + return MathShelf.rawIntToFloat(__a | __b); } /** @@ -301,7 +299,6 @@ public final class SoftFloat @SquirrelJMEVendorApi public static float rem(int __a, int __b) { - Assembly.breakpoint(); throw Debugging.todo(); } @@ -316,7 +313,6 @@ public final class SoftFloat @SquirrelJMEVendorApi public static float sub(int __a, int __b) { - Assembly.breakpoint(); throw Debugging.todo(); } @@ -330,7 +326,6 @@ public final class SoftFloat @SquirrelJMEVendorApi public static double toDouble(int __a) { - Assembly.breakpoint(); throw Debugging.todo(); } @@ -352,7 +347,7 @@ public final class SoftFloat sig |= 0x0080_0000; // sig64 = (uint_fast64_t) sig<<32; - long sig64 = Assembly.longPack(0, sig); + long sig64 = MathShelf.longPack(0, sig); int shiftDist = 0xAA - exp; if (UnsignedInteger.compareUnsigned(0, shiftDist) < 0) @@ -371,7 +366,6 @@ public final class SoftFloat @SquirrelJMEVendorApi public static long toLong(int __a) { - Assembly.breakpoint(); throw Debugging.todo(); } @@ -510,7 +504,7 @@ public final class SoftFloat // struct exp16_sig32 { int_fast16_t exp; uint_fast32_t sig; }; // exp = 1 - shiftDist ,, sig = sig<= 32) - return Assembly.longPack(0, __al << (__s - 32)); + return MathShelf.longPack(0, __al << (__s - 32)); // Merge of bits (shift in range of 1-31) - return Assembly.longPack((__al << __s), + return MathShelf.longPack((__al << __s), (__ah << __s) | (__al >>> (32 - __s))); } @@ -259,15 +260,15 @@ public final class SoftLong // Doing nothing? if (__s == 0) - return Assembly.longPack(__al, __ah); + return MathShelf.longPack(__al, __ah); // Shifting all the high bits low else if (__s >= 32) - return Assembly.longPack(__ah >> (__s - 32), + return MathShelf.longPack(__ah >> (__s - 32), (__ah & 0x80000000) >> 31); // Merge of bits (shift in range of 1-31) - return Assembly.longPack((__ah << (32 - __s)) | (__al >>> __s), + return MathShelf.longPack((__ah << (32 - __s)) | (__al >>> __s), (__ah >> __s)); } @@ -301,7 +302,7 @@ public final class SoftLong ch++; // Return result - return Assembly.longPack(cl, ch); + return MathShelf.longPack(cl, ch); } /** @@ -315,7 +316,6 @@ public final class SoftLong @SquirrelJMEVendorApi public static double toDouble(int __al, int __ah) { - Assembly.breakpoint(); throw Debugging.todo(); } @@ -330,7 +330,6 @@ public final class SoftLong @SquirrelJMEVendorApi public static float toFloat(int __al, int __ah) { - Assembly.breakpoint(); throw Debugging.todo(); } @@ -366,14 +365,14 @@ public final class SoftLong // Doing nothing? if (__s == 0) - return Assembly.longPack(__al, __ah); + return MathShelf.longPack(__al, __ah); // Shifting all the high bits low else if (__s >= 32) - return Assembly.longPack(__ah >>> (__s - 32), 0); + return MathShelf.longPack(__ah >>> (__s - 32), 0); // Merge of bits (shift in range of 1-31) - return Assembly.longPack((__ah << (32 - __s)) | (__al >>> __s), + return MathShelf.longPack((__ah << (32 - __s)) | (__al >>> __s), (__ah >>> __s)); } @@ -390,7 +389,7 @@ public final class SoftLong @SquirrelJMEVendorApi public static long xor(int __al, int __ah, int __bl, int __bh) { - return Assembly.longPack(__al ^ __bl, __ah ^ __bh); + return MathShelf.longPack(__al ^ __bl, __ah ^ __bh); } /** @@ -530,10 +529,10 @@ public final class SoftLong // if the numerator is negative if (__doRem) return (negNum ? SoftLong.neg(rl, rh) : - Assembly.longPack(rl, rh)); + MathShelf.longPack(rl, rh)); // Return, normalize negative if needed - return (isNeg ? SoftLong.neg(ql, qh) : Assembly.longPack(ql, qh)); + return (isNeg ? SoftLong.neg(ql, qh) : MathShelf.longPack(ql, qh)); } /** @@ -606,7 +605,7 @@ public final class SoftLong int m = over + (d * w) + (c * x) + (b * y) + (a * z); // Combine the resultant parts - return Assembly.longPack((o << 16) | (p & 0xFFFF), + return MathShelf.longPack((o << 16) | (p & 0xFFFF), (m << 16) | (n & 0xFFFF)); } } diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/MathShelf.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/MathShelf.java index 2995108b05..eab65228b9 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/MathShelf.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/MathShelf.java @@ -9,7 +9,6 @@ package cc.squirreljme.jvm.mle; -import cc.squirreljme.runtime.cldc.annotation.Api; import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; /** @@ -30,13 +29,68 @@ public final class MathShelf } /** + * Packs the given two integers to a double value. + * + * @param __lo The low value. + * @param __hi The high value. + * @return The double value. + * @since 2019/06/21 + */ + public static native double doublePack(int __lo, int __hi); + + /** + * Unpacks the high value of a double. + * + * @param __d The double to unpack. + * @return The unpacked high value. + * @since 2020/02/24 + */ + public static native int doubleUnpackHigh(double __d); + + /** + * Unpacks the low value of a double. + * + * @param __d The double to unpack. + * @return The unpacked low value. + * @since 2020/02/24 + */ + public static native int doubleUnpackLow(double __d); + + /** + * Packs the given two integers to a long value. + * + * @param __lo The low value. + * @param __hi The high value. + * @return The long value. + * @since 2019/06/21 + */ + public static native long longPack(int __lo, int __hi); + + /** + * Unpack high value from long. + * + * @param __v The long value. + * @return The unpacked fragment. + * @since 2019/06/21 + */ + public static native int longUnpackHigh(long __v); + + /** + * Unpack low value from long. + * + * @param __v The long value. + * @return The unpacked fragment. + * @since 2019/06/21 + */ + public static native int longUnpackLow(long __v); + + /** * Extracts the raw bits of the given value. * * @param __v The value to extract. * @return The raw bits. * @since 2020/06/18 */ - @SquirrelJMEVendorApi public static native long rawDoubleToLong(double __v); /** @@ -46,7 +100,6 @@ public final class MathShelf * @return The raw bits. * @since 2020/06/18 */ - @SquirrelJMEVendorApi public static native int rawFloatToInt(float __v); /** @@ -56,7 +109,6 @@ public final class MathShelf * @return The value. * @since 2020/06/18 */ - @SquirrelJMEVendorApi public static native float rawIntToFloat(int __b); /** @@ -66,6 +118,5 @@ public final class MathShelf * @return The value. * @since 2020/06/18 */ - @SquirrelJMEVendorApi public static native double rawLongToDouble(long __b); } diff --git a/modules/cldc-compact/src/main/java/java/lang/Long.java b/modules/cldc-compact/src/main/java/java/lang/Long.java index fa46c02aff..1cdc864a74 100644 --- a/modules/cldc-compact/src/main/java/java/lang/Long.java +++ b/modules/cldc-compact/src/main/java/java/lang/Long.java @@ -9,7 +9,7 @@ package java.lang; -import cc.squirreljme.jvm.Assembly; +import cc.squirreljme.jvm.mle.MathShelf; import cc.squirreljme.jvm.mle.RuntimeShelf; import cc.squirreljme.jvm.mle.TypeShelf; import cc.squirreljme.jvm.mle.constants.MemoryProfileType; @@ -332,11 +332,11 @@ public final class Long @Api public static long reverse(long __l) { - int hi = Assembly.longUnpackHigh(__l); - int lo = Assembly.longUnpackLow(__l); + int hi = MathShelf.longUnpackHigh(__l); + int lo = MathShelf.longUnpackLow(__l); // Hi is placed lo, and lo is placed hi - return Assembly.longPack(Integer.reverse(hi), Integer.reverse(lo)); + return MathShelf.longPack(Integer.reverse(hi), Integer.reverse(lo)); } /** -- 2.11.4.GIT