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

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

Issue 2591653002: [wasm] Introduce WasmSharedModuleData and refactor other objects (Closed)
Patch Set: Fix SLOW_DCHECK Created 3 years, 12 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 | « src/runtime/runtime-debug.cc ('k') | src/snapshot/code-serializer.cc » ('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 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 CHECK(Type::Is##Type(args[index])); \ 735 CHECK(Type::Is##Type(args[index])); \
736 Handle<Type> name = args.at<Type>(index); 736 Handle<Type> name = args.at<Type>(index);
737 737
738 // Take a compiled wasm module, serialize it and copy the buffer into an array 738 // Take a compiled wasm module, serialize it and copy the buffer into an array
739 // buffer, which is then returned. 739 // buffer, which is then returned.
740 RUNTIME_FUNCTION(Runtime_SerializeWasmModule) { 740 RUNTIME_FUNCTION(Runtime_SerializeWasmModule) {
741 HandleScope shs(isolate); 741 HandleScope shs(isolate);
742 DCHECK(args.length() == 1); 742 DCHECK(args.length() == 1);
743 CONVERT_ARG_HANDLE_CHECKED_2(WasmModuleObject, module_obj, 0); 743 CONVERT_ARG_HANDLE_CHECKED_2(WasmModuleObject, module_obj, 0);
744 744
745 Handle<WasmCompiledModule> orig = handle(module_obj->get_compiled_module()); 745 Handle<WasmCompiledModule> orig(module_obj->compiled_module());
746 std::unique_ptr<ScriptData> data = 746 std::unique_ptr<ScriptData> data =
747 WasmCompiledModuleSerializer::SerializeWasmModule(isolate, orig); 747 WasmCompiledModuleSerializer::SerializeWasmModule(isolate, orig);
748 void* buff = isolate->array_buffer_allocator()->Allocate(data->length()); 748 void* buff = isolate->array_buffer_allocator()->Allocate(data->length());
749 Handle<JSArrayBuffer> ret = isolate->factory()->NewJSArrayBuffer(); 749 Handle<JSArrayBuffer> ret = isolate->factory()->NewJSArrayBuffer();
750 JSArrayBuffer::Setup(ret, isolate, false, buff, data->length()); 750 JSArrayBuffer::Setup(ret, isolate, false, buff, data->length());
751 memcpy(buff, data->data(), data->length()); 751 memcpy(buff, data->data(), data->length());
752 return *ret; 752 return *ret;
753 } 753 }
754 754
755 // Take an array buffer and attempt to reconstruct a compiled wasm module. 755 // Take an array buffer and attempt to reconstruct a compiled wasm module.
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 RUNTIME_FUNCTION(Runtime_ValidateWasmOrphanedInstance) { 810 RUNTIME_FUNCTION(Runtime_ValidateWasmOrphanedInstance) {
811 HandleScope shs(isolate); 811 HandleScope shs(isolate);
812 DCHECK(args.length() == 1); 812 DCHECK(args.length() == 1);
813 CONVERT_ARG_HANDLE_CHECKED_2(WasmInstanceObject, instance, 0); 813 CONVERT_ARG_HANDLE_CHECKED_2(WasmInstanceObject, instance, 0);
814 wasm::testing::ValidateOrphanedInstance(isolate, instance); 814 wasm::testing::ValidateOrphanedInstance(isolate, instance);
815 return isolate->heap()->ToBoolean(true); 815 return isolate->heap()->ToBoolean(true);
816 } 816 }
817 817
818 } // namespace internal 818 } // namespace internal
819 } // namespace v8 819 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-debug.cc ('k') | src/snapshot/code-serializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698