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

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

Issue 8383029: Implement external strings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address final review comments Created 9 years, 1 month 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
« no previous file with comments | « runtime/vm/raw_object.cc ('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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 StringWriteTo(writer, 1106 StringWriteTo(writer,
1107 object_id, 1107 object_id,
1108 ObjectStore::kFourByteStringClass, 1108 ObjectStore::kFourByteStringClass,
1109 serialize_classes, 1109 serialize_classes,
1110 ptr()->length_, 1110 ptr()->length_,
1111 ptr()->hash_, 1111 ptr()->hash_,
1112 ptr()->data_); 1112 ptr()->data_);
1113 } 1113 }
1114 1114
1115 1115
1116 RawExternalOneByteString* ExternalOneByteString::ReadFrom(
1117 SnapshotReader* reader,
1118 intptr_t object_id,
1119 bool classes_serialized) {
1120 UNREACHABLE();
1121 return ExternalOneByteString::null();
1122 }
1123
1124
1125 RawExternalTwoByteString* ExternalTwoByteString::ReadFrom(
1126 SnapshotReader* reader,
1127 intptr_t object_id,
1128 bool classes_serialized) {
1129 UNREACHABLE();
1130 return ExternalTwoByteString::null();
1131 }
1132
1133
1134 RawExternalFourByteString* ExternalFourByteString::ReadFrom(
1135 SnapshotReader* reader,
1136 intptr_t object_id,
1137 bool classes_serialized) {
1138 UNREACHABLE();
1139 return ExternalFourByteString::null();
1140 }
1141
1142
1143 void RawExternalOneByteString::WriteTo(SnapshotWriter* writer,
1144 intptr_t object_id,
1145 bool serialize_classes) {
1146 // Serialize as a non-external one byte string.
1147 StringWriteTo(writer,
1148 object_id,
1149 ObjectStore::kOneByteStringClass,
1150 serialize_classes,
1151 ptr()->length_,
1152 ptr()->hash_,
1153 ptr()->external_data_->data_);
1154 }
1155
1156
1157 void RawExternalTwoByteString::WriteTo(SnapshotWriter* writer,
1158 intptr_t object_id,
1159 bool serialize_classes) {
1160 // Serialize as a non-external two byte string.
1161 StringWriteTo(writer,
1162 object_id,
1163 ObjectStore::kTwoByteStringClass,
1164 serialize_classes,
1165 ptr()->length_,
1166 ptr()->hash_,
1167 ptr()->external_data_->data_);
1168 }
1169
1170
1171 void RawExternalFourByteString::WriteTo(SnapshotWriter* writer,
1172 intptr_t object_id,
1173 bool serialize_classes) {
1174 // Serialize as a non-external four byte string.
1175 StringWriteTo(writer,
1176 object_id,
1177 ObjectStore::kFourByteStringClass,
1178 serialize_classes,
1179 ptr()->length_,
1180 ptr()->hash_,
1181 ptr()->external_data_->data_);
1182 }
1183
1184
1116 RawBool* Bool::ReadFrom(SnapshotReader* reader, 1185 RawBool* Bool::ReadFrom(SnapshotReader* reader,
1117 intptr_t object_id, 1186 intptr_t object_id,
1118 bool classes_serialized) { 1187 bool classes_serialized) {
1119 UNREACHABLE(); 1188 UNREACHABLE();
1120 return Bool::null(); 1189 return Bool::null();
1121 } 1190 }
1122 1191
1123 1192
1124 void RawBool::WriteTo(SnapshotWriter* writer, 1193 void RawBool::WriteTo(SnapshotWriter* writer,
1125 intptr_t object_id, 1194 intptr_t object_id,
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
1316 // Write out all the other fields. 1385 // Write out all the other fields.
1317 writer->Write<RawObject*>(ptr()->num_bracket_expressions_); 1386 writer->Write<RawObject*>(ptr()->num_bracket_expressions_);
1318 writer->WriteObject(ptr()->pattern_); 1387 writer->WriteObject(ptr()->pattern_);
1319 writer->Write<intptr_t>(ptr()->type_); 1388 writer->Write<intptr_t>(ptr()->type_);
1320 writer->Write<intptr_t>(ptr()->flags_); 1389 writer->Write<intptr_t>(ptr()->flags_);
1321 1390
1322 // Do not write out the data part which is native. 1391 // Do not write out the data part which is native.
1323 } 1392 }
1324 1393
1325 } // namespace dart 1394 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/raw_object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698