Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Unified Diff: test/mjsunit/deopt-with-outer-context.js

Issue 1604923002: [Interpreter] Always store current context in the frames context slot. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_fix_block_context_scope
Patch Set: Rebase Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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));
« no previous file with comments | « test/cctest/interpreter/test-bytecode-generator.cc ('k') | test/unittests/compiler/interpreter-assembler-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698