Chromium Code Reviews| Index: src/compiler/pipeline.cc |
| diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc |
| index 6f85651a2e93e8882b178d03a2e865d965870b2d..a78e92f1e3c81de63ce8177a21009e96e838819c 100644 |
| --- a/src/compiler/pipeline.cc |
| +++ b/src/compiler/pipeline.cc |
| @@ -15,6 +15,7 @@ |
| #include "src/compiler/change-lowering.h" |
| #include "src/compiler/code-generator.h" |
| #include "src/compiler/common-operator-reducer.h" |
| +#include "src/compiler/context-relaxation.h" |
| #include "src/compiler/control-flow-optimizer.h" |
| #include "src/compiler/dead-code-elimination.h" |
| #include "src/compiler/frame-elider.h" |
| @@ -80,6 +81,7 @@ class PipelineData { |
| javascript_(nullptr), |
| jsgraph_(nullptr), |
| js_type_feedback_(nullptr), |
| + relaxed_context_(nullptr), |
| schedule_(nullptr), |
| instruction_zone_scope_(zone_pool_), |
| instruction_zone_(instruction_zone_scope_.zone()), |
| @@ -191,6 +193,10 @@ class PipelineData { |
| void set_js_type_feedback(JSTypeFeedbackTable* js_type_feedback) { |
| js_type_feedback_ = js_type_feedback; |
| } |
| + Node* relaxed_context() const { return relaxed_context_; } |
| + void set_relaxed_context(Node* relaxed_context) { |
| + relaxed_context_ = relaxed_context; |
| + } |
| LoopAssignmentAnalysis* loop_assignment() const { return loop_assignment_; } |
| void set_loop_assignment(LoopAssignmentAnalysis* loop_assignment) { |
| @@ -286,6 +292,7 @@ class PipelineData { |
| JSOperatorBuilder* javascript_; |
| JSGraph* jsgraph_; |
| JSTypeFeedbackTable* js_type_feedback_; |
| + Node* relaxed_context_; |
|
Michael Starzinger
2015/07/02 10:29:26
nit: Please reset this to {nullptr} in PipelineDat
|
| Schedule* schedule_; |
| // All objects in the following group of fields are allocated in |
| @@ -379,6 +386,8 @@ class AstGraphBuilderWithPositions final : public AstGraphBuilder { |
| AST_NODE_LIST(DEF_VISIT) |
| #undef DEF_VISIT |
| + using AstGraphBuilder::relaxed_context; |
| + |
| private: |
| SourcePositionTable* const source_positions_; |
| SourcePosition const start_position_; |
| @@ -482,6 +491,7 @@ struct GraphBuilderPhase { |
| if (!graph_builder.CreateGraph(constant_context, stack_check)) { |
| data->set_compilation_failed(); |
| } |
| + data->set_relaxed_context(graph_builder.relaxed_context()); |
| } |
| }; |
| @@ -690,6 +700,7 @@ struct GenericLoweringPhase { |
| void Run(PipelineData* data, Zone* temp_zone) { |
| JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); |
| + ContextRelaxation relaxing(data->graph()->start(), data->relaxed_context()); |
| DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(), |
| data->common()); |
| CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), |
| @@ -699,6 +710,7 @@ struct GenericLoweringPhase { |
| SelectLowering select_lowering(data->jsgraph()->graph(), |
| data->jsgraph()->common()); |
| TailCallOptimization tco(data->common(), data->graph()); |
| + AddReducer(data, &graph_reducer, &relaxing); |
| AddReducer(data, &graph_reducer, &dead_code_elimination); |
| AddReducer(data, &graph_reducer, &common_reducer); |
| AddReducer(data, &graph_reducer, &generic_lowering); |