OLD | NEW |
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/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/compiler/js-graph.h" | 9 #include "src/compiler/js-graph.h" |
10 #include "src/compiler/liveness-analyzer.h" | 10 #include "src/compiler/liveness-analyzer.h" |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 // The abstract execution environment for generated code consists of | 461 // The abstract execution environment for generated code consists of |
462 // parameter variables, local variables and the operand stack. The | 462 // parameter variables, local variables and the operand stack. The |
463 // environment will perform proper SSA-renaming of all tracked nodes | 463 // environment will perform proper SSA-renaming of all tracked nodes |
464 // at split and merge points in the control flow. Internally all the | 464 // at split and merge points in the control flow. Internally all the |
465 // values are stored in one list using the following layout: | 465 // values are stored in one list using the following layout: |
466 // | 466 // |
467 // [parameters (+receiver)] [locals] [operand stack] | 467 // [parameters (+receiver)] [locals] [operand stack] |
468 // | 468 // |
469 class AstGraphBuilder::Environment : public ZoneObject { | 469 class AstGraphBuilder::Environment : public ZoneObject { |
470 public: | 470 public: |
471 Environment(AstGraphBuilder* builder, DeclarationScope* scope, | 471 Environment(AstGraphBuilder* builder, Scope* scope, Node* control_dependency); |
472 Node* control_dependency); | |
473 | 472 |
474 int parameters_count() const { return parameters_count_; } | 473 int parameters_count() const { return parameters_count_; } |
475 int locals_count() const { return locals_count_; } | 474 int locals_count() const { return locals_count_; } |
476 int context_chain_length() { return static_cast<int>(contexts_.size()); } | 475 int context_chain_length() { return static_cast<int>(contexts_.size()); } |
477 int stack_height() { | 476 int stack_height() { |
478 return static_cast<int>(values()->size()) - parameters_count_ - | 477 return static_cast<int>(values()->size()) - parameters_count_ - |
479 locals_count_; | 478 locals_count_; |
480 } | 479 } |
481 | 480 |
482 // Operations on parameter or local variables. | 481 // Operations on parameter or local variables. |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 | 604 |
606 // Prepare environment to be used as loop header. | 605 // Prepare environment to be used as loop header. |
607 void PrepareForLoop(BitVector* assigned, bool is_osr = false); | 606 void PrepareForLoop(BitVector* assigned, bool is_osr = false); |
608 }; | 607 }; |
609 | 608 |
610 } // namespace compiler | 609 } // namespace compiler |
611 } // namespace internal | 610 } // namespace internal |
612 } // namespace v8 | 611 } // namespace v8 |
613 | 612 |
614 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ | 613 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ |
OLD | NEW |