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

Side by Side Diff: test/mjsunit/regress/regress-606021.js

Issue 2010503002: Version 5.2.361.7 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@5.2
Patch Set: Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « src/crankshaft/hydrogen.cc ('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
(Empty)
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Flags: --allow-natives-syntax
6
7 function foo() {
8 return function(c) {
9 var double_var = [3.0, 3.5][0];
10 var literal = c ? [1, double_var] : [double_var, 3.5];
11 return literal[0];
12 };
13 }
14
15 var f1 = foo();
16 var f2 = foo();
17
18 // Both closures point to full code.
19 f1(false);
20 f2(false);
21
22 // Optimize f1, but don't initialize the [1, double_var] literal.
23 %OptimizeFunctionOnNextCall(f1);
24 f1(false);
25
26 // Initialize the [1, double_var] literal, and transition the boilerplate to
27 // double.
28 f2(true);
29
30 // Trick crankshaft into writing double_var at the wrong position.
31 var l = f1(true);
32 assertEquals(1, l);
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698