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

Unified Diff: src/runtime.js

Issue 7979: Fast check undefined in EQUALS. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.js
===================================================================
--- src/runtime.js (revision 592)
+++ src/runtime.js (working copy)
@@ -78,12 +78,16 @@
// NOTE: This checks for both null and undefined.
return (y == null) ? 0 : 1;
} else {
+ // x is not a number, boolean, null or undefined.
+ if (IS_UNDEFINED(y)) return 1; // not equal
+
if (IS_OBJECT(y)) {
return %_ObjectEquals(x, y) ? 0 : 1;
}
if (IS_FUNCTION(y)) {
return %_ObjectEquals(x, y) ? 0 : 1;
}
+
x = %ToPrimitive(x, NO_HINT);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698