Commit f3e51833 authored by yangguo's avatar yangguo Committed by Commit bot

Reintroduce %GetRootNaN to fix MIPS.

R=dusan.milosavljevic@imgtec.com

Review URL: https://codereview.chromium.org/1101503003

Cr-Commit-Position: refs/heads/master@{#27967}
parent 7bcc3d10
......@@ -169,7 +169,7 @@ macro SET_PRIVATE(obj, sym, val) = (obj[sym] = val);
macro DELETE_PRIVATE(obj, sym) = (delete obj[sym]);
# Constants. The compiler constant folds them.
const NAN = (0/0);
const NAN = $NaN;
const INFINITY = (1/0);
const UNDEFINED = (void 0);
......
......@@ -22,6 +22,7 @@ var $String = global.String;
var $Number = global.Number;
var $Function = global.Function;
var $Boolean = global.Boolean;
var $NaN = %GetRootNaN();
// ECMA-262 Section 11.9.3.
function EQUALS(y) {
......
......@@ -579,5 +579,12 @@ RUNTIME_FUNCTION(Runtime_IsNonNegativeSmi) {
return isolate->heap()->ToBoolean(obj->IsSmi() &&
Smi::cast(obj)->value() >= 0);
}
RUNTIME_FUNCTION(Runtime_GetRootNaN) {
SealHandleScope shs(isolate);
DCHECK(args.length() == 0);
return isolate->heap()->nan_value();
}
}
} // namespace v8::internal
......@@ -380,7 +380,8 @@ namespace internal {
F(MaxSmi, 0, 1) \
F(NumberToString, 1, 1) \
F(IsSmi, 1, 1) \
F(IsNonNegativeSmi, 1, 1)
F(IsNonNegativeSmi, 1, 1) \
F(GetRootNaN, 0, 1)
#define FOR_EACH_INTRINSIC_OBJECT(F) \
......
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