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

Unified Diff: test/mjsunit/regress/regress-osr-in-literal.js

Issue 1451423002: [turbofan] Fix several OSR entries within literals. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « src/compiler/ast-loop-assignment-analyzer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-osr-in-literal.js
diff --git a/test/mjsunit/regress/regress-osr-in-literal.js b/test/mjsunit/regress/regress-osr-in-literal.js
new file mode 100644
index 0000000000000000000000000000000000000000..9351f2daffefe3cd562ca271f9983d8dbdc20dae
--- /dev/null
+++ b/test/mjsunit/regress/regress-osr-in-literal.js
@@ -0,0 +1,23 @@
+// 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 --harmony-do-expressions
+
+var p = {};
+var testCases = [
+ { s:"[1, do { _OSR_ 2 }, 3]", r:[1, 2, 3] },
+ { s:"[1, ...[2], do { _OSR_ 3 }, 4]", r:[1, 2, 3, 4] },
rossberg 2015/11/17 13:21:13 Perhaps add a test with `do` inside the spread.
Michael Starzinger 2015/11/17 13:32:51 Done.
+ { s:"{ a:do { _OSR_ 1 } }", r:{ a:1 } },
+ { s:"{ a:do { _OSR_ 2 }, __proto__:p }", r:{ a:2, __proto__:p } },
+ { s:"{ [do { _OSR_ 'b' }]: 3 }", r:{ b:3 } },
+ { s:"{ [do { _OSR_ 'b' }]: 3, c: 4 }", r:{ b:3, c:4 } },
+ { s:"{ [do { _OSR_ 'b' }]: 3, __proto__:p }", r:{ b:3, __proto__:p } },
+];
+
+for (var i = 0; i < testCases.length; ++i) {
+ var source = "(function f" + i + "(x) { return " + testCases[i].s + "})";
+ var osr = "for (var i = 0; i < 10; i++) { if (i == 5) %OptimizeOsr(); }";
+ var fun = eval(source.replace("_OSR_", osr));
+ assertEquals(testCases[i].r, fun(23));
+}
« no previous file with comments | « src/compiler/ast-loop-assignment-analyzer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698