| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |