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

Side by Side Diff: test/common/wasm/wasm-module-runner.cc

Issue 2345593003: [wasm] Master CL for Binary 0xC changes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test failures and TSAN races. 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 | « test/cctest/wasm/wasm-run-utils.h ('k') | test/fuzzer/wasm-code.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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 "test/common/wasm/wasm-module-runner.h" 5 #include "test/common/wasm/wasm-module-runner.h"
6 6
7 #include "src/handles.h" 7 #include "src/handles.h"
8 #include "src/isolate.h" 8 #include "src/isolate.h"
9 #include "src/objects.h" 9 #include "src/objects.h"
10 #include "src/property-descriptor.h" 10 #include "src/property-descriptor.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 if (thrower->error()) return Handle<JSObject>::null(); 61 if (thrower->error()) return Handle<JSObject>::null();
62 62
63 // Although we decoded the module for some pre-validation, run the bytes 63 // Although we decoded the module for some pre-validation, run the bytes
64 // again through the normal pipeline. 64 // again through the normal pipeline.
65 MaybeHandle<JSObject> module_object = CreateModuleObjectFromBytes( 65 MaybeHandle<JSObject> module_object = CreateModuleObjectFromBytes(
66 isolate, module->module_start, module->module_end, thrower, 66 isolate, module->module_start, module->module_end, thrower,
67 ModuleOrigin::kWasmOrigin); 67 ModuleOrigin::kWasmOrigin);
68 if (module_object.is_null()) return Handle<JSObject>::null(); 68 if (module_object.is_null()) return Handle<JSObject>::null();
69 MaybeHandle<JSObject> maybe_instance = WasmModule::Instantiate( 69 MaybeHandle<JSObject> maybe_instance = WasmModule::Instantiate(
70 isolate, module_object.ToHandleChecked(), Handle<JSReceiver>::null(), 70 isolate, thrower, module_object.ToHandleChecked(),
71 Handle<JSArrayBuffer>::null()); 71 Handle<JSReceiver>::null(), Handle<JSArrayBuffer>::null());
72 Handle<JSObject> instance; 72 Handle<JSObject> instance;
73 if (!maybe_instance.ToHandle(&instance)) { 73 if (!maybe_instance.ToHandle(&instance)) {
74 return Handle<JSObject>::null(); 74 return Handle<JSObject>::null();
75 } 75 }
76 return instance; 76 return instance;
77 } 77 }
78 78
79 int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start, 79 int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start,
80 const byte* module_end, ModuleOrigin origin) { 80 const byte* module_end, ModuleOrigin origin) {
81 HandleScope scope(isolate); 81 HandleScope scope(isolate);
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 void SetupIsolateForWasmModule(Isolate* isolate) { 207 void SetupIsolateForWasmModule(Isolate* isolate) {
208 WasmJs::InstallWasmMapsIfNeeded(isolate, isolate->native_context()); 208 WasmJs::InstallWasmMapsIfNeeded(isolate, isolate->native_context());
209 WasmJs::InstallWasmModuleSymbolIfNeeded(isolate, isolate->global_object(), 209 WasmJs::InstallWasmModuleSymbolIfNeeded(isolate, isolate->global_object(),
210 isolate->native_context()); 210 isolate->native_context());
211 } 211 }
212 212
213 } // namespace testing 213 } // namespace testing
214 } // namespace wasm 214 } // namespace wasm
215 } // namespace internal 215 } // namespace internal
216 } // namespace v8 216 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/wasm/wasm-run-utils.h ('k') | test/fuzzer/wasm-code.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698