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

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

Issue 10899039: Add compiler error when instantiating abstract class (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 months 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 | « no previous file | 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 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
651 bool is_finalized() const { 656 bool is_finalized() const {
652 return StateBits::decode(raw_ptr()->state_bits_) == RawClass::kFinalized; 657 return StateBits::decode(raw_ptr()->state_bits_) == RawClass::kFinalized;
653 } 658 }
654 void set_is_finalized() const; 659 void set_is_finalized() const;
655 660
656 bool is_prefinalized() const { 661 bool is_prefinalized() const {
657 return StateBits::decode(raw_ptr()->state_bits_) == RawClass::kPreFinalized; 662 return StateBits::decode(raw_ptr()->state_bits_) == RawClass::kPreFinalized;
658 } 663 }
659 664
660 void set_is_prefinalized() const; 665 void set_is_prefinalized() const;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 714
710 // Return a class object corresponding to the specified kind. If 715 // Return a class object corresponding to the specified kind. If
711 // a canonicalized version of it exists then that object is returned 716 // a canonicalized version of it exists then that object is returned
712 // otherwise a new object is allocated and returned. 717 // otherwise a new object is allocated and returned.
713 static RawClass* GetClass(intptr_t class_id, bool is_signature_class); 718 static RawClass* GetClass(intptr_t class_id, bool is_signature_class);
714 719
715 private: 720 private:
716 enum { 721 enum {
717 kConstBit = 1, 722 kConstBit = 1,
718 kInterfaceBit = 2, 723 kInterfaceBit = 2,
719 kStateTagBit = 3, 724 kAbstractBit = 3,
725 kStateTagBit = 4,
720 kStateTagSize = 2, 726 kStateTagSize = 2,
721 }; 727 };
722 class ConstBit : public BitField<bool, kConstBit, 1> {}; 728 class ConstBit : public BitField<bool, kConstBit, 1> {};
723 class InterfaceBit : public BitField<bool, kInterfaceBit, 1> {}; 729 class InterfaceBit : public BitField<bool, kInterfaceBit, 1> {};
730 class AbstractBit : public BitField<bool, kAbstractBit, 1> {};
724 class StateBits : public BitField<RawClass::ClassState, 731 class StateBits : public BitField<RawClass::ClassState,
725 kStateTagBit, kStateTagSize> {}; // NOLINT 732 kStateTagBit, kStateTagSize> {}; // NOLINT
726 733
727 void set_name(const String& value) const; 734 void set_name(const String& value) const;
728 void set_token_pos(intptr_t value) const; 735 void set_token_pos(intptr_t value) const;
729 void set_signature_function(const Function& value) const; 736 void set_signature_function(const Function& value) const;
730 void set_signature_type(const AbstractType& value) const; 737 void set_signature_type(const AbstractType& value) const;
731 void set_class_state(RawClass::ClassState state) const; 738 void set_class_state(RawClass::ClassState state) const;
732 void set_state_bits(uint8_t bits) const; 739 void set_state_bits(uint8_t bits) const;
733 740
(...skipping 4804 matching lines...) Expand 10 before | Expand all | Expand 10 after
5538 if (this->CharAt(i) != str.CharAt(begin_index + i)) { 5545 if (this->CharAt(i) != str.CharAt(begin_index + i)) {
5539 return false; 5546 return false;
5540 } 5547 }
5541 } 5548 }
5542 return true; 5549 return true;
5543 } 5550 }
5544 5551
5545 } // namespace dart 5552 } // namespace dart
5546 5553
5547 #endif // VM_OBJECT_H_ 5554 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698