| 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" |
| 11 #include "src/compiler.h" | 11 #include "src/compiler.h" |
| 12 #include "src/deoptimizer.h" | 12 #include "src/deoptimizer.h" |
| 13 #include "src/frames-inl.h" | 13 #include "src/frames-inl.h" |
| 14 #include "src/full-codegen/full-codegen.h" | 14 #include "src/full-codegen/full-codegen.h" |
| 15 #include "src/isolate-inl.h" | 15 #include "src/isolate-inl.h" |
| 16 #include "src/runtime-profiler.h" | 16 #include "src/runtime-profiler.h" |
| 17 #include "src/snapshot/code-serializer.h" | 17 #include "src/snapshot/code-serializer.h" |
| 18 #include "src/snapshot/natives.h" | 18 #include "src/snapshot/natives.h" |
| 19 #include "src/wasm/wasm-module.h" | 19 #include "src/wasm/wasm-module.h" |
| 20 #include "src/wasm/wasm-objects.h" |
| 20 | 21 |
| 21 namespace v8 { | 22 namespace v8 { |
| 22 namespace internal { | 23 namespace internal { |
| 23 | 24 |
| 24 RUNTIME_FUNCTION(Runtime_ConstructDouble) { | 25 RUNTIME_FUNCTION(Runtime_ConstructDouble) { |
| 25 HandleScope scope(isolate); | 26 HandleScope scope(isolate); |
| 26 DCHECK(args.length() == 2); | 27 DCHECK(args.length() == 2); |
| 27 CONVERT_NUMBER_CHECKED(uint32_t, hi, Uint32, args[0]); | 28 CONVERT_NUMBER_CHECKED(uint32_t, hi, Uint32, args[0]); |
| 28 CONVERT_NUMBER_CHECKED(uint32_t, lo, Uint32, args[1]); | 29 CONVERT_NUMBER_CHECKED(uint32_t, lo, Uint32, args[1]); |
| 29 uint64_t result = (static_cast<uint64_t>(hi) << 32) | lo; | 30 uint64_t result = (static_cast<uint64_t>(hi) << 32) | lo; |
| (...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 reinterpret_cast<uint8_t*>(wire_bytes->backing_store()), | 777 reinterpret_cast<uint8_t*>(wire_bytes->backing_store()), |
| 777 static_cast<int>(wire_bytes->byte_length()->Number()))); | 778 static_cast<int>(wire_bytes->byte_length()->Number()))); |
| 778 if (!already_external) { | 779 if (!already_external) { |
| 779 wire_bytes->set_is_external(false); | 780 wire_bytes->set_is_external(false); |
| 780 isolate->heap()->RegisterNewArrayBuffer(*wire_bytes); | 781 isolate->heap()->RegisterNewArrayBuffer(*wire_bytes); |
| 781 } | 782 } |
| 782 Handle<FixedArray> compiled_module; | 783 Handle<FixedArray> compiled_module; |
| 783 if (!maybe_compiled_module.ToHandle(&compiled_module)) { | 784 if (!maybe_compiled_module.ToHandle(&compiled_module)) { |
| 784 return isolate->heap()->undefined_value(); | 785 return isolate->heap()->undefined_value(); |
| 785 } | 786 } |
| 786 return *wasm::CreateWasmModuleObject( | 787 return *WasmModuleObject::New( |
| 787 isolate, Handle<wasm::WasmCompiledModule>::cast(compiled_module), | 788 isolate, Handle<WasmCompiledModule>::cast(compiled_module)); |
| 788 wasm::kWasmOrigin); | |
| 789 } | 789 } |
| 790 | 790 |
| 791 RUNTIME_FUNCTION(Runtime_ValidateWasmInstancesChain) { | 791 RUNTIME_FUNCTION(Runtime_ValidateWasmInstancesChain) { |
| 792 HandleScope shs(isolate); | 792 HandleScope shs(isolate); |
| 793 DCHECK(args.length() == 2); | 793 DCHECK(args.length() == 2); |
| 794 CONVERT_ARG_HANDLE_CHECKED(JSObject, module_obj, 0); | 794 CONVERT_ARG_HANDLE_CHECKED(JSObject, module_obj, 0); |
| 795 CONVERT_ARG_HANDLE_CHECKED(Smi, instance_count, 1); | 795 CONVERT_ARG_HANDLE_CHECKED(Smi, instance_count, 1); |
| 796 wasm::testing::ValidateInstancesChain(isolate, module_obj, | 796 wasm::testing::ValidateInstancesChain(isolate, module_obj, |
| 797 instance_count->value()); | 797 instance_count->value()); |
| 798 return isolate->heap()->ToBoolean(true); | 798 return isolate->heap()->ToBoolean(true); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 809 RUNTIME_FUNCTION(Runtime_ValidateWasmOrphanedInstance) { | 809 RUNTIME_FUNCTION(Runtime_ValidateWasmOrphanedInstance) { |
| 810 HandleScope shs(isolate); | 810 HandleScope shs(isolate); |
| 811 DCHECK(args.length() == 1); | 811 DCHECK(args.length() == 1); |
| 812 CONVERT_ARG_HANDLE_CHECKED(JSObject, instance_obj, 0); | 812 CONVERT_ARG_HANDLE_CHECKED(JSObject, instance_obj, 0); |
| 813 wasm::testing::ValidateOrphanedInstance(isolate, instance_obj); | 813 wasm::testing::ValidateOrphanedInstance(isolate, instance_obj); |
| 814 return isolate->heap()->ToBoolean(true); | 814 return isolate->heap()->ToBoolean(true); |
| 815 } | 815 } |
| 816 | 816 |
| 817 } // namespace internal | 817 } // namespace internal |
| 818 } // namespace v8 | 818 } // namespace v8 |
| OLD | NEW |