Reviewers: arv,

Message:
This takes care of one of your comments on the original patch. Going to make
sure it doesn't regress perf.

Description:
Use NumberIsNaN in collections.js and make it inlined

Please review this at https://codereview.chromium.org/1067933002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+6, -4 lines):
  M src/collection.js
  M src/v8natives.js


Index: src/collection.js
diff --git a/src/collection.js b/src/collection.js
index 928670c3ae39c6c99e3baaee220ff3f8b2dfdf7d..7bb2393a7da32fb4a10251792b276589185e0100 100644
--- a/src/collection.js
+++ b/src/collection.js
@@ -25,7 +25,7 @@ function HashToEntry(table, hash, numBuckets) {


 function SetFindEntry(table, numBuckets, key, hash) {
-  var keyIsNaN = IS_NUMBER(key) && NUMBER_IS_NAN(key);
+  var keyIsNaN = NumberIsNaN(key);
   for (var entry = HashToEntry(table, hash, numBuckets);
        entry !== NOT_FOUND;
        entry = ORDERED_HASH_SET_CHAIN_AT(table, entry, numBuckets)) {
@@ -33,7 +33,7 @@ function SetFindEntry(table, numBuckets, key, hash) {
     if (key === candidate) {
       return entry;
     }
-    if (keyIsNaN && IS_NUMBER(candidate) && NUMBER_IS_NAN(candidate)) {
+    if (keyIsNaN && NumberIsNaN(candidate)) {
       return entry;
     }
   }
@@ -43,7 +43,7 @@ function SetFindEntry(table, numBuckets, key, hash) {


 function MapFindEntry(table, numBuckets, key, hash) {
-  var keyIsNaN = IS_NUMBER(key) && NUMBER_IS_NAN(key);
+  var keyIsNaN = NumberIsNaN(key);
   for (var entry = HashToEntry(table, hash, numBuckets);
        entry !== NOT_FOUND;
        entry = ORDERED_HASH_MAP_CHAIN_AT(table, entry, numBuckets)) {
@@ -51,7 +51,7 @@ function MapFindEntry(table, numBuckets, key, hash) {
     if (key === candidate) {
       return entry;
     }
-    if (keyIsNaN && IS_NUMBER(candidate) && NUMBER_IS_NAN(candidate)) {
+    if (keyIsNaN && NumberIsNaN(candidate)) {
       return entry;
     }
   }
Index: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index 42ee7709d6cdf6fb8bc48763bb936041da1f0457..df6305e74de1ef9f930f5c32f65a899dfbdb2baa 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -1715,6 +1715,8 @@ function SetUpNumber() {
     "parseInt", GlobalParseInt,
     "parseFloat", GlobalParseFloat
   ));
+
+  %SetInlineBuiltinFlag(NumberIsNaN);
 }

 SetUpNumber();


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to