| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
| 8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 CONVERT_ARG_HANDLE_CHECKED(String, subject, 0); | 224 CONVERT_ARG_HANDLE_CHECKED(String, subject, 0); |
| 225 | 225 |
| 226 double value = | 226 double value = |
| 227 StringToDouble(isolate->unicode_cache(), subject, ALLOW_TRAILING_JUNK, | 227 StringToDouble(isolate->unicode_cache(), subject, ALLOW_TRAILING_JUNK, |
| 228 std::numeric_limits<double>::quiet_NaN()); | 228 std::numeric_limits<double>::quiet_NaN()); |
| 229 | 229 |
| 230 return *isolate->factory()->NewNumber(value); | 230 return *isolate->factory()->NewNumber(value); |
| 231 } | 231 } |
| 232 | 232 |
| 233 | 233 |
| 234 RUNTIME_FUNCTION(Runtime_NumberToStringRT) { | 234 RUNTIME_FUNCTION(Runtime_NumberToString) { |
| 235 HandleScope scope(isolate); | 235 HandleScope scope(isolate); |
| 236 DCHECK(args.length() == 1); | 236 DCHECK(args.length() == 1); |
| 237 CONVERT_NUMBER_ARG_HANDLE_CHECKED(number, 0); | 237 CONVERT_NUMBER_ARG_HANDLE_CHECKED(number, 0); |
| 238 | 238 |
| 239 return *isolate->factory()->NumberToString(number); | 239 return *isolate->factory()->NumberToString(number); |
| 240 } | 240 } |
| 241 | 241 |
| 242 | 242 |
| 243 RUNTIME_FUNCTION(Runtime_NumberToStringSkipCache) { | 243 RUNTIME_FUNCTION(Runtime_NumberToStringSkipCache) { |
| 244 HandleScope scope(isolate); | 244 HandleScope scope(isolate); |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 } | 551 } |
| 552 | 552 |
| 553 | 553 |
| 554 RUNTIME_FUNCTION(Runtime_MaxSmi) { | 554 RUNTIME_FUNCTION(Runtime_MaxSmi) { |
| 555 SealHandleScope shs(isolate); | 555 SealHandleScope shs(isolate); |
| 556 DCHECK(args.length() == 0); | 556 DCHECK(args.length() == 0); |
| 557 return Smi::FromInt(Smi::kMaxValue); | 557 return Smi::FromInt(Smi::kMaxValue); |
| 558 } | 558 } |
| 559 | 559 |
| 560 | 560 |
| 561 RUNTIME_FUNCTION(Runtime_NumberToString) { | |
| 562 SealHandleScope shs(isolate); | |
| 563 return __RT_impl_Runtime_NumberToStringRT(args, isolate); | |
| 564 } | |
| 565 | |
| 566 | |
| 567 RUNTIME_FUNCTION(Runtime_IsSmi) { | 561 RUNTIME_FUNCTION(Runtime_IsSmi) { |
| 568 SealHandleScope shs(isolate); | 562 SealHandleScope shs(isolate); |
| 569 DCHECK(args.length() == 1); | 563 DCHECK(args.length() == 1); |
| 570 CONVERT_ARG_CHECKED(Object, obj, 0); | 564 CONVERT_ARG_CHECKED(Object, obj, 0); |
| 571 return isolate->heap()->ToBoolean(obj->IsSmi()); | 565 return isolate->heap()->ToBoolean(obj->IsSmi()); |
| 572 } | 566 } |
| 573 | 567 |
| 574 | 568 |
| 575 RUNTIME_FUNCTION(Runtime_IsNonNegativeSmi) { | 569 RUNTIME_FUNCTION(Runtime_IsNonNegativeSmi) { |
| 576 SealHandleScope shs(isolate); | 570 SealHandleScope shs(isolate); |
| 577 DCHECK(args.length() == 1); | 571 DCHECK(args.length() == 1); |
| 578 CONVERT_ARG_CHECKED(Object, obj, 0); | 572 CONVERT_ARG_CHECKED(Object, obj, 0); |
| 579 return isolate->heap()->ToBoolean(obj->IsSmi() && | 573 return isolate->heap()->ToBoolean(obj->IsSmi() && |
| 580 Smi::cast(obj)->value() >= 0); | 574 Smi::cast(obj)->value() >= 0); |
| 581 } | 575 } |
| 582 | 576 |
| 583 | 577 |
| 584 RUNTIME_FUNCTION(Runtime_GetRootNaN) { | 578 RUNTIME_FUNCTION(Runtime_GetRootNaN) { |
| 585 SealHandleScope shs(isolate); | 579 SealHandleScope shs(isolate); |
| 586 DCHECK(args.length() == 0); | 580 DCHECK(args.length() == 0); |
| 587 return isolate->heap()->nan_value(); | 581 return isolate->heap()->nan_value(); |
| 588 } | 582 } |
| 589 } // namespace internal | 583 } // namespace internal |
| 590 } // namespace v8 | 584 } // namespace v8 |
| OLD | NEW |