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

Unified Diff: vm/raw_object.h

Issue 9594028: Add a first class GrowableObjectArray type in the VM and use it internally in the VM at all spots w… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
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 side-by-side diff with in-line comments
Download patch
Index: vm/raw_object.h
===================================================================
--- vm/raw_object.h (revision 4983)
+++ vm/raw_object.h (working copy)
@@ -61,6 +61,7 @@
V(Bool) \
V(Array) \
V(ImmutableArray) \
+ V(GrowableObjectArray) \
V(ByteArray) \
V(InternalByteArray) \
V(ExternalByteArray) \
@@ -996,6 +997,24 @@
};
+class RawGrowableObjectArray : public RawInstance {
+ RAW_HEAP_OBJECT_IMPLEMENTATION(GrowableObjectArray);
+
+ RawObject** from() {
+ return reinterpret_cast<RawObject**>(&ptr()->data_);
+ }
+ RawArray* data_;
+ RawObject** to() {
+ return reinterpret_cast<RawObject**>(&ptr()->data_);
+ }
+
+ intptr_t capacity_;
cshapiro 2012/03/06 00:56:31 I am not sure why we need a separate capacity_ mem
siva 2012/03/06 23:32:33 Removed the capacity_ field and made length_ a Smi
+ intptr_t length_;
+
+ friend class SnapshotReader;
+};
+
+
class RawByteArray : public RawInstance {
RAW_HEAP_OBJECT_IMPLEMENTATION(ByteArray);

Powered by Google App Engine
This is Rietveld 408576698