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_SHARED_H_ | 5 #ifndef VM_FLOW_GRAPH_COMPILER_SHARED_H_ |
6 #define VM_FLOW_GRAPH_COMPILER_SHARED_H_ | 6 #define VM_FLOW_GRAPH_COMPILER_SHARED_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/code_descriptors.h" | 10 #include "vm/code_descriptors.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 intptr_t argument_count, | 111 intptr_t argument_count, |
112 const Array& argument_names, | 112 const Array& argument_names, |
113 intptr_t checked_argument_count); | 113 intptr_t checked_argument_count); |
114 void GenerateStaticCall(intptr_t cid, | 114 void GenerateStaticCall(intptr_t cid, |
115 intptr_t token_index, | 115 intptr_t token_index, |
116 intptr_t try_index, | 116 intptr_t try_index, |
117 const Function& function, | 117 const Function& function, |
118 intptr_t argument_count, | 118 intptr_t argument_count, |
119 const Array& argument_names); | 119 const Array& argument_names); |
120 | 120 |
| 121 void GenerateNumberTypeCheck(Register kClassIdReg, |
| 122 const AbstractType& type, |
| 123 Label* is_instance_lbl, |
| 124 Label* is_not_instance_lbl); |
| 125 void GenerateStringTypeCheck(Register kClassIdReg, |
| 126 Label* is_instance_lbl, |
| 127 Label* is_not_instance_lbl); |
| 128 void GenerateListTypeCheck(Register kClassIdReg, |
| 129 Label* is_instance_lbl); |
| 130 |
121 void GenerateDeferredCode(); | 131 void GenerateDeferredCode(); |
122 | 132 |
123 | 133 |
124 // Returns 'true' if code generation for this function is complete, i.e., | 134 // Returns 'true' if code generation for this function is complete, i.e., |
125 // no fall-through to regular code is needed. | 135 // no fall-through to regular code is needed. |
126 bool TryIntrinsify(); | 136 bool TryIntrinsify(); |
127 virtual void GenerateInlinedGetter(intptr_t offset) = 0; | 137 virtual void GenerateInlinedGetter(intptr_t offset) = 0; |
128 virtual void GenerateInlinedSetter(intptr_t offset) = 0; | 138 virtual void GenerateInlinedSetter(intptr_t offset) = 0; |
129 // Returns pc-offset (in bytes) of the pc after the call, can be used to emit | 139 // Returns pc-offset (in bytes) of the pc after the call, can be used to emit |
130 // pc-descriptor information. | 140 // pc-descriptor information. |
131 virtual intptr_t EmitInstanceCall(ExternalLabel* target_label, | 141 virtual intptr_t EmitInstanceCall(ExternalLabel* target_label, |
132 const ICData& ic_data, | 142 const ICData& ic_data, |
133 const Array& arguments_descriptor, | 143 const Array& arguments_descriptor, |
134 intptr_t argument_count) = 0; | 144 intptr_t argument_count) = 0; |
135 // Returns pc-offset (in bytes) of the pc after the call, can be used to emit | 145 // Returns pc-offset (in bytes) of the pc after the call, can be used to emit |
136 // pc-descriptor information. | 146 // pc-descriptor information. |
137 virtual intptr_t EmitStaticCall(const Function& function, | 147 virtual intptr_t EmitStaticCall(const Function& function, |
138 const Array& arguments_descriptor, | 148 const Array& arguments_descriptor, |
139 intptr_t argument_count) = 0; | 149 intptr_t argument_count) = 0; |
| 150 virtual void CheckClassIds(Register class_id_reg, |
| 151 const GrowableArray<intptr_t>& class_ids, |
| 152 Label* is_equal_lbl, |
| 153 Label* is_not_equal_lbl) = 0; |
140 | 154 |
141 | 155 |
142 struct BlockInfo : public ZoneAllocated { | 156 struct BlockInfo : public ZoneAllocated { |
143 public: | 157 public: |
144 BlockInfo() : label() { } | 158 BlockInfo() : label() { } |
145 | 159 |
146 Label label; | 160 Label label; |
147 }; | 161 }; |
148 | 162 |
149 const GrowableArray<BlockInfo*>& block_info() const { return block_info_; } | 163 const GrowableArray<BlockInfo*>& block_info() const { return block_info_; } |
(...skipping 25 matching lines...) Expand all Loading... |
175 const bool is_optimizing_; | 189 const bool is_optimizing_; |
176 | 190 |
177 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompilerShared); | 191 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompilerShared); |
178 }; | 192 }; |
179 | 193 |
180 | 194 |
181 } // namespace dart | 195 } // namespace dart |
182 | 196 |
183 | 197 |
184 #endif // VM_FLOW_GRAPH_COMPILER_SHARED_H_ | 198 #endif // VM_FLOW_GRAPH_COMPILER_SHARED_H_ |
OLD | NEW |