\E s" u1 *" single data-stack type-prefix addr
\E s" functionptr" single data-stack type-prefix af
\E s" methodinfo *" single data-stack type-prefix am
+\E s" fieldinfo *" single data-stack type-prefix afi
\E s" Cell *" single data-stack type-prefix acell
\E s" Inst *" single data-stack type-prefix ainst
\E s" unresolved_field *" single data-stack type-prefix auf
/* Note: This code should use a binary search, as
the table is sorted. Note also, we reversed the order
of the parms */
- unsigned i;
- for ( i = 0; i < iNpairs; i++ ) {
- Cell *table = (Cell *)(addrSegment+iOffset);
- if ( iKey == (s4)(table[2 * i]) ) {
+ int i;
+
+ i = iNpairs;
+
+ while (--i >= 0) {
+ Cell *table = (Cell *) (addrSegment+iOffset);
+ if (iKey == (s4) (table[2 * i])) {
SET_IP((Inst *)(table[2 * i + 1])); INST_TAIL;
}
}
IRETURN ( #vOffsetFP ... vValue -- vResult ) 0xac
{
Inst *new_ip;
- Cell *currentsp = sp;
+ MAYBE_UNUSED Cell *currentsp = sp;
new_ip = (Inst *) access_local_cell(vOffsetFP - SIZEOF_VOID_P);
sp = fp + 1;
fp = (Cell *) access_local_cell(vOffsetFP);
LRETURN ( #vOffsetFP ... lValue -- lResult ) 0xad
{
Inst *new_ip;
- Cell *currentsp = sp;
+ MAYBE_UNUSED Cell *currentsp = sp;
new_ip = (Inst *) access_local_cell(vOffsetFP - SIZEOF_VOID_P);
sp = fp + 1;
fp = (Cell *) access_local_cell(vOffsetFP);
RETURN ( #vOffsetFP ... -- ) 0xb1
{
Inst *new_ip;
- Cell *currentsp = sp;
+ MAYBE_UNUSED Cell *currentsp = sp;
new_ip = (Inst *) access_local_cell(vOffsetFP - SIZEOF_VOID_P);
sp = fp + 1;
fp = (Cell *) access_local_cell(vOffsetFP);
acelloldfp = fp;
ainstoldip = IP;
fp = sp - 1 + iNargs;
- sp = fp - MAXLOCALS(stub) + 1;
+ sp = fp - FRAMESIZE(stub) + 1;
SET_IP(target);
}
acelloldfp = fp;
ainstoldip = IP;
fp = sp - 1 + iNargs; /* !! scale nargs at translation time */
- sp = fp - MAXLOCALS(aaTarget) + 1;
+ sp = fp - FRAMESIZE(aaTarget) + 1;
SET_IP(target);
}
acelloldfp = fp;
ainstoldip = IP;
fp = sp - 1 + iNargs; /* !! scale nargs at translation time */
- sp = fp - MAXLOCALS(aaTarget) + 1;
+ sp = fp - FRAMESIZE(aaTarget) + 1;
SET_IP(target);
}
acelloldfp = fp;
ainstoldip = IP;
fp = sp - 1 + iNargs;
- sp = fp - MAXLOCALS(stub) + 1;
+ sp = fp - FRAMESIZE(stub) + 1;
SET_IP(target);
}
CHECKCAST ( #aClass #acr aRef -- aRef ) 0xc0
{
- if (!builtin_checkcast((java_objectheader *) aRef, (classinfo *) aClass))
- THROW(classcastexception);
+ if (!builtin_checkcast(aRef, (classinfo *) aClass))
+ THROW_CLASSCASTEXCEPTION(aRef);
}
ARRAYCHECKCAST ( #aClass #acr aRef -- aRef ) 0xc0
{
if (!builtin_arraycheckcast(aRef, aClass))
- THROW(classcastexception);
+ THROW_CLASSCASTEXCEPTION(aRef);
}
PATCHER_ARRAYCHECKCAST ( #avftbl #acr ... -- ) 0xc0
MONITORENTER ( aRef -- )
{
#if defined(ENABLE_THREADS)
- /* CHECK_NULL_PTR(aRef); is now done explicitly */
- builtin_monitorenter(aRef);
+ /* CHECK_NULL_PTR(aRef); is now done explicitly inside lock_monitor_enter */
+ global_sp = sp;
+ if (!lock_monitor_enter(aRef))
+ THROW0;
+ CLEAR_global_sp;
#endif
}
MONITOREXIT ( aRef -- )
{
#if defined(ENABLE_THREADS)
- /* CHECK_NULL_PTR(aRef); cannot happen */
- builtin_monitorexit(aRef);
+ global_sp = sp;
+ if (!lock_monitor_exit(aRef))
+ THROW0;
+ CLEAR_global_sp;
#endif
}
float f;
vm_Cell2f(v,f);
#if !defined(NDEBUG)
-builtin_displaymethodstop(am, (s8) v, f, f);
+builtin_verbosecall_exit((s8) v, f, f, am);
#endif
}
if (*exceptionptr)
THROW0;
PATCHER_NATIVECALL ( #am #af #addrcif ... -- )
-#if !defined(WITH_STATIC_CLASSPATH)
stackframeinfo sfi;
bool result;
global_sp = sp;
IP[-4] = opt_verbosecall ? INST_ADDR(TRACENATIVECALL) : INST_ADDR(NATIVECALL);
SET_IP(IP - 4);
patchersuper_rewrite(IP);
-#else
-assert(false);
-#endif
TRACECALL ( #am -- )
#if !defined(NDEBUG)
-builtin_trace_args(
- access_local_cell(0 * -SIZEOF_VOID_P),
- access_local_cell(1 * -SIZEOF_VOID_P),
- access_local_cell(2 * -SIZEOF_VOID_P),
- access_local_cell(3 * -SIZEOF_VOID_P),
+#if SIZEOF_VOID_P == 4
+{
+ s8 args[TRACE_ARGS_NUM];
+ int i;
+ int ofs = 0;
+ typedesc *params = am->parseddesc->paramtypes;
+ for (i=0; i < TRACE_ARGS_NUM; ++i, ++params) {
+ if (IS_2_WORD_TYPE(params->type)) {
+ vm_twoCell2l(access_local_cell(ofs), access_local_cell(ofs - SIZEOF_VOID_P), args[i]);
+ ofs -= 2*SIZEOF_VOID_P;
+ }
+ else {
+ args[i] = access_local_cell(ofs);
+ ofs -= SIZEOF_VOID_P;
+ }
+ }
+ builtin_verbosecall_enter(args[0], args[1], args[2], args[3],
+#if TRACE_ARGS_NUM > 4
+ args[4], args[5],
+#endif
+#if TRACE_ARGS_NUM == 8
+ args[6], args[7],
+#endif
+ am);
+}
+#else /* SIZEOF_VOID_P */
+ builtin_verbosecall_enter(
+ access_local_cell(0 * -SIZEOF_VOID_P),
+ access_local_cell(1 * -SIZEOF_VOID_P),
+ access_local_cell(2 * -SIZEOF_VOID_P),
+ access_local_cell(3 * -SIZEOF_VOID_P),
#if TRACE_ARGS_NUM > 4
- access_local_cell(4 * -SIZEOF_VOID_P),
- access_local_cell(5 * -SIZEOF_VOID_P),
+ access_local_cell(4 * -SIZEOF_VOID_P),
+ access_local_cell(5 * -SIZEOF_VOID_P),
#endif
#if TRACE_ARGS_NUM == 8
- access_local_cell(6 * -SIZEOF_VOID_P),
- access_local_cell(7 * -SIZEOF_VOID_P),
+ access_local_cell(6 * -SIZEOF_VOID_P),
+ access_local_cell(7 * -SIZEOF_VOID_P),
#endif
- am);
+ am);
+#endif /* SIZEOF_VOID_P */
#endif /* !defined(NDEBUG) */
TRACERETURN ( #am v -- v )
float f;
vm_Cell2f(v,f);
#if !defined(NDEBUG)
-builtin_displaymethodstop(am, (s8) v, f, f);
+builtin_verbosecall_exit((s8) v, f, f, am);
#endif
TRACELRETURN ( #am l -- l )
Double_Store ds;
ds.l = l;
#if !defined(NDEBUG)
-builtin_displaymethodstop(am, l, ds.d, ds.d);
+builtin_verbosecall_exit(l, ds.d, ds.d, am);
#endif
END ( ... -- )