| 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_OBJECT_H_ | 5 #ifndef VM_OBJECT_H_ |
| 6 #define VM_OBJECT_H_ | 6 #define VM_OBJECT_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "platform/utils.h" | 10 #include "platform/utils.h" |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 | 641 |
| 642 static intptr_t InstanceSize() { | 642 static intptr_t InstanceSize() { |
| 643 return RoundedAllocationSize(sizeof(RawClass)); | 643 return RoundedAllocationSize(sizeof(RawClass)); |
| 644 } | 644 } |
| 645 | 645 |
| 646 bool is_interface() const { | 646 bool is_interface() const { |
| 647 return InterfaceBit::decode(raw_ptr()->state_bits_); | 647 return InterfaceBit::decode(raw_ptr()->state_bits_); |
| 648 } | 648 } |
| 649 void set_is_interface() const; | 649 void set_is_interface() const; |
| 650 | 650 |
| 651 bool is_abstract() const { | |
| 652 return AbstractBit::decode(raw_ptr()->state_bits_); | |
| 653 } | |
| 654 void set_is_abstract() const; | |
| 655 | |
| 656 bool is_finalized() const { | 651 bool is_finalized() const { |
| 657 return StateBits::decode(raw_ptr()->state_bits_) == RawClass::kFinalized; | 652 return StateBits::decode(raw_ptr()->state_bits_) == RawClass::kFinalized; |
| 658 } | 653 } |
| 659 void set_is_finalized() const; | 654 void set_is_finalized() const; |
| 660 | 655 |
| 661 bool is_prefinalized() const { | 656 bool is_prefinalized() const { |
| 662 return StateBits::decode(raw_ptr()->state_bits_) == RawClass::kPreFinalized; | 657 return StateBits::decode(raw_ptr()->state_bits_) == RawClass::kPreFinalized; |
| 663 } | 658 } |
| 664 | 659 |
| 665 void set_is_prefinalized() const; | 660 void set_is_prefinalized() const; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 | 709 |
| 715 // Return a class object corresponding to the specified kind. If | 710 // Return a class object corresponding to the specified kind. If |
| 716 // a canonicalized version of it exists then that object is returned | 711 // a canonicalized version of it exists then that object is returned |
| 717 // otherwise a new object is allocated and returned. | 712 // otherwise a new object is allocated and returned. |
| 718 static RawClass* GetClass(intptr_t class_id, bool is_signature_class); | 713 static RawClass* GetClass(intptr_t class_id, bool is_signature_class); |
| 719 | 714 |
| 720 private: | 715 private: |
| 721 enum { | 716 enum { |
| 722 kConstBit = 1, | 717 kConstBit = 1, |
| 723 kInterfaceBit = 2, | 718 kInterfaceBit = 2, |
| 724 kAbstractBit = 3, | 719 kStateTagBit = 3, |
| 725 kStateTagBit = 4, | |
| 726 kStateTagSize = 2, | 720 kStateTagSize = 2, |
| 727 }; | 721 }; |
| 728 class ConstBit : public BitField<bool, kConstBit, 1> {}; | 722 class ConstBit : public BitField<bool, kConstBit, 1> {}; |
| 729 class InterfaceBit : public BitField<bool, kInterfaceBit, 1> {}; | 723 class InterfaceBit : public BitField<bool, kInterfaceBit, 1> {}; |
| 730 class AbstractBit : public BitField<bool, kAbstractBit, 1> {}; | |
| 731 class StateBits : public BitField<RawClass::ClassState, | 724 class StateBits : public BitField<RawClass::ClassState, |
| 732 kStateTagBit, kStateTagSize> {}; // NOLINT | 725 kStateTagBit, kStateTagSize> {}; // NOLINT |
| 733 | 726 |
| 734 void set_name(const String& value) const; | 727 void set_name(const String& value) const; |
| 735 void set_token_pos(intptr_t value) const; | 728 void set_token_pos(intptr_t value) const; |
| 736 void set_signature_function(const Function& value) const; | 729 void set_signature_function(const Function& value) const; |
| 737 void set_signature_type(const AbstractType& value) const; | 730 void set_signature_type(const AbstractType& value) const; |
| 738 void set_class_state(RawClass::ClassState state) const; | 731 void set_class_state(RawClass::ClassState state) const; |
| 739 void set_state_bits(uint8_t bits) const; | 732 void set_state_bits(uint8_t bits) const; |
| 740 | 733 |
| (...skipping 4804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5545 if (this->CharAt(i) != str.CharAt(begin_index + i)) { | 5538 if (this->CharAt(i) != str.CharAt(begin_index + i)) { |
| 5546 return false; | 5539 return false; |
| 5547 } | 5540 } |
| 5548 } | 5541 } |
| 5549 return true; | 5542 return true; |
| 5550 } | 5543 } |
| 5551 | 5544 |
| 5552 } // namespace dart | 5545 } // namespace dart |
| 5553 | 5546 |
| 5554 #endif // VM_OBJECT_H_ | 5547 #endif // VM_OBJECT_H_ |
| OLD | NEW |