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

Unified Diff: src/runtime.js

Issue 7014: Make strict equality checks faster on IA32 by doing... (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 | « src/codegen-ia32.cc ('k') | 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 478)
+++ src/runtime.js (working copy)
@@ -94,24 +94,17 @@
if (IS_NUMBER(this)) {
if (!IS_NUMBER(x)) return 1; // not equal
return %NumberEquals(this, x);
- }
-
- if (IS_STRING(this)) {
+ } else if (IS_STRING(this)) {
bak 2008/10/10 06:23:44 What is up with excessive use of else parts. retur
if (!IS_STRING(x)) return 1; // not equal
return %StringEquals(this, x);
- }
-
- if (IS_BOOLEAN(this)) {
- if (!IS_BOOLEAN(x)) return 1; // not equal
- if (this) return x ? 0 : 1;
- else return x ? 1 : 0;
- }
-
- if (IS_UNDEFINED(this)) { // both undefined and undetectable
+ } else if (IS_UNDEFINED(this)) {
+ // Both undefined and undetectable.
return IS_UNDEFINED(x) ? 0 : 1;
+ } else {
+ // Objects, null, booleans and functions are all that's left.
+ // They can all be compared with a simple identity check.
+ return %_ObjectEquals(this, x) ? 0 : 1;
}
-
- return %_ObjectEquals(this, x) ? 0 : 1;
}
« no previous file with comments | « src/codegen-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698