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

Side by Side Diff: test/mjsunit/regress/regress-crbug-485410.js

Issue 1420913003: [turbofan] Try hard(er) to use smi representation for float64 values. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove unittest for now. Will need new ones, once we know what we want. 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
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 5 // Flags: --allow-natives-syntax
6 6
7 var doubles = new Float64Array(1); 7 var doubles = new Float64Array(1);
8 function ToHeapNumber(i) { 8 function ToHeapNumber(i) {
9 doubles[0] = i; 9 doubles[0] = i;
10 return doubles[0]; 10 return doubles[0];
11 } 11 }
12 for (var i = 0; i < 3; i++) ToHeapNumber(i); 12 for (var i = 0; i < 3; i++) ToHeapNumber(i);
13 %OptimizeFunctionOnNextCall(ToHeapNumber); 13 %OptimizeFunctionOnNextCall(ToHeapNumber);
14 assertFalse(%IsSmi(ToHeapNumber(1))); 14 ToHeapNumber(1);
15 15
16 function Fail(a, i, v) { 16 function Fail(a, i, v) {
17 a[i] = v; 17 a[i] = v;
18 } 18 }
19 19
20 for (var i = 0; i < 3; i++) Fail(new Array(1), 1, i); 20 for (var i = 0; i < 3; i++) Fail(new Array(1), 1, i);
21 %OptimizeFunctionOnNextCall(Fail); 21 %OptimizeFunctionOnNextCall(Fail);
22 // 1050 > JSObject::kMaxGap, causing stub failure and runtime call. 22 // 1050 > JSObject::kMaxGap, causing stub failure and runtime call.
23 Fail(new Array(1), ToHeapNumber(1050), 3); 23 Fail(new Array(1), ToHeapNumber(1050), 3);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698