Chromium Code Reviews

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

Issue 809333002: [turbofan] Implement OSR for outer loops. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
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 96 matching lines...)
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) virtual void Visit##type(type* node) OVERRIDE; 119 #define DECLARE_VISIT(type) virtual void Visit##type(type* node) OVERRIDE;
118 // Visiting functions for AST nodes make this an AstVisitor. 120 // Visiting functions for AST nodes make this an AstVisitor.
119 AST_NODE_LIST(DECLARE_VISIT) 121 AST_NODE_LIST(DECLARE_VISIT)
120 #undef DECLARE_VISIT 122 #undef DECLARE_VISIT
121 123
122 // Visiting function for declarations list is overridden. 124 // Visiting function for declarations list is overridden.
123 void VisitDeclarations(ZoneList<Declaration*>* declarations) OVERRIDE; 125 void VisitDeclarations(ZoneList<Declaration*>* declarations) OVERRIDE;
124 126
125 private: 127 private:
126 CompilationInfo* info_; 128 CompilationInfo* info_;
127 AstContext* ast_context_; 129 AstContext* ast_context_;
128 JSGraph* jsgraph_; 130 JSGraph* jsgraph_;
129 131
130 // List of global declarations for functions and variables. 132 // List of global declarations for functions and variables.
131 ZoneVector<Handle<Object>> globals_; 133 ZoneVector<Handle<Object>> globals_;
132 134
133 // Stack of breakable statements entered by the visitor. 135 // Stack of breakable statements entered by the visitor.
134 BreakableScope* breakable_; 136 BreakableScope* breakable_;
135 137
136 // Stack of context objects pushed onto the chain by the visitor. 138 // Stack of context objects pushed onto the chain by the visitor.
137 ContextScope* execution_context_; 139 ContextScope* execution_context_;
138 140
139 // Nodes representing values in the activation record. 141 // Nodes representing values in the activation record.
140 SetOncePointer<Node> function_closure_; 142 SetOncePointer<Node> function_closure_;
141 SetOncePointer<Node> function_context_; 143 SetOncePointer<Node> function_context_;
142 144
145 // The node representing the OSR entry into the loop, if any.
146 SetOncePointer<Node> osr_loop_entry_;
147
143 // Result of loop assignment analysis performed before graph creation. 148 // Result of loop assignment analysis performed before graph creation.
144 LoopAssignmentAnalysis* loop_assignment_analysis_; 149 LoopAssignmentAnalysis* loop_assignment_analysis_;
145 150
146 CompilationInfo* info() const { return info_; } 151 CompilationInfo* info() const { return info_; }
147 inline StrictMode strict_mode() const; 152 inline StrictMode strict_mode() const;
148 JSGraph* jsgraph() { return jsgraph_; } 153 JSGraph* jsgraph() { return jsgraph_; }
149 JSOperatorBuilder* javascript() { return jsgraph_->javascript(); } 154 JSOperatorBuilder* javascript() { return jsgraph_->javascript(); }
150 ZoneVector<Handle<Object>>* globals() { return &globals_; } 155 ZoneVector<Handle<Object>>* globals() { return &globals_; }
151 156
152 // Current scope during visitation. 157 // Current scope during visitation.
(...skipping 289 matching lines...)
442 447
443 Scope* AstGraphBuilder::current_scope() const { 448 Scope* AstGraphBuilder::current_scope() const {
444 return execution_context_->scope(); 449 return execution_context_->scope();
445 } 450 }
446 451
447 } // namespace compiler 452 } // namespace compiler
448 } // namespace internal 453 } // namespace internal
449 } // namespace v8 454 } // namespace v8
450 455
451 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ 456 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_
OLDNEW

Powered by Google App Engine