void ion::TraceLIR(uint32_t bblock, uint32_t lir, uint32_t execModeInt, const char *lirOpName, const char *mirOpName, JSScript *script, jsbytecode *pc) { #ifdef DEBUG static enum { NotSet, All, Bailouts } traceMode; // If you set IONFLAGS=trace, this function will be invoked before every LIR. // // You can either modify it to do whatever you like, or use gdb scripting. // For example: // // break ParTrace // commands // continue // exit if (traceMode == NotSet) { // Racy, but that's ok. const char *env = getenv("IONFLAGS"); if (strstr(env, "trace-all")) traceMode = All; else traceMode = Bailouts; } IonLIRTraceData *cached; if (execModeInt == 0) cached = &seqTraceData; else cached = &ForkJoinSlice::Current()->traceData; if (bblock == 0xDEADBEEF) { if (execModeInt == 0) printTrace("BAILOUT", cached); else SpewBailoutIR(cached->bblock, cached->lir, cached->lirOpName, cached->mirOpName, cached->script, cached->pc); } cached->bblock = bblock; cached->lir = lir; cached->execModeInt = execModeInt; cached->lirOpName = lirOpName; cached->mirOpName = mirOpName; cached->script = script; cached->pc = pc; if (traceMode == All) printTrace("Exec", cached); #endif }
void jit::TraceLIR(IonLIRTraceData *current) { #ifdef DEBUG static enum { NotSet, All, Bailouts } traceMode; // If you set IONFLAGS=trace, this function will be invoked before every LIR. // // You can either modify it to do whatever you like, or use gdb scripting. // For example: // // break TraceLIR // commands // continue // exit if (traceMode == NotSet) { // Racy, but that's ok. const char *env = getenv("IONFLAGS"); if (strstr(env, "trace-all")) traceMode = All; else traceMode = Bailouts; } IonLIRTraceData *cached; if (current->execModeInt == 0) cached = &seqTraceData; else cached = &ForkJoinContext::current()->traceData; if (current->blockIndex == 0xDEADBEEF) { if (current->execModeInt == 0) printTrace("BAILOUT", cached); else SpewBailoutIR(cached); } memcpy(cached, current, sizeof(IonLIRTraceData)); if (traceMode == All) printTrace("Exec", cached); #endif }