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

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

Issue 304703002: Split GuardField into GuardFieldType and GuardFieldLength instructions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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
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/snapshot.h" 5 #include "vm/snapshot.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/bigint_operations.h" 8 #include "vm/bigint_operations.h"
9 #include "vm/bootstrap.h" 9 #include "vm/bootstrap.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 if ((offset != type_argument_field_offset) && 851 if ((offset != type_argument_field_offset) &&
852 (kind_ == Snapshot::kMessage)) { 852 (kind_ == Snapshot::kMessage)) {
853 // TODO(fschneider): Consider hoisting these lookups out of the loop. 853 // TODO(fschneider): Consider hoisting these lookups out of the loop.
854 // This would involve creating a handle, since cls_ can't be reused 854 // This would involve creating a handle, since cls_ can't be reused
855 // across the call to ReadObjectRef. 855 // across the call to ReadObjectRef.
856 cls_ = isolate()->class_table()->At(result_cid); 856 cls_ = isolate()->class_table()->At(result_cid);
857 array_ = cls_.OffsetToFieldMap(); 857 array_ = cls_.OffsetToFieldMap();
858 field_ ^= array_.At(offset >> kWordSizeLog2); 858 field_ ^= array_.At(offset >> kWordSizeLog2);
859 ASSERT(!field_.IsNull()); 859 ASSERT(!field_.IsNull());
860 ASSERT(field_.Offset() == offset); 860 ASSERT(field_.Offset() == offset);
861 field_.UpdateGuardedCidAndLength(obj_); 861 field_.RecordStore(obj_);
862 } 862 }
863 // TODO(fschneider): Verify the guarded cid and length for other kinds of 863 // TODO(fschneider): Verify the guarded cid and length for other kinds of
864 // snapshot (kFull, kScript) with asserts. 864 // snapshot (kFull, kScript) with asserts.
865 offset += kWordSize; 865 offset += kWordSize;
866 } 866 }
867 if (kind_ == Snapshot::kFull) { 867 if (kind_ == Snapshot::kFull) {
868 // We create an uninitialized object in the case of full snapshots, so 868 // We create an uninitialized object in the case of full snapshots, so
869 // we need to initialize any remaining padding area with the Null object. 869 // we need to initialize any remaining padding area with the Null object.
870 while (offset < instance_size) { 870 while (offset < instance_size) {
871 result->SetFieldAtOffset(offset, Object::null_object()); 871 result->SetFieldAtOffset(offset, Object::null_object());
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
1573 NoGCScope no_gc; 1573 NoGCScope no_gc;
1574 WriteObject(obj.raw()); 1574 WriteObject(obj.raw());
1575 UnmarkAll(); 1575 UnmarkAll();
1576 } else { 1576 } else {
1577 ThrowException(exception_type(), exception_msg()); 1577 ThrowException(exception_type(), exception_msg());
1578 } 1578 }
1579 } 1579 }
1580 1580
1581 1581
1582 } // namespace dart 1582 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698