mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Add debugging facilities for typemaps and fix sp_adj calculation for tree calls.
This commit is contained in:
parent
454c89d72b
commit
8569359e49
@ -1433,7 +1433,7 @@ TraceRecorder::emitTreeCallStackSetup(Fragment* inner)
|
||||
if (callDepth > 0) {
|
||||
/* Calculate the amount we have to lift the native stack pointer by to compensate for
|
||||
any outer frames that the inner tree doesn't expect but the outer tree has. */
|
||||
ptrdiff_t sp_adj = nativeStackOffset(&cx->fp->argv[0]);
|
||||
ptrdiff_t sp_adj = nativeStackOffset(&cx->fp->argv[-1]) + sizeof(double);
|
||||
/* Calculate the amount we have to lift the call stack by */
|
||||
ptrdiff_t rp_adj = callDepth * sizeof(FrameInfo);
|
||||
/* Guard that we have enough stack space for the tree we are trying to call on top
|
||||
@ -5426,6 +5426,24 @@ TraceRecorder::record_JSOP_HOLE()
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void
|
||||
TraceRecorder::printTypeMap(uint8* globalTypeMap, uint8* stackTypeMap)
|
||||
{
|
||||
uint8* m = globalTypeMap;
|
||||
const char* types[] = { "object", "int", "double", "int", "string", "int", "boolean", "int" };
|
||||
FORALL_GLOBAL_SLOTS(cx, traceMonitor->globalSlots->length(), traceMonitor->globalSlots->data(),
|
||||
printf("%s%d type=%s value=%lx\n", vpname, vpnum, types[(unsigned)*m], *vp);
|
||||
++m;
|
||||
);
|
||||
m = stackTypeMap;
|
||||
FORALL_SLOTS_IN_PENDING_FRAMES(cx, callDepth,
|
||||
printf("%s%d type=%s value=%lx\n", vpname, vpnum, types[(unsigned)*m], *vp);
|
||||
++m;
|
||||
);
|
||||
}
|
||||
#endif DEBUG
|
||||
|
||||
#define UNUSED(op) bool TraceRecorder::record_##op() { return false; }
|
||||
|
||||
UNUSED(JSOP_UNUSED76)
|
||||
|
@ -302,6 +302,10 @@ class TraceRecorder {
|
||||
bool interpretedFunctionCall(jsval& fval, JSFunction* fun, uintN argc);
|
||||
bool forInLoop(jsval* vp);
|
||||
|
||||
#ifdef DEBUG
|
||||
void printTypeMap(uint8* globalTypeMap, uint8* stackTypeMap);
|
||||
#endif
|
||||
|
||||
public:
|
||||
TraceRecorder(JSContext* cx, nanojit::GuardRecord*, nanojit::Fragment*, TreeInfo*,
|
||||
unsigned ngslots, uint8* globalTypeMap, uint8* stackTypeMap);
|
||||
|
Loading…
Reference in New Issue
Block a user