[wasm] Remove redundant parameters from PipelineWasmCompilationJob
This removes more parameters which can be queried from the NativeModule. R=titzer@chromium.org Bug: v8:8343 Change-Id: Ia5111a336e8e2272f189ff2c5523afec8b2de660 Reviewed-on: https://chromium-review.googlesource.com/c/1303723 Reviewed-by: Ben Titzer <titzer@chromium.org> Commit-Queue: Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#57092}
This commit is contained in:
parent
bf3d7b9ae3
commit
00a2e85800
@ -806,10 +806,9 @@ PipelineStatistics* CreatePipelineStatistics(Handle<Script> script,
|
|||||||
return pipeline_statistics;
|
return pipeline_statistics;
|
||||||
}
|
}
|
||||||
|
|
||||||
PipelineStatistics* CreatePipelineStatistics(wasm::WasmEngine* wasm_engine,
|
PipelineStatistics* CreatePipelineStatistics(
|
||||||
wasm::FunctionBody function_body,
|
wasm::WasmEngine* wasm_engine, wasm::FunctionBody function_body,
|
||||||
wasm::WasmModule* wasm_module,
|
const wasm::WasmModule* wasm_module, OptimizedCompilationInfo* info,
|
||||||
OptimizedCompilationInfo* info,
|
|
||||||
ZoneStats* zone_stats) {
|
ZoneStats* zone_stats) {
|
||||||
PipelineStatistics* pipeline_statistics = nullptr;
|
PipelineStatistics* pipeline_statistics = nullptr;
|
||||||
|
|
||||||
@ -1013,20 +1012,20 @@ class PipelineWasmCompilationJob final : public OptimizedCompilationJob {
|
|||||||
OptimizedCompilationInfo* info, wasm::WasmEngine* wasm_engine,
|
OptimizedCompilationInfo* info, wasm::WasmEngine* wasm_engine,
|
||||||
MachineGraph* mcgraph, CallDescriptor* call_descriptor,
|
MachineGraph* mcgraph, CallDescriptor* call_descriptor,
|
||||||
SourcePositionTable* source_positions, NodeOriginTable* node_origins,
|
SourcePositionTable* source_positions, NodeOriginTable* node_origins,
|
||||||
wasm::FunctionBody function_body, wasm::WasmModule* wasm_module,
|
wasm::FunctionBody function_body, wasm::NativeModule* native_module,
|
||||||
wasm::NativeModule* native_module, int function_index, bool asmjs_origin)
|
int function_index)
|
||||||
: OptimizedCompilationJob(kNoStackLimit, info, "TurboFan",
|
: OptimizedCompilationJob(kNoStackLimit, info, "TurboFan",
|
||||||
State::kReadyToExecute),
|
State::kReadyToExecute),
|
||||||
zone_stats_(wasm_engine->allocator()),
|
zone_stats_(wasm_engine->allocator()),
|
||||||
pipeline_statistics_(CreatePipelineStatistics(
|
pipeline_statistics_(CreatePipelineStatistics(
|
||||||
wasm_engine, function_body, wasm_module, info, &zone_stats_)),
|
wasm_engine, function_body, native_module->module(), info,
|
||||||
|
&zone_stats_)),
|
||||||
data_(&zone_stats_, wasm_engine, info, mcgraph,
|
data_(&zone_stats_, wasm_engine, info, mcgraph,
|
||||||
pipeline_statistics_.get(), source_positions, node_origins,
|
pipeline_statistics_.get(), source_positions, node_origins,
|
||||||
function_index, WasmAssemblerOptions()),
|
function_index, WasmAssemblerOptions()),
|
||||||
pipeline_(&data_),
|
pipeline_(&data_),
|
||||||
linkage_(call_descriptor),
|
linkage_(call_descriptor),
|
||||||
native_module_(native_module),
|
native_module_(native_module) {}
|
||||||
asmjs_origin_(asmjs_origin) {}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Status PrepareJobImpl(Isolate* isolate) final;
|
Status PrepareJobImpl(Isolate* isolate) final;
|
||||||
@ -1040,7 +1039,6 @@ class PipelineWasmCompilationJob final : public OptimizedCompilationJob {
|
|||||||
PipelineImpl pipeline_;
|
PipelineImpl pipeline_;
|
||||||
Linkage linkage_;
|
Linkage linkage_;
|
||||||
wasm::NativeModule* native_module_;
|
wasm::NativeModule* native_module_;
|
||||||
bool asmjs_origin_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
PipelineWasmCompilationJob::Status PipelineWasmCompilationJob::PrepareJobImpl(
|
PipelineWasmCompilationJob::Status PipelineWasmCompilationJob::PrepareJobImpl(
|
||||||
@ -1054,14 +1052,17 @@ PipelineWasmCompilationJob::ExecuteJobImpl() {
|
|||||||
|
|
||||||
PipelineData* data = &data_;
|
PipelineData* data = &data_;
|
||||||
data->BeginPhaseKind("wasm optimization");
|
data->BeginPhaseKind("wasm optimization");
|
||||||
if (FLAG_wasm_opt || asmjs_origin_) {
|
const bool is_asm_js = native_module_->module()->origin == wasm::kAsmJsOrigin;
|
||||||
|
if (FLAG_wasm_opt || is_asm_js) {
|
||||||
PipelineRunScope scope(data, "wasm full optimization");
|
PipelineRunScope scope(data, "wasm full optimization");
|
||||||
GraphReducer graph_reducer(scope.zone(), data->graph(),
|
GraphReducer graph_reducer(scope.zone(), data->graph(),
|
||||||
data->mcgraph()->Dead());
|
data->mcgraph()->Dead());
|
||||||
DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(),
|
DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(),
|
||||||
data->common(), scope.zone());
|
data->common(), scope.zone());
|
||||||
ValueNumberingReducer value_numbering(scope.zone(), data->graph()->zone());
|
ValueNumberingReducer value_numbering(scope.zone(), data->graph()->zone());
|
||||||
MachineOperatorReducer machine_reducer(data->mcgraph(), asmjs_origin_);
|
const bool allow_signalling_nan = is_asm_js;
|
||||||
|
MachineOperatorReducer machine_reducer(data->mcgraph(),
|
||||||
|
allow_signalling_nan);
|
||||||
CommonOperatorReducer common_reducer(&graph_reducer, data->graph(),
|
CommonOperatorReducer common_reducer(&graph_reducer, data->graph(),
|
||||||
data->broker(), data->common(),
|
data->broker(), data->common(),
|
||||||
data->machine(), scope.zone());
|
data->machine(), scope.zone());
|
||||||
@ -2325,13 +2326,11 @@ OptimizedCompilationJob* Pipeline::NewWasmCompilationJob(
|
|||||||
OptimizedCompilationInfo* info, wasm::WasmEngine* wasm_engine,
|
OptimizedCompilationInfo* info, wasm::WasmEngine* wasm_engine,
|
||||||
MachineGraph* mcgraph, CallDescriptor* call_descriptor,
|
MachineGraph* mcgraph, CallDescriptor* call_descriptor,
|
||||||
SourcePositionTable* source_positions, NodeOriginTable* node_origins,
|
SourcePositionTable* source_positions, NodeOriginTable* node_origins,
|
||||||
wasm::FunctionBody function_body, wasm::WasmModule* wasm_module,
|
wasm::FunctionBody function_body, wasm::NativeModule* native_module,
|
||||||
wasm::NativeModule* native_module, int function_index,
|
int function_index) {
|
||||||
wasm::ModuleOrigin asmjs_origin) {
|
|
||||||
return new PipelineWasmCompilationJob(
|
return new PipelineWasmCompilationJob(
|
||||||
info, wasm_engine, mcgraph, call_descriptor, source_positions,
|
info, wasm_engine, mcgraph, call_descriptor, source_positions,
|
||||||
node_origins, function_body, wasm_module, native_module, function_index,
|
node_origins, function_body, native_module, function_index);
|
||||||
asmjs_origin);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Pipeline::AllocateRegistersForTesting(const RegisterConfiguration* config,
|
bool Pipeline::AllocateRegistersForTesting(const RegisterConfiguration* config,
|
||||||
|
@ -50,9 +50,8 @@ class Pipeline : public AllStatic {
|
|||||||
OptimizedCompilationInfo* info, wasm::WasmEngine* wasm_engine,
|
OptimizedCompilationInfo* info, wasm::WasmEngine* wasm_engine,
|
||||||
MachineGraph* mcgraph, CallDescriptor* call_descriptor,
|
MachineGraph* mcgraph, CallDescriptor* call_descriptor,
|
||||||
SourcePositionTable* source_positions, NodeOriginTable* node_origins,
|
SourcePositionTable* source_positions, NodeOriginTable* node_origins,
|
||||||
wasm::FunctionBody function_body, wasm::WasmModule* wasm_module,
|
wasm::FunctionBody function_body, wasm::NativeModule* native_module,
|
||||||
wasm::NativeModule* native_module, int function_index,
|
int function_index);
|
||||||
wasm::ModuleOrigin wasm_origin);
|
|
||||||
|
|
||||||
// Run the pipeline on a machine graph and generate code.
|
// Run the pipeline on a machine graph and generate code.
|
||||||
static MaybeHandle<Code> GenerateCodeForWasmStub(
|
static MaybeHandle<Code> GenerateCodeForWasmStub(
|
||||||
|
@ -5321,8 +5321,7 @@ void TurbofanWasmCompilationUnit::ExecuteCompilation(
|
|||||||
std::unique_ptr<OptimizedCompilationJob> job(Pipeline::NewWasmCompilationJob(
|
std::unique_ptr<OptimizedCompilationJob> job(Pipeline::NewWasmCompilationJob(
|
||||||
&info, wasm_unit_->wasm_engine_, mcgraph, call_descriptor,
|
&info, wasm_unit_->wasm_engine_, mcgraph, call_descriptor,
|
||||||
source_positions, node_origins, wasm_unit_->func_body_,
|
source_positions, node_origins, wasm_unit_->func_body_,
|
||||||
const_cast<wasm::WasmModule*>(env->module), wasm_unit_->native_module_,
|
wasm_unit_->native_module_, wasm_unit_->func_index_));
|
||||||
wasm_unit_->func_index_, env->module->origin));
|
|
||||||
if (job->ExecuteJob() == CompilationJob::SUCCEEDED) {
|
if (job->ExecuteJob() == CompilationJob::SUCCEEDED) {
|
||||||
wasm_unit_->SetResult(info.wasm_code(), counters);
|
wasm_unit_->SetResult(info.wasm_code(), counters);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user