Reviewers: dusmil.imgtec,
Description:
Reintroduce %GetRootNaN to fix MIPS.
[email protected]
Please review this at https://codereview.chromium.org/1101503003/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+11, -2 lines):
M src/macros.py
M src/runtime.js
M src/runtime/runtime.h
M src/runtime/runtime-numbers.cc
Index: src/macros.py
diff --git a/src/macros.py b/src/macros.py
index
6038a71ae58340103e1aa8b0677c7295ae114897..2dab3b2bae1ac88ec3866eaac5de04867798c7ee
100644
--- a/src/macros.py
+++ b/src/macros.py
@@ -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);
Index: src/runtime.js
diff --git a/src/runtime.js b/src/runtime.js
index
0e6c68eb369d9c27ced4ef030c844da6449b65b9..aaaa4fecba110c4e5e3edc0a88ea9f6a3e946e89
100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -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) {
Index: src/runtime/runtime-numbers.cc
diff --git a/src/runtime/runtime-numbers.cc b/src/runtime/runtime-numbers.cc
index
78dd3cbef6754f8c1996d406d6367d8a18b4fa03..2bc3af1254d13911afcaa7f906bc9413fd89b79b
100644
--- a/src/runtime/runtime-numbers.cc
+++ b/src/runtime/runtime-numbers.cc
@@ -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
Index: src/runtime/runtime.h
diff --git a/src/runtime/runtime.h b/src/runtime/runtime.h
index
2d475bbec2b078eecc867fb94e5f643585754508..602a679e8b18a5fb8f0baa3cb3b2212de9c7f2e0
100644
--- a/src/runtime/runtime.h
+++ b/src/runtime/runtime.h
@@ -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) \
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.