| 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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 | 541 |
| 542 | 542 |
| 543 RUNTIME_FUNCTION(Runtime_IsSmi) { | 543 RUNTIME_FUNCTION(Runtime_IsSmi) { |
| 544 SealHandleScope shs(isolate); | 544 SealHandleScope shs(isolate); |
| 545 DCHECK(args.length() == 1); | 545 DCHECK(args.length() == 1); |
| 546 CONVERT_ARG_CHECKED(Object, obj, 0); | 546 CONVERT_ARG_CHECKED(Object, obj, 0); |
| 547 return isolate->heap()->ToBoolean(obj->IsSmi()); | 547 return isolate->heap()->ToBoolean(obj->IsSmi()); |
| 548 } | 548 } |
| 549 | 549 |
| 550 | 550 |
| 551 RUNTIME_FUNCTION(Runtime_IsNonNegativeSmi) { |
| 552 SealHandleScope shs(isolate); |
| 553 DCHECK(args.length() == 1); |
| 554 CONVERT_ARG_CHECKED(Object, obj, 0); |
| 555 return isolate->heap()->ToBoolean(obj->IsSmi() && |
| 556 Smi::cast(obj)->value() >= 0); |
| 557 } |
| 558 |
| 559 |
| 551 RUNTIME_FUNCTION(Runtime_GetRootNaN) { | 560 RUNTIME_FUNCTION(Runtime_GetRootNaN) { |
| 552 SealHandleScope shs(isolate); | 561 SealHandleScope shs(isolate); |
| 553 DCHECK(args.length() == 0); | 562 DCHECK(args.length() == 0); |
| 554 return isolate->heap()->nan_value(); | 563 return isolate->heap()->nan_value(); |
| 555 } | 564 } |
| 556 } // namespace internal | 565 } // namespace internal |
| 557 } // namespace v8 | 566 } // namespace v8 |
| OLD | NEW |