Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: runtime/vm/object.h

Issue 11348283: Add flag 'implements' to class, it is set anytime someone implements this class. This is a way to r… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 674
675 static intptr_t InstanceSize() { 675 static intptr_t InstanceSize() {
676 return RoundedAllocationSize(sizeof(RawClass)); 676 return RoundedAllocationSize(sizeof(RawClass));
677 } 677 }
678 678
679 bool is_interface() const { 679 bool is_interface() const {
680 return InterfaceBit::decode(raw_ptr()->state_bits_); 680 return InterfaceBit::decode(raw_ptr()->state_bits_);
681 } 681 }
682 void set_is_interface() const; 682 void set_is_interface() const;
683 683
684 bool is_implemented() const {
685 return ImplementedBit::decode(raw_ptr()->state_bits_);
686 }
687 void set_is_implemented() const;
688
684 bool is_abstract() const { 689 bool is_abstract() const {
685 return AbstractBit::decode(raw_ptr()->state_bits_); 690 return AbstractBit::decode(raw_ptr()->state_bits_);
686 } 691 }
687 void set_is_abstract() const; 692 void set_is_abstract() const;
688 693
689 bool is_finalized() const { 694 bool is_finalized() const {
690 return StateBits::decode(raw_ptr()->state_bits_) == RawClass::kFinalized; 695 return StateBits::decode(raw_ptr()->state_bits_) == RawClass::kFinalized;
691 } 696 }
692 void set_is_finalized() const; 697 void set_is_finalized() const;
693 698
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 755
751 // Return a class object corresponding to the specified kind. If 756 // Return a class object corresponding to the specified kind. If
752 // a canonicalized version of it exists then that object is returned 757 // a canonicalized version of it exists then that object is returned
753 // otherwise a new object is allocated and returned. 758 // otherwise a new object is allocated and returned.
754 static RawClass* GetClass(intptr_t class_id, bool is_signature_class); 759 static RawClass* GetClass(intptr_t class_id, bool is_signature_class);
755 760
756 private: 761 private:
757 enum { 762 enum {
758 kConstBit = 1, 763 kConstBit = 1,
759 kInterfaceBit = 2, 764 kInterfaceBit = 2,
760 kAbstractBit = 3, 765 kImplementedBit = 3,
761 kStateTagBit = 4, 766 kAbstractBit = 4,
767 kStateTagBit = 5,
762 kStateTagSize = 2, 768 kStateTagSize = 2,
763 }; 769 };
764 class ConstBit : public BitField<bool, kConstBit, 1> {}; 770 class ConstBit : public BitField<bool, kConstBit, 1> {};
765 class InterfaceBit : public BitField<bool, kInterfaceBit, 1> {}; 771 class InterfaceBit : public BitField<bool, kInterfaceBit, 1> {};
772 class ImplementedBit : public BitField<bool, kImplementedBit, 1> {};
766 class AbstractBit : public BitField<bool, kAbstractBit, 1> {}; 773 class AbstractBit : public BitField<bool, kAbstractBit, 1> {};
767 class StateBits : public BitField<RawClass::ClassState, 774 class StateBits : public BitField<RawClass::ClassState,
768 kStateTagBit, kStateTagSize> {}; // NOLINT 775 kStateTagBit, kStateTagSize> {}; // NOLINT
769 776
770 void set_name(const String& value) const; 777 void set_name(const String& value) const;
771 void set_token_pos(intptr_t value) const; 778 void set_token_pos(intptr_t value) const;
772 void set_signature_function(const Function& value) const; 779 void set_signature_function(const Function& value) const;
773 void set_signature_type(const AbstractType& value) const; 780 void set_signature_type(const AbstractType& value) const;
774 void set_class_state(RawClass::ClassState state) const; 781 void set_class_state(RawClass::ClassState state) const;
775 void set_state_bits(intptr_t bits) const; 782 void set_state_bits(intptr_t bits) const;
(...skipping 5205 matching lines...) Expand 10 before | Expand all | Expand 10 after
5981 if (this->CharAt(i) != str.CharAt(begin_index + i)) { 5988 if (this->CharAt(i) != str.CharAt(begin_index + i)) {
5982 return false; 5989 return false;
5983 } 5990 }
5984 } 5991 }
5985 return true; 5992 return true;
5986 } 5993 }
5987 5994
5988 } // namespace dart 5995 } // namespace dart
5989 5996
5990 #endif // VM_OBJECT_H_ 5997 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698