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/snapshot.h" | 5 #include "vm/snapshot.h" |
6 | 6 |
7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
8 #include "vm/bootstrap.h" | 8 #include "vm/bootstrap.h" |
9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 result->SetFieldAtOffset(offset, pobj_); | 518 result->SetFieldAtOffset(offset, pobj_); |
519 if ((offset != type_argument_field_offset) && | 519 if ((offset != type_argument_field_offset) && |
520 (kind_ == Snapshot::kMessage)) { | 520 (kind_ == Snapshot::kMessage)) { |
521 // TODO(fschneider): Consider hoisting these lookups out of the loop. | 521 // TODO(fschneider): Consider hoisting these lookups out of the loop. |
522 // This would involve creating a handle, since cls_ can't be reused | 522 // This would involve creating a handle, since cls_ can't be reused |
523 // across the call to ReadObjectImpl. | 523 // across the call to ReadObjectImpl. |
524 cls_ = isolate()->class_table()->At(result_cid); | 524 cls_ = isolate()->class_table()->At(result_cid); |
525 array_ = cls_.OffsetToFieldMap(); | 525 array_ = cls_.OffsetToFieldMap(); |
526 field_ ^= array_.At(offset >> kWordSizeLog2); | 526 field_ ^= array_.At(offset >> kWordSizeLog2); |
527 ASSERT(!field_.IsNull()); | 527 ASSERT(!field_.IsNull()); |
528 ASSERT(field_.Offset() == offset); | 528 ASSERT(field_.InstanceFieldOffset() == offset); |
529 obj_ = pobj_.raw(); | 529 obj_ = pobj_.raw(); |
530 field_.RecordStore(obj_); | 530 field_.RecordStore(obj_); |
531 } | 531 } |
532 // TODO(fschneider): Verify the guarded cid and length for other kinds of | 532 // TODO(fschneider): Verify the guarded cid and length for other kinds of |
533 // snapshot (kFull, kScript) with asserts. | 533 // snapshot (kFull, kScript) with asserts. |
534 offset += kWordSize; | 534 offset += kWordSize; |
535 } | 535 } |
536 if (kind_ == Snapshot::kFull) { | 536 if (kind_ == Snapshot::kFull) { |
537 // We create an uninitialized object in the case of full snapshots, so | 537 // We create an uninitialized object in the case of full snapshots, so |
538 // we need to initialize any remaining padding area with the Null object. | 538 // we need to initialize any remaining padding area with the Null object. |
(...skipping 1953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2492 NoSafepointScope no_safepoint; | 2492 NoSafepointScope no_safepoint; |
2493 WriteObject(obj.raw()); | 2493 WriteObject(obj.raw()); |
2494 UnmarkAll(); | 2494 UnmarkAll(); |
2495 } else { | 2495 } else { |
2496 ThrowException(exception_type(), exception_msg()); | 2496 ThrowException(exception_type(), exception_msg()); |
2497 } | 2497 } |
2498 } | 2498 } |
2499 | 2499 |
2500 | 2500 |
2501 } // namespace dart | 2501 } // namespace dart |
OLD | NEW |