Add generic recorder hooks that are called before and after all opcodes as we trace. We might want to instead just move to pre_OP and post_OP.

This commit is contained in:
Andreas Gal 2008-07-16 17:29:08 -07:00
parent dd7be4a81c
commit db7e41ed40
3 changed files with 15 additions and 1 deletions

View File

@ -6905,7 +6905,8 @@ js_Interpret(JSContext *cx)
#define RECORD(x) \
JS_BEGIN_MACRO \
if (!JS_TRACE_MONITOR(cx).recorder->record_##x()) { \
TraceRecorder* r = JS_TRACE_MONITOR(cx).recorder; \
if (!r->before_OP(x) || !r->record_##x() || !r->after_OP(x)) { \
js_AbortRecording(cx, #x); \
ENABLE_TRACER(0); \
} \

View File

@ -3002,3 +3002,13 @@ bool TraceRecorder::record_JSOP_HOLE()
stack(0, lir->insImm(JSVAL_HOLE));
return true;
}
bool TraceRecorder::before_OP(jsbytecode op)
{
return true;
}
bool TraceRecorder::after_OP(jsbytecode op)
{
return true;
}

View File

@ -211,6 +211,9 @@ public:
bool loopEdge();
void stop();
bool before_OP(jsbytecode op);
bool after_OP(jsbytecode op);
#define OPDEF(op,val,name,token,length,nuses,ndefs,prec,format) \
bool record_##op();
# include "jsopcode.tbl"