summaryrefslogtreecommitdiff
path: root/deps/v8/src/runtime/runtime-numbers.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/runtime/runtime-numbers.cc')
-rw-r--r--deps/v8/src/runtime/runtime-numbers.cc19
1 files changed, 18 insertions, 1 deletions
diff --git a/deps/v8/src/runtime/runtime-numbers.cc b/deps/v8/src/runtime/runtime-numbers.cc
index f976df951c..46fbff3463 100644
--- a/deps/v8/src/runtime/runtime-numbers.cc
+++ b/deps/v8/src/runtime/runtime-numbers.cc
@@ -114,11 +114,13 @@ RUNTIME_FUNCTION(Runtime_StringToNumber) {
}
+// ES6 18.2.5 parseInt(string, radix) slow path
RUNTIME_FUNCTION(Runtime_StringParseInt) {
HandleScope handle_scope(isolate);
DCHECK(args.length() == 2);
CONVERT_ARG_HANDLE_CHECKED(String, subject, 0);
CONVERT_NUMBER_CHECKED(int, radix, Int32, args[1]);
+ // Step 8.a. is already handled in the JS function.
RUNTIME_ASSERT(radix == 0 || (2 <= radix && radix <= 36));
subject = String::Flatten(subject);
@@ -128,7 +130,6 @@ RUNTIME_FUNCTION(Runtime_StringParseInt) {
DisallowHeapAllocation no_gc;
String::FlatContent flat = subject->GetFlatContent();
- // ECMA-262 section 15.1.2.3, empty string is NaN
if (flat.IsOneByte()) {
value =
StringToInt(isolate->unicode_cache(), flat.ToOneByteVector(), radix);
@@ -141,6 +142,7 @@ RUNTIME_FUNCTION(Runtime_StringParseInt) {
}
+// ES6 18.2.4 parseFloat(string)
RUNTIME_FUNCTION(Runtime_StringParseFloat) {
HandleScope shs(isolate);
DCHECK(args.length() == 1);
@@ -316,5 +318,20 @@ RUNTIME_FUNCTION(Runtime_GetRootNaN) {
return isolate->heap()->nan_value();
}
+
+RUNTIME_FUNCTION(Runtime_GetHoleNaNUpper) {
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 0);
+ return *isolate->factory()->NewNumberFromUint(kHoleNanUpper32);
+}
+
+
+RUNTIME_FUNCTION(Runtime_GetHoleNaNLower) {
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 0);
+ return *isolate->factory()->NewNumberFromUint(kHoleNanLower32);
+}
+
+
} // namespace internal
} // namespace v8