OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_CODE_GENERATOR_IA32_H_ | 5 #ifndef VM_CODE_GENERATOR_IA32_H_ |
6 #define VM_CODE_GENERATOR_IA32_H_ | 6 #define VM_CODE_GENERATOR_IA32_H_ |
7 | 7 |
8 #ifndef VM_CODE_GENERATOR_H_ | 8 #ifndef VM_CODE_GENERATOR_H_ |
9 #error Do not include code_generator_ia32.h directly; use code_generator.h. | 9 #error Do not include code_generator_ia32.h directly; use code_generator.h. |
10 #endif | 10 #endif |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 CodeGenerator(Assembler* assembler, const ParsedFunction& parsed_function); | 70 CodeGenerator(Assembler* assembler, const ParsedFunction& parsed_function); |
71 virtual ~CodeGenerator() { } | 71 virtual ~CodeGenerator() { } |
72 | 72 |
73 // Accessors. | 73 // Accessors. |
74 Assembler* assembler() const { return assembler_; } | 74 Assembler* assembler() const { return assembler_; } |
75 | 75 |
76 const ParsedFunction& parsed_function() const { return parsed_function_; } | 76 const ParsedFunction& parsed_function() const { return parsed_function_; } |
77 | 77 |
78 void GenerateCode(); | 78 void GenerateCode(); |
79 virtual void GenerateDeferredCode(); | 79 virtual void GenerateDeferredCode(); |
80 virtual void InitGenerator(); | |
regis
2012/05/08 21:26:41
Add comment explaining why you factorize this init
srdjan
2012/05/08 21:43:18
// Constructor is lighweight, major initialization
| |
80 | 81 |
81 #define DEFINE_VISITOR_FUNCTION(type, name) \ | 82 #define DEFINE_VISITOR_FUNCTION(type, name) \ |
82 virtual void Visit##type(type* node); | 83 virtual void Visit##type(type* node); |
83 NODE_LIST(DEFINE_VISITOR_FUNCTION) | 84 NODE_LIST(DEFINE_VISITOR_FUNCTION) |
84 #undef DEFINE_VISITOR_FUNCTION | 85 #undef DEFINE_VISITOR_FUNCTION |
85 | 86 |
86 CodeGeneratorState* state() const { return state_; } | 87 CodeGeneratorState* state() const { return state_; } |
87 void set_state(CodeGeneratorState* state) { state_ = state; } | 88 void set_state(CodeGeneratorState* state) { state_ = state; } |
88 | 89 |
89 // Add exception handler table to code. | 90 // Add exception handler table to code. |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
256 // The runtime context level is only incremented when a new context is | 257 // The runtime context level is only incremented when a new context is |
257 // allocated and chained to the list of contexts. | 258 // allocated and chained to the list of contexts. |
258 intptr_t context_level_; | 259 intptr_t context_level_; |
259 | 260 |
260 DISALLOW_IMPLICIT_CONSTRUCTORS(CodeGenerator); | 261 DISALLOW_IMPLICIT_CONSTRUCTORS(CodeGenerator); |
261 }; | 262 }; |
262 | 263 |
263 } // namespace dart | 264 } // namespace dart |
264 | 265 |
265 #endif // VM_CODE_GENERATOR_IA32_H_ | 266 #endif // VM_CODE_GENERATOR_IA32_H_ |
OLD | NEW |