Reviewers: Kasper Lund, Description: Fast check undefined in EQUALS.
Please review this at http://codereview.chromium.org/7979 SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ Affected files: M src/runtime.js 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); } } --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
