Chromium Code Reviews| Index: test/cctest/wasm/test-run-wasm-module.cc |
| diff --git a/test/cctest/wasm/test-run-wasm-module.cc b/test/cctest/wasm/test-run-wasm-module.cc |
| index 7d3ca86a4d60646209979a7e6d58df7a65f66af2..830a1c4893eed4c145906ee47a6233452fef250b 100644 |
| --- a/test/cctest/wasm/test-run-wasm-module.cc |
| +++ b/test/cctest/wasm/test-run-wasm-module.cc |
| @@ -7,7 +7,6 @@ |
| #include "src/wasm/encoder.h" |
| #include "src/wasm/module-decoder.h" |
| -#include "src/wasm/wasm-js.h" |
| #include "src/wasm/wasm-macro-gen.h" |
| #include "src/wasm/wasm-module.h" |
| #include "src/wasm/wasm-opcodes.h" |
| @@ -22,6 +21,7 @@ using namespace v8::internal::compiler; |
| using namespace v8::internal::wasm; |
| namespace { |
| +static bool isolate_setup_for_module = false; |
| void TestModule(Zone* zone, WasmModuleBuilder* builder, |
| int32_t expected_result) { |
| ZoneBuffer buffer(zone); |
| @@ -29,7 +29,10 @@ void TestModule(Zone* zone, WasmModuleBuilder* builder, |
| Isolate* isolate = CcTest::InitIsolateOnce(); |
| HandleScope scope(isolate); |
| - WasmJs::SetupIsolateForWasm(isolate); |
| + if (!isolate_setup_for_module) { |
|
Mircea Trofin
2016/09/16 07:13:01
This will only setup the first isolate.
gdeepti
2016/09/16 07:37:21
My understanding is that the isolate being returne
|
| + testing::SetupIsolateForWasmModule(isolate); |
| + isolate_setup_for_module = true; |
| + } |
| int32_t result = testing::CompileAndRunWasmModule( |
| isolate, buffer.begin(), buffer.end(), ModuleOrigin::kWasmOrigin); |
| CHECK_EQ(expected_result, result); |
| @@ -205,7 +208,6 @@ TEST(Run_WasmModule_Serialization) { |
| v8::WasmCompiledModule::SerializedModule data; |
| { |
| HandleScope scope(isolate); |
| - WasmJs::SetupIsolateForWasm(isolate); |
| ModuleResult decoding_result = DecodeWasmModule( |
| isolate, &zone, buffer.begin(), buffer.end(), false, kWasmOrigin); |
| @@ -236,7 +238,7 @@ TEST(Run_WasmModule_Serialization) { |
| v8::Local<v8::Context> new_ctx = v8::Context::New(v8_isolate); |
| new_ctx->Enter(); |
| isolate = reinterpret_cast<Isolate*>(v8_isolate); |
| - WasmJs::SetupIsolateForWasm(isolate); |
| + testing::SetupIsolateForWasmModule(isolate); |
|
Mircea Trofin
2016/09/16 07:13:00
On line 240, we reassign isolate to the v8_isolate
gdeepti
2016/09/16 07:37:21
Can you elaborate what you mean by we won't initia
|
| v8::MaybeLocal<v8::WasmCompiledModule> deserialized = |
| v8::WasmCompiledModule::Deserialize(v8_isolate, data); |