OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_H_ | 5 #ifndef VM_FLOW_GRAPH_H_ |
6 #define VM_FLOW_GRAPH_H_ | 6 #define VM_FLOW_GRAPH_H_ |
7 | 7 |
8 #include "vm/bit_vector.h" | 8 #include "vm/bit_vector.h" |
9 #include "vm/growable_array.h" | 9 #include "vm/growable_array.h" |
10 #include "vm/hash_map.h" | 10 #include "vm/hash_map.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 152 |
153 intptr_t current_ssa_temp_index() const { return current_ssa_temp_index_; } | 153 intptr_t current_ssa_temp_index() const { return current_ssa_temp_index_; } |
154 void set_current_ssa_temp_index(intptr_t index) { | 154 void set_current_ssa_temp_index(intptr_t index) { |
155 current_ssa_temp_index_ = index; | 155 current_ssa_temp_index_ = index; |
156 } | 156 } |
157 | 157 |
158 intptr_t max_virtual_register_number() const { | 158 intptr_t max_virtual_register_number() const { |
159 return current_ssa_temp_index(); | 159 return current_ssa_temp_index(); |
160 } | 160 } |
161 | 161 |
| 162 bool InstanceCallNeedsClassCheck(InstanceCallInstr* call, |
| 163 RawFunction::Kind kind) const; |
| 164 |
162 Thread* thread() const { return thread_; } | 165 Thread* thread() const { return thread_; } |
163 Zone* zone() const { return thread()->zone(); } | 166 Zone* zone() const { return thread()->zone(); } |
164 Isolate* isolate() const { return thread()->isolate(); } | 167 Isolate* isolate() const { return thread()->isolate(); } |
165 | 168 |
166 intptr_t max_block_id() const { return max_block_id_; } | 169 intptr_t max_block_id() const { return max_block_id_; } |
167 void set_max_block_id(intptr_t id) { max_block_id_ = id; } | 170 void set_max_block_id(intptr_t id) { max_block_id_ = id; } |
168 intptr_t allocate_block_id() { return ++max_block_id_; } | 171 intptr_t allocate_block_id() { return ++max_block_id_; } |
169 | 172 |
170 GraphEntryInstr* graph_entry() const { | 173 GraphEntryInstr* graph_entry() const { |
171 return graph_entry_; | 174 return graph_entry_; |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 BitVector* FindLoop(BlockEntryInstr* m, BlockEntryInstr* n) const; | 348 BitVector* FindLoop(BlockEntryInstr* m, BlockEntryInstr* n) const; |
346 | 349 |
347 void InsertConversionsFor(Definition* def); | 350 void InsertConversionsFor(Definition* def); |
348 void ConvertUse(Value* use, Representation from); | 351 void ConvertUse(Value* use, Representation from); |
349 void ConvertEnvironmentUse(Value* use, Representation from); | 352 void ConvertEnvironmentUse(Value* use, Representation from); |
350 void InsertConversion(Representation from, | 353 void InsertConversion(Representation from, |
351 Representation to, | 354 Representation to, |
352 Value* use, | 355 Value* use, |
353 bool is_environment_use); | 356 bool is_environment_use); |
354 | 357 |
| 358 bool IsReceiver(Definition* def) const; |
| 359 void ComputeIsReceiverRecursive(PhiInstr* phi, BitVector* processed) const; |
| 360 |
355 Thread* thread_; | 361 Thread* thread_; |
356 | 362 |
357 // DiscoverBlocks computes parent_ and assigned_vars_ which are then used | 363 // DiscoverBlocks computes parent_ and assigned_vars_ which are then used |
358 // if/when computing SSA. | 364 // if/when computing SSA. |
359 GrowableArray<intptr_t> parent_; | 365 GrowableArray<intptr_t> parent_; |
360 GrowableArray<BitVector*> assigned_vars_; | 366 GrowableArray<BitVector*> assigned_vars_; |
361 | 367 |
362 intptr_t current_ssa_temp_index_; | 368 intptr_t current_ssa_temp_index_; |
363 intptr_t max_block_id_; | 369 intptr_t max_block_id_; |
364 | 370 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 | 539 |
534 private: | 540 private: |
535 GrowableArray<Definition*> defs_; | 541 GrowableArray<Definition*> defs_; |
536 BitVector* contains_vector_; | 542 BitVector* contains_vector_; |
537 }; | 543 }; |
538 | 544 |
539 | 545 |
540 } // namespace dart | 546 } // namespace dart |
541 | 547 |
542 #endif // VM_FLOW_GRAPH_H_ | 548 #endif // VM_FLOW_GRAPH_H_ |
OLD | NEW |