| 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_FLOW_GRAPH_COMPILER_X64_H_ | 5 #ifndef VM_FLOW_GRAPH_COMPILER_X64_H_ |
| 6 #define VM_FLOW_GRAPH_COMPILER_X64_H_ | 6 #define VM_FLOW_GRAPH_COMPILER_X64_H_ |
| 7 | 7 |
| 8 #ifndef VM_FLOW_GRAPH_COMPILER_H_ | 8 #ifndef VM_FLOW_GRAPH_COMPILER_H_ |
| 9 #error Include flow_graph_compiler.h instead of flow_graph_compiler_x64.h. | 9 #error Include flow_graph_compiler.h instead of flow_graph_compiler_x64.h. |
| 10 #endif | 10 #endif |
| 11 | 11 |
| 12 #include "vm/assembler.h" | 12 #include "vm/assembler.h" |
| 13 #include "vm/assembler_macros.h" |
| 13 #include "vm/code_descriptors.h" | 14 #include "vm/code_descriptors.h" |
| 14 #include "vm/code_generator.h" | 15 #include "vm/code_generator.h" |
| 15 #include "vm/intermediate_language.h" | 16 #include "vm/intermediate_language.h" |
| 16 | 17 |
| 17 namespace dart { | 18 namespace dart { |
| 18 | 19 |
| 19 class Code; | 20 class Code; |
| 20 class ExceptionHandlerList; | 21 class ExceptionHandlerList; |
| 21 template <typename T> class GrowableArray; | 22 template <typename T> class GrowableArray; |
| 22 class ParsedFunction; | 23 class ParsedFunction; |
| 23 | 24 |
| 24 class FlowGraphCompiler : public FlowGraphVisitor { | 25 class FlowGraphCompiler : public FlowGraphVisitor { |
| 25 public: | 26 public: |
| 26 FlowGraphCompiler(Assembler* assembler, | 27 FlowGraphCompiler(Assembler* assembler, |
| 27 const ParsedFunction& parsed_function, | 28 const ParsedFunction& parsed_function, |
| 28 const GrowableArray<BlockEntryInstr*>& block_order, | 29 const GrowableArray<BlockEntryInstr*>& block_order, |
| 29 bool is_optimizing); | 30 bool is_optimizing); |
| 30 | 31 |
| 31 virtual ~FlowGraphCompiler(); | 32 virtual ~FlowGraphCompiler(); |
| 32 | 33 |
| 33 void CompileGraph(); | 34 void CompileGraph(); |
| 34 | 35 |
| 35 // Infrastructure copied from class CodeGenerator or stubbed out. | 36 // Infrastructure copied from class CodeGenerator or stubbed out. |
| 36 void FinalizePcDescriptors(const Code& code); | 37 void FinalizePcDescriptors(const Code& code); |
| 37 void FinalizeStackmaps(const Code& code); | 38 void FinalizeStackmaps(const Code& code); |
| 38 void FinalizeVarDescriptors(const Code& code); | 39 void FinalizeVarDescriptors(const Code& code); |
| 39 void FinalizeExceptionHandlers(const Code& code); | 40 void FinalizeExceptionHandlers(const Code& code); |
| 40 | 41 |
| 41 private: | 42 private: |
| 43 static const int kLocalsOffsetFromFP = (-1 * kWordSize); |
| 44 |
| 42 // Constructor is lighweight, major initialization work should occur here. | 45 // Constructor is lighweight, major initialization work should occur here. |
| 43 // This makes it easier to measure time spent in the compiler. | 46 // This makes it easier to measure time spent in the compiler. |
| 44 void InitCompiler(); | 47 void InitCompiler(); |
| 45 | 48 |
| 46 struct BlockInfo : public ZoneAllocated { | 49 struct BlockInfo : public ZoneAllocated { |
| 47 public: | 50 public: |
| 48 BlockInfo() : label() { } | 51 BlockInfo() : label() { } |
| 49 | 52 |
| 50 Label label; | 53 Label label; |
| 51 }; | 54 }; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 DescriptorList* pc_descriptors_list_; | 145 DescriptorList* pc_descriptors_list_; |
| 143 ExceptionHandlerList* exception_handlers_list_; | 146 ExceptionHandlerList* exception_handlers_list_; |
| 144 const bool is_optimizing_; | 147 const bool is_optimizing_; |
| 145 | 148 |
| 146 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); | 149 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); |
| 147 }; | 150 }; |
| 148 | 151 |
| 149 } // namespace dart | 152 } // namespace dart |
| 150 | 153 |
| 151 #endif // VM_FLOW_GRAPH_COMPILER_X64_H_ | 154 #endif // VM_FLOW_GRAPH_COMPILER_X64_H_ |
| OLD | NEW |