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

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

Issue 2662333002: Start adding vm/cc tests for rewind functionality. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
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/dart_api_message.h" 5 #include "vm/dart_api_message.h"
6 #include "vm/object.h" 6 #include "vm/object.h"
7 #include "vm/snapshot_ids.h" 7 #include "vm/snapshot_ids.h"
8 #include "vm/symbols.h" 8 #include "vm/symbols.h"
9 #include "vm/unicode.h" 9 #include "vm/unicode.h"
10 10
(...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after
1285 break; 1285 break;
1286 } 1286 }
1287 case Dart_CObject_kCapability: { 1287 case Dart_CObject_kCapability: {
1288 WriteInlinedHeader(object); 1288 WriteInlinedHeader(object);
1289 WriteIndexedObject(kCapabilityCid); 1289 WriteIndexedObject(kCapabilityCid);
1290 WriteTags(0); 1290 WriteTags(0);
1291 Write<uint64_t>(object->value.as_capability.id); 1291 Write<uint64_t>(object->value.as_capability.id);
1292 break; 1292 break;
1293 } 1293 }
1294 default: 1294 default:
1295 fprintf(stderr, "Unexpected Dart_CObject_Type %d\n", type);
rmacnak 2017/01/31 19:21:00 FATAL1("Unexpected Dart_CObject_Type %d\n", type);
turnidge 2017/01/31 19:35:46 Done.
1295 UNREACHABLE(); 1296 UNREACHABLE();
1296 } 1297 }
1297 1298
1298 return true; 1299 return true;
1299 } 1300 }
1300 1301
1301 1302
1302 bool ApiMessageWriter::WriteCMessage(Dart_CObject* object) { 1303 bool ApiMessageWriter::WriteCMessage(Dart_CObject* object) {
1303 bool success = WriteCObject(object); 1304 bool success = WriteCObject(object);
1304 if (!success) { 1305 if (!success) {
1305 UnmarkAllCObjects(object); 1306 UnmarkAllCObjects(object);
1306 return false; 1307 return false;
1307 } 1308 }
1308 // Write out all objects that were added to the forward list and have 1309 // Write out all objects that were added to the forward list and have
1309 // not been serialized yet. These would typically be fields of arrays. 1310 // not been serialized yet. These would typically be fields of arrays.
1310 // NOTE: The forward list might grow as we process the list. 1311 // NOTE: The forward list might grow as we process the list.
1311 for (intptr_t i = 0; i < forward_id_; i++) { 1312 for (intptr_t i = 0; i < forward_id_; i++) {
1312 success = WriteForwardedCObject(forward_list_[i]); 1313 success = WriteForwardedCObject(forward_list_[i]);
1313 if (!success) { 1314 if (!success) {
1314 UnmarkAllCObjects(object); 1315 UnmarkAllCObjects(object);
1315 return false; 1316 return false;
1316 } 1317 }
1317 } 1318 }
1318 UnmarkAllCObjects(object); 1319 UnmarkAllCObjects(object);
1319 return true; 1320 return true;
1320 } 1321 }
1321 1322
1322 } // namespace dart 1323 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698