| 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 |
| 11 | 11 |
| 12 #include "vm/assembler.h" | 12 #include "vm/assembler.h" |
| 13 #include "vm/ast.h" | 13 #include "vm/ast.h" |
| 14 #include "vm/growable_array.h" | 14 #include "vm/growable_array.h" |
| 15 #include "vm/parser.h" | 15 #include "vm/parser.h" |
| 16 | 16 |
| 17 namespace dart { | 17 namespace dart { |
| 18 | 18 |
| 19 // Forward declarations. | 19 // Forward declarations. |
| 20 class Assembler; | 20 class Assembler; |
| 21 class AstNode; | 21 class AstNode; |
| 22 class CodeGenerator; | 22 class CodeGenerator; |
| 23 class DescriptorList; | 23 class DescriptorList; |
| 24 class ExceptionHandlerList; |
| 24 class SourceLabel; | 25 class SourceLabel; |
| 25 class StackmapBuilder; | 26 class StackmapBuilder; |
| 26 | 27 |
| 27 | 28 |
| 28 class CodeGeneratorState : public StackResource { | 29 class CodeGeneratorState : public StackResource { |
| 29 public: | 30 public: |
| 30 explicit CodeGeneratorState(CodeGenerator* codegen); | 31 explicit CodeGeneratorState(CodeGenerator* codegen); |
| 31 virtual ~CodeGeneratorState(); | 32 virtual ~CodeGeneratorState(); |
| 32 | 33 |
| 33 CodeGeneratorState* parent() const { return parent_; } | 34 CodeGeneratorState* parent() const { return parent_; } |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 void GenerateReturnEpilog(ReturnNode* node); | 113 void GenerateReturnEpilog(ReturnNode* node); |
| 113 | 114 |
| 114 // Return true if the VM may optimize functions. | 115 // Return true if the VM may optimize functions. |
| 115 static bool CanOptimize(); | 116 static bool CanOptimize(); |
| 116 | 117 |
| 117 private: | 118 private: |
| 118 // TODO(srdjan): Remove the friendship once the two compilers are properly | 119 // TODO(srdjan): Remove the friendship once the two compilers are properly |
| 119 // structured. | 120 // structured. |
| 120 friend class OptimizingCodeGenerator; | 121 friend class OptimizingCodeGenerator; |
| 121 | 122 |
| 122 // Forward declarations. | |
| 123 class HandlerList; | |
| 124 | |
| 125 // Return true if intrinsification succeeded and no more code is needed. | 123 // Return true if intrinsification succeeded and no more code is needed. |
| 126 // Returns false if either no intrinsification occured or if intrinsified | 124 // Returns false if either no intrinsification occured or if intrinsified |
| 127 // code needs the rest for slow case execution. | 125 // code needs the rest for slow case execution. |
| 128 bool TryIntrinsify(); | 126 bool TryIntrinsify(); |
| 129 | 127 |
| 130 void IntrinsifyGetter(); | 128 void IntrinsifyGetter(); |
| 131 void IntrinsifySetter(); | 129 void IntrinsifySetter(); |
| 132 | 130 |
| 133 virtual void GeneratePreEntryCode(); | 131 virtual void GeneratePreEntryCode(); |
| 134 void GenerateLegacyEntryCode(); | 132 void GenerateLegacyEntryCode(); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 | 211 |
| 214 void set_context_level(intptr_t value) { context_level_ = value; } | 212 void set_context_level(intptr_t value) { context_level_ = value; } |
| 215 intptr_t context_level() const { return context_level_; } | 213 intptr_t context_level() const { return context_level_; } |
| 216 | 214 |
| 217 Assembler* assembler_; | 215 Assembler* assembler_; |
| 218 const ParsedFunction& parsed_function_; | 216 const ParsedFunction& parsed_function_; |
| 219 intptr_t locals_space_size_; | 217 intptr_t locals_space_size_; |
| 220 CodeGeneratorState* state_; | 218 CodeGeneratorState* state_; |
| 221 DescriptorList* pc_descriptors_list_; | 219 DescriptorList* pc_descriptors_list_; |
| 222 StackmapBuilder* stackmap_builder_; | 220 StackmapBuilder* stackmap_builder_; |
| 223 HandlerList* exception_handlers_list_; | 221 ExceptionHandlerList* exception_handlers_list_; |
| 224 int try_index_; | 222 int try_index_; |
| 225 // The runtime context level is only incremented when a new context is | 223 // The runtime context level is only incremented when a new context is |
| 226 // allocated and chained to the list of contexts. | 224 // allocated and chained to the list of contexts. |
| 227 intptr_t context_level_; | 225 intptr_t context_level_; |
| 228 | 226 |
| 229 DISALLOW_IMPLICIT_CONSTRUCTORS(CodeGenerator); | 227 DISALLOW_IMPLICIT_CONSTRUCTORS(CodeGenerator); |
| 230 }; | 228 }; |
| 231 | 229 |
| 232 } // namespace dart | 230 } // namespace dart |
| 233 | 231 |
| 234 #endif // VM_CODE_GENERATOR_IA32_H_ | 232 #endif // VM_CODE_GENERATOR_IA32_H_ |
| OLD | NEW |