Chromium Code Reviews| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 BreakableScope* breakable() const { return breakable_; } | 49 BreakableScope* breakable() const { return breakable_; } |
| 50 ContextScope* execution_context() const { return execution_context_; } | 50 ContextScope* execution_context() const { return execution_context_; } |
| 51 | 51 |
| 52 void set_ast_context(AstContext* ctx) { ast_context_ = ctx; } | 52 void set_ast_context(AstContext* ctx) { ast_context_ = ctx; } |
| 53 void set_breakable(BreakableScope* brk) { breakable_ = brk; } | 53 void set_breakable(BreakableScope* brk) { breakable_ = brk; } |
| 54 void set_execution_context(ContextScope* ctx) { execution_context_ = ctx; } | 54 void set_execution_context(ContextScope* ctx) { execution_context_ = ctx; } |
| 55 | 55 |
| 56 // Support for control flow builders. The concrete type of the environment | 56 // Support for control flow builders. The concrete type of the environment |
| 57 // depends on the graph builder, but environments themselves are not virtual. | 57 // depends on the graph builder, but environments themselves are not virtual. |
| 58 typedef StructuredGraphBuilder::Environment BaseEnvironment; | 58 typedef StructuredGraphBuilder::Environment BaseEnvironment; |
| 59 virtual BaseEnvironment* CopyEnvironment(BaseEnvironment* env); | 59 virtual BaseEnvironment* CopyEnvironment(BaseEnvironment* env) OVERRIDE; |
| 60 | 60 |
| 61 // TODO(mstarzinger): The pipeline only needs to be a friend to access the | 61 // TODO(mstarzinger): The pipeline only needs to be a friend to access the |
| 62 // function context. Remove as soon as the context is a parameter. | 62 // function context. Remove as soon as the context is a parameter. |
| 63 friend class Pipeline; | 63 friend class Pipeline; |
| 64 | 64 |
| 65 // Getters for values in the activation record. | 65 // Getters for values in the activation record. |
| 66 Node* GetFunctionClosure(); | 66 Node* GetFunctionClosure(); |
| 67 Node* GetFunctionContext(); | 67 Node* GetFunctionContext(); |
| 68 | 68 |
| 69 // | 69 // |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 103 Node* BuildHoleCheckSilent(Node* value, Node* for_hole, Node* not_hole); | 103 Node* BuildHoleCheckSilent(Node* value, Node* for_hole, Node* not_hole); |
| 104 Node* BuildHoleCheckThrow(Node* value, Variable* var, Node* not_hole, | 104 Node* BuildHoleCheckThrow(Node* value, Variable* var, Node* not_hole, |
| 105 BailoutId bailout_id); | 105 BailoutId bailout_id); |
| 106 | 106 |
| 107 // Builders for binary operations. | 107 // Builders for binary operations. |
| 108 Node* BuildBinaryOp(Node* left, Node* right, Token::Value op); | 108 Node* BuildBinaryOp(Node* left, Node* right, Token::Value op); |
| 109 | 109 |
| 110 // Builder for stack-check guards. | 110 // Builder for stack-check guards. |
| 111 Node* BuildStackCheck(); | 111 Node* BuildStackCheck(); |
| 112 | 112 |
| 113 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); | 113 #define DECLARE_VISIT(type) virtual void Visit##type(type* node) OVERRIDE; |
| 114 // Visiting functions for AST nodes make this an AstVisitor. | 114 // Visiting functions for AST nodes make this an AstVisitor. |
| 115 AST_NODE_LIST(DECLARE_VISIT) | 115 AST_NODE_LIST(DECLARE_VISIT) |
| 116 #undef DECLARE_VISIT | 116 #undef DECLARE_VISIT |
| 117 | 117 |
| 118 // Visiting function for declarations list is overridden. | 118 // Visiting function for declarations list is overridden. |
| 119 virtual void VisitDeclarations(ZoneList<Declaration*>* declarations); | 119 virtual void VisitDeclarations(ZoneList<Declaration*>* declarations); |
|
Jakob Kummerow
2014/10/29 10:17:45
Why don't we need OVERRIDE here? Oversight?
Nico
2014/10/29 15:43:39
Yes, oversight. https://code.google.com/p/v8/issue
| |
| 120 | 120 |
| 121 private: | 121 private: |
| 122 CompilationInfo* info_; | 122 CompilationInfo* info_; |
| 123 AstContext* ast_context_; | 123 AstContext* ast_context_; |
| 124 JSGraph* jsgraph_; | 124 JSGraph* jsgraph_; |
| 125 | 125 |
| 126 // List of global declarations for functions and variables. | 126 // List of global declarations for functions and variables. |
| 127 ZoneList<Handle<Object> > globals_; | 127 ZoneList<Handle<Object> > globals_; |
| 128 | 128 |
| 129 // Stack of breakable statements entered by the visitor. | 129 // Stack of breakable statements entered by the visitor. |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 437 }; | 437 }; |
| 438 | 438 |
| 439 Scope* AstGraphBuilder::current_scope() const { | 439 Scope* AstGraphBuilder::current_scope() const { |
| 440 return execution_context_->scope(); | 440 return execution_context_->scope(); |
| 441 } | 441 } |
| 442 } | 442 } |
| 443 } | 443 } |
| 444 } // namespace v8::internal::compiler | 444 } // namespace v8::internal::compiler |
| 445 | 445 |
| 446 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ | 446 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ |
| OLD | NEW |