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

Side by Side Diff: test/mjsunit/compiler/deopt-tonumber-binop.js

Issue 985713003: [turbofan] Fix lazy deopt for JSToNumber conversions in binary operations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@multiple-framestates
Patch Set: Fixes, rebase Created 5 years, 9 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 // Flags: --allow-natives-syntax
6 //
7 var f = (function() {
8 "use asm";
9 function f(x, y) {
10 return x - y;
11 }
12 return f;
13 })();
14
15 var counter = 0;
16
17 var deopt = { toString : function() {
18 %DeoptimizeFunction(f);
19 counter++;
20 return "2";
21 } };
22
23 var o = { toString : function() {
24 counter++;
25 return "1";
26 } };
27
28 counter = 0;
29 assertEquals(1, f(deopt, o));
30 assertEquals(2, counter);
31
32 %OptimizeFunctionOnNextCall(f);
33 counter = 0;
34 assertEquals(-1, f(o, deopt));
35 assertEquals(2, counter);
36
37 %OptimizeFunctionOnNextCall(f);
38 counter = 0;
39 assertEquals(0, f(deopt, deopt));
40 assertEquals(2, counter);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698