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

Side by Side Diff: src/js/runtime.js

Issue 1680783002: [intrinsics] Kill the %_IsMinusZero intrinsic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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/full-codegen/x87/full-codegen-x87.cc ('k') | src/js/typedarray.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 // This files contains runtime support implemented in JavaScript. 5 // This files contains runtime support implemented in JavaScript.
6 6
7 // CAUTION: Some of the functions specified in this file are called 7 // CAUTION: Some of the functions specified in this file are called
8 // directly from compiled code. These are the functions with names in 8 // directly from compiled code. These are the functions with names in
9 // ALL CAPS. The compiled code passes the first argument in 'this'. 9 // ALL CAPS. The compiled code passes the first argument in 'this'.
10 10
(...skipping 25 matching lines...) Expand all
36 36
37 // ---------------------------------------------------------------------------- 37 // ----------------------------------------------------------------------------
38 38
39 /* ------------------------------------- 39 /* -------------------------------------
40 - - - C o n v e r s i o n s - - - 40 - - - C o n v e r s i o n s - - -
41 ------------------------------------- 41 -------------------------------------
42 */ 42 */
43 43
44 // ES5, section 9.12 44 // ES5, section 9.12
45 function SameValue(x, y) { 45 function SameValue(x, y) {
46 if (typeof x != typeof y) return false; 46 if (typeof x !== typeof y) return false;
47 if (IS_NUMBER(x)) { 47 if (IS_NUMBER(x)) {
48 if (NUMBER_IS_NAN(x) && NUMBER_IS_NAN(y)) return true; 48 if (NUMBER_IS_NAN(x) && NUMBER_IS_NAN(y)) return true;
49 // x is +0 and y is -0 or vice versa. 49 // x is +0 and y is -0 or vice versa.
50 if (x === 0 && y === 0 && %_IsMinusZero(x) != %_IsMinusZero(y)) { 50 if (x === 0 && y === 0 && 1/x !== 1/y) {
51 return false; 51 return false;
52 } 52 }
53 } 53 }
54 if (IS_SIMD_VALUE(x)) return %SimdSameValue(x, y); 54 if (IS_SIMD_VALUE(x)) return %SimdSameValue(x, y);
55 return x === y; 55 return x === y;
56 } 56 }
57 57
58 58
59 // ES6, section 7.2.4 59 // ES6, section 7.2.4
60 function SameValueZero(x, y) { 60 function SameValueZero(x, y) {
61 if (typeof x != typeof y) return false; 61 if (typeof x !== typeof y) return false;
62 if (IS_NUMBER(x)) { 62 if (IS_NUMBER(x)) {
63 if (NUMBER_IS_NAN(x) && NUMBER_IS_NAN(y)) return true; 63 if (NUMBER_IS_NAN(x) && NUMBER_IS_NAN(y)) return true;
64 } 64 }
65 if (IS_SIMD_VALUE(x)) return %SimdSameValueZero(x, y); 65 if (IS_SIMD_VALUE(x)) return %SimdSameValueZero(x, y);
66 return x === y; 66 return x === y;
67 } 67 }
68 68
69 69
70 function ConcatIterableToArray(target, iterable) { 70 function ConcatIterableToArray(target, iterable) {
71 var index = target.length; 71 var index = target.length;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 to.SameValueZero = SameValueZero; 168 to.SameValueZero = SameValueZero;
169 to.ToPositiveInteger = ToPositiveInteger; 169 to.ToPositiveInteger = ToPositiveInteger;
170 to.SpeciesConstructor = SpeciesConstructor; 170 to.SpeciesConstructor = SpeciesConstructor;
171 }); 171 });
172 172
173 %InstallToContext([ 173 %InstallToContext([
174 "concat_iterable_to_array", ConcatIterableToArray, 174 "concat_iterable_to_array", ConcatIterableToArray,
175 ]); 175 ]);
176 176
177 }) 177 })
OLDNEW
« no previous file with comments | « src/full-codegen/x87/full-codegen-x87.cc ('k') | src/js/typedarray.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698