OLD | NEW |
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 Loading... |
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, thrower, module_object.ToHandleChecked(), | 70 isolate, module_object.ToHandleChecked(), Handle<JSReceiver>::null(), |
71 Handle<JSReceiver>::null(), Handle<JSArrayBuffer>::null()); | 71 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 Loading... |
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 |
OLD | NEW |