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 |
160 // An abstract representation for an exception handler that is being | 163 // An abstract representation for an exception handler that is being |
161 // entered and exited while the graph builder is iterating over the | 164 // entered and exited while the graph builder is iterating over the |
162 // underlying bytecode. The exception handlers within the bytecode are | 165 // underlying bytecode. The exception handlers within the bytecode are |
163 // well scoped, hence will form a stack during iteration. | 166 // well scoped, hence will form a stack during iteration. |
164 struct ExceptionHandler { | 167 struct ExceptionHandler { |
165 int start_offset_; // Start offset of the handled area in the bytecode. | 168 int start_offset_; // Start offset of the handled area in the bytecode. |
166 int end_offset_; // End offset of the handled area in the bytecode. | 169 int end_offset_; // End offset of the handled area in the bytecode. |
167 int handler_offset_; // Handler entry offset within the bytecode. | 170 int handler_offset_; // Handler entry offset within the bytecode. |
168 int context_register_; // Index of register holding handler context. | 171 int context_register_; // Index of register holding handler context. |
| 172 CatchPrediction pred_; // Prediction of whether handler is catching. |
169 }; | 173 }; |
170 | 174 |
171 // Field accessors | 175 // Field accessors |
172 Graph* graph() const { return jsgraph_->graph(); } | 176 Graph* graph() const { return jsgraph_->graph(); } |
173 CommonOperatorBuilder* common() const { return jsgraph_->common(); } | 177 CommonOperatorBuilder* common() const { return jsgraph_->common(); } |
174 Zone* graph_zone() const { return graph()->zone(); } | 178 Zone* graph_zone() const { return graph()->zone(); } |
175 CompilationInfo* info() const { return info_; } | 179 CompilationInfo* info() const { return info_; } |
176 JSGraph* jsgraph() const { return jsgraph_; } | 180 JSGraph* jsgraph() const { return jsgraph_; } |
177 JSOperatorBuilder* javascript() const { return jsgraph_->javascript(); } | 181 JSOperatorBuilder* javascript() const { return jsgraph_->javascript(); } |
178 Zone* local_zone() const { return local_zone_; } | 182 Zone* local_zone() const { return local_zone_; } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 ZoneVector<Node*> exit_controls_; | 251 ZoneVector<Node*> exit_controls_; |
248 | 252 |
249 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphBuilder); | 253 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphBuilder); |
250 }; | 254 }; |
251 | 255 |
252 } // namespace compiler | 256 } // namespace compiler |
253 } // namespace internal | 257 } // namespace internal |
254 } // namespace v8 | 258 } // namespace v8 |
255 | 259 |
256 #endif // V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ | 260 #endif // V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ |
OLD | NEW |