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

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

Issue 1455953002: [turbofan] Fix deoptimization from array literal spread. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Skip ignition. 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 unified diff | Download patch
« no previous file with comments | « test/mjsunit/regress/regress-deopt-in-array-literal-spread.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --allow-natives-syntax --harmony-do-expressions 5 // Flags: --allow-natives-syntax --harmony-do-expressions
6 6
7 "use strict"; 7 "use strict";
8 8
9 var p = {}; 9 var p = {};
10 var testCases = [ 10 var testCases = [
11 { s:"[1, do { _OSR_ 2 }, 3]", r:[1, 2, 3] }, 11 { s:"[1, do { _OSR_ 2 }, 3]", r:[1, 2, 3] },
12 { s:"[1, ...[2], do { _OSR_ 3 }, 4]", r:[1, 2, 3, 4] }, 12 { s:"[1, ...[2], do { _OSR_ 3 }, 4]", r:[1, 2, 3, 4] },
13 { s:"[1, ...do { _OSR_ [2,3] }, 4]", r:[1, 2, 3, 4] }, 13 { s:"[1, ...do { _OSR_ [2,3] }, 4]", r:[1, 2, 3, 4] },
14 { s:"{ a:do { _OSR_ 1 } }", r:{ a:1 } }, 14 { s:"{ a:do { _OSR_ 1 } }", r:{ a:1 } },
15 { s:"{ a:do { _OSR_ 2 }, __proto__:p }", r:{ a:2, __proto__:p } }, 15 { s:"{ a:do { _OSR_ 2 }, __proto__:p }", r:{ a:2, __proto__:p } },
16 { s:"{ a:do { _OSR_ 3 }, get b() { return 4; } }", r:{ a:3, b:4 } }, 16 { s:"{ a:do { _OSR_ 3 }, get b() { return 4; } }", r:{ a:3, b:4 } },
17 { s:"{ [do { _OSR_ 'b' }]: 3 }", r:{ b:3 } }, 17 { s:"{ [do { _OSR_ 'b' }]: 3 }", r:{ b:3 } },
18 { s:"{ [do { _OSR_ 'b' }]: 3, c: 4 }", r:{ b:3, c:4 } }, 18 { s:"{ [do { _OSR_ 'b' }]: 3, c: 4 }", r:{ b:3, c:4 } },
19 { s:"{ [do { _OSR_ 'b' }]: 3, __proto__:p }", r:{ b:3, __proto__:p } }, 19 { s:"{ [do { _OSR_ 'b' }]: 3, __proto__:p }", r:{ b:3, __proto__:p } },
20 { s:"{ get [do { _OSR_ 'c' }]() { return 4; } }", r:{ c:4 } },
20 { s:"class { [do { _OSR_ 'f' }]() {} }" }, 21 { s:"class { [do { _OSR_ 'f' }]() {} }" },
21 { s:"class { [do { _OSR_ 'f' }]() {}; g() {} }" }, 22 { s:"class { [do { _OSR_ 'f' }]() {}; g() {} }" },
22 ]; 23 ];
23 24
24 for (var i = 0; i < testCases.length; ++i) { 25 for (var i = 0; i < testCases.length; ++i) {
25 var source = "(function f" + i + "(x) { return " + testCases[i].s + "})"; 26 var source = "(function f" + i + "(x) { return " + testCases[i].s + "})";
26 var osr = "for (var i = 0; i < 10; i++) { if (i == 5) %OptimizeOsr(); }"; 27 var osr = "for (var i = 0; i < 10; i++) { if (i == 5) %OptimizeOsr(); }";
27 var result = eval(source.replace("_OSR_", osr))(); 28 var result = eval(source.replace("_OSR_", osr))();
28 if (testCases[i].r) assertEquals(testCases[i].r, result); 29 if (testCases[i].r) assertEquals(testCases[i].r, result);
29 } 30 }
OLDNEW
« no previous file with comments | « test/mjsunit/regress/regress-deopt-in-array-literal-spread.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698