[INFER] *correctly* mark VMFrames when patching native returns, bug 661859.
authorBrian Hackett <bhackett1024@gmail.com>
Sat, 04 Jun 2011 13:41:31 -0700
changeset 75139 2b6ec8bc086bc218512f1f3c96fd672110b81c5d
parent 75138 53649a1d6e4542f8a27fb40c57d7086117676325
child 75140 6d423e5f2e488bfaa6466ba6be90b0c352f057f9
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
bugs661859
milestone6.0a1
[INFER] *correctly* mark VMFrames when patching native returns, bug 661859.
js/src/methodjit/Retcon.cpp
--- a/js/src/methodjit/Retcon.cpp
+++ b/js/src/methodjit/Retcon.cpp
@@ -419,30 +419,29 @@ Recompiler::recompile(bool resetUses)
          * frames which were pushed inside the call.
          */
         StackFrame *fp = f->fp();
         void **addr = f->returnAddressLocation();
         RejoinState rejoin = (RejoinState) f->stubRejoin;
         if (rejoin == REJOIN_NATIVE ||
             rejoin == REJOIN_NATIVE_LOWERED) {
             /* Native call. */
-            if (fp->script() == script && fp->isConstructing())
-                patchNative(cx, script->jitCtor, fp, fp->pc(cx, NULL), NULL, rejoin);
-            else if (fp->script() == script)
-                patchNative(cx, script->jitNormal, fp, fp->pc(cx, NULL), NULL, rejoin);
-            f->stubRejoin = REJOIN_NATIVE_PATCHED;
+            if (fp->script() == script) {
+                patchNative(cx, fp->jit(), fp, fp->pc(cx, NULL), NULL, rejoin);
+                f->stubRejoin = REJOIN_NATIVE_PATCHED;
+            }
         } else if (rejoin == REJOIN_NATIVE_PATCHED) {
             /* Already patched, don't do anything. */
         } else if (rejoin) {
             /* Recompilation triggered by CompileFunction. */
             if (fp->script() == script) {
                 fp->setRejoin(StubRejoin(rejoin));
                 *addr = JS_FUNC_TO_DATA_PTR(void *, JaegerInterpoline);
+                f->stubRejoin = 0;
             }
-            f->stubRejoin = 0;
         } else if (script->jitCtor && script->jitCtor->isValidCode(*addr)) {
             patchCall(script->jitCtor, fp, addr);
         } else if (script->jitNormal && script->jitNormal->isValidCode(*addr)) {
             patchCall(script->jitNormal, fp, addr);
         }
 
         nextf = f;
     }