Commit d960cdce authored by Stephanie Gawroriski's avatar Stephanie Gawroriski
Browse files

First merge of cherry picked code from SummerCoat Branch.

parents c1e1b26d 84fc8144
Pipeline #39165 passed with stages
in 1 minute and 59 seconds
......@@ -498,18 +498,18 @@ workflows:
- construct_testJars:
requires:
- build_linux
- construct_libSummerCoat:
requires:
- build_linux
- construct_libTestSummerCoat:
requires:
- construct_testJars
- construct_romSummerCoat:
requires:
- construct_libSummerCoat
- construct_romTestSummerCoat:
requires:
- construct_libTestSummerCoat
# - construct_libSummerCoat:
# requires:
# - build_linux
# - construct_libTestSummerCoat:
# requires:
# - construct_testJars
# - construct_romSummerCoat:
# requires:
# - construct_libSummerCoat
# - construct_romTestSummerCoat:
# requires:
# - construct_libTestSummerCoat
############################## RATUFACOAT ##############################
# - ratufacoat_build_windows:
......
......@@ -76,6 +76,8 @@
<module name="squirreljme.modules.tool-jdwp.main" target="1.7" />
<module name="squirreljme.modules.tool-jdwp.test" target="1.7" />
<module name="squirreljme.modules.tool-jdwp.testFixtures" target="1.7" />
<module name="squirreljme.modules.tool-manifest-reader.main" target="1.7" />
<module name="squirreljme.modules.tool-manifest-reader.test" target="1.7" />
<module name="squirreljme.modules.tool-manifest-reader.testFixtures" target="1.7" />
<module name="squirreljme.modules.tool-manifest-writer.testFixtures" target="1.7" />
<module name="squirreljme.modules.tool-packfile.testFixtures" target="1.7" />
......
......@@ -68,7 +68,6 @@
<option value="$PROJECT_DIR$/modules/tac" />
<option value="$PROJECT_DIR$/modules/tool-classfile" />
<option value="$PROJECT_DIR$/modules/tool-jarfile" />
<option value="$PROJECT_DIR$/modules/tool-manifest-reader" />
<option value="$PROJECT_DIR$/modules/tool-manifest-writer" />
<option value="$PROJECT_DIR$/modules/tool-packfile" />
<option value="$PROJECT_DIR$/modules/vodafone-api" />
......
......@@ -15,36 +15,34 @@
#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", "(J)I", (void*)restrictedFunction},
{"arrayLength", "(I)I", (void*)restrictedFunction},
{"arrayLength", "(Ljava/lang/Object;)I", (void*)restrictedFunction},
{"arrayLengthSet", "(JI)V", (void*)restrictedFunction},
{"arrayLengthSet", "(Ljava/lang/Object;I)V", (void*)restrictedFunction},
{"atomicCompareGetAndSet", "(IIJ)I", (void*)restrictedFunction},
{"atomicDecrementAndGet", "(J)I", (void*)restrictedFunction},
{"atomicIncrement", "(J)V", (void*)restrictedFunction},
{"breakpoint", "()V", (void*)restrictedFunction},
{"classInfoOfBoolean", "()Lcc/squirreljme/jvm/ClassInfo;", (void*)restrictedFunction},
{"classInfoOfBooleanPointer", "()J", (void*)restrictedFunction},
{"classInfoOfByte", "()Lcc/squirreljme/jvm/ClassInfo;", (void*)restrictedFunction},
{"classInfoOfBytePointer", "()J", (void*)restrictedFunction},
{"classInfoOfCharacter", "()Lcc/squirreljme/jvm/ClassInfo;", (void*)restrictedFunction},
{"classInfoOfCharacterPointer", "()J", (void*)restrictedFunction},
{"classInfoOfDouble", "()Lcc/squirreljme/jvm/ClassInfo;", (void*)restrictedFunction},
{"classInfoOfDoublePointer", "()J", (void*)restrictedFunction},
{"classInfoOfFloat", "()Lcc/squirreljme/jvm/ClassInfo;", (void*)restrictedFunction},
{"classInfoOfFloatPointer", "()J", (void*)restrictedFunction},
{"classInfoOfInteger", "()Lcc/squirreljme/jvm/ClassInfo;", (void*)restrictedFunction},
{"classInfoOfIntegerPointer", "()J", (void*)restrictedFunction},
{"classInfoOfLong", "()Lcc/squirreljme/jvm/ClassInfo;", (void*)restrictedFunction},
{"classInfoOfLongPointer", "()J", (void*)restrictedFunction},
{"classInfoOfShort", "()Lcc/squirreljme/jvm/ClassInfo;", (void*)restrictedFunction},
{"classInfoOfShortPointer", "()J", (void*)restrictedFunction},
{"doublePack", "(II)D", (void*)restrictedFunction},
{"doubleToRawLongBits", "(D)J", (void*)restrictedFunction},
{"doubleUnpackHigh", "(D)I", (void*)restrictedFunction},
......@@ -52,50 +50,44 @@ static const JNINativeMethod assemblyMethods[] =
{"exceptionHandle", "()V", (void*)restrictedFunction},
{"floatToRawIntBits", "(F)I", (void*)restrictedFunction},
{"intBitsToFloat", "(I)F", (void*)restrictedFunction},
{"invoke", "(JJ)V", (void*)restrictedFunction},
{"invoke", "(JJI)V", (void*)restrictedFunction},
{"invoke", "(JJII)V", (void*)restrictedFunction},
{"invoke", "(JJIII)V", (void*)restrictedFunction},
{"invoke", "(JJIIII)V", (void*)restrictedFunction},
{"invoke", "(JJIIIII)V", (void*)restrictedFunction},
{"invoke", "(JJIIIIII)V", (void*)restrictedFunction},
{"invoke", "(JJIIIIIII)V", (void*)restrictedFunction},
{"invoke", "(JJIIIIIIII)V", (void*)restrictedFunction},
{"invokeV", "(JJ)I", (void*)restrictedFunction},
{"invokeV", "(JJI)I", (void*)restrictedFunction},
{"invokeV", "(JJII)I", (void*)restrictedFunction},
{"invokeV", "(JJIII)I", (void*)restrictedFunction},
{"invokeV", "(JJIIII)I", (void*)restrictedFunction},
{"invokeV", "(JJIIIII)I", (void*)restrictedFunction},
{"invokeV", "(JJIIIIII)I", (void*)restrictedFunction},
{"invokeV", "(JJIIIIIII)I", (void*)restrictedFunction},
{"invokeV", "(JJIIIIIIII)I", (void*)restrictedFunction},
{"invokeVL", "(JJ)J", (void*)restrictedFunction},
{"invokeVL", "(JJI)J", (void*)restrictedFunction},
{"invokeVL", "(JJII)J", (void*)restrictedFunction},
{"invokeVL", "(JJIII)J", (void*)restrictedFunction},
{"invokeVL", "(JJIIII)J", (void*)restrictedFunction},
{"invokeVL", "(JJIIIII)J", (void*)restrictedFunction},
{"invokeVL", "(JJIIIIII)J", (void*)restrictedFunction},
{"invokeVL", "(JJIIIIIII)J", (void*)restrictedFunction},
{"invokeVL", "(JJIIIIIIII)J", (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*)restrictedFunction},
{"longUnpackHigh", "(J)I", (void*)restrictedFunction},
{"longUnpackLow", "(J)I", (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},
{"memReadJavaInt", "(JI)I", (void*)restrictedFunction},
{"memReadJavaLong", "(JI)J", (void*)restrictedFunction},
{"memReadJavaShort", "(JI)I", (void*)restrictedFunction},
{"memReadPointer", "(JI)J", (void*)restrictedFunction},
{"memReadLong", "(JI)J", (void*)restrictedFunction},
{"memReadShort", "(JI)I", (void*)restrictedFunction},
{"memWriteByte", "(JII)V", (void*)restrictedFunction},
{"memWriteInt", "(JII)V", (void*)restrictedFunction},
{"memWriteJavaInt", "(JII)V", (void*)restrictedFunction},
{"memWriteJavaLong", "(JIJ)V", (void*)restrictedFunction},
{"memWriteJavaShort", "(JII)V", (void*)restrictedFunction},
{"memWritePointer", "(JIJ)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},
......@@ -121,37 +113,23 @@ static const JNINativeMethod assemblyMethods[] =
{"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},
{"objectGetClassInfo", "(J)Lcc/squirreljme/jvm/ClassInfo;", (void*)restrictedFunction},
{"objectGetClassInfo", "(Ljava/lang/Object;)Lcc/squirreljme/jvm/ClassInfo;", (void*)restrictedFunction},
{"objectGetClassInfoPointer", "(J)J", (void*)restrictedFunction},
{"objectGetClassInfoPointer", "(Ljava/lang/Object;)J", (void*)restrictedFunction},
{"objectSetClassInfo", "(JJ)V", (void*)restrictedFunction},
{"objectSetClassInfo", "(Ljava/lang/Object;J)V", (void*)restrictedFunction},
{"objectSetClassInfo", "(JLcc/squirreljme/jvm/ClassInfo;)V", (void*)restrictedFunction},
{"objectSetClassInfo", "(Ljava/lang/Object;Lcc/squirreljme/jvm/ClassInfo;)V", (void*)restrictedFunction},
{"objectToPointer", "(Ljava/lang/Object;)J", (void*)restrictedFunction},
{"objectToPointerRefQueue", "(Ljava/lang/Object;)J", (void*)restrictedFunction},
{"pointerToObject", "(J)Ljava/lang/Object;", (void*)restrictedFunction},
{"pointerToClassInfo", "(J)Lcc/squirreljme/jvm/ClassInfo;", (void*)restrictedFunction},
{"poolLoad", "(JI)J", (void*)restrictedFunction},
{"poolLoad", "(Ljava/lang/Object;I)J", (void*)restrictedFunction},
{"poolStore", "(JIJ)V", (void*)restrictedFunction},
{"poolStore", "(Ljava/lang/Object;IJ)V", (void*)restrictedFunction},
{"refCount", "(J)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", "(J)I", (void*)restrictedFunction},
{"refGetCount", "(I)I", (void*)restrictedFunction},
{"refGetCount", "(Ljava/lang/Object;)I", (void*)restrictedFunction},
{"refSetCount", "(JI)V", (void*)restrictedFunction},
{"refSetCount", "(II)V", (void*)restrictedFunction},
{"refSetCount", "(Ljava/lang/Object;I)V", (void*)restrictedFunction},
{"refUncount", "(J)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},
{"sizeOfBaseArray", "()I", (void*)restrictedFunction},
{"sizeOfBaseObject", "()I", (void*)restrictedFunction},
{"sizeOfPointer", "()I", (void*)restrictedFunction},
{"specialGetExceptionRegister", "()Ljava/lang/Object;", (void*)restrictedFunction},
{"specialGetExceptionRegisterThrowable", "()Ljava/lang/Throwable;", (void*)restrictedFunction},
{"specialGetExceptionRegisterPointer", "()J", (void*)restrictedFunction},
......@@ -159,73 +137,14 @@ static const JNINativeMethod assemblyMethods[] =
{"specialGetPoolRegisterPointer", "()J", (void*)restrictedFunction},
{"specialGetReturnRegister", "()I", (void*)restrictedFunction},
{"specialGetReturnRegisterLong", "()J", (void*)restrictedFunction},
{"specialGetStaticFieldRegister", "()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},
{"specialSetStaticFieldRegister", "(J)V", (void*)restrictedFunction},
{"specialSetThreadRegister", "(J)V", (void*)restrictedFunction},
{"specialSetThreadRegister", "(Ljava/lang/Thread;)V", (void*)restrictedFunction},
// Un-Pure System Calls
{"sysCall", "(S)V", (void*)restrictedFunction},
{"sysCall", "(SI)V", (void*)restrictedFunction},
{"sysCall", "(SII)V", (void*)restrictedFunction},
{"sysCall", "(SIII)V", (void*)restrictedFunction},
{"sysCall", "(SIIII)V", (void*)restrictedFunction},
{"sysCall", "(SIIIII)V", (void*)restrictedFunction},
{"sysCall", "(SIIIIII)V", (void*)restrictedFunction},
{"sysCall", "(SIIIIIII)V", (void*)restrictedFunction},
{"sysCall", "(SIIIIIIII)V", (void*)restrictedFunction},
{"sysCallV", "(S)I", (void*)restrictedFunction},
{"sysCallV", "(SI)I", (void*)restrictedFunction},
{"sysCallV", "(SII)I", (void*)restrictedFunction},
{"sysCallV", "(SIII)I", (void*)restrictedFunction},
{"sysCallV", "(SIIII)I", (void*)restrictedFunction},
{"sysCallV", "(SIIIII)I", (void*)restrictedFunction},
{"sysCallV", "(SIIIIII)I", (void*)restrictedFunction},
{"sysCallV", "(SIIIIIII)I", (void*)restrictedFunction},
{"sysCallV", "(SIIIIIIII)I", (void*)restrictedFunction},
{"sysCallVL", "(S)J", (void*)restrictedFunction},
{"sysCallVL", "(SI)J", (void*)restrictedFunction},
{"sysCallVL", "(SII)J", (void*)restrictedFunction},
{"sysCallVL", "(SIII)J", (void*)restrictedFunction},
{"sysCallVL", "(SIIII)J", (void*)restrictedFunction},
{"sysCallVL", "(SIIIII)J", (void*)restrictedFunction},
{"sysCallVL", "(SIIIIII)J", (void*)restrictedFunction},
{"sysCallVL", "(SIIIIIII)J", (void*)restrictedFunction},
{"sysCallVL", "(SIIIIIIII)J", (void*)restrictedFunction},
// Pure System Calls {"sysCallP", "(S)V", (void*)restrictedFunction},
{"sysCallP", "(SI)V", (void*)restrictedFunction},
{"sysCallP", "(SII)V", (void*)restrictedFunction},
{"sysCallP", "(SIII)V", (void*)restrictedFunction},
{"sysCallP", "(SIIII)V", (void*)restrictedFunction},
{"sysCallP", "(SIIIII)V", (void*)restrictedFunction},
{"sysCallP", "(SIIIIII)V", (void*)restrictedFunction},
{"sysCallP", "(SIIIIIII)V", (void*)restrictedFunction},
{"sysCallP", "(SIIIIIIII)V", (void*)restrictedFunction},
{"sysCallPV", "(S)I", (void*)restrictedFunction},
{"sysCallPV", "(SI)I", (void*)restrictedFunction},
{"sysCallPV", "(SII)I", (void*)restrictedFunction},
{"sysCallPV", "(SIII)I", (void*)restrictedFunction},
{"sysCallPV", "(SIIII)I", (void*)restrictedFunction},
{"sysCallPV", "(SIIIII)I", (void*)restrictedFunction},
{"sysCallPV", "(SIIIIII)I", (void*)restrictedFunction},
{"sysCallPV", "(SIIIIIII)I", (void*)restrictedFunction},
{"sysCallPV", "(SIIIIIIII)I", (void*)restrictedFunction},
{"sysCallPVL", "(S)J", (void*)restrictedFunction},
{"sysCallPVL", "(SI)J", (void*)restrictedFunction},
{"sysCallPVL", "(SII)J", (void*)restrictedFunction},
{"sysCallPVL", "(SIII)J", (void*)restrictedFunction},
{"sysCallPVL", "(SIIII)J", (void*)restrictedFunction},
{"sysCallPVL", "(SIIIII)J", (void*)restrictedFunction},
{"sysCallPVL", "(SIIIIII)J", (void*)restrictedFunction},
{"sysCallPVL", "(SIIIIIII)J", (void*)restrictedFunction},
{"sysCallPVL", "(SIIIIIIII)J", (void*)restrictedFunction}
};
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved)
......
......@@ -64,7 +64,7 @@ public final class NativeFramebuffer
// Set title of the framebuffer
case Framebuffer.CONTROL_SET_TITLE:
this.title = String.valueOf((char[])Assembly.pointerToObject(
Assembly.longPack(__a, __b)));
(int)Assembly.longPack(__a, __b)));
return 0;
default:
......
......@@ -15,7 +15,6 @@ dependencies
api project(":modules:common-vm")
api project(":modules:meep-swm")
api project(":modules:tool-classfile")
api project(":modules:tool-manifest-reader")
api project(":modules:debug-jdwp")
}
......
......@@ -12,11 +12,12 @@ package cc.squirreljme.vm.springcoat;
import cc.squirreljme.jvm.mle.RuntimeShelf;
import cc.squirreljme.jvm.mle.constants.BuiltInEncodingType;
import cc.squirreljme.jvm.mle.constants.BuiltInLocaleType;
import cc.squirreljme.jvm.mle.constants.ByteOrderType;
import cc.squirreljme.jvm.mle.constants.MemoryProfileType;
import cc.squirreljme.jvm.mle.constants.VMDescriptionType;
import cc.squirreljme.jvm.mle.constants.VMStatisticType;
import cc.squirreljme.jvm.mle.constants.VMType;
import cc.squirreljme.runtime.cldc.SquirrelJME;
import cc.squirreljme.runtime.cldc.debug.Debugging;
import cc.squirreljme.runtime.cldc.lang.LineEndingUtils;
import cc.squirreljme.vm.springcoat.exceptions.SpringMLECallError;
......@@ -28,6 +29,21 @@ import cc.squirreljme.vm.springcoat.exceptions.SpringMLECallError;
public enum MLERuntime
implements MLEFunction
{
/** {@link RuntimeShelf#byteOrder()}. */
BYTE_ORDER("byteOrder:()I")
{
/**
* {@inheritDoc}
* @since 2021/02/09
*/
@Override
public Object handle(SpringThreadWorker __thread, Object... __args)
{
// SpringCoat is always big endian
return ByteOrderType.BIG_ENDIAN;
}
},
/** {@link RuntimeShelf#currentTimeMillis()}. */
CURRENT_TIME_MILLIS("currentTimeMillis:()J")
{
......@@ -134,6 +150,21 @@ public enum MLERuntime
}
},
/** {@link RuntimeShelf#memoryProfile()}. */
MEMORY_PROFILE("memoryProfile:()I")
{
/**
* {@inheritDoc}
* @since 2021/02/19
*/
@Override
public Object handle(SpringThreadWorker __thread, Object... __args)
{
// No memory concerns
return MemoryProfileType.NORMAL;
}
},
/** {@link RuntimeShelf#nanoTime()}. */
NANO_TIME("nanoTime:()J")
{
......
......@@ -21,6 +21,7 @@ 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.constants.VerboseDebugFlag;
import cc.squirreljme.runtime.cldc.debug.Debugging;
import cc.squirreljme.vm.springcoat.brackets.TypeObject;
......@@ -1037,10 +1038,28 @@ 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/mle/lle/"))
__class.toString().startsWith("cc/squirreljme/jvm/summercoat/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", __class,
"Invalid LLE native call: %s:%s %s", __class, __method,
Arrays.asList(__args)));
}
// Do not allow the older SpringCoat "asm" classes to be called as
// the interfaces are very different with the MLE layer.
......
......@@ -943,8 +943,7 @@ public final class NativeCPU
Frame was = frames.getLast();
if ((was._taskid == 0 ||
syscallid == SystemCallIndex.EXCEPTION_LOAD ||
syscallid == SystemCallIndex.EXCEPTION_STORE) &&
syscallid != SystemCallIndex.IPC_CALL)
syscallid == SystemCallIndex.EXCEPTION_STORE))
{
// If profiling, profile the handling of the
// system call in a sub-frame
......@@ -1263,8 +1262,6 @@ public final class NativeCPU
case SystemCallIndex.PD_WRITE_BYTE:
case SystemCallIndex.SLEEP:
case SystemCallIndex.SUPERVISOR_BOOT_OKAY:
case SystemCallIndex.SUPERVISOR_PROPERTY_GET:
case SystemCallIndex.SUPERVISOR_PROPERTY_SET:
case SystemCallIndex.TIME_MILLI_WALL:
case SystemCallIndex.TIME_NANO_MONO:
case SystemCallIndex.VMI_MEM_FREE:
......@@ -1554,50 +1551,6 @@ public final class NativeCPU
err = 0;
break;
// Get supervisor property
case SystemCallIndex.SUPERVISOR_PROPERTY_GET:
{
int dx = __args[0];
// Out of range?
if (dx < 0 || dx >= SupervisorPropertyIndex.NUM_PROPERTIES)
{
rv = 0;
err = SystemCallError.VALUE_OUT_OF_RANGE;
}
// Valid
else
{
rv = this._supervisorproperties[dx];
err = SystemCallError.NO_ERROR;
}
}
break;
// Set supervisor property
case SystemCallIndex.SUPERVISOR_PROPERTY_SET:
{
int dx = __args[0];
// Out of range?
if (dx < 0 || dx >= SupervisorPropertyIndex.NUM_PROPERTIES)
{
rv = 0;
err = SystemCallError.VALUE_OUT_OF_RANGE;
}
// Valid
else
{
this._supervisorproperties[dx] = __args[1];
rv = 0;
err = SystemCallError.NO_ERROR;
}
}
break;
// Current wall clock milliseconds.
case SystemCallIndex.TIME_MILLI_WALL:
{
......
......@@ -345,9 +345,8 @@ public final class JVMFunction
public static final long jvmSystemCall(short __si, int __a, int __b,
int __c, int __d, int __e, int __f, int __g, int __h)
{
// Call pure form
return Assembly.sysCallPVL(__si, __a, __b, __c, __d, __e, __f, __g,
__h);
Assembly.breakpoint();
throw Debugging.todo();
}
}
......@@ -28,14 +28,14 @@ public class SoftDouble
/**
* Adds two values.
*
* @param __ah A high.
* @param __al A low.
* @param __bh B high.
* @param __ah A high.
* @param __bl B low.
* @param __bh B high.
* @return The result.
* @since 2019/05/24
*/
public static double add(int __ah, int __al, int __bh, int __bl)
public static double add(int __al, int __ah, int __bl, int __bh)
{
Assembly.breakpoint();
throw new todo.TODO();
......@@ -44,14 +44,14 @@ public class SoftDouble
/**
* Compares two values.
*
* @param __ah A high.
* @param __al A low.
* @param __bh B high.
* @param __ah A high.
* @param __bl B low.
* @param __bh B high.
* @return The result.
* @since 2019/05/24
*/
public static int cmpl(int __ah, int __al, int __bh, int __bl)
public static int cmpl(int __al, int __ah, int __bl, int __bh)
{
Assembly.breakpoint();
throw new todo.TODO();
......@@ -60,14 +60,14 @@ public class SoftDouble
/**
* Compares two values.
*
* @param __ah A high.
* @param __al A low.
* @param __bh B high.
* @param __ah A high.
* @param __bl B low.
* @param __bh B high.
* @return The result.
* @since 2019/05/24
*/
public static int cmpg(int __ah, int __al, int __bh, int __bl)
public static int cmpg(int __al, int __ah, int __bl, int __bh)
{
Assembly.breakpoint();
throw new todo.TODO();
......@@ -76,14 +76,14 @@ public class SoftDouble
/**
* Divides two values.