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

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

Issue 109593003: Use a trail instead of a mark bit when processing recursive types in the VM (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 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
« no previous file with comments | « runtime/vm/raw_object.h ('k') | tests/language/cyclic_type2_test.dart » ('j') | 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) 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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 // Set all the object fields. 324 // Set all the object fields.
325 // TODO(5411462): Need to assert No GC can happen here, even though 325 // TODO(5411462): Need to assert No GC can happen here, even though
326 // allocations may happen. 326 // allocations may happen.
327 intptr_t num_flds = (type_ref.raw()->to() - type_ref.raw()->from()); 327 intptr_t num_flds = (type_ref.raw()->to() - type_ref.raw()->from());
328 for (intptr_t i = 0; i <= num_flds; i++) { 328 for (intptr_t i = 0; i <= num_flds; i++) {
329 (*reader->ObjectHandle()) = reader->ReadObjectRef(); 329 (*reader->ObjectHandle()) = reader->ReadObjectRef();
330 type_ref.StorePointer((type_ref.raw()->from() + i), 330 type_ref.StorePointer((type_ref.raw()->from() + i),
331 reader->ObjectHandle()->raw()); 331 reader->ObjectHandle()->raw());
332 } 332 }
333 333
334 type_ref.set_is_being_checked(false);
335
336 return type_ref.raw(); 334 return type_ref.raw();
337 } 335 }
338 336
339 337
340 void RawTypeRef::WriteTo(SnapshotWriter* writer, 338 void RawTypeRef::WriteTo(SnapshotWriter* writer,
341 intptr_t object_id, 339 intptr_t object_id,
342 Snapshot::Kind kind) { 340 Snapshot::Kind kind) {
343 ASSERT(writer != NULL); 341 ASSERT(writer != NULL);
344 342
345 // Write out the serialization header value for this object. 343 // Write out the serialization header value for this object.
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 // TODO(5411462): Need to assert No GC can happen here, even though 448 // TODO(5411462): Need to assert No GC can happen here, even though
451 // allocations may happen. 449 // allocations may happen.
452 intptr_t num_flds = (bounded_type.raw()->to() - 450 intptr_t num_flds = (bounded_type.raw()->to() -
453 bounded_type.raw()->from()); 451 bounded_type.raw()->from());
454 for (intptr_t i = 0; i <= num_flds; i++) { 452 for (intptr_t i = 0; i <= num_flds; i++) {
455 (*reader->ObjectHandle()) = reader->ReadObjectRef(); 453 (*reader->ObjectHandle()) = reader->ReadObjectRef();
456 bounded_type.StorePointer((bounded_type.raw()->from() + i), 454 bounded_type.StorePointer((bounded_type.raw()->from() + i),
457 reader->ObjectHandle()->raw()); 455 reader->ObjectHandle()->raw());
458 } 456 }
459 457
460 bounded_type.set_is_being_checked(false);
461
462 return bounded_type.raw(); 458 return bounded_type.raw();
463 } 459 }
464 460
465 461
466 void RawBoundedType::WriteTo(SnapshotWriter* writer, 462 void RawBoundedType::WriteTo(SnapshotWriter* writer,
467 intptr_t object_id, 463 intptr_t object_id,
468 Snapshot::Kind kind) { 464 Snapshot::Kind kind) {
469 ASSERT(writer != NULL); 465 ASSERT(writer != NULL);
470 466
471 // Write out the serialization header value for this object. 467 // Write out the serialization header value for this object.
(...skipping 2242 matching lines...) Expand 10 before | Expand all | Expand 10 after
2714 // We do not allow objects with native fields in an isolate message. 2710 // We do not allow objects with native fields in an isolate message.
2715 writer->SetWriteException(Exceptions::kArgument, 2711 writer->SetWriteException(Exceptions::kArgument,
2716 "Illegal argument in isolate message" 2712 "Illegal argument in isolate message"
2717 " : (object is a MirrorReference)"); 2713 " : (object is a MirrorReference)");
2718 } else { 2714 } else {
2719 UNREACHABLE(); 2715 UNREACHABLE();
2720 } 2716 }
2721 } 2717 }
2722 2718
2723 } // namespace dart 2719 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/raw_object.h ('k') | tests/language/cyclic_type2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698