| 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/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/ast.h" | 10 #include "src/ast.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 Node* BuildHoleCheckSilent(Node* value, Node* for_hole, Node* not_hole); | 107 Node* BuildHoleCheckSilent(Node* value, Node* for_hole, Node* not_hole); |
| 108 Node* BuildHoleCheckThrow(Node* value, Variable* var, Node* not_hole, | 108 Node* BuildHoleCheckThrow(Node* value, Variable* var, Node* not_hole, |
| 109 BailoutId bailout_id); | 109 BailoutId bailout_id); |
| 110 | 110 |
| 111 // Builders for binary operations. | 111 // Builders for binary operations. |
| 112 Node* BuildBinaryOp(Node* left, Node* right, Token::Value op); | 112 Node* BuildBinaryOp(Node* left, Node* right, Token::Value op); |
| 113 | 113 |
| 114 // Builder for stack-check guards. | 114 // Builder for stack-check guards. |
| 115 Node* BuildStackCheck(); | 115 Node* BuildStackCheck(); |
| 116 | 116 |
| 117 bool IsOsrLoopEntry(IterationStatement* stmt); |
| 118 |
| 117 #define DECLARE_VISIT(type) void Visit##type(type* node) OVERRIDE; | 119 #define DECLARE_VISIT(type) void Visit##type(type* node) OVERRIDE; |
| 120 |
| 118 // Visiting functions for AST nodes make this an AstVisitor. | 121 // Visiting functions for AST nodes make this an AstVisitor. |
| 119 AST_NODE_LIST(DECLARE_VISIT) | 122 AST_NODE_LIST(DECLARE_VISIT) |
| 120 #undef DECLARE_VISIT | 123 #undef DECLARE_VISIT |
| 121 | 124 |
| 122 // Visiting function for declarations list is overridden. | 125 // Visiting function for declarations list is overridden. |
| 123 void VisitDeclarations(ZoneList<Declaration*>* declarations) OVERRIDE; | 126 void VisitDeclarations(ZoneList<Declaration*>* declarations) OVERRIDE; |
| 124 | 127 |
| 125 private: | 128 private: |
| 126 CompilationInfo* info_; | 129 CompilationInfo* info_; |
| 127 AstContext* ast_context_; | 130 AstContext* ast_context_; |
| 128 JSGraph* jsgraph_; | 131 JSGraph* jsgraph_; |
| 129 | 132 |
| 130 // List of global declarations for functions and variables. | 133 // List of global declarations for functions and variables. |
| 131 ZoneVector<Handle<Object>> globals_; | 134 ZoneVector<Handle<Object>> globals_; |
| 132 | 135 |
| 133 // Stack of breakable statements entered by the visitor. | 136 // Stack of breakable statements entered by the visitor. |
| 134 BreakableScope* breakable_; | 137 BreakableScope* breakable_; |
| 135 | 138 |
| 136 // Stack of context objects pushed onto the chain by the visitor. | 139 // Stack of context objects pushed onto the chain by the visitor. |
| 137 ContextScope* execution_context_; | 140 ContextScope* execution_context_; |
| 138 | 141 |
| 139 // Nodes representing values in the activation record. | 142 // Nodes representing values in the activation record. |
| 140 SetOncePointer<Node> function_closure_; | 143 SetOncePointer<Node> function_closure_; |
| 141 SetOncePointer<Node> function_context_; | 144 SetOncePointer<Node> function_context_; |
| 142 | 145 |
| 146 // The node representing the OSR entry into the loop, if any. |
| 147 SetOncePointer<Node> osr_loop_entry_; |
| 148 |
| 143 // Result of loop assignment analysis performed before graph creation. | 149 // Result of loop assignment analysis performed before graph creation. |
| 144 LoopAssignmentAnalysis* loop_assignment_analysis_; | 150 LoopAssignmentAnalysis* loop_assignment_analysis_; |
| 145 | 151 |
| 146 CompilationInfo* info() const { return info_; } | 152 CompilationInfo* info() const { return info_; } |
| 147 inline StrictMode strict_mode() const; | 153 inline StrictMode strict_mode() const; |
| 148 JSGraph* jsgraph() { return jsgraph_; } | 154 JSGraph* jsgraph() { return jsgraph_; } |
| 149 JSOperatorBuilder* javascript() { return jsgraph_->javascript(); } | 155 JSOperatorBuilder* javascript() { return jsgraph_->javascript(); } |
| 150 ZoneVector<Handle<Object>>* globals() { return &globals_; } | 156 ZoneVector<Handle<Object>>* globals() { return &globals_; } |
| 151 | 157 |
| 152 // Current scope during visitation. | 158 // Current scope during visitation. |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 | 448 |
| 443 Scope* AstGraphBuilder::current_scope() const { | 449 Scope* AstGraphBuilder::current_scope() const { |
| 444 return execution_context_->scope(); | 450 return execution_context_->scope(); |
| 445 } | 451 } |
| 446 | 452 |
| 447 } // namespace compiler | 453 } // namespace compiler |
| 448 } // namespace internal | 454 } // namespace internal |
| 449 } // namespace v8 | 455 } // namespace v8 |
| 450 | 456 |
| 451 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ | 457 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ |
| OLD | NEW |