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

Side by Side Diff: runtime/vm/raw_object_snapshot.cc

Issue 10832401: Gentle start with removing explicit interfaces (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 #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/symbols.h" 9 #include "vm/symbols.h"
10 #include "vm/visitor.h" 10 #include "vm/visitor.h"
(...skipping 24 matching lines...) Expand all
35 (kind == Snapshot::kScript && !RawObject::IsCreatedFromSnapshot(tags))) { 35 (kind == Snapshot::kScript && !RawObject::IsCreatedFromSnapshot(tags))) {
36 // Read in the base information. 36 // Read in the base information.
37 intptr_t class_id = reader->ReadIntptrValue(); 37 intptr_t class_id = reader->ReadIntptrValue();
38 bool is_signature_class = reader->Read<bool>(); 38 bool is_signature_class = reader->Read<bool>();
39 39
40 // Allocate class object of specified kind. 40 // Allocate class object of specified kind.
41 if (kind == Snapshot::kFull) { 41 if (kind == Snapshot::kFull) {
42 cls = reader->NewClass(class_id, is_signature_class); 42 cls = reader->NewClass(class_id, is_signature_class);
43 } else { 43 } else {
44 if (class_id < kNumPredefinedCids) { 44 if (class_id < kNumPredefinedCids) {
45 ASSERT((class_id >= kInstanceCid) && (class_id <= kWeakPropertyCid)); 45 ASSERT((class_id >= kInstanceCid) && (class_id <= kDartFunctionCid));
46 cls = reader->isolate()->class_table()->At(class_id); 46 cls = reader->isolate()->class_table()->At(class_id);
47 } else { 47 } else {
48 if (is_signature_class) { 48 if (is_signature_class) {
49 cls = New<Closure>(kIllegalCid); 49 cls = New<Closure>(kIllegalCid);
50 } else { 50 } else {
51 cls = New<Instance>(kIllegalCid); 51 cls = New<Instance>(kIllegalCid);
52 } 52 }
53 } 53 }
54 } 54 }
55 reader->AddBackRef(object_id, &cls, kIsDeserialized); 55 reader->AddBackRef(object_id, &cls, kIsDeserialized);
(...skipping 1966 matching lines...) Expand 10 before | Expand all | Expand 10 after
2022 ptr()->length_, \ 2022 ptr()->length_, \
2023 reinterpret_cast<uint8_t*>(ptr()->external_data_->data())); \ 2023 reinterpret_cast<uint8_t*>(ptr()->external_data_->data())); \
2024 } \ 2024 } \
2025 2025
2026 2026
2027 BYTEARRAY_TYPE_LIST(EXTERNALARRAY_WRITE_TO) 2027 BYTEARRAY_TYPE_LIST(EXTERNALARRAY_WRITE_TO)
2028 #undef BYTEARRAY_WRITE_TO 2028 #undef BYTEARRAY_WRITE_TO
2029 #undef BYTEARRAY_TYPE_LIST 2029 #undef BYTEARRAY_TYPE_LIST
2030 2030
2031 2031
2032 RawDartFunction* DartFunction::ReadFrom(SnapshotReader* reader,
2033 intptr_t object_id,
2034 intptr_t tags,
2035 Snapshot::Kind kind) {
2036 UNREACHABLE(); // DartFunction is an abstract class.
2037 return DartFunction::null();
2038 }
2039
2040
2041 void RawDartFunction::WriteTo(SnapshotWriter* writer,
2042 intptr_t object_id,
2043 Snapshot::Kind kind) {
2044 UNREACHABLE(); // DartFunction is an abstract class.
2045 }
2046
2047
2032 RawClosure* Closure::ReadFrom(SnapshotReader* reader, 2048 RawClosure* Closure::ReadFrom(SnapshotReader* reader,
2033 intptr_t object_id, 2049 intptr_t object_id,
2034 intptr_t tags, 2050 intptr_t tags,
2035 Snapshot::Kind kind) { 2051 Snapshot::Kind kind) {
2036 UNIMPLEMENTED(); 2052 UNIMPLEMENTED();
2037 return Closure::null(); 2053 return Closure::null();
2038 } 2054 }
2039 2055
2040 2056
2041 void RawClosure::WriteTo(SnapshotWriter* writer, 2057 void RawClosure::WriteTo(SnapshotWriter* writer,
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
2153 // Write out the class and tags information. 2169 // Write out the class and tags information.
2154 writer->WriteIndexedObject(kWeakPropertyCid); 2170 writer->WriteIndexedObject(kWeakPropertyCid);
2155 writer->WriteIntptrValue(writer->GetObjectTags(this)); 2171 writer->WriteIntptrValue(writer->GetObjectTags(this));
2156 2172
2157 // Write out all the other fields. 2173 // Write out all the other fields.
2158 writer->Write<RawObject*>(ptr()->key_); 2174 writer->Write<RawObject*>(ptr()->key_);
2159 writer->Write<RawObject*>(ptr()->value_); 2175 writer->Write<RawObject*>(ptr()->value_);
2160 } 2176 }
2161 2177
2162 } // namespace dart 2178 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698