Commit 81dc553b authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm][test] Do not compile code for interpreter tests

When executing the interpreter, we should not try to create compiled
code. Otherwise we cannot implement and test a feature in the
interpreter in isolation.

R=ahaas@chromium.org
CC=fgm@chromium.org

Change-Id: I2074de31650a52b38b2f6e530e20b427d2d1db65
Reviewed-on: https://chromium-review.googlesource.com/c/1462876Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59493}
parent 082c27fa
...@@ -415,15 +415,9 @@ void WasmFunctionCompiler::Build(const byte* start, const byte* end) { ...@@ -415,15 +415,9 @@ void WasmFunctionCompiler::Build(const byte* start, const byte* end) {
static_cast<uint32_t>(len)}; static_cast<uint32_t>(len)};
if (interpreter_) { if (interpreter_) {
// Add the code to the interpreter. // Add the code to the interpreter; do not generate compiled code.
interpreter_->SetFunctionCodeForTesting(function_, start, end); interpreter_->SetFunctionCodeForTesting(function_, start, end);
} return;
// TODO(wasm): tests that go through JS depend on having a compiled version
// of each function, even if the execution tier is the interpreter. Fix.
auto tier = builder_->execution_tier();
if (tier == ExecutionTier::kInterpreter) {
tier = ExecutionTier::kOptimized;
} }
Vector<const uint8_t> wire_bytes = builder_->instance_object() Vector<const uint8_t> wire_bytes = builder_->instance_object()
...@@ -441,7 +435,7 @@ void WasmFunctionCompiler::Build(const byte* start, const byte* end) { ...@@ -441,7 +435,7 @@ void WasmFunctionCompiler::Build(const byte* start, const byte* end) {
NativeModule* native_module = NativeModule* native_module =
builder_->instance_object()->module_object()->native_module(); builder_->instance_object()->module_object()->native_module();
WasmCompilationUnit unit(isolate()->wasm_engine(), function_->func_index, WasmCompilationUnit unit(isolate()->wasm_engine(), function_->func_index,
tier); builder_->execution_tier());
WasmFeatures unused_detected_features; WasmFeatures unused_detected_features;
WasmCompilationResult result = unit.ExecuteCompilation( WasmCompilationResult result = unit.ExecuteCompilation(
&env, native_module->compilation_state()->GetWireBytesStorage(), &env, native_module->compilation_state()->GetWireBytesStorage(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment