Bug 1501301: Fix the argv loop in aarch64 generateEnterJIT r=sstangl
authorDavid Major <dmajor@mozilla.com>
Tue, 23 Oct 2018 19:41:49 +0000
changeset 491015 57e435f97c303a4e04f9d74e5eafbe89cc6acab5
parent 491014 87757f9e1d78a189f5ceb1dadd7f4520f066c049
child 491016 48c57a68273eafff79cf99855c348fe1bc5b317b
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewerssstangl
bugs1501301
milestone65.0a1
Bug 1501301: Fix the argv loop in aarch64 generateEnterJIT r=sstangl The code was looping one too many times. Differential Revision: https://phabricator.services.mozilla.com/D9530
js/src/jit/arm64/Trampoline-arm64.cpp
--- a/js/src/jit/arm64/Trampoline-arm64.cpp
+++ b/js/src/jit/arm64/Trampoline-arm64.cpp
@@ -131,21 +131,21 @@ JitRuntime::generateEnterJIT(JSContext* 
             masm.bind(&loopHead);
 
             // Load an argument from argv, then increment argv by 8.
             masm.Ldr(x24, MemOperand(ARMRegister(reg_argv, 64), Operand(8), vixl::PostIndex));
 
             // Store the argument to tmp_sp, then increment tmp_sp by 8.
             masm.Str(x24, MemOperand(tmp_sp, Operand(8), vixl::PostIndex));
 
-            // Set the condition codes for |cmp tmp_argc, 2| (using the old value).
+            // Decrement tmp_argc and set the condition codes for the new value.
             masm.Subs(tmp_argc, tmp_argc, Operand(1));
 
             // Branch if arguments remain.
-            masm.B(&loopHead, vixl::Condition::ge);
+            masm.B(&loopHead, vixl::Condition::NonZero);
         }
 
         masm.bind(&noArguments);
     }
     masm.checkStackAlignment();
 
     // Push the number of actual arguments and the calleeToken.
     // The result address is used to store the actual number of arguments