Index: src/compiler/pipeline.cc |
diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc |
index 331b4af5908bd742f5438aa22a4a4a7f03e35de6..af30681fe4b1aeedc418a90526e3ab6638d336c4 100644 |
--- a/src/compiler/pipeline.cc |
+++ b/src/compiler/pipeline.cc |
@@ -74,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" |
@@ -114,7 +115,9 @@ class PipelineData { |
// For WASM compile entry point. |
PipelineData(ZoneStats* zone_stats, CompilationInfo* info, JSGraph* jsgraph, |
- SourcePositionTable* source_positions) |
+ SourcePositionTable* source_positions, |
+ ZoneVector<trap_handler::ProtectedInstructionData>* |
+ protected_instructions) |
: isolate_(info->isolate()), |
info_(info), |
debug_name_(info_->GetDebugName()), |
@@ -129,7 +132,8 @@ class PipelineData { |
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) {} |
// For machine graph testing entry point. |
PipelineData(ZoneStats* zone_stats, CompilationInfo* info, Graph* graph, |
@@ -230,6 +234,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(); |
@@ -350,6 +359,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); |
}; |
@@ -609,13 +621,14 @@ PipelineCompilationJob::Status PipelineCompilationJob::FinalizeJobImpl() { |
class PipelineWasmCompilationJob final : public CompilationJob { |
public: |
- explicit PipelineWasmCompilationJob(CompilationInfo* info, JSGraph* jsgraph, |
- CallDescriptor* descriptor, |
- SourcePositionTable* source_positions) |
+ explicit PipelineWasmCompilationJob( |
+ CompilationInfo* info, JSGraph* jsgraph, CallDescriptor* descriptor, |
+ SourcePositionTable* source_positions, |
+ ZoneVector<trap_handler::ProtectedInstructionData>* protected_insts) |
: CompilationJob(info->isolate(), info, "TurboFan", |
State::kReadyToExecute), |
zone_stats_(info->isolate()->allocator()), |
- data_(&zone_stats_, info, jsgraph, source_positions), |
+ data_(&zone_stats_, info, jsgraph, source_positions, protected_insts), |
pipeline_(&data_), |
linkage_(descriptor) {} |
@@ -1403,7 +1416,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()); |
} |
}; |
@@ -1727,9 +1740,11 @@ CompilationJob* Pipeline::NewCompilationJob(Handle<JSFunction> function) { |
// static |
CompilationJob* Pipeline::NewWasmCompilationJob( |
CompilationInfo* info, JSGraph* jsgraph, CallDescriptor* descriptor, |
- SourcePositionTable* source_positions) { |
- return new PipelineWasmCompilationJob(info, jsgraph, descriptor, |
- source_positions); |
+ SourcePositionTable* source_positions, |
+ ZoneVector<trap_handler::ProtectedInstructionData>* |
+ protected_instructions) { |
+ return new PipelineWasmCompilationJob( |
+ info, jsgraph, descriptor, source_positions, protected_instructions); |
} |
bool Pipeline::AllocateRegistersForTesting(const RegisterConfiguration* config, |