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

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

Issue 9515011: Add support for malformed types and postpone some related errors from compile (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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 | « runtime/vm/code_generator_x64.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 760 matching lines...) Expand 10 before | Expand all | Expand 10 after
771 // InstantiatedType. 771 // InstantiatedType.
772 // 772 //
773 // Caution: 'RawAbstractType*' denotes a 'raw' pointer to a VM object of class 773 // Caution: 'RawAbstractType*' denotes a 'raw' pointer to a VM object of class
774 // AbstractType, as opposed to 'AbstractType' denoting a 'handle' to the same 774 // AbstractType, as opposed to 'AbstractType' denoting a 'handle' to the same
775 // object. 'RawAbstractType' does not relate to a 'raw type', as opposed to a 775 // object. 'RawAbstractType' does not relate to a 'raw type', as opposed to a
776 // 'cooked type' or 'rare type'. 776 // 'cooked type' or 'rare type'.
777 class AbstractType : public Object { 777 class AbstractType : public Object {
778 public: 778 public:
779 virtual bool IsFinalized() const; 779 virtual bool IsFinalized() const;
780 virtual bool IsBeingFinalized() const; 780 virtual bool IsBeingFinalized() const;
781 virtual bool IsMalformed() const;
782 virtual RawError* malformed_error() const;
783 virtual void set_malformed_error(const Error& value) const;
781 virtual bool IsResolved() const; 784 virtual bool IsResolved() const;
782 virtual bool HasResolvedTypeClass() const; 785 virtual bool HasResolvedTypeClass() const;
783 virtual RawClass* type_class() const; 786 virtual RawClass* type_class() const;
784 virtual RawUnresolvedClass* unresolved_class() const; 787 virtual RawUnresolvedClass* unresolved_class() const;
785 virtual RawAbstractTypeArguments* arguments() const; 788 virtual RawAbstractTypeArguments* arguments() const;
786 virtual intptr_t token_index() const; 789 virtual intptr_t token_index() const;
787 virtual bool IsInstantiated() const; 790 virtual bool IsInstantiated() const;
788 virtual bool Equals(const AbstractType& other) const; 791 virtual bool Equals(const AbstractType& other) const;
789 792
790 // Instantiate this type using the given type argument vector. 793 // Instantiate this type using the given type argument vector.
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 class Type : public AbstractType { 889 class Type : public AbstractType {
887 public: 890 public:
888 virtual bool IsFinalized() const { 891 virtual bool IsFinalized() const {
889 return raw_ptr()->type_state_ == RawType::kFinalized; 892 return raw_ptr()->type_state_ == RawType::kFinalized;
890 } 893 }
891 void set_is_finalized() const; 894 void set_is_finalized() const;
892 virtual bool IsBeingFinalized() const { 895 virtual bool IsBeingFinalized() const {
893 return raw_ptr()->type_state_ == RawType::kBeingFinalized; 896 return raw_ptr()->type_state_ == RawType::kBeingFinalized;
894 } 897 }
895 void set_is_being_finalized() const; 898 void set_is_being_finalized() const;
899 virtual bool IsMalformed() const;
900 virtual RawError* malformed_error() const;
901 virtual void set_malformed_error(const Error& value) const;
896 virtual bool IsResolved() const; // Class and all arguments classes resolved. 902 virtual bool IsResolved() const; // Class and all arguments classes resolved.
897 virtual bool HasResolvedTypeClass() const; // Own type class resolved. 903 virtual bool HasResolvedTypeClass() const; // Own type class resolved.
898 virtual RawClass* type_class() const; 904 virtual RawClass* type_class() const;
899 void set_type_class(const Object& value) const; 905 void set_type_class(const Object& value) const;
900 virtual RawUnresolvedClass* unresolved_class() const; 906 virtual RawUnresolvedClass* unresolved_class() const;
901 virtual RawAbstractTypeArguments* arguments() const; 907 virtual RawAbstractTypeArguments* arguments() const;
902 void set_arguments(const AbstractTypeArguments& value) const; 908 void set_arguments(const AbstractTypeArguments& value) const;
903 virtual intptr_t token_index() const { return raw_ptr()->token_index_; } 909 virtual intptr_t token_index() const { return raw_ptr()->token_index_; }
904 virtual bool IsInstantiated() const; 910 virtual bool IsInstantiated() const;
905 virtual bool Equals(const AbstractType& other) const; 911 virtual bool Equals(const AbstractType& other) const;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 // instantiated yet, i.e. it is only a place holder. 975 // instantiated yet, i.e. it is only a place holder.
970 // Upon finalization, the TypeParameter index is changed to reflect its position 976 // Upon finalization, the TypeParameter index is changed to reflect its position
971 // as type argument (rather than type parameter) of the enclosing class. 977 // as type argument (rather than type parameter) of the enclosing class.
972 class TypeParameter : public AbstractType { 978 class TypeParameter : public AbstractType {
973 public: 979 public:
974 virtual bool IsFinalized() const { 980 virtual bool IsFinalized() const {
975 return raw_ptr()->type_state_ == RawTypeParameter::kFinalized; 981 return raw_ptr()->type_state_ == RawTypeParameter::kFinalized;
976 } 982 }
977 void set_is_finalized() const; 983 void set_is_finalized() const;
978 virtual bool IsBeingFinalized() const { return false; } 984 virtual bool IsBeingFinalized() const { return false; }
985 virtual bool IsMalformed() const { return false; }
979 virtual bool IsResolved() const { return true; } 986 virtual bool IsResolved() const { return true; }
980 virtual bool HasResolvedTypeClass() const { return false; } 987 virtual bool HasResolvedTypeClass() const { return false; }
981 virtual RawString* Name() const { return raw_ptr()->name_; } 988 virtual RawString* Name() const { return raw_ptr()->name_; }
982 virtual intptr_t Index() const { return raw_ptr()->index_; } 989 virtual intptr_t Index() const { return raw_ptr()->index_; }
983 void set_index(intptr_t value) const; 990 void set_index(intptr_t value) const;
984 virtual intptr_t token_index() const { return raw_ptr()->token_index_; } 991 virtual intptr_t token_index() const { return raw_ptr()->token_index_; }
985 virtual bool IsInstantiated() const { return false; } 992 virtual bool IsInstantiated() const { return false; }
986 virtual bool Equals(const AbstractType& other) const; 993 virtual bool Equals(const AbstractType& other) const;
987 virtual RawAbstractType* InstantiateFrom( 994 virtual RawAbstractType* InstantiateFrom(
988 const AbstractTypeArguments& instantiator_type_arguments) const; 995 const AbstractTypeArguments& instantiator_type_arguments) const;
(...skipping 24 matching lines...) Expand all
1013 // object and of a AbstractTypeArguments object. The type is uninstantiated, 1020 // object and of a AbstractTypeArguments object. The type is uninstantiated,
1014 // because it refers to at least one TypeParameter object, i.e. to a type that 1021 // because it refers to at least one TypeParameter object, i.e. to a type that
1015 // is not known at compile time. 1022 // is not known at compile time.
1016 // The type argument vector is the instantiator, because each type parameter 1023 // The type argument vector is the instantiator, because each type parameter
1017 // with index i in the uninstantiated type can be substituted (or 1024 // with index i in the uninstantiated type can be substituted (or
1018 // "instantiated") with the type at index i in the type argument vector. 1025 // "instantiated") with the type at index i in the type argument vector.
1019 class InstantiatedType : public AbstractType { 1026 class InstantiatedType : public AbstractType {
1020 public: 1027 public:
1021 virtual bool IsFinalized() const { return true; } 1028 virtual bool IsFinalized() const { return true; }
1022 virtual bool IsBeingFinalized() const { return false; } 1029 virtual bool IsBeingFinalized() const { return false; }
1030 virtual bool IsMalformed() const { return false; }
1023 virtual bool IsResolved() const { return true; } 1031 virtual bool IsResolved() const { return true; }
1024 virtual bool HasResolvedTypeClass() const { return true; } 1032 virtual bool HasResolvedTypeClass() const { return true; }
1025 virtual RawClass* type_class() const; 1033 virtual RawClass* type_class() const;
1026 virtual RawAbstractTypeArguments* arguments() const; 1034 virtual RawAbstractTypeArguments* arguments() const;
1027 virtual intptr_t token_index() const; 1035 virtual intptr_t token_index() const;
1028 virtual bool IsInstantiated() const { return true; } 1036 virtual bool IsInstantiated() const { return true; }
1029 1037
1030 RawAbstractType* uninstantiated_type() const { 1038 RawAbstractType* uninstantiated_type() const {
1031 return raw_ptr()->uninstantiated_type_; 1039 return raw_ptr()->uninstantiated_type_;
1032 } 1040 }
(...skipping 2734 matching lines...) Expand 10 before | Expand all | Expand 10 after
3767 } 3775 }
3768 3776
3769 3777
3770 void Context::SetAt(intptr_t index, const Instance& value) const { 3778 void Context::SetAt(intptr_t index, const Instance& value) const {
3771 StorePointer(InstanceAddr(index), value.raw()); 3779 StorePointer(InstanceAddr(index), value.raw());
3772 } 3780 }
3773 3781
3774 } // namespace dart 3782 } // namespace dart
3775 3783
3776 #endif // VM_OBJECT_H_ 3784 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/code_generator_x64.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698