Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: src/compiler/ast-graph-builder.h

Issue 522873002: Removal of the deoptimization block from Turbofan (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Change constant capitalization Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/compiler/arm64/instruction-selector-arm64.cc ('k') | src/compiler/ast-graph-builder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_AST_GRAPH_BUILDER_H_ 5 #ifndef V8_COMPILER_AST_GRAPH_BUILDER_H_
6 #define V8_COMPILER_AST_GRAPH_BUILDER_H_ 6 #define V8_COMPILER_AST_GRAPH_BUILDER_H_
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/ast.h" 10 #include "src/ast.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 void VisitNot(UnaryOperation* expr); 165 void VisitNot(UnaryOperation* expr);
166 166
167 // Dispatched from VisitBinaryOperation. 167 // Dispatched from VisitBinaryOperation.
168 void VisitComma(BinaryOperation* expr); 168 void VisitComma(BinaryOperation* expr);
169 void VisitLogicalExpression(BinaryOperation* expr); 169 void VisitLogicalExpression(BinaryOperation* expr);
170 void VisitArithmeticExpression(BinaryOperation* expr); 170 void VisitArithmeticExpression(BinaryOperation* expr);
171 171
172 // Dispatched from VisitForInStatement. 172 // Dispatched from VisitForInStatement.
173 void VisitForInAssignment(Expression* expr, Node* value); 173 void VisitForInAssignment(Expression* expr, Node* value);
174 174
175 // Flag that describes how to combine the current environment with
176 // the output of a node to obtain a framestate for lazy bailout.
177 enum OutputFrameStateCombine {
178 PUSH_OUTPUT, // Push the output on the expression stack.
179 IGNORE_OUTPUT // Use the frame state as-is.
180 };
181
182 // Builds deoptimization for a given node. 175 // Builds deoptimization for a given node.
183 void PrepareFrameState(Node* node, BailoutId ast_id, 176 void PrepareFrameState(Node* node, BailoutId ast_id,
184 OutputFrameStateCombine combine = IGNORE_OUTPUT); 177 OutputFrameStateCombine combine = kIgnoreOutput);
185 178
186 OutputFrameStateCombine StateCombineFromAstContext(); 179 OutputFrameStateCombine StateCombineFromAstContext();
187 180
188 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); 181 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
189 DISALLOW_COPY_AND_ASSIGN(AstGraphBuilder); 182 DISALLOW_COPY_AND_ASSIGN(AstGraphBuilder);
190 }; 183 };
191 184
192 185
193 // The abstract execution environment for generated code consists of 186 // The abstract execution environment for generated code consists of
194 // parameter variables, local variables and the operand stack. The 187 // parameter variables, local variables and the operand stack. The
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 int index = static_cast<int>(values()->size()) - depth - 1; 251 int index = static_cast<int>(values()->size()) - depth - 1;
259 return values()->at(index); 252 return values()->at(index);
260 } 253 }
261 void Drop(int depth) { 254 void Drop(int depth) {
262 DCHECK(depth >= 0 && depth <= stack_height()); 255 DCHECK(depth >= 0 && depth <= stack_height());
263 values()->erase(values()->end() - depth, values()->end()); 256 values()->erase(values()->end() - depth, values()->end());
264 } 257 }
265 258
266 // Preserve a checkpoint of the environment for the IR graph. Any 259 // Preserve a checkpoint of the environment for the IR graph. Any
267 // further mutation of the environment will not affect checkpoints. 260 // further mutation of the environment will not affect checkpoints.
268 Node* Checkpoint(BailoutId ast_id); 261 Node* Checkpoint(BailoutId ast_id, OutputFrameStateCombine combine);
269 262
270 private: 263 private:
271 void UpdateStateValues(Node** state_values, int offset, int count); 264 void UpdateStateValues(Node** state_values, int offset, int count);
272 265
273 int parameters_count_; 266 int parameters_count_;
274 int locals_count_; 267 int locals_count_;
275 Node* parameters_node_; 268 Node* parameters_node_;
276 Node* locals_node_; 269 Node* locals_node_;
277 Node* stack_node_; 270 Node* stack_node_;
278 }; 271 };
279 272
280 273
281 // Each expression in the AST is evaluated in a specific context. This context 274 // Each expression in the AST is evaluated in a specific context. This context
282 // decides how the evaluation result is passed up the visitor. 275 // decides how the evaluation result is passed up the visitor.
283 class AstGraphBuilder::AstContext BASE_EMBEDDED { 276 class AstGraphBuilder::AstContext BASE_EMBEDDED {
284 public: 277 public:
285 bool IsEffect() const { return kind_ == Expression::kEffect; } 278 bool IsEffect() const { return kind_ == Expression::kEffect; }
286 bool IsValue() const { return kind_ == Expression::kValue; } 279 bool IsValue() const { return kind_ == Expression::kValue; }
287 bool IsTest() const { return kind_ == Expression::kTest; } 280 bool IsTest() const { return kind_ == Expression::kTest; }
288 281
289 // Determines how to combine the frame state with the value 282 // Determines how to combine the frame state with the value
290 // that is about to be plugged into this AstContext. 283 // that is about to be plugged into this AstContext.
291 AstGraphBuilder::OutputFrameStateCombine GetStateCombine() { 284 OutputFrameStateCombine GetStateCombine() {
292 return IsEffect() ? IGNORE_OUTPUT : PUSH_OUTPUT; 285 return IsEffect() ? kIgnoreOutput : kPushOutput;
293 } 286 }
294 287
295 // Plug a node into this expression context. Call this function in tail 288 // Plug a node into this expression context. Call this function in tail
296 // position in the Visit functions for expressions. 289 // position in the Visit functions for expressions.
297 virtual void ProduceValue(Node* value) = 0; 290 virtual void ProduceValue(Node* value) = 0;
298 291
299 // Unplugs a node from this expression context. Call this to retrieve the 292 // Unplugs a node from this expression context. Call this to retrieve the
300 // result of another Visit function that already plugged the context. 293 // result of another Visit function that already plugged the context.
301 virtual Node* ConsumeValue() = 0; 294 virtual Node* ConsumeValue() = 0;
302 295
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 }; 415 };
423 416
424 Scope* AstGraphBuilder::current_scope() const { 417 Scope* AstGraphBuilder::current_scope() const {
425 return execution_context_->scope(); 418 return execution_context_->scope();
426 } 419 }
427 } 420 }
428 } 421 }
429 } // namespace v8::internal::compiler 422 } // namespace v8::internal::compiler
430 423
431 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ 424 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_
OLDNEW
« no previous file with comments | « src/compiler/arm64/instruction-selector-arm64.cc ('k') | src/compiler/ast-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698