| 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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 | 470 |
| 471 | 471 |
| 472 RUNTIME_FUNCTION(Runtime_IsSmi) { | 472 RUNTIME_FUNCTION(Runtime_IsSmi) { |
| 473 SealHandleScope shs(isolate); | 473 SealHandleScope shs(isolate); |
| 474 DCHECK(args.length() == 1); | 474 DCHECK(args.length() == 1); |
| 475 CONVERT_ARG_CHECKED(Object, obj, 0); | 475 CONVERT_ARG_CHECKED(Object, obj, 0); |
| 476 return isolate->heap()->ToBoolean(obj->IsSmi()); | 476 return isolate->heap()->ToBoolean(obj->IsSmi()); |
| 477 } | 477 } |
| 478 | 478 |
| 479 | 479 |
| 480 RUNTIME_FUNCTION(Runtime_IsNonNegativeSmi) { | |
| 481 SealHandleScope shs(isolate); | |
| 482 DCHECK(args.length() == 1); | |
| 483 CONVERT_ARG_CHECKED(Object, obj, 0); | |
| 484 return isolate->heap()->ToBoolean(obj->IsSmi() && | |
| 485 Smi::cast(obj)->value() >= 0); | |
| 486 } | |
| 487 | |
| 488 | |
| 489 RUNTIME_FUNCTION(Runtime_GetRootNaN) { | 480 RUNTIME_FUNCTION(Runtime_GetRootNaN) { |
| 490 SealHandleScope shs(isolate); | 481 SealHandleScope shs(isolate); |
| 491 DCHECK(args.length() == 0); | 482 DCHECK(args.length() == 0); |
| 492 return isolate->heap()->nan_value(); | 483 return isolate->heap()->nan_value(); |
| 493 } | 484 } |
| 494 } // namespace internal | 485 } // namespace internal |
| 495 } // namespace v8 | 486 } // namespace v8 |
| OLD | NEW |