| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 <stdlib.h> | 5 #include <stdlib.h> |
| 6 #include <string.h> | 6 #include <string.h> |
| 7 | 7 |
| 8 #include "src/snapshot/code-serializer.h" | 8 #include "src/snapshot/code-serializer.h" |
| 9 #include "src/version.h" | 9 #include "src/version.h" |
| 10 #include "src/wasm/module-decoder.h" | 10 #include "src/wasm/module-decoder.h" |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 WASM_I32V(InterruptThread::signal_value_)), | 529 WASM_I32V(InterruptThread::signal_value_)), |
| 530 WASM_BR(1))), | 530 WASM_BR(1))), |
| 531 WASM_I32V(121)}; | 531 WASM_I32V(121)}; |
| 532 f->EmitCode(code, sizeof(code)); | 532 f->EmitCode(code, sizeof(code)); |
| 533 ZoneBuffer buffer(&zone); | 533 ZoneBuffer buffer(&zone); |
| 534 builder->WriteTo(buffer); | 534 builder->WriteTo(buffer); |
| 535 | 535 |
| 536 HandleScope scope(isolate); | 536 HandleScope scope(isolate); |
| 537 testing::SetupIsolateForWasmModule(isolate); | 537 testing::SetupIsolateForWasmModule(isolate); |
| 538 ErrorThrower thrower(isolate, "Test"); | 538 ErrorThrower thrower(isolate, "Test"); |
| 539 const Handle<JSObject> instance = | 539 const Handle<WasmInstanceObject> instance = |
| 540 testing::CompileInstantiateWasmModuleForTesting( | 540 testing::CompileInstantiateWasmModuleForTesting( |
| 541 isolate, &thrower, buffer.begin(), buffer.end(), | 541 isolate, &thrower, buffer.begin(), buffer.end(), |
| 542 ModuleOrigin::kWasmOrigin); | 542 ModuleOrigin::kWasmOrigin); |
| 543 CHECK(!instance.is_null()); | 543 CHECK(!instance.is_null()); |
| 544 | 544 |
| 545 MaybeHandle<JSArrayBuffer> maybe_memory = | 545 MaybeHandle<JSArrayBuffer> maybe_memory = |
| 546 GetInstanceMemory(isolate, instance); | 546 GetInstanceMemory(isolate, instance); |
| 547 Handle<JSArrayBuffer> memory = maybe_memory.ToHandleChecked(); | 547 Handle<JSArrayBuffer> memory = maybe_memory.ToHandleChecked(); |
| 548 int32_t* memory_array = reinterpret_cast<int32_t*>(memory->backing_store()); | 548 int32_t* memory_array = reinterpret_cast<int32_t*>(memory->backing_store()); |
| 549 | 549 |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 }; | 907 }; |
| 908 | 908 |
| 909 testing::CompileInstantiateWasmModuleForTesting(isolate, &thrower, data, | 909 testing::CompileInstantiateWasmModuleForTesting(isolate, &thrower, data, |
| 910 data + arraysize(data), | 910 data + arraysize(data), |
| 911 ModuleOrigin::kWasmOrigin); | 911 ModuleOrigin::kWasmOrigin); |
| 912 // It should be possible to instantiate this module. | 912 // It should be possible to instantiate this module. |
| 913 CHECK(!thrower.error()); | 913 CHECK(!thrower.error()); |
| 914 } | 914 } |
| 915 Cleanup(); | 915 Cleanup(); |
| 916 } | 916 } |
| OLD | NEW |