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 // Constructor is lighweight, major initialization work should occur here. |
| 81 // This makes it easier to measure time spent in the code generator. |
| 82 virtual void InitGenerator(); |
80 | 83 |
81 #define DEFINE_VISITOR_FUNCTION(type, name) \ | 84 #define DEFINE_VISITOR_FUNCTION(type, name) \ |
82 virtual void Visit##type(type* node); | 85 virtual void Visit##type(type* node); |
83 NODE_LIST(DEFINE_VISITOR_FUNCTION) | 86 NODE_LIST(DEFINE_VISITOR_FUNCTION) |
84 #undef DEFINE_VISITOR_FUNCTION | 87 #undef DEFINE_VISITOR_FUNCTION |
85 | 88 |
86 CodeGeneratorState* state() const { return state_; } | 89 CodeGeneratorState* state() const { return state_; } |
87 void set_state(CodeGeneratorState* state) { state_ = state; } | 90 void set_state(CodeGeneratorState* state) { state_ = state; } |
88 | 91 |
89 // Add exception handler table to code. | 92 // 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 | 259 // The runtime context level is only incremented when a new context is |
257 // allocated and chained to the list of contexts. | 260 // allocated and chained to the list of contexts. |
258 intptr_t context_level_; | 261 intptr_t context_level_; |
259 | 262 |
260 DISALLOW_IMPLICIT_CONSTRUCTORS(CodeGenerator); | 263 DISALLOW_IMPLICIT_CONSTRUCTORS(CodeGenerator); |
261 }; | 264 }; |
262 | 265 |
263 } // namespace dart | 266 } // namespace dart |
264 | 267 |
265 #endif // VM_CODE_GENERATOR_IA32_H_ | 268 #endif // VM_CODE_GENERATOR_IA32_H_ |
OLD | NEW |