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

Unified Diff: src/js/runtime.js

Issue 1695743003: [builtins] Support SameValue and SameValueZero via runtime functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address bug in SameValue and SameValueZero for SIMD types. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/js/prologue.js ('k') | src/js/v8natives.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/runtime.js
diff --git a/src/js/runtime.js b/src/js/runtime.js
index eeb887aff4cba2c110cfbe1eddf246e0a1f48db1..7a61094da62d4bcd07b10d4a0ebb12fa7a0d809f 100644
--- a/src/js/runtime.js
+++ b/src/js/runtime.js
@@ -36,36 +36,11 @@ utils.ImportFromExperimental(function(from) {
// ----------------------------------------------------------------------------
-/* -------------------------------------
- - - - C o n v e r s i o n s - - -
- -------------------------------------
-*/
-
-// ES5, section 9.12
-function SameValue(x, y) {
- if (typeof x !== typeof y) return false;
- if (IS_NUMBER(x)) {
- if (NUMBER_IS_NAN(x) && NUMBER_IS_NAN(y)) return true;
- // x is +0 and y is -0 or vice versa.
- if (x === 0 && y === 0 && 1/x !== 1/y) {
- return false;
- }
- }
- if (IS_SIMD_VALUE(x)) return %SimdSameValue(x, y);
- return x === y;
-}
-
-
-// ES6, section 7.2.4
-function SameValueZero(x, y) {
- if (typeof x !== typeof y) return false;
- if (IS_NUMBER(x)) {
- if (NUMBER_IS_NAN(x) && NUMBER_IS_NAN(y)) return true;
- }
- if (IS_SIMD_VALUE(x)) return %SimdSameValueZero(x, y);
- return x === y;
-}
+/* ---------------------------------
+ - - - U t i l i t i e s - - -
+ ---------------------------------
+*/
function ConcatIterableToArray(target, iterable) {
var index = target.length;
@@ -76,12 +51,6 @@ function ConcatIterableToArray(target, iterable) {
}
-/* ---------------------------------
- - - - U t i l i t i e s - - -
- ---------------------------------
-*/
-
-
// This function should be called rather than %AddElement in contexts where the
// argument might not be less than 2**32-1. ES2015 ToLength semantics mean that
// this is a concern at basically all callsites.
@@ -164,8 +133,6 @@ utils.Export(function(to) {
to.AddIndexedProperty = AddIndexedProperty;
to.MaxSimple = MaxSimple;
to.MinSimple = MinSimple;
- to.SameValue = SameValue;
- to.SameValueZero = SameValueZero;
to.ToPositiveInteger = ToPositiveInteger;
to.SpeciesConstructor = SpeciesConstructor;
});
« no previous file with comments | « src/js/prologue.js ('k') | src/js/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698