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

Side by Side Diff: vm/raw_object_snapshot.cc

Issue 10012042: Wire GrowableArray to use the internal VM object. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 8 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
« vm/object.cc ('K') | « vm/raw_object.h ('k') | no next file » | 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 #include "vm/bigint_operations.h" 5 #include "vm/bigint_operations.h"
6 #include "vm/object.h" 6 #include "vm/object.h"
7 #include "vm/object_store.h" 7 #include "vm/object_store.h"
8 #include "vm/snapshot.h" 8 #include "vm/snapshot.h"
9 #include "vm/visitor.h" 9 #include "vm/visitor.h"
10 10
(...skipping 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after
1745 1745
1746 1746
1747 RawGrowableObjectArray* GrowableObjectArray::ReadFrom(SnapshotReader* reader, 1747 RawGrowableObjectArray* GrowableObjectArray::ReadFrom(SnapshotReader* reader,
1748 intptr_t object_id, 1748 intptr_t object_id,
1749 intptr_t tags, 1749 intptr_t tags,
1750 Snapshot::Kind kind) { 1750 Snapshot::Kind kind) {
1751 ASSERT(reader != NULL); 1751 ASSERT(reader != NULL);
1752 1752
1753 // Read the length so that we can determine instance size to allocate. 1753 // Read the length so that we can determine instance size to allocate.
1754 GrowableObjectArray& array = GrowableObjectArray::ZoneHandle( 1754 GrowableObjectArray& array = GrowableObjectArray::ZoneHandle(
1755 reader->isolate(), reader->NewGrowableObjectArray()); 1755 reader->isolate(), GrowableObjectArray::null());
1756 if (kind == Snapshot::kFull) {
1757 array = reader->NewGrowableObjectArray();
1758 } else {
1759 array = GrowableObjectArray::New(0);
1760 }
1756 reader->AddBackwardReference(object_id, &array); 1761 reader->AddBackwardReference(object_id, &array);
1757 intptr_t length = reader->ReadSmiValue(); 1762 intptr_t length = reader->ReadSmiValue();
1758 array.SetLength(length); 1763 array.SetLength(length);
1759 Array& contents = Array::Handle(); 1764 Array& contents = Array::Handle();
1760 contents ^= reader->ReadObject(); 1765 contents ^= reader->ReadObject();
1761 array.SetData(contents); 1766 array.SetData(contents);
1762 return array.raw(); 1767 return array.raw();
1763 } 1768 }
1764 1769
1765 1770
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1969 writer->Write<RawObject*>(ptr()->num_bracket_expressions_); 1974 writer->Write<RawObject*>(ptr()->num_bracket_expressions_);
1970 writer->WriteObject(ptr()->pattern_); 1975 writer->WriteObject(ptr()->pattern_);
1971 writer->WriteIntptrValue(ptr()->type_); 1976 writer->WriteIntptrValue(ptr()->type_);
1972 writer->WriteIntptrValue(ptr()->flags_); 1977 writer->WriteIntptrValue(ptr()->flags_);
1973 1978
1974 // Do not write out the data part which is native. 1979 // Do not write out the data part which is native.
1975 } 1980 }
1976 1981
1977 1982
1978 } // namespace dart 1983 } // namespace dart
OLDNEW
« vm/object.cc ('K') | « vm/raw_object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698