From d952f192ba6e07db8d4dda2d50daa0183b89966e Mon Sep 17 00:00:00 2001 From: Andreas Gal Date: Fri, 25 Jul 2008 02:29:36 -0700 Subject: [PATCH] Can't use lr->from. Seems to not get set in certain cases. Go figure. The nanojit tree code is really weird. --- js/src/jstracer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/src/jstracer.cpp b/js/src/jstracer.cpp index 549c2427c59..70b544ba626 100644 --- a/js/src/jstracer.cpp +++ b/js/src/jstracer.cpp @@ -1282,7 +1282,7 @@ js_ExecuteTree(JSContext* cx, Fragment* f) } static bool -js_AttemptToExtendTree(JSContext* cx, GuardRecord* lr) +js_AttemptToExtendTree(JSContext* cx, GuardRecord* lr, Fragment* f) { debug_only(printf("trying to attach another branch to the tree\n");) @@ -1290,16 +1290,16 @@ js_AttemptToExtendTree(JSContext* cx, GuardRecord* lr) if (!(c = lr->target)) { c = JS_TRACE_MONITOR(cx).fragmento->createBranch(lr, lr->exit); c->spawnedFrom = lr->guard; - c->parent = lr->from; + c->parent = f; lr->exit->target = c; lr->target = c; - c->root = c->parent; + c->root = f; c->calldepth = lr->calldepth; } if (++c->hits() >= HOTEXIT) { /* start tracing secondary trace from this point */ - c->lirbuf = c->parent->lirbuf; + c->lirbuf = f->lirbuf; return js_StartRecorder(cx, lr, c, lr->guard->exit()->typeMap); } return false; @@ -1402,7 +1402,7 @@ js_LoopEdge(JSContext* cx, jsbytecode* oldpc) if (lr->exit->loopExit) return false; - return js_AttemptToExtendTree(cx, lr); + return js_AttemptToExtendTree(cx, lr, f); } void