Bug 1212298 - Use inner script instead of outer script in CodeGenerator::visitCallDirectEval. r=shu a=ritu
authorJan de Mooij <jdemooij@mozilla.com>
Tue, 05 Jan 2016 20:49:14 +0100
changeset 305974 faa80a5c54b0ef9f76fa14489d0173f04dbf0be6
parent 305973 36699ba4cc35bf293eb97398ad1243a6a09a5fdb
child 305975 0a239969b8758be115fa6f6dca21719fd2dde169
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersshu, ritu
bugs1212298
milestone44.0
Bug 1212298 - Use inner script instead of outer script in CodeGenerator::visitCallDirectEval. r=shu a=ritu
js/src/jit-test/tests/ion/bug1212298.js
js/src/jit/CodeGenerator.cpp
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/ion/bug1212298.js
@@ -0,0 +1,8 @@
+function f() {
+    for (var e = 1; e < 3000; e++) {
+	(function(arguments) {
+            eval("var y");
+	})();
+    }
+}
+f();
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -3594,17 +3594,17 @@ CodeGenerator::visitCallDirectEval(LCall
 {
     Register scopeChain = ToRegister(lir->getScopeChain());
     Register string = ToRegister(lir->getString());
 
     pushArg(ImmPtr(lir->mir()->pc()));
     pushArg(string);
     pushArg(ToValue(lir, LCallDirectEval::NewTarget));
     pushArg(ToValue(lir, LCallDirectEval::ThisValue));
-    pushArg(ImmGCPtr(gen->info().script()));
+    pushArg(ImmGCPtr(current->mir()->info().script()));
     pushArg(scopeChain);
 
     callVM(DirectEvalStringInfo, lir);
 }
 
 void
 CodeGenerator::generateArgumentsChecks(bool bailout)
 {