| 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 <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
| 10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 } | 595 } |
| 596 | 596 |
| 597 | 597 |
| 598 RUNTIME_FUNCTION(Runtime_InNewSpace) { | 598 RUNTIME_FUNCTION(Runtime_InNewSpace) { |
| 599 SealHandleScope shs(isolate); | 599 SealHandleScope shs(isolate); |
| 600 DCHECK(args.length() == 1); | 600 DCHECK(args.length() == 1); |
| 601 CONVERT_ARG_CHECKED(Object, obj, 0); | 601 CONVERT_ARG_CHECKED(Object, obj, 0); |
| 602 return isolate->heap()->ToBoolean(isolate->heap()->InNewSpace(obj)); | 602 return isolate->heap()->ToBoolean(isolate->heap()->InNewSpace(obj)); |
| 603 } | 603 } |
| 604 | 604 |
| 605 RUNTIME_FUNCTION(Runtime_IsAsmWasmCode) { |
| 606 SealHandleScope shs(isolate); |
| 607 DCHECK(args.length() == 1); |
| 608 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
| 609 |
| 610 if (!function->shared()->HasAsmWasmData()) { |
| 611 // Doesn't have wasm data. |
| 612 return isolate->heap()->ToBoolean(false); |
| 613 } |
| 614 if (function->code() != |
| 615 isolate->builtins()->builtin(Builtins::kInstantiateAsmJs)) { |
| 616 // Hasn't been compiled yet. |
| 617 return isolate->heap()->ToBoolean(false); |
| 618 } |
| 619 return isolate->heap()->ToBoolean(true); |
| 620 } |
| 605 | 621 |
| 606 #define ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(Name) \ | 622 #define ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(Name) \ |
| 607 RUNTIME_FUNCTION(Runtime_Has##Name) { \ | 623 RUNTIME_FUNCTION(Runtime_Has##Name) { \ |
| 608 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ | 624 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ |
| 609 return isolate->heap()->ToBoolean(obj->Has##Name()); \ | 625 return isolate->heap()->ToBoolean(obj->Has##Name()); \ |
| 610 } | 626 } |
| 611 | 627 |
| 612 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastSmiElements) | 628 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastSmiElements) |
| 613 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastObjectElements) | 629 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastObjectElements) |
| 614 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastSmiOrObjectElements) | 630 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastSmiOrObjectElements) |
| (...skipping 21 matching lines...) Expand all Loading... |
| 636 | 652 |
| 637 RUNTIME_FUNCTION(Runtime_SpeciesProtector) { | 653 RUNTIME_FUNCTION(Runtime_SpeciesProtector) { |
| 638 SealHandleScope shs(isolate); | 654 SealHandleScope shs(isolate); |
| 639 DCHECK_EQ(0, args.length()); | 655 DCHECK_EQ(0, args.length()); |
| 640 return isolate->heap()->ToBoolean(isolate->IsArraySpeciesLookupChainIntact()); | 656 return isolate->heap()->ToBoolean(isolate->IsArraySpeciesLookupChainIntact()); |
| 641 } | 657 } |
| 642 | 658 |
| 643 | 659 |
| 644 } // namespace internal | 660 } // namespace internal |
| 645 } // namespace v8 | 661 } // namespace v8 |
| OLD | NEW |