Index: test/mjsunit/deopt-with-outer-context.js |
diff --git a/test/mjsunit/deopt-with-outer-context.js b/test/mjsunit/deopt-with-outer-context.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..42a829d853899d5156e7c70f25928a328f2de906 |
--- /dev/null |
+++ b/test/mjsunit/deopt-with-outer-context.js |
@@ -0,0 +1,22 @@ |
+// Copyright 2015 the V8 project authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// Flags: --allow-natives-syntax |
+ |
+function outer(y) { |
+ function inner() { |
+ var x = 10; |
+ (function() { |
+ // Access x from inner function to force it to be context allocated. |
+ x = 20; |
+ %DeoptimizeFunction(inner); |
+ })(); |
+ // Variable y should be read from the outer context. |
+ return y; |
+ }; |
+ %OptimizeFunctionOnNextCall(inner); |
+ return inner(); |
+} |
+ |
+assertEquals(30, outer(30)); |