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/compiler-dispatcher/optimizing-compile-dispatcher.h" | 10 #include "src/compiler-dispatcher/optimizing-compile-dispatcher.h" |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 return isolate->heap()->false_value(); | 692 return isolate->heap()->false_value(); |
693 } | 693 } |
694 if (function->shared()->code() != | 694 if (function->shared()->code() != |
695 isolate->builtins()->builtin(Builtins::kInstantiateAsmJs)) { | 695 isolate->builtins()->builtin(Builtins::kInstantiateAsmJs)) { |
696 // Hasn't been compiled yet. | 696 // Hasn't been compiled yet. |
697 return isolate->heap()->false_value(); | 697 return isolate->heap()->false_value(); |
698 } | 698 } |
699 return isolate->heap()->true_value(); | 699 return isolate->heap()->true_value(); |
700 } | 700 } |
701 | 701 |
| 702 namespace { |
| 703 bool DisallowCodegenFromStringsCallback(v8::Local<v8::Context> context) { |
| 704 return false; |
| 705 } |
| 706 } |
| 707 |
| 708 RUNTIME_FUNCTION(Runtime_DisallowCodegenFromStrings) { |
| 709 SealHandleScope shs(isolate); |
| 710 DCHECK_EQ(0, args.length()); |
| 711 v8::Isolate* v8_isolate = reinterpret_cast<v8::Isolate*>(isolate); |
| 712 v8_isolate->SetAllowCodeGenerationFromStringsCallback( |
| 713 DisallowCodegenFromStringsCallback); |
| 714 return isolate->heap()->undefined_value(); |
| 715 } |
| 716 |
702 RUNTIME_FUNCTION(Runtime_IsWasmCode) { | 717 RUNTIME_FUNCTION(Runtime_IsWasmCode) { |
703 SealHandleScope shs(isolate); | 718 SealHandleScope shs(isolate); |
704 DCHECK_EQ(1, args.length()); | 719 DCHECK_EQ(1, args.length()); |
705 CONVERT_ARG_CHECKED(JSFunction, function, 0); | 720 CONVERT_ARG_CHECKED(JSFunction, function, 0); |
706 bool is_js_to_wasm = function->code()->kind() == Code::JS_TO_WASM_FUNCTION; | 721 bool is_js_to_wasm = function->code()->kind() == Code::JS_TO_WASM_FUNCTION; |
707 return isolate->heap()->ToBoolean(is_js_to_wasm); | 722 return isolate->heap()->ToBoolean(is_js_to_wasm); |
708 } | 723 } |
709 | 724 |
710 #define ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(Name) \ | 725 #define ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(Name) \ |
711 RUNTIME_FUNCTION(Runtime_Has##Name) { \ | 726 RUNTIME_FUNCTION(Runtime_Has##Name) { \ |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 CHECK(HeapObject::cast(*object)->map()->IsMap()); | 855 CHECK(HeapObject::cast(*object)->map()->IsMap()); |
841 } else { | 856 } else { |
842 CHECK(object->IsSmi()); | 857 CHECK(object->IsSmi()); |
843 } | 858 } |
844 #endif | 859 #endif |
845 return isolate->heap()->ToBoolean(true); | 860 return isolate->heap()->ToBoolean(true); |
846 } | 861 } |
847 | 862 |
848 } // namespace internal | 863 } // namespace internal |
849 } // namespace v8 | 864 } // namespace v8 |
OLD | NEW |