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

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

Issue 10368004: Properly set the element type of literal lists. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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
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 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 public: 1047 public:
1048 virtual bool IsFinalized() const { return true; } 1048 virtual bool IsFinalized() const { return true; }
1049 virtual bool IsBeingFinalized() const { return false; } 1049 virtual bool IsBeingFinalized() const { return false; }
1050 virtual bool IsMalformed() const { return false; } 1050 virtual bool IsMalformed() const { return false; }
1051 virtual bool IsResolved() const { return true; } 1051 virtual bool IsResolved() const { return true; }
1052 virtual bool HasResolvedTypeClass() const { return true; } 1052 virtual bool HasResolvedTypeClass() const { return true; }
1053 virtual RawClass* type_class() const; 1053 virtual RawClass* type_class() const;
1054 virtual RawAbstractTypeArguments* arguments() const; 1054 virtual RawAbstractTypeArguments* arguments() const;
1055 virtual intptr_t token_index() const; 1055 virtual intptr_t token_index() const;
1056 virtual bool IsInstantiated() const { return true; } 1056 virtual bool IsInstantiated() const { return true; }
1057 virtual bool Equals(const AbstractType& other) const;
1057 1058
1058 RawAbstractType* uninstantiated_type() const { 1059 RawAbstractType* uninstantiated_type() const {
1059 return raw_ptr()->uninstantiated_type_; 1060 return raw_ptr()->uninstantiated_type_;
1060 } 1061 }
1061 RawAbstractTypeArguments* instantiator_type_arguments() const { 1062 RawAbstractTypeArguments* instantiator_type_arguments() const {
1062 return raw_ptr()->instantiator_type_arguments_; 1063 return raw_ptr()->instantiator_type_arguments_;
1063 } 1064 }
1064 1065
1065 static intptr_t InstanceSize() { 1066 static intptr_t InstanceSize() {
1066 return RoundedAllocationSize(sizeof(RawInstantiatedType)); 1067 return RoundedAllocationSize(sizeof(RawInstantiatedType));
(...skipping 2534 matching lines...) Expand 10 before | Expand all | Expand 10 after
3601 ASSERT(!IsNull()); 3602 ASSERT(!IsNull());
3602 ASSERT(index < Length()); 3603 ASSERT(index < Length());
3603 StorePointer(ObjectAddr(index), value.raw()); 3604 StorePointer(ObjectAddr(index), value.raw());
3604 } 3605 }
3605 3606
3606 void Add(const Object& value, Heap::Space space = Heap::kNew) const; 3607 void Add(const Object& value, Heap::Space space = Heap::kNew) const;
3607 void Grow(intptr_t new_capacity, Heap::Space space = Heap::kNew) const; 3608 void Grow(intptr_t new_capacity, Heap::Space space = Heap::kNew) const;
3608 RawObject* RemoveLast() const; 3609 RawObject* RemoveLast() const;
3609 3610
3610 virtual RawAbstractTypeArguments* GetTypeArguments() const { 3611 virtual RawAbstractTypeArguments* GetTypeArguments() const {
3611 // TODO(regis): Enable asserts once allocation of array literal fixed. 3612 ASSERT(AbstractTypeArguments::AreEqual(
3612 // ASSERT(Array::Handle(data()).GetTypeArguments() == 3613 AbstractTypeArguments::Handle(Array::Handle(data()).GetTypeArguments()),
3613 // raw_ptr()->type_arguments_); 3614 AbstractTypeArguments::Handle(raw_ptr()->type_arguments_)));
3614 return raw_ptr()->type_arguments_; 3615 return raw_ptr()->type_arguments_;
3615 } 3616 }
3616 virtual void SetTypeArguments(const AbstractTypeArguments& value) const { 3617 virtual void SetTypeArguments(const AbstractTypeArguments& value) const {
3617 const Array& contents = Array::Handle(data()); 3618 const Array& contents = Array::Handle(data());
3618 contents.SetTypeArguments(value); 3619 contents.SetTypeArguments(value);
3619 raw_ptr()->type_arguments_ = value.raw(); 3620 raw_ptr()->type_arguments_ = value.raw();
3620 } 3621 }
3621 3622
3622 virtual bool Equals(const Instance& other) const; 3623 virtual bool Equals(const Instance& other) const;
3623 3624
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
4068 } 4069 }
4069 4070
4070 4071
4071 intptr_t Stackmap::SizeInBits() const { 4072 intptr_t Stackmap::SizeInBits() const {
4072 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte); 4073 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte);
4073 } 4074 }
4074 4075
4075 } // namespace dart 4076 } // namespace dart
4076 4077
4077 #endif // VM_OBJECT_H_ 4078 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698