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_INTERMEDIATE_LANGUAGE_H_ | 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ |
6 #define VM_INTERMEDIATE_LANGUAGE_H_ | 6 #define VM_INTERMEDIATE_LANGUAGE_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
(...skipping 3491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3502 // by stores/loads. LoadOptimizer handles loads separately. Hence stores | 3502 // by stores/loads. LoadOptimizer handles loads separately. Hence stores |
3503 // are marked as having no side-effects. | 3503 // are marked as having no side-effects. |
3504 virtual EffectSet Effects() const { return EffectSet::None(); } | 3504 virtual EffectSet Effects() const { return EffectSet::None(); } |
3505 | 3505 |
3506 virtual bool MayThrow() const { return false; } | 3506 virtual bool MayThrow() const { return false; } |
3507 | 3507 |
3508 bool IsUnboxedStore() const; | 3508 bool IsUnboxedStore() const; |
3509 | 3509 |
3510 bool IsPotentialUnboxedStore() const; | 3510 bool IsPotentialUnboxedStore() const; |
3511 | 3511 |
3512 virtual Representation RequiredInputRepresentation(intptr_t index) const { | 3512 virtual Representation RequiredInputRepresentation(intptr_t index) const; |
3513 ASSERT((index == 0) || (index == 1)); | |
3514 if ((index == 1) && IsUnboxedStore()) return kUnboxedDouble; | |
3515 return kTagged; | |
3516 } | |
3517 | 3513 |
3518 private: | 3514 private: |
3519 friend class FlowGraphOptimizer; // For ASSERT(initialization_). | 3515 friend class FlowGraphOptimizer; // For ASSERT(initialization_). |
3520 | 3516 |
3521 bool CanValueBeSmi() const { | 3517 bool CanValueBeSmi() const { |
3522 const intptr_t cid = value()->Type()->ToNullableCid(); | 3518 const intptr_t cid = value()->Type()->ToNullableCid(); |
3523 // Write barrier is skipped for nullable and non-nullable smis. | 3519 // Write barrier is skipped for nullable and non-nullable smis. |
3524 ASSERT(cid != kSmiCid); | 3520 ASSERT(cid != kSmiCid); |
3525 return (cid == kDynamicCid); | 3521 return (cid == kDynamicCid); |
3526 } | 3522 } |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4256 | 4252 |
4257 Value* instance() const { return inputs_[0]; } | 4253 Value* instance() const { return inputs_[0]; } |
4258 intptr_t offset_in_bytes() const { return offset_in_bytes_; } | 4254 intptr_t offset_in_bytes() const { return offset_in_bytes_; } |
4259 const AbstractType& type() const { return type_; } | 4255 const AbstractType& type() const { return type_; } |
4260 void set_result_cid(intptr_t value) { result_cid_ = value; } | 4256 void set_result_cid(intptr_t value) { result_cid_ = value; } |
4261 intptr_t result_cid() const { return result_cid_; } | 4257 intptr_t result_cid() const { return result_cid_; } |
4262 | 4258 |
4263 const Field* field() const { return field_; } | 4259 const Field* field() const { return field_; } |
4264 void set_field(const Field* field) { field_ = field; } | 4260 void set_field(const Field* field) { field_ = field; } |
4265 | 4261 |
4266 virtual Representation representation() const { | 4262 virtual Representation representation() const; |
4267 return IsUnboxedLoad() ? kUnboxedDouble : kTagged; | |
4268 } | |
4269 | 4263 |
4270 bool IsUnboxedLoad() const; | 4264 bool IsUnboxedLoad() const; |
4271 | 4265 |
4272 bool IsPotentialUnboxedLoad() const; | 4266 bool IsPotentialUnboxedLoad() const; |
4273 | 4267 |
4274 void set_recognized_kind(MethodRecognizer::Kind kind) { | 4268 void set_recognized_kind(MethodRecognizer::Kind kind) { |
4275 recognized_kind_ = kind; | 4269 recognized_kind_ = kind; |
4276 } | 4270 } |
4277 | 4271 |
4278 MethodRecognizer::Kind recognized_kind() const { | 4272 MethodRecognizer::Kind recognized_kind() const { |
(...skipping 2850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7129 ForwardInstructionIterator* current_iterator_; | 7123 ForwardInstructionIterator* current_iterator_; |
7130 | 7124 |
7131 private: | 7125 private: |
7132 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 7126 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
7133 }; | 7127 }; |
7134 | 7128 |
7135 | 7129 |
7136 } // namespace dart | 7130 } // namespace dart |
7137 | 7131 |
7138 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 7132 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
OLD | NEW |