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 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4253 | 4249 |
4254 Value* instance() const { return inputs_[0]; } | 4250 Value* instance() const { return inputs_[0]; } |
4255 intptr_t offset_in_bytes() const { return offset_in_bytes_; } | 4251 intptr_t offset_in_bytes() const { return offset_in_bytes_; } |
4256 const AbstractType& type() const { return type_; } | 4252 const AbstractType& type() const { return type_; } |
4257 void set_result_cid(intptr_t value) { result_cid_ = value; } | 4253 void set_result_cid(intptr_t value) { result_cid_ = value; } |
4258 intptr_t result_cid() const { return result_cid_; } | 4254 intptr_t result_cid() const { return result_cid_; } |
4259 | 4255 |
4260 const Field* field() const { return field_; } | 4256 const Field* field() const { return field_; } |
4261 void set_field(const Field* field) { field_ = field; } | 4257 void set_field(const Field* field) { field_ = field; } |
4262 | 4258 |
4263 virtual Representation representation() const { | 4259 virtual Representation representation() const; |
4264 return IsUnboxedLoad() ? kUnboxedDouble : kTagged; | |
4265 } | |
4266 | 4260 |
4267 bool IsUnboxedLoad() const; | 4261 bool IsUnboxedLoad() const; |
4268 | 4262 |
4269 bool IsPotentialUnboxedLoad() const; | 4263 bool IsPotentialUnboxedLoad() const; |
4270 | 4264 |
4271 void set_recognized_kind(MethodRecognizer::Kind kind) { | 4265 void set_recognized_kind(MethodRecognizer::Kind kind) { |
4272 recognized_kind_ = kind; | 4266 recognized_kind_ = kind; |
4273 } | 4267 } |
4274 | 4268 |
4275 MethodRecognizer::Kind recognized_kind() const { | 4269 MethodRecognizer::Kind recognized_kind() const { |
(...skipping 2850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7126 ForwardInstructionIterator* current_iterator_; | 7120 ForwardInstructionIterator* current_iterator_; |
7127 | 7121 |
7128 private: | 7122 private: |
7129 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 7123 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
7130 }; | 7124 }; |
7131 | 7125 |
7132 | 7126 |
7133 } // namespace dart | 7127 } // namespace dart |
7134 | 7128 |
7135 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 7129 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
OLD | NEW |