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 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 Assembler* assembler() const { return assembler_; } | 44 Assembler* assembler() const { return assembler_; } |
45 | 45 |
46 Label* AddDeoptStub(intptr_t deopt_id, | 46 Label* AddDeoptStub(intptr_t deopt_id, |
47 intptr_t deopt_token_index, | 47 intptr_t deopt_token_index, |
48 intptr_t try_index_, | 48 intptr_t try_index_, |
49 DeoptReasonId reason, | 49 DeoptReasonId reason, |
50 Register reg1, | 50 Register reg1, |
51 Register reg2); | 51 Register reg2); |
52 | 52 |
| 53 bool is_optimizing() const { return is_optimizing_; } |
| 54 const ParsedFunction& parsed_function() const { return parsed_function_; } |
53 | 55 |
54 void GenerateCallRuntime(intptr_t cid, | 56 void GenerateCallRuntime(intptr_t cid, |
55 intptr_t token_index, | 57 intptr_t token_index, |
56 intptr_t try_index, | 58 intptr_t try_index, |
57 const RuntimeEntry& entry); | 59 const RuntimeEntry& entry); |
| 60 void AddCurrentDescriptor(PcDescriptors::Kind kind, |
| 61 intptr_t cid, |
| 62 intptr_t token_index, |
| 63 intptr_t try_index); |
58 | 64 |
59 // Returns true if the next block after current in the current block order | 65 // Returns true if the next block after current in the current block order |
60 // is the given block. | 66 // is the given block. |
61 bool IsNextBlock(TargetEntryInstr* block_entry) const { | 67 bool IsNextBlock(TargetEntryInstr* block_entry) const { |
62 intptr_t current_index = reverse_index(current_block()->postorder_number()); | 68 intptr_t current_index = reverse_index(current_block()->postorder_number()); |
63 return block_order_[current_index + 1] == block_entry; | 69 return block_order_[current_index + 1] == block_entry; |
64 } | 70 } |
65 | 71 |
66 // Returns assembler label associated with the given block entry. | 72 // Returns assembler label associated with the given block entry. |
67 Label* GetBlockLabel(TargetEntryInstr* block_entry) const { | 73 Label* GetBlockLabel(TargetEntryInstr* block_entry) const { |
(...skipping 18 matching lines...) Expand all Loading... |
86 | 92 |
87 struct BlockInfo : public ZoneAllocated { | 93 struct BlockInfo : public ZoneAllocated { |
88 public: | 94 public: |
89 BlockInfo() : label() { } | 95 BlockInfo() : label() { } |
90 | 96 |
91 Label label; | 97 Label label; |
92 }; | 98 }; |
93 | 99 |
94 BlockEntryInstr* current_block() const { return current_block_; } | 100 BlockEntryInstr* current_block() const { return current_block_; } |
95 | 101 |
96 bool is_optimizing() const { return is_optimizing_; } | |
97 | |
98 // Bail out of the flow graph compiler. Does not return to the caller. | 102 // Bail out of the flow graph compiler. Does not return to the caller. |
99 void Bailout(const char* reason); | 103 void Bailout(const char* reason); |
100 | 104 |
101 virtual void VisitBlocks(); | 105 virtual void VisitBlocks(); |
102 | 106 |
103 // Emit code to perform a computation, leaving its value in RAX. | 107 // Emit code to perform a computation, leaving its value in RAX. |
104 #define DECLARE_VISIT_COMPUTATION(ShortName, ClassName) \ | 108 #define DECLARE_VISIT_COMPUTATION(ShortName, ClassName) \ |
105 virtual void Visit##ShortName(ClassName* comp); | 109 virtual void Visit##ShortName(ClassName* comp); |
106 | 110 |
107 // Each visit function compiles a type of instruction. | 111 // Each visit function compiles a type of instruction. |
(...skipping 27 matching lines...) Expand all Loading... |
135 intptr_t try_index, | 139 intptr_t try_index, |
136 const Function& function, | 140 const Function& function, |
137 intptr_t argument_count, | 141 intptr_t argument_count, |
138 const Array& argument_names); | 142 const Array& argument_names); |
139 | 143 |
140 // Infrastructure copied from class CodeGenerator. | 144 // Infrastructure copied from class CodeGenerator. |
141 void GenerateCall(intptr_t token_index, | 145 void GenerateCall(intptr_t token_index, |
142 intptr_t try_index, | 146 intptr_t try_index, |
143 const ExternalLabel* label, | 147 const ExternalLabel* label, |
144 PcDescriptors::Kind kind); | 148 PcDescriptors::Kind kind); |
145 void AddCurrentDescriptor(PcDescriptors::Kind kind, | |
146 intptr_t cid, | |
147 intptr_t token_index, | |
148 intptr_t try_index); | |
149 | 149 |
150 // Type checking helper methods. | 150 // Type checking helper methods. |
151 void CheckClassIds(const GrowableArray<intptr_t>& class_ids, | 151 void CheckClassIds(const GrowableArray<intptr_t>& class_ids, |
152 Label* is_instance_lbl, | 152 Label* is_instance_lbl, |
153 Label* is_not_instance_lbl); | 153 Label* is_not_instance_lbl); |
154 RawSubtypeTestCache* GenerateInlineInstanceof(intptr_t cid, | 154 RawSubtypeTestCache* GenerateInlineInstanceof(intptr_t cid, |
155 intptr_t token_index, | 155 intptr_t token_index, |
156 const AbstractType& type, | 156 const AbstractType& type, |
157 Label* is_instance, | 157 Label* is_instance, |
158 Label* is_not_instance); | 158 Label* is_not_instance); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 ExceptionHandlerList* exception_handlers_list_; | 220 ExceptionHandlerList* exception_handlers_list_; |
221 GrowableArray<DeoptimizationStub*> deopt_stubs_; | 221 GrowableArray<DeoptimizationStub*> deopt_stubs_; |
222 const bool is_optimizing_; | 222 const bool is_optimizing_; |
223 | 223 |
224 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); | 224 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); |
225 }; | 225 }; |
226 | 226 |
227 } // namespace dart | 227 } // namespace dart |
228 | 228 |
229 #endif // VM_FLOW_GRAPH_COMPILER_X64_H_ | 229 #endif // VM_FLOW_GRAPH_COMPILER_X64_H_ |
OLD | NEW |