Commit aea684ed authored by ager@chromium.org's avatar ager@chromium.org

Add fast check for NaN in NumberCompare slow case.

Review URL: http://codereview.chromium.org/344010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3158 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent a84ba0e1
......@@ -128,7 +128,10 @@ function COMPARE(x, ncr) {
if (IS_STRING(a) && IS_STRING(b)) {
return %StringCompare(a, b);
} else {
return %NumberCompare(%ToNumber(a), %ToNumber(b), ncr);
var a_number = %ToNumber(a);
var b_number = %ToNumber(b);
if (NUMBER_IS_NAN(a_number) || NUMBER_IS_NAN(b_number)) return ncr;
return %NumberCompare(a_number, b_number, ncr);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment