From 6562b9f74d06fabdd025ab50a8dd6e130cb9dddf Mon Sep 17 00:00:00 2001 From: "shaver@mozilla.org" Date: Sat, 9 Aug 2008 23:12:32 -0400 Subject: [PATCH] JSOP_ANONFUNOBJ --- js/src/jstracer.cpp | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/js/src/jstracer.cpp b/js/src/jstracer.cpp index 5ed3b8b8e848..6d8dc25a2fad 100644 --- a/js/src/jstracer.cpp +++ b/js/src/jstracer.cpp @@ -3998,10 +3998,30 @@ TraceRecorder::record_JSOP_DEFVAR() return false; } +/* + * XXX could hoist out to jsinterp.h and share with jsinterp.cpp, but + * XXX jsopcode.cpp has different definitions of same-named macros. + */ +#define GET_FULL_INDEX(PCOFF) \ + (atoms - script->atomMap.vector + GET_INDEX(regs.pc + PCOFF)) + +#define LOAD_FUNCTION(PCOFF) \ + JS_GET_SCRIPT_FUNCTION(script, GET_FULL_INDEX(PCOFF), fun) + bool TraceRecorder::record_JSOP_ANONFUNOBJ() { - return false; + JSFunction* fun; + JSFrameRegs& regs = *cx->fp->regs; + JSScript* script = cx->fp->script; + LOAD_FUNCTION(0); // needs script, regs, fun + + JSObject* obj = FUN_OBJECT(fun); + if (OBJ_GET_PARENT(cx, obj) != cx->fp->scopeChain) + ABORT_TRACE("can't trace with activation object on scopeChain"); + + stack(0, lir->insImmPtr(obj)); + return true; } bool @@ -4058,23 +4078,13 @@ TraceRecorder::record_JSOP_ARGCNT() return false; } -/* - * XXX could hoist out to jsinterp.h and share with jsinterp.cpp, but - * XXX jsopcode.cpp has different definitions of same-named macros. - */ -#define GET_FULL_INDEX(PCOFF) \ - (atoms - script->atomMap.vector + GET_INDEX(regs.pc + PCOFF)) - -#define LOAD_FUNCTION(PCOFF) \ - JS_GET_SCRIPT_FUNCTION(script, GET_FULL_INDEX(PCOFF), fun) - bool TraceRecorder::record_JSOP_DEFLOCALFUN() { JSFunction* fun; JSFrameRegs& regs = *cx->fp->regs; JSScript* script = cx->fp->script; - LOAD_FUNCTION(SLOTNO_LEN); + LOAD_FUNCTION(SLOTNO_LEN); // needs script, regs, fun JSObject* obj = FUN_OBJECT(fun); if (OBJ_GET_PARENT(cx, obj) != cx->fp->scopeChain)