| 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/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 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1293 break; | 1293 break; |
| 1294 } | 1294 } |
| 1295 case Dart_CObject_kCapability: { | 1295 case Dart_CObject_kCapability: { |
| 1296 WriteInlinedHeader(object); | 1296 WriteInlinedHeader(object); |
| 1297 WriteIndexedObject(kCapabilityCid); | 1297 WriteIndexedObject(kCapabilityCid); |
| 1298 WriteTags(0); | 1298 WriteTags(0); |
| 1299 Write<uint64_t>(object->value.as_capability.id); | 1299 Write<uint64_t>(object->value.as_capability.id); |
| 1300 break; | 1300 break; |
| 1301 } | 1301 } |
| 1302 default: | 1302 default: |
| 1303 UNREACHABLE(); | 1303 FATAL1("Unexpected Dart_CObject_Type %d\n", type); |
| 1304 } | 1304 } |
| 1305 | 1305 |
| 1306 return true; | 1306 return true; |
| 1307 } | 1307 } |
| 1308 | 1308 |
| 1309 | 1309 |
| 1310 bool ApiMessageWriter::WriteCMessage(Dart_CObject* object) { | 1310 bool ApiMessageWriter::WriteCMessage(Dart_CObject* object) { |
| 1311 bool success = WriteCObject(object); | 1311 bool success = WriteCObject(object); |
| 1312 if (!success) { | 1312 if (!success) { |
| 1313 UnmarkAllCObjects(object); | 1313 UnmarkAllCObjects(object); |
| 1314 return false; | 1314 return false; |
| 1315 } | 1315 } |
| 1316 // Write out all objects that were added to the forward list and have | 1316 // Write out all objects that were added to the forward list and have |
| 1317 // not been serialized yet. These would typically be fields of arrays. | 1317 // not been serialized yet. These would typically be fields of arrays. |
| 1318 // NOTE: The forward list might grow as we process the list. | 1318 // NOTE: The forward list might grow as we process the list. |
| 1319 for (intptr_t i = 0; i < forward_id_; i++) { | 1319 for (intptr_t i = 0; i < forward_id_; i++) { |
| 1320 success = WriteForwardedCObject(forward_list_[i]); | 1320 success = WriteForwardedCObject(forward_list_[i]); |
| 1321 if (!success) { | 1321 if (!success) { |
| 1322 UnmarkAllCObjects(object); | 1322 UnmarkAllCObjects(object); |
| 1323 return false; | 1323 return false; |
| 1324 } | 1324 } |
| 1325 } | 1325 } |
| 1326 UnmarkAllCObjects(object); | 1326 UnmarkAllCObjects(object); |
| 1327 return true; | 1327 return true; |
| 1328 } | 1328 } |
| 1329 | 1329 |
| 1330 } // namespace dart | 1330 } // namespace dart |
| OLD | NEW |