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

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

Issue 9233039: Store resolved library prefix in unresolved class object in order not to repeat (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 10 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 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 friend class Object; 714 friend class Object;
715 friend class Instance; 715 friend class Instance;
716 friend class Type; 716 friend class Type;
717 }; 717 };
718 718
719 719
720 // Unresolved class is used for storing unresolved names which will be resolved 720 // Unresolved class is used for storing unresolved names which will be resolved
721 // to a class after all classes have been loaded and finalized. 721 // to a class after all classes have been loaded and finalized.
722 class UnresolvedClass : public Object { 722 class UnresolvedClass : public Object {
723 public: 723 public:
724 RawString* qualifier() const { return raw_ptr()->qualifier_; } 724 RawLibraryPrefix* library_prefix() const {
725 return raw_ptr()->library_prefix_;
726 }
725 RawString* ident() const { return raw_ptr()->ident_; } 727 RawString* ident() const { return raw_ptr()->ident_; }
726 intptr_t token_index() const { return raw_ptr()->token_index_; } 728 intptr_t token_index() const { return raw_ptr()->token_index_; }
727 729
728 RawClass* factory_signature_class() const { 730 RawClass* factory_signature_class() const {
729 return raw_ptr()->factory_signature_class_; 731 return raw_ptr()->factory_signature_class_;
730 } 732 }
731 void set_factory_signature_class(const Class& value) const; 733 void set_factory_signature_class(const Class& value) const;
732 734
733 RawString* Name() const; 735 RawString* Name() const;
734 736
735 static intptr_t InstanceSize() { 737 static intptr_t InstanceSize() {
736 return RoundedAllocationSize(sizeof(RawUnresolvedClass)); 738 return RoundedAllocationSize(sizeof(RawUnresolvedClass));
737 } 739 }
738 static RawUnresolvedClass* New(intptr_t token_index, 740 static RawUnresolvedClass* New(intptr_t token_index,
739 const String& qualifier, 741 const LibraryPrefix& library_prefix,
740 const String& ident); 742 const String& ident);
741 743
742 private: 744 private:
743 void set_token_index(intptr_t token_index) const; 745 void set_token_index(intptr_t token_index) const;
744 void set_ident(const String& ident) const; 746 void set_ident(const String& ident) const;
745 void set_qualifier(const String& qualifier) const; 747 void set_library_prefix(const LibraryPrefix& library_prefix) const;
746 748
747 static RawUnresolvedClass* New(); 749 static RawUnresolvedClass* New();
748 750
749 HEAP_OBJECT_IMPLEMENTATION(UnresolvedClass, Object); 751 HEAP_OBJECT_IMPLEMENTATION(UnresolvedClass, Object);
750 friend class Class; 752 friend class Class;
751 }; 753 };
752 754
753 755
754 // AbstractType is an abstract superclass. 756 // AbstractType is an abstract superclass.
755 // Subclasses of AbstractType are Type, TypeParameter, and 757 // Subclasses of AbstractType are Type, TypeParameter, and
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 static RawType* ListInterface(); 928 static RawType* ListInterface();
927 929
928 // The least specific valid raw type of the given class. 930 // The least specific valid raw type of the given class.
929 // For example, type A<Dynamic> would be returned for class A<T>, and type 931 // For example, type A<Dynamic> would be returned for class A<T>, and type
930 // B<Dynamic, A<Dynamic>> would be returned for B<U, V extends A>. 932 // B<Dynamic, A<Dynamic>> would be returned for B<U, V extends A>.
931 static RawType* NewRawType(const Class& type_class); 933 static RawType* NewRawType(const Class& type_class);
932 934
933 // The finalized type of the given non-parameterized class. 935 // The finalized type of the given non-parameterized class.
934 static RawType* NewNonParameterizedType(const Class& type_class); 936 static RawType* NewNonParameterizedType(const Class& type_class);
935 937
936 static RawType* NewParameterizedType(
937 const Object& type_class, const AbstractTypeArguments& arguments);
938
939 static RawType* New(const Object& clazz, 938 static RawType* New(const Object& clazz,
940 const AbstractTypeArguments& arguments); 939 const AbstractTypeArguments& arguments);
941 940
942 private: 941 private:
943 void set_type_state(int8_t state) const; 942 void set_type_state(int8_t state) const;
944 943
945 static RawType* New(); 944 static RawType* New();
946 945
947 HEAP_OBJECT_IMPLEMENTATION(Type, AbstractType); 946 HEAP_OBJECT_IMPLEMENTATION(Type, AbstractType);
948 friend class Class; 947 friend class Class;
(...skipping 2653 matching lines...) Expand 10 before | Expand all | Expand 10 after
3602 } 3601 }
3603 3602
3604 3603
3605 void Context::SetAt(intptr_t index, const Instance& value) const { 3604 void Context::SetAt(intptr_t index, const Instance& value) const {
3606 StorePointer(InstanceAddr(index), value.raw()); 3605 StorePointer(InstanceAddr(index), value.raw());
3607 } 3606 }
3608 3607
3609 } // namespace dart 3608 } // namespace dart
3610 3609
3611 #endif // VM_OBJECT_H_ 3610 #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