From: feng@chromium.org Date: Tue, 28 Oct 2008 03:39:17 +0000 (+0000) Subject: Fast check undefined in EQUALS. X-Git-Tag: upstream/4.7.83~25102 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1706231d789e45dbbe1c492974bd14888ef1c123;p=platform%2Fupstream%2Fv8.git Fast check undefined in EQUALS. Review URL: http://codereview.chromium.org/7979 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@614 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/runtime.js b/src/runtime.js index 1355356a0..5e73d4100 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -78,12 +78,15 @@ function EQUALS(y) { // NOTE: This checks for both null and undefined. return (y == null) ? 0 : 1; } else { + // x is not a number, boolean, null or undefined. + if (y == null) 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); } }