OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ | 5 #ifndef V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ |
6 #define V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ | 6 #define V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ |
7 | 7 |
8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/compiler/bytecode-branch-analysis.h" | 9 #include "src/compiler/bytecode-branch-analysis.h" |
10 #include "src/compiler/js-graph.h" | 10 #include "src/compiler/js-graph.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 // Simulates control flow that exits the function body. | 150 // Simulates control flow that exits the function body. |
151 void MergeControlToLeaveFunction(Node* exit); | 151 void MergeControlToLeaveFunction(Node* exit); |
152 | 152 |
153 // Simulates entry and exit of exception handlers. | 153 // Simulates entry and exit of exception handlers. |
154 void EnterAndExitExceptionHandlers(int current_offset); | 154 void EnterAndExitExceptionHandlers(int current_offset); |
155 | 155 |
156 // Growth increment for the temporary buffer used to construct input lists to | 156 // Growth increment for the temporary buffer used to construct input lists to |
157 // new nodes. | 157 // new nodes. |
158 static const int kInputBufferSizeIncrement = 64; | 158 static const int kInputBufferSizeIncrement = 64; |
159 | 159 |
160 // The catch prediction from the handler table is reused. | |
161 typedef HandlerTable::CatchPrediction CatchPrediction; | |
162 | |
163 // An abstract representation for an exception handler that is being | 160 // An abstract representation for an exception handler that is being |
164 // entered and exited while the graph builder is iterating over the | 161 // entered and exited while the graph builder is iterating over the |
165 // underlying bytecode. The exception handlers within the bytecode are | 162 // underlying bytecode. The exception handlers within the bytecode are |
166 // well scoped, hence will form a stack during iteration. | 163 // well scoped, hence will form a stack during iteration. |
167 struct ExceptionHandler { | 164 struct ExceptionHandler { |
168 int start_offset_; // Start offset of the handled area in the bytecode. | 165 int start_offset_; // Start offset of the handled area in the bytecode. |
169 int end_offset_; // End offset of the handled area in the bytecode. | 166 int end_offset_; // End offset of the handled area in the bytecode. |
170 int handler_offset_; // Handler entry offset within the bytecode. | 167 int handler_offset_; // Handler entry offset within the bytecode. |
171 int context_register_; // Index of register holding handler context. | 168 int context_register_; // Index of register holding handler context. |
172 CatchPrediction pred_; // Prediction of whether handler is catching. | |
173 }; | 169 }; |
174 | 170 |
175 // Field accessors | 171 // Field accessors |
176 Graph* graph() const { return jsgraph_->graph(); } | 172 Graph* graph() const { return jsgraph_->graph(); } |
177 CommonOperatorBuilder* common() const { return jsgraph_->common(); } | 173 CommonOperatorBuilder* common() const { return jsgraph_->common(); } |
178 Zone* graph_zone() const { return graph()->zone(); } | 174 Zone* graph_zone() const { return graph()->zone(); } |
179 CompilationInfo* info() const { return info_; } | 175 CompilationInfo* info() const { return info_; } |
180 JSGraph* jsgraph() const { return jsgraph_; } | 176 JSGraph* jsgraph() const { return jsgraph_; } |
181 JSOperatorBuilder* javascript() const { return jsgraph_->javascript(); } | 177 JSOperatorBuilder* javascript() const { return jsgraph_->javascript(); } |
182 Zone* local_zone() const { return local_zone_; } | 178 Zone* local_zone() const { return local_zone_; } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 ZoneVector<Node*> exit_controls_; | 247 ZoneVector<Node*> exit_controls_; |
252 | 248 |
253 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphBuilder); | 249 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphBuilder); |
254 }; | 250 }; |
255 | 251 |
256 } // namespace compiler | 252 } // namespace compiler |
257 } // namespace internal | 253 } // namespace internal |
258 } // namespace v8 | 254 } // namespace v8 |
259 | 255 |
260 #endif // V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ | 256 #endif // V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ |
OLD | NEW |