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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
45 } | 45 } |
46 | 46 |
47 AstContext* ast_context() const { return ast_context_; } | 47 AstContext* ast_context() const { return ast_context_; } |
48 BreakableScope* breakable() const { return breakable_; } | 48 BreakableScope* breakable() const { return breakable_; } |
49 ContextScope* execution_context() const { return execution_context_; } | 49 ContextScope* execution_context() const { return execution_context_; } |
50 | 50 |
51 void set_ast_context(AstContext* ctx) { ast_context_ = ctx; } | 51 void set_ast_context(AstContext* ctx) { ast_context_ = ctx; } |
52 void set_breakable(BreakableScope* brk) { breakable_ = brk; } | 52 void set_breakable(BreakableScope* brk) { breakable_ = brk; } |
53 void set_execution_context(ContextScope* ctx) { execution_context_ = ctx; } | 53 void set_execution_context(ContextScope* ctx) { execution_context_ = ctx; } |
54 | 54 |
55 LoadICFeedbackNode LoadNamedFeedback(int slot) const { | |
Michael Starzinger
2014/10/08 15:23:09
As discussed offline: Haveing to deal with IC-rela
mvstanton
2014/10/10 08:26:16
Done.
| |
56 return LoadICFeedbackNode(vector_, slot); | |
57 } | |
58 | |
59 KeyedLoadICFeedbackNode LoadPropertyFeedback(int slot) const { | |
60 return KeyedLoadICFeedbackNode(vector_, slot); | |
61 } | |
62 | |
55 // Support for control flow builders. The concrete type of the environment | 63 // Support for control flow builders. The concrete type of the environment |
56 // depends on the graph builder, but environments themselves are not virtual. | 64 // depends on the graph builder, but environments themselves are not virtual. |
57 typedef StructuredGraphBuilder::Environment BaseEnvironment; | 65 typedef StructuredGraphBuilder::Environment BaseEnvironment; |
58 virtual BaseEnvironment* CopyEnvironment(BaseEnvironment* env); | 66 virtual BaseEnvironment* CopyEnvironment(BaseEnvironment* env); |
59 | 67 |
60 // TODO(mstarzinger): The pipeline only needs to be a friend to access the | 68 // TODO(mstarzinger): The pipeline only needs to be a friend to access the |
61 // function context. Remove as soon as the context is a parameter. | 69 // function context. Remove as soon as the context is a parameter. |
62 friend class Pipeline; | 70 friend class Pipeline; |
63 | 71 |
64 // Getters for values in the activation record. | 72 // Getters for values in the activation record. |
(...skipping 10 matching lines...) Expand all Loading... | |
75 Node* BuildLocalFunctionContext(Node* context, Node* closure); | 83 Node* BuildLocalFunctionContext(Node* context, Node* closure); |
76 | 84 |
77 // Builder to create an arguments object if it is used. | 85 // Builder to create an arguments object if it is used. |
78 Node* BuildArgumentsObject(Variable* arguments); | 86 Node* BuildArgumentsObject(Variable* arguments); |
79 | 87 |
80 // Builders for variable load and assignment. | 88 // Builders for variable load and assignment. |
81 Node* BuildVariableAssignment(Variable* var, Node* value, Token::Value op, | 89 Node* BuildVariableAssignment(Variable* var, Node* value, Token::Value op, |
82 BailoutId bailout_id); | 90 BailoutId bailout_id); |
83 Node* BuildVariableDelete(Variable* var, BailoutId bailout_id, | 91 Node* BuildVariableDelete(Variable* var, BailoutId bailout_id, |
84 OutputFrameStateCombine state_combine); | 92 OutputFrameStateCombine state_combine); |
85 Node* BuildVariableLoad(Variable* var, BailoutId bailout_id, | 93 Node* BuildVariableLoad(VariableProxy* proxy, BailoutId bailout_id, |
Michael Starzinger
2014/10/08 15:23:09
Either all the BuildVariableFoo helpers should wor
mvstanton
2014/10/10 08:26:16
Done.
| |
86 ContextualMode mode = CONTEXTUAL); | 94 ContextualMode mode = CONTEXTUAL); |
87 | 95 |
88 // Builders for accessing the function context. | 96 // Builders for accessing the function context. |
89 Node* BuildLoadBuiltinsObject(); | 97 Node* BuildLoadBuiltinsObject(); |
90 Node* BuildLoadGlobalObject(); | 98 Node* BuildLoadGlobalObject(); |
91 Node* BuildLoadClosure(); | 99 Node* BuildLoadClosure(); |
92 Node* BuildLoadObjectField(Node* object, int offset); | 100 Node* BuildLoadObjectField(Node* object, int offset); |
93 | 101 |
94 // Builders for automatic type conversion. | 102 // Builders for automatic type conversion. |
95 Node* BuildToBoolean(Node* value); | 103 Node* BuildToBoolean(Node* value); |
(...skipping 15 matching lines...) Expand all Loading... | |
111 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); | 119 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); |
112 // Visiting functions for AST nodes make this an AstVisitor. | 120 // Visiting functions for AST nodes make this an AstVisitor. |
113 AST_NODE_LIST(DECLARE_VISIT) | 121 AST_NODE_LIST(DECLARE_VISIT) |
114 #undef DECLARE_VISIT | 122 #undef DECLARE_VISIT |
115 | 123 |
116 // Visiting function for declarations list is overridden. | 124 // Visiting function for declarations list is overridden. |
117 virtual void VisitDeclarations(ZoneList<Declaration*>* declarations); | 125 virtual void VisitDeclarations(ZoneList<Declaration*>* declarations); |
118 | 126 |
119 private: | 127 private: |
120 CompilationInfo* info_; | 128 CompilationInfo* info_; |
129 Handle<TypeFeedbackVector> vector_; | |
Michael Starzinger
2014/10/08 15:23:09
nit: Let's not start caching handles yet, this see
mvstanton
2014/10/10 08:26:16
Done.
| |
121 AstContext* ast_context_; | 130 AstContext* ast_context_; |
122 JSGraph* jsgraph_; | 131 JSGraph* jsgraph_; |
123 | 132 |
124 // List of global declarations for functions and variables. | 133 // List of global declarations for functions and variables. |
125 ZoneList<Handle<Object> > globals_; | 134 ZoneList<Handle<Object> > globals_; |
126 | 135 |
127 // Stack of breakable statements entered by the visitor. | 136 // Stack of breakable statements entered by the visitor. |
128 BreakableScope* breakable_; | 137 BreakableScope* breakable_; |
129 | 138 |
130 // Stack of context objects pushed onto the chain by the visitor. | 139 // Stack of context objects pushed onto the chain by the visitor. |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
428 }; | 437 }; |
429 | 438 |
430 Scope* AstGraphBuilder::current_scope() const { | 439 Scope* AstGraphBuilder::current_scope() const { |
431 return execution_context_->scope(); | 440 return execution_context_->scope(); |
432 } | 441 } |
433 } | 442 } |
434 } | 443 } |
435 } // namespace v8::internal::compiler | 444 } // namespace v8::internal::compiler |
436 | 445 |
437 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ | 446 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ |
OLD | NEW |