Commit 5eef6886 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[wasm] Slightly simplify {PipelineData} class.

R=clemensh@chromium.org

Change-Id: I57183c306a4b0b38822ae3136a8c49ab94992010
Reviewed-on: https://chromium-review.googlesource.com/c/1337575Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57530}
parent 856be9c2
...@@ -88,11 +88,6 @@ ...@@ -88,11 +88,6 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
namespace trap_handler {
struct ProtectedInstructionData;
} // namespace trap_handler
namespace compiler { namespace compiler {
// Turbofan can only handle 2^16 control inputs. Since each control flow split // Turbofan can only handle 2^16 control inputs. Since each control flow split
...@@ -147,14 +142,13 @@ class PipelineData { ...@@ -147,14 +142,13 @@ class PipelineData {
OptimizedCompilationInfo* info, MachineGraph* mcgraph, OptimizedCompilationInfo* info, MachineGraph* mcgraph,
PipelineStatistics* pipeline_statistics, PipelineStatistics* pipeline_statistics,
SourcePositionTable* source_positions, SourcePositionTable* source_positions,
NodeOriginTable* node_origins, int wasm_function_index, NodeOriginTable* node_origins,
const AssemblerOptions& assembler_options) const AssemblerOptions& assembler_options)
: isolate_(nullptr), : isolate_(nullptr),
wasm_engine_(wasm_engine), wasm_engine_(wasm_engine),
allocator_(wasm_engine->allocator()), allocator_(wasm_engine->allocator()),
info_(info), info_(info),
debug_name_(info_->GetDebugName()), debug_name_(info_->GetDebugName()),
wasm_function_index_(wasm_function_index),
may_have_unverifiable_graph_(false), may_have_unverifiable_graph_(false),
zone_stats_(zone_stats), zone_stats_(zone_stats),
pipeline_statistics_(pipeline_statistics), pipeline_statistics_(pipeline_statistics),
...@@ -434,15 +428,12 @@ class PipelineData { ...@@ -434,15 +428,12 @@ class PipelineData {
const char* debug_name() const { return debug_name_.get(); } const char* debug_name() const { return debug_name_.get(); }
int wasm_function_index() const { return wasm_function_index_; }
private: private:
Isolate* const isolate_; Isolate* const isolate_;
wasm::WasmEngine* const wasm_engine_ = nullptr; wasm::WasmEngine* const wasm_engine_ = nullptr;
AccountingAllocator* const allocator_; AccountingAllocator* const allocator_;
OptimizedCompilationInfo* const info_; OptimizedCompilationInfo* const info_;
std::unique_ptr<char[]> debug_name_; std::unique_ptr<char[]> debug_name_;
int wasm_function_index_ = -1;
bool may_have_unverifiable_graph_ = true; bool may_have_unverifiable_graph_ = true;
ZoneStats* const zone_stats_; ZoneStats* const zone_stats_;
PipelineStatistics* pipeline_statistics_ = nullptr; PipelineStatistics* pipeline_statistics_ = nullptr;
...@@ -2097,7 +2088,7 @@ wasm::WasmCode* Pipeline::GenerateCodeForWasmNativeStub( ...@@ -2097,7 +2088,7 @@ wasm::WasmCode* Pipeline::GenerateCodeForWasmNativeStub(
ZoneStats zone_stats(wasm_engine->allocator()); ZoneStats zone_stats(wasm_engine->allocator());
NodeOriginTable* node_positions = new (graph->zone()) NodeOriginTable(graph); NodeOriginTable* node_positions = new (graph->zone()) NodeOriginTable(graph);
PipelineData data(&zone_stats, wasm_engine, &info, mcgraph, nullptr, PipelineData data(&zone_stats, wasm_engine, &info, mcgraph, nullptr,
source_positions, node_positions, -1, options); source_positions, node_positions, options);
std::unique_ptr<PipelineStatistics> pipeline_statistics; std::unique_ptr<PipelineStatistics> pipeline_statistics;
if (FLAG_turbo_stats || FLAG_turbo_stats_nvp) { if (FLAG_turbo_stats || FLAG_turbo_stats_nvp) {
pipeline_statistics.reset(new PipelineStatistics( pipeline_statistics.reset(new PipelineStatistics(
...@@ -2139,7 +2130,7 @@ wasm::WasmCode* Pipeline::GenerateCodeForWasmNativeStub( ...@@ -2139,7 +2130,7 @@ wasm::WasmCode* Pipeline::GenerateCodeForWasmNativeStub(
code_generator->tasm()->GetCode(nullptr, &code_desc); code_generator->tasm()->GetCode(nullptr, &code_desc);
wasm::WasmCode* code = native_module->AddCode( wasm::WasmCode* code = native_module->AddCode(
data.wasm_function_index(), code_desc, wasm::WasmCode::kAnonymousFuncIndex, code_desc,
code_generator->frame()->GetTotalFrameSlotCount(), code_generator->frame()->GetTotalFrameSlotCount(),
code_generator->GetSafepointTableOffset(), code_generator->GetSafepointTableOffset(),
code_generator->GetHandlerTableOffset(), code_generator->GetHandlerTableOffset(),
...@@ -2312,7 +2303,7 @@ wasm::WasmCode* Pipeline::GenerateCodeForWasmFunction( ...@@ -2312,7 +2303,7 @@ wasm::WasmCode* Pipeline::GenerateCodeForWasmFunction(
native_module->module(), info, &zone_stats)); native_module->module(), info, &zone_stats));
PipelineData data(&zone_stats, wasm_engine, info, mcgraph, PipelineData data(&zone_stats, wasm_engine, info, mcgraph,
pipeline_statistics.get(), source_positions, node_origins, pipeline_statistics.get(), source_positions, node_origins,
function_index, WasmAssemblerOptions()); WasmAssemblerOptions());
PipelineImpl pipeline(&data); PipelineImpl pipeline(&data);
...@@ -2375,7 +2366,7 @@ wasm::WasmCode* Pipeline::GenerateCodeForWasmFunction( ...@@ -2375,7 +2366,7 @@ wasm::WasmCode* Pipeline::GenerateCodeForWasmFunction(
code_generator->tasm()->GetCode(nullptr, &code_desc); code_generator->tasm()->GetCode(nullptr, &code_desc);
wasm::WasmCode* code = native_module->AddCode( wasm::WasmCode* code = native_module->AddCode(
data.wasm_function_index(), code_desc, function_index, code_desc,
code_generator->frame()->GetTotalFrameSlotCount(), code_generator->frame()->GetTotalFrameSlotCount(),
code_generator->GetSafepointTableOffset(), code_generator->GetSafepointTableOffset(),
code_generator->GetHandlerTableOffset(), code_generator->GetHandlerTableOffset(),
......
...@@ -142,6 +142,9 @@ class V8_EXPORT_PRIVATE WasmCode final { ...@@ -142,6 +142,9 @@ class V8_EXPORT_PRIVATE WasmCode final {
enum FlushICache : bool { kFlushICache = true, kNoFlushICache = false }; enum FlushICache : bool { kFlushICache = true, kNoFlushICache = false };
static constexpr uint32_t kAnonymousFuncIndex = 0xffffffff;
STATIC_ASSERT(kAnonymousFuncIndex > kV8MaxWasmFunctions);
private: private:
friend class NativeModule; friend class NativeModule;
...@@ -180,9 +183,6 @@ class V8_EXPORT_PRIVATE WasmCode final { ...@@ -180,9 +183,6 @@ class V8_EXPORT_PRIVATE WasmCode final {
// trap_handler_index. // trap_handler_index.
void RegisterTrapHandlerData(); void RegisterTrapHandlerData();
static constexpr uint32_t kAnonymousFuncIndex = 0xffffffff;
STATIC_ASSERT(kAnonymousFuncIndex > kV8MaxWasmFunctions);
Vector<byte> instructions_; Vector<byte> instructions_;
OwnedVector<const byte> reloc_info_; OwnedVector<const byte> reloc_info_;
OwnedVector<const byte> source_position_table_; OwnedVector<const byte> source_position_table_;
......
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