Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: src/runtime/runtime-test.cc

Issue 2405173002: [wasm] Use WasmCompiledModule type in interfaces (Closed)
Patch Set: rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/wasm/wasm-module.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 RUNTIME_FUNCTION(Runtime_DeserializeWasmModule) { 756 RUNTIME_FUNCTION(Runtime_DeserializeWasmModule) {
757 HandleScope shs(isolate); 757 HandleScope shs(isolate);
758 DCHECK(args.length() == 1); 758 DCHECK(args.length() == 1);
759 CONVERT_ARG_HANDLE_CHECKED(JSArrayBuffer, buffer, 0); 759 CONVERT_ARG_HANDLE_CHECKED(JSArrayBuffer, buffer, 0);
760 760
761 Address mem_start = static_cast<Address>(buffer->backing_store()); 761 Address mem_start = static_cast<Address>(buffer->backing_store());
762 int mem_size = static_cast<int>(buffer->byte_length()->Number()); 762 int mem_size = static_cast<int>(buffer->byte_length()->Number());
763 763
764 ScriptData sc(mem_start, mem_size); 764 ScriptData sc(mem_start, mem_size);
765 MaybeHandle<FixedArray> maybe_compiled_module = 765 MaybeHandle<FixedArray> maybe_compiled_module =
766 WasmCompiledModuleSerializer::DeserializeWasmModule(isolate, &sc); 766 WasmCompiledModuleSerializer::DeserializeWasmModule(isolate, &sc);
ahaas 2016/10/11 07:46:05 Couldn't DeserializeWasmModule already return a wa
Clemens Hammacher 2016/10/11 08:19:19 We would have to include wasm headers in code-seri
767 Handle<FixedArray> compiled_module; 767 Handle<FixedArray> compiled_module;
768 if (!maybe_compiled_module.ToHandle(&compiled_module)) { 768 if (!maybe_compiled_module.ToHandle(&compiled_module)) {
769 return isolate->heap()->undefined_value(); 769 return isolate->heap()->undefined_value();
770 } 770 }
771 return *wasm::CreateCompiledModuleObject(isolate, compiled_module, 771 return *wasm::CreateCompiledModuleObject(
772 wasm::ModuleOrigin::kWasmOrigin); 772 isolate, Handle<wasm::WasmCompiledModule>::cast(compiled_module),
773 wasm::kWasmOrigin);
773 } 774 }
774 775
775 RUNTIME_FUNCTION(Runtime_ValidateWasmInstancesChain) { 776 RUNTIME_FUNCTION(Runtime_ValidateWasmInstancesChain) {
776 HandleScope shs(isolate); 777 HandleScope shs(isolate);
777 DCHECK(args.length() == 2); 778 DCHECK(args.length() == 2);
778 CONVERT_ARG_HANDLE_CHECKED(JSObject, module_obj, 0); 779 CONVERT_ARG_HANDLE_CHECKED(JSObject, module_obj, 0);
779 CONVERT_ARG_HANDLE_CHECKED(Smi, instance_count, 1); 780 CONVERT_ARG_HANDLE_CHECKED(Smi, instance_count, 1);
780 wasm::testing::ValidateInstancesChain(isolate, module_obj, 781 wasm::testing::ValidateInstancesChain(isolate, module_obj,
781 instance_count->value()); 782 instance_count->value());
782 return isolate->heap()->ToBoolean(true); 783 return isolate->heap()->ToBoolean(true);
(...skipping 10 matching lines...) Expand all
793 RUNTIME_FUNCTION(Runtime_ValidateWasmOrphanedInstance) { 794 RUNTIME_FUNCTION(Runtime_ValidateWasmOrphanedInstance) {
794 HandleScope shs(isolate); 795 HandleScope shs(isolate);
795 DCHECK(args.length() == 1); 796 DCHECK(args.length() == 1);
796 CONVERT_ARG_HANDLE_CHECKED(JSObject, instance_obj, 0); 797 CONVERT_ARG_HANDLE_CHECKED(JSObject, instance_obj, 0);
797 wasm::testing::ValidateOrphanedInstance(isolate, instance_obj); 798 wasm::testing::ValidateOrphanedInstance(isolate, instance_obj);
798 return isolate->heap()->ToBoolean(true); 799 return isolate->heap()->ToBoolean(true);
799 } 800 }
800 801
801 } // namespace internal 802 } // namespace internal
802 } // namespace v8 803 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/wasm/wasm-module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698