Commit a7f59888 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm][test] Rename {Link} to {SetExecutable}

There is no linking stage any more, and all the {Link} method did was
to set the module to executable. Thus rename the method to reflect that.

R=ahaas@chromium.org

Bug: v8:8562
Change-Id: Ifc83b5cbbb1377312d7c318e50a0f9d1ede45aa6
Reviewed-on: https://chromium-review.googlesource.com/c/1439237Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59167}
parent eee2b431
......@@ -48,7 +48,7 @@ class ArgPassingHelper {
runner.Build(outer_code.data(), outer_code.data() + outer_code.size());
int funcs_to_redict[] = {static_cast<int>(inner_compiler.function_index())};
runner.builder().Link();
runner.builder().SetExecutable();
WasmDebugInfo::RedirectToInterpreter(debug_info_,
ArrayVector(funcs_to_redict));
main_fun_wrapper_ = runner.builder().WrapCode(runner.function_index());
......
......@@ -119,8 +119,7 @@ uint32_t TestingModuleBuilder::AddFunction(FunctionSig* sig, const char* name,
}
Handle<JSFunction> TestingModuleBuilder::WrapCode(uint32_t index) {
// Wrap the code so it can be called as a JS function.
Link();
SetExecutable();
FunctionSig* sig = test_module_->functions[index].sig;
MaybeHandle<Code> maybe_ret_code =
compiler::CompileJSToWasmWrapper(isolate_, sig, false);
......
......@@ -176,6 +176,7 @@ class TestingModuleBuilder {
enum FunctionType { kImport, kWasm };
uint32_t AddFunction(FunctionSig* sig, const char* name, FunctionType type);
// Wrap the code so it can be called as a JS function.
Handle<JSFunction> WrapCode(uint32_t index);
void AddIndirectFunctionTable(const uint16_t* function_indexes,
......@@ -204,11 +205,8 @@ class TestingModuleBuilder {
Address globals_start() const {
return reinterpret_cast<Address>(globals_data_);
}
void Link() {
if (linked_) return;
linked_ = true;
native_module_->SetExecutable(true);
}
void SetExecutable() { native_module_->SetExecutable(true); }
CompilationEnv CreateCompilationEnv();
......@@ -231,7 +229,6 @@ class TestingModuleBuilder {
ExecutionTier execution_tier_;
Handle<WasmInstanceObject> instance_object_;
NativeModule* native_module_ = nullptr;
bool linked_ = false;
RuntimeExceptionSupport runtime_exception_support_;
LowerSimd lower_simd_;
......@@ -453,7 +450,7 @@ class WasmRunner : public WasmRunnerBase {
wrapper_.SetInnerCode(builder_.GetFunctionCode(0));
wrapper_.SetInstance(builder_.instance_object());
builder_.Link();
builder_.SetExecutable();
Handle<Code> wrapper_code = wrapper_.GetWrapperCode();
compiler::CodeRunner<int32_t> runner(CcTest::InitIsolateOnce(),
wrapper_code, wrapper_.signature());
......
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