summaryrefslogtreecommitdiff
path: root/deps/v8/src/compiler/pipeline.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/compiler/pipeline.cc')
-rw-r--r--deps/v8/src/compiler/pipeline.cc329
1 files changed, 187 insertions, 142 deletions
diff --git a/deps/v8/src/compiler/pipeline.cc b/deps/v8/src/compiler/pipeline.cc
index 2614155722..d0f4f18ea3 100644
--- a/deps/v8/src/compiler/pipeline.cc
+++ b/deps/v8/src/compiler/pipeline.cc
@@ -65,7 +65,6 @@
#include "src/compiler/simplified-operator.h"
#include "src/compiler/store-store-elimination.h"
#include "src/compiler/tail-call-optimization.h"
-#include "src/compiler/type-hint-analyzer.h"
#include "src/compiler/typed-optimization.h"
#include "src/compiler/typer.h"
#include "src/compiler/value-numbering-reducer.h"
@@ -75,6 +74,7 @@
#include "src/ostreams.h"
#include "src/parsing/parse-info.h"
#include "src/register-configuration.h"
+#include "src/trap-handler/trap-handler.h"
#include "src/type-info.h"
#include "src/utils.h"
@@ -111,39 +111,51 @@ class PipelineData {
javascript_ = new (graph_zone_) JSOperatorBuilder(graph_zone_);
jsgraph_ = new (graph_zone_)
JSGraph(isolate_, graph_, common_, javascript_, simplified_, machine_);
+ is_asm_ = info->shared_info()->asm_function();
}
// For WASM compile entry point.
- PipelineData(ZoneStats* zone_stats, CompilationInfo* info, Graph* graph,
- SourcePositionTable* source_positions)
+ PipelineData(ZoneStats* zone_stats, CompilationInfo* info, JSGraph* jsgraph,
+ SourcePositionTable* source_positions,
+ ZoneVector<trap_handler::ProtectedInstructionData>*
+ protected_instructions)
: isolate_(info->isolate()),
info_(info),
debug_name_(info_->GetDebugName()),
zone_stats_(zone_stats),
graph_zone_scope_(zone_stats_, ZONE_NAME),
- graph_(graph),
+ graph_(jsgraph->graph()),
source_positions_(source_positions),
+ machine_(jsgraph->machine()),
+ common_(jsgraph->common()),
+ javascript_(jsgraph->javascript()),
+ jsgraph_(jsgraph),
instruction_zone_scope_(zone_stats_, ZONE_NAME),
instruction_zone_(instruction_zone_scope_.zone()),
register_allocation_zone_scope_(zone_stats_, ZONE_NAME),
- register_allocation_zone_(register_allocation_zone_scope_.zone()) {}
+ register_allocation_zone_(register_allocation_zone_scope_.zone()),
+ protected_instructions_(protected_instructions) {
+ is_asm_ =
+ info->has_shared_info() ? info->shared_info()->asm_function() : false;
+ }
// For machine graph testing entry point.
PipelineData(ZoneStats* zone_stats, CompilationInfo* info, Graph* graph,
- Schedule* schedule)
+ Schedule* schedule, SourcePositionTable* source_positions)
: isolate_(info->isolate()),
info_(info),
debug_name_(info_->GetDebugName()),
zone_stats_(zone_stats),
graph_zone_scope_(zone_stats_, ZONE_NAME),
graph_(graph),
- source_positions_(new (info->zone()) SourcePositionTable(graph_)),
+ source_positions_(source_positions),
schedule_(schedule),
instruction_zone_scope_(zone_stats_, ZONE_NAME),
instruction_zone_(instruction_zone_scope_.zone()),
register_allocation_zone_scope_(zone_stats_, ZONE_NAME),
- register_allocation_zone_(register_allocation_zone_scope_.zone()) {}
-
+ register_allocation_zone_(register_allocation_zone_scope_.zone()) {
+ is_asm_ = false;
+ }
// For register allocation testing entry point.
PipelineData(ZoneStats* zone_stats, CompilationInfo* info,
InstructionSequence* sequence)
@@ -156,7 +168,10 @@ class PipelineData {
instruction_zone_(sequence->zone()),
sequence_(sequence),
register_allocation_zone_scope_(zone_stats_, ZONE_NAME),
- register_allocation_zone_(register_allocation_zone_scope_.zone()) {}
+ register_allocation_zone_(register_allocation_zone_scope_.zone()) {
+ is_asm_ =
+ info->has_shared_info() ? info->shared_info()->asm_function() : false;
+ }
~PipelineData() {
DeleteRegisterAllocationZone();
@@ -170,6 +185,11 @@ class PipelineData {
PipelineStatistics* pipeline_statistics() { return pipeline_statistics_; }
bool compilation_failed() const { return compilation_failed_; }
void set_compilation_failed() { compilation_failed_ = true; }
+
+ bool is_asm() const { return is_asm_; }
+ bool verify_graph() const { return verify_graph_; }
+ void set_verify_graph(bool value) { verify_graph_ = value; }
+
Handle<Code> code() { return code_; }
void set_code(Handle<Code> code) {
DCHECK(code_.is_null());
@@ -199,12 +219,6 @@ class PipelineData {
loop_assignment_ = loop_assignment;
}
- TypeHintAnalysis* type_hint_analysis() const { return type_hint_analysis_; }
- void set_type_hint_analysis(TypeHintAnalysis* type_hint_analysis) {
- DCHECK_NULL(type_hint_analysis_);
- type_hint_analysis_ = type_hint_analysis;
- }
-
Schedule* schedule() const { return schedule_; }
void set_schedule(Schedule* schedule) {
DCHECK(!schedule_);
@@ -233,6 +247,11 @@ class PipelineData {
source_position_output_ = source_position_output;
}
+ ZoneVector<trap_handler::ProtectedInstructionData>* protected_instructions()
+ const {
+ return protected_instructions_;
+ }
+
void DeleteGraphZone() {
if (graph_zone_ == nullptr) return;
graph_zone_scope_.Destroy();
@@ -240,7 +259,6 @@ class PipelineData {
graph_ = nullptr;
source_positions_ = nullptr;
loop_assignment_ = nullptr;
- type_hint_analysis_ = nullptr;
simplified_ = nullptr;
machine_ = nullptr;
common_ = nullptr;
@@ -293,7 +311,7 @@ class PipelineData {
DCHECK(register_allocation_data_ == nullptr);
register_allocation_data_ = new (register_allocation_zone())
RegisterAllocationData(config, register_allocation_zone(), frame(),
- sequence(), debug_name_.get());
+ sequence(), debug_name());
}
void BeginPhaseKind(const char* phase_kind_name) {
@@ -308,6 +326,8 @@ class PipelineData {
}
}
+ const char* debug_name() const { return debug_name_.get(); }
+
private:
Isolate* const isolate_;
CompilationInfo* const info_;
@@ -316,6 +336,8 @@ class PipelineData {
ZoneStats* const zone_stats_;
PipelineStatistics* pipeline_statistics_ = nullptr;
bool compilation_failed_ = false;
+ bool verify_graph_ = false;
+ bool is_asm_ = false;
Handle<Code> code_ = Handle<Code>::null();
// All objects in the following group of fields are allocated in graph_zone_.
@@ -325,7 +347,6 @@ class PipelineData {
Graph* graph_ = nullptr;
SourcePositionTable* source_positions_ = nullptr;
LoopAssignmentAnalysis* loop_assignment_ = nullptr;
- TypeHintAnalysis* type_hint_analysis_ = nullptr;
SimplifiedOperatorBuilder* simplified_ = nullptr;
MachineOperatorBuilder* machine_ = nullptr;
CommonOperatorBuilder* common_ = nullptr;
@@ -355,6 +376,9 @@ class PipelineData {
// Source position output for --trace-turbo.
std::string source_position_output_;
+ ZoneVector<trap_handler::ProtectedInstructionData>* protected_instructions_ =
+ nullptr;
+
DISALLOW_COPY_AND_ASSIGN(PipelineData);
};
@@ -555,27 +579,29 @@ class PipelineCompilationJob final : public CompilationJob {
PipelineCompilationJob::Status PipelineCompilationJob::PrepareJobImpl() {
if (info()->shared_info()->asm_function()) {
- if (info()->osr_frame()) info()->MarkAsFrameSpecializing();
+ if (info()->osr_frame() && !info()->is_optimizing_from_bytecode()) {
+ info()->MarkAsFrameSpecializing();
+ }
info()->MarkAsFunctionContextSpecializing();
} else {
if (!FLAG_always_opt) {
info()->MarkAsBailoutOnUninitialized();
}
- if (FLAG_turbo_inlining) {
- info()->MarkAsInliningEnabled();
+ if (FLAG_turbo_loop_peeling) {
+ info()->MarkAsLoopPeelingEnabled();
}
}
- if (!info()->shared_info()->asm_function() || FLAG_turbo_asm_deoptimization) {
+ if (info()->is_optimizing_from_bytecode() ||
+ !info()->shared_info()->asm_function()) {
info()->MarkAsDeoptimizationEnabled();
if (FLAG_inline_accessors) {
info()->MarkAsAccessorInliningEnabled();
}
}
if (!info()->is_optimizing_from_bytecode()) {
- if (info()->is_deoptimization_enabled() && FLAG_turbo_type_feedback) {
- info()->MarkAsTypeFeedbackEnabled();
- }
if (!Compiler::EnsureDeoptimizationSupport(info())) return FAILED;
+ } else if (FLAG_turbo_inlining) {
+ info()->MarkAsInliningEnabled();
}
linkage_ = new (&zone_) Linkage(Linkage::ComputeIncoming(&zone_, info()));
@@ -612,15 +638,18 @@ PipelineCompilationJob::Status PipelineCompilationJob::FinalizeJobImpl() {
class PipelineWasmCompilationJob final : public CompilationJob {
public:
- explicit PipelineWasmCompilationJob(CompilationInfo* info, Graph* graph,
- CallDescriptor* descriptor,
- SourcePositionTable* source_positions)
+ explicit PipelineWasmCompilationJob(
+ CompilationInfo* info, JSGraph* jsgraph, CallDescriptor* descriptor,
+ SourcePositionTable* source_positions,
+ ZoneVector<trap_handler::ProtectedInstructionData>* protected_insts,
+ bool allow_signalling_nan)
: CompilationJob(info->isolate(), info, "TurboFan",
State::kReadyToExecute),
zone_stats_(info->isolate()->allocator()),
- data_(&zone_stats_, info, graph, source_positions),
+ data_(&zone_stats_, info, jsgraph, source_positions, protected_insts),
pipeline_(&data_),
- linkage_(descriptor) {}
+ linkage_(descriptor),
+ allow_signalling_nan_(allow_signalling_nan) {}
protected:
Status PrepareJobImpl() final;
@@ -632,6 +661,7 @@ class PipelineWasmCompilationJob final : public CompilationJob {
PipelineData data_;
PipelineImpl pipeline_;
Linkage linkage_;
+ bool allow_signalling_nan_;
};
PipelineWasmCompilationJob::Status
@@ -649,6 +679,24 @@ PipelineWasmCompilationJob::ExecuteJobImpl() {
}
pipeline_.RunPrintAndVerify("Machine", true);
+ if (FLAG_wasm_opt) {
+ PipelineData* data = &data_;
+ PipelineRunScope scope(data, "WASM optimization");
+ JSGraphReducer graph_reducer(data->jsgraph(), scope.zone());
+ DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(),
+ data->common());
+ ValueNumberingReducer value_numbering(scope.zone(), data->graph()->zone());
+ MachineOperatorReducer machine_reducer(data->jsgraph(),
+ allow_signalling_nan_);
+ CommonOperatorReducer common_reducer(&graph_reducer, data->graph(),
+ data->common(), data->machine());
+ AddReducer(data, &graph_reducer, &dead_code_elimination);
+ AddReducer(data, &graph_reducer, &value_numbering);
+ AddReducer(data, &graph_reducer, &machine_reducer);
+ AddReducer(data, &graph_reducer, &common_reducer);
+ graph_reducer.ReduceGraph();
+ pipeline_.RunPrintAndVerify("Optimized Machine", true);
+ }
if (!pipeline_.ScheduleAndSelectInstructions(&linkage_, true)) return FAILED;
return SUCCEEDED;
@@ -694,20 +742,6 @@ struct LoopAssignmentAnalysisPhase {
};
-struct TypeHintAnalysisPhase {
- static const char* phase_name() { return "type hint analysis"; }
-
- void Run(PipelineData* data, Zone* temp_zone) {
- if (data->info()->is_type_feedback_enabled()) {
- TypeHintAnalyzer analyzer(data->graph_zone());
- Handle<Code> code(data->info()->shared_info()->code(), data->isolate());
- TypeHintAnalysis* type_hint_analysis = analyzer.Analyze(code);
- data->set_type_hint_analysis(type_hint_analysis);
- }
- }
-};
-
-
struct GraphBuilderPhase {
static const char* phase_name() { return "graph builder"; }
@@ -715,15 +749,18 @@ struct GraphBuilderPhase {
bool succeeded = false;
if (data->info()->is_optimizing_from_bytecode()) {
- BytecodeGraphBuilder graph_builder(temp_zone, data->info(),
- data->jsgraph(), 1.0f,
- data->source_positions());
+ // Bytecode graph builder assumes deoptimziation is enabled.
+ DCHECK(data->info()->is_deoptimization_enabled());
+ BytecodeGraphBuilder graph_builder(
+ temp_zone, data->info()->shared_info(),
+ handle(data->info()->closure()->feedback_vector()),
+ data->info()->osr_ast_id(), data->jsgraph(), 1.0f,
+ data->source_positions());
succeeded = graph_builder.CreateGraph();
} else {
AstGraphBuilderWithPositions graph_builder(
temp_zone, data->info(), data->jsgraph(), 1.0f,
- data->loop_assignment(), data->type_hint_analysis(),
- data->source_positions());
+ data->loop_assignment(), data->source_positions());
succeeded = graph_builder.CreateGraph();
}
@@ -744,9 +781,6 @@ struct InliningPhase {
CommonOperatorReducer common_reducer(&graph_reducer, data->graph(),
data->common(), data->machine());
JSCallReducer::Flags call_reducer_flags = JSCallReducer::kNoFlags;
- if (data->info()->is_bailout_on_uninitialized()) {
- call_reducer_flags |= JSCallReducer::kBailoutOnUninitialized;
- }
if (data->info()->is_deoptimization_enabled()) {
call_reducer_flags |= JSCallReducer::kDeoptimizationEnabled;
}
@@ -817,21 +851,6 @@ struct TyperPhase {
}
};
-struct OsrTyperPhase {
- static const char* phase_name() { return "osr typer"; }
-
- void Run(PipelineData* data, Zone* temp_zone) {
- NodeVector roots(temp_zone);
- data->jsgraph()->GetCachedNodes(&roots);
- // Dummy induction variable optimizer: at the moment, we do not try
- // to compute loop variable bounds on OSR.
- LoopVariableOptimizer induction_vars(data->jsgraph()->graph(),
- data->common(), temp_zone);
- Typer typer(data->isolate(), Typer::kNoFlags, data->graph());
- typer.Run(roots, &induction_vars);
- }
-};
-
struct UntyperPhase {
static const char* phase_name() { return "untyper"; }
@@ -944,8 +963,8 @@ struct EscapeAnalysisPhase {
}
};
-struct RepresentationSelectionPhase {
- static const char* phase_name() { return "representation selection"; }
+struct SimplifiedLoweringPhase {
+ static const char* phase_name() { return "simplified lowering"; }
void Run(PipelineData* data, Zone* temp_zone) {
SimplifiedLowering lowering(data->jsgraph(), temp_zone,
@@ -978,6 +997,23 @@ struct LoopExitEliminationPhase {
}
};
+struct ConcurrentOptimizationPrepPhase {
+ static const char* phase_name() {
+ return "concurrent optimization preparation";
+ }
+
+ void Run(PipelineData* data, Zone* temp_zone) {
+ // Make sure we cache these code stubs.
+ data->jsgraph()->CEntryStubConstant(1);
+ data->jsgraph()->CEntryStubConstant(2);
+ data->jsgraph()->CEntryStubConstant(3);
+
+ // This is needed for escape analysis.
+ NodeProperties::SetType(data->jsgraph()->FalseConstant(), Type::Boolean());
+ NodeProperties::SetType(data->jsgraph()->TrueConstant(), Type::Boolean());
+ }
+};
+
struct GenericLoweringPhase {
static const char* phase_name() { return "generic lowering"; }
@@ -1178,21 +1214,6 @@ struct LateGraphTrimmingPhase {
};
-struct StressLoopPeelingPhase {
- static const char* phase_name() { return "stress loop peeling"; }
-
- void Run(PipelineData* data, Zone* temp_zone) {
- // Peel the first outer loop for testing.
- // TODO(titzer): peel all loops? the N'th loop? Innermost loops?
- LoopTree* loop_tree = LoopFinder::BuildLoopTree(data->graph(), temp_zone);
- if (loop_tree != nullptr && loop_tree->outer_loops().size() > 0) {
- LoopPeeler::Peel(data->graph(), data->common(), loop_tree,
- loop_tree->outer_loops()[0], temp_zone);
- }
- }
-};
-
-
struct ComputeSchedulePhase {
static const char* phase_name() { return "scheduling"; }
@@ -1404,7 +1425,7 @@ struct GenerateCodePhase {
void Run(PipelineData* data, Zone* temp_zone, Linkage* linkage) {
CodeGenerator generator(data->frame(), linkage, data->sequence(),
- data->info());
+ data->info(), data->protected_instructions());
data->set_code(generator.GenerateCode());
}
};
@@ -1475,8 +1496,6 @@ bool PipelineImpl::CreateGraph() {
Run<LoopAssignmentAnalysisPhase>();
}
- Run<TypeHintAnalysisPhase>();
-
Run<GraphBuilderPhase>();
if (data->compilation_failed()) {
data->EndPhaseKind();
@@ -1486,8 +1505,6 @@ bool PipelineImpl::CreateGraph() {
// Perform OSR deconstruction.
if (info()->is_osr()) {
- Run<OsrTyperPhase>();
-
Run<OsrDeconstructionPhase>();
Run<UntyperPhase>();
@@ -1512,7 +1529,7 @@ bool PipelineImpl::CreateGraph() {
// Determine the Typer operation flags.
Typer::Flags flags = Typer::kNoFlags;
if (is_sloppy(info()->shared_info()->language_mode()) &&
- !info()->shared_info()->IsBuiltin()) {
+ info()->shared_info()->IsUserJavaScript()) {
// Sloppy mode functions always have an Object for this.
flags |= Typer::kThisIsReceiver;
}
@@ -1533,43 +1550,50 @@ bool PipelineImpl::CreateGraph() {
// Lower JSOperators where we can determine types.
Run<TypedLoweringPhase>();
RunPrintAndVerify("Lowered typed");
+ }
- if (FLAG_turbo_loop_peeling) {
- Run<LoopPeelingPhase>();
- RunPrintAndVerify("Loops peeled", true);
- } else {
- Run<LoopExitEliminationPhase>();
- RunPrintAndVerify("Loop exits eliminated", true);
- }
+ // Do some hacky things to prepare for the optimization phase.
+ // (caching handles, etc.).
+ Run<ConcurrentOptimizationPrepPhase>();
- if (FLAG_turbo_stress_loop_peeling) {
- Run<StressLoopPeelingPhase>();
- RunPrintAndVerify("Loop peeled");
- }
+ data->EndPhaseKind();
- if (!info()->shared_info()->asm_function()) {
- if (FLAG_turbo_load_elimination) {
- Run<LoadEliminationPhase>();
- RunPrintAndVerify("Load eliminated");
- }
+ return true;
+}
- if (FLAG_turbo_escape) {
- Run<EscapeAnalysisPhase>();
- if (data->compilation_failed()) {
- info()->AbortOptimization(kCyclicObjectStateDetectedInEscapeAnalysis);
- data->EndPhaseKind();
- return false;
- }
- RunPrintAndVerify("Escape Analysed");
+bool PipelineImpl::OptimizeGraph(Linkage* linkage) {
+ PipelineData* data = this->data_;
+
+ if (data->info()->is_loop_peeling_enabled()) {
+ Run<LoopPeelingPhase>();
+ RunPrintAndVerify("Loops peeled", true);
+ } else {
+ Run<LoopExitEliminationPhase>();
+ RunPrintAndVerify("Loop exits eliminated", true);
+ }
+
+ if (!data->is_asm()) {
+ if (FLAG_turbo_load_elimination) {
+ Run<LoadEliminationPhase>();
+ RunPrintAndVerify("Load eliminated");
+ }
+
+ if (FLAG_turbo_escape) {
+ Run<EscapeAnalysisPhase>();
+ if (data->compilation_failed()) {
+ info()->AbortOptimization(kCyclicObjectStateDetectedInEscapeAnalysis);
+ data->EndPhaseKind();
+ return false;
}
+ RunPrintAndVerify("Escape Analysed");
}
}
- // Select representations. This has to run w/o the Typer decorator, because
- // we cannot compute meaningful types anyways, and the computed types might
- // even conflict with the representation/truncation logic.
- Run<RepresentationSelectionPhase>();
- RunPrintAndVerify("Representations selected", true);
+ // Perform simplified lowering. This has to run w/o the Typer decorator,
+ // because we cannot compute meaningful types anyways, and the computed types
+ // might even conflict with the representation/truncation logic.
+ Run<SimplifiedLoweringPhase>();
+ RunPrintAndVerify("Simplified lowering", true);
#ifdef DEBUG
// From now on it is invalid to look at types on the nodes, because:
@@ -1592,14 +1616,6 @@ bool PipelineImpl::CreateGraph() {
Run<GenericLoweringPhase>();
RunPrintAndVerify("Generic lowering", true);
- data->EndPhaseKind();
-
- return true;
-}
-
-bool PipelineImpl::OptimizeGraph(Linkage* linkage) {
- PipelineData* data = this->data_;
-
data->BeginPhaseKind("block building");
// Run early optimization pass.
@@ -1648,7 +1664,9 @@ Handle<Code> Pipeline::GenerateCodeForCodeStub(Isolate* isolate,
// Construct a pipeline for scheduling and code generation.
ZoneStats zone_stats(isolate->allocator());
- PipelineData data(&zone_stats, &info, graph, schedule);
+ SourcePositionTable source_positions(graph);
+ PipelineData data(&zone_stats, &info, graph, schedule, &source_positions);
+ data.set_verify_graph(FLAG_csa_verify);
std::unique_ptr<PipelineStatistics> pipeline_statistics;
if (FLAG_turbo_stats || FLAG_turbo_stats_nvp) {
pipeline_statistics.reset(new PipelineStatistics(&info, &zone_stats));
@@ -1660,6 +1678,12 @@ Handle<Code> Pipeline::GenerateCodeForCodeStub(Isolate* isolate,
if (FLAG_trace_turbo) {
{
+ CodeTracer::Scope tracing_scope(isolate->GetCodeTracer());
+ OFStream os(tracing_scope.file());
+ os << "---------------------------------------------------\n"
+ << "Begin compiling " << debug_name << " using Turbofan" << std::endl;
+ }
+ {
TurboJsonFile json_of(&info, std::ios_base::trunc);
json_of << "{\"function\":\"" << info.GetDebugName().get()
<< "\", \"source\":\"\",\n\"phases\":[";
@@ -1696,13 +1720,16 @@ Handle<Code> Pipeline::GenerateCodeForTesting(CompilationInfo* info,
}
// static
-Handle<Code> Pipeline::GenerateCodeForTesting(CompilationInfo* info,
- CallDescriptor* call_descriptor,
- Graph* graph,
- Schedule* schedule) {
+Handle<Code> Pipeline::GenerateCodeForTesting(
+ CompilationInfo* info, CallDescriptor* call_descriptor, Graph* graph,
+ Schedule* schedule, SourcePositionTable* source_positions) {
// Construct a pipeline for scheduling and code generation.
ZoneStats zone_stats(info->isolate()->allocator());
- PipelineData data(&zone_stats, info, graph, schedule);
+ // TODO(wasm): Refactor code generation to check for non-existing source
+ // table, then remove this conditional allocation.
+ if (!source_positions)
+ source_positions = new (info->zone()) SourcePositionTable(graph);
+ PipelineData data(&zone_stats, info, graph, schedule, source_positions);
std::unique_ptr<PipelineStatistics> pipeline_statistics;
if (FLAG_turbo_stats || FLAG_turbo_stats_nvp) {
pipeline_statistics.reset(new PipelineStatistics(info, &zone_stats));
@@ -1729,10 +1756,13 @@ CompilationJob* Pipeline::NewCompilationJob(Handle<JSFunction> function) {
// static
CompilationJob* Pipeline::NewWasmCompilationJob(
- CompilationInfo* info, Graph* graph, CallDescriptor* descriptor,
- SourcePositionTable* source_positions) {
- return new PipelineWasmCompilationJob(info, graph, descriptor,
- source_positions);
+ CompilationInfo* info, JSGraph* jsgraph, CallDescriptor* descriptor,
+ SourcePositionTable* source_positions,
+ ZoneVector<trap_handler::ProtectedInstructionData>* protected_instructions,
+ bool allow_signalling_nan) {
+ return new PipelineWasmCompilationJob(
+ info, jsgraph, descriptor, source_positions, protected_instructions,
+ allow_signalling_nan);
}
bool Pipeline::AllocateRegistersForTesting(const RegisterConfiguration* config,
@@ -1767,12 +1797,27 @@ bool PipelineImpl::ScheduleAndSelectInstructions(Linkage* linkage,
info(), data->graph(), data->schedule()));
}
- if (FLAG_turbo_verify_machine_graph != nullptr &&
- (!strcmp(FLAG_turbo_verify_machine_graph, "*") ||
- !strcmp(FLAG_turbo_verify_machine_graph,
- data->info()->GetDebugName().get()))) {
+ bool verify_stub_graph = data->verify_graph();
+ if (verify_stub_graph ||
+ (FLAG_turbo_verify_machine_graph != nullptr &&
+ (!strcmp(FLAG_turbo_verify_machine_graph, "*") ||
+ !strcmp(FLAG_turbo_verify_machine_graph, data->debug_name())))) {
+ if (FLAG_trace_csa_verify) {
+ AllowHandleDereference allow_deref;
+ CompilationInfo* info = data->info();
+ CodeTracer::Scope tracing_scope(info->isolate()->GetCodeTracer());
+ OFStream os(tracing_scope.file());
+ os << "--------------------------------------------------\n"
+ << "--- Verifying " << data->debug_name() << " generated by TurboFan\n"
+ << "--------------------------------------------------\n"
+ << *data->schedule()
+ << "--------------------------------------------------\n"
+ << "--- End of " << data->debug_name() << " generated by TurboFan\n"
+ << "--------------------------------------------------\n";
+ }
Zone temp_zone(data->isolate()->allocator(), ZONE_NAME);
MachineGraphVerifier::Run(data->graph(), data->schedule(), linkage,
+ data->info()->IsStub(), data->debug_name(),
&temp_zone);
}