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

Unified Diff: runtime/vm/snapshot.cc

Issue 1221503004: Reclaim the CreatedFromSnapshot bit and use it to indicate VM Heap object (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address-code-review-comments Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/snapshot.h ('k') | tests/isolate/isolate.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot.cc
diff --git a/runtime/vm/snapshot.cc b/runtime/vm/snapshot.cc
index b08e704d7b220ad08c1691e7c49f3b2a7c169cbb..907e80577cda45b0eb934896f60799a8b8a7852d 100644
--- a/runtime/vm/snapshot.cc
+++ b/runtime/vm/snapshot.cc
@@ -325,6 +325,11 @@ RawObject* SnapshotReader::VmIsolateSnapshotObject(intptr_t index) const {
}
+bool SnapshotReader::is_vm_isolate() const {
+ return isolate_ == Dart::vm_isolate();
+}
+
+
RawObject* SnapshotReader::ReadObjectImpl(bool as_reference,
intptr_t patch_object_id,
intptr_t patch_offset) {
@@ -463,9 +468,6 @@ RawObject* SnapshotReader::ReadObjectRef(intptr_t object_id,
#undef SNAPSHOT_READ
default: UNREACHABLE(); break;
}
- if (kind_ == Snapshot::kFull) {
- pobj_.SetCreatedFromSnapshot();
- }
return pobj_.raw();
}
@@ -536,10 +538,14 @@ RawObject* SnapshotReader::ReadInlinedObject(intptr_t object_id,
result->SetFieldAtOffset(offset, Object::null_object());
offset += kWordSize;
}
- result->SetCreatedFromSnapshot();
- } else if (RawObject::IsCanonical(tags)) {
- *result = result->CheckAndCanonicalize(NULL);
- ASSERT(!result->IsNull());
+ }
+ if (RawObject::IsCanonical(tags)) {
+ if (kind_ == Snapshot::kFull) {
+ result->SetCanonical();
+ } else {
+ *result = result->CheckAndCanonicalize(NULL);
+ ASSERT(!result->IsNull());
+ }
}
return result->raw();
} else if (header_id == kStaticImplicitClosureObjectId) {
@@ -578,9 +584,6 @@ RawObject* SnapshotReader::ReadInlinedObject(intptr_t object_id,
#undef SNAPSHOT_READ
default: UNREACHABLE(); break;
}
- if (kind_ == Snapshot::kFull) {
- pobj_.SetCreatedFromSnapshot();
- }
AddPatchRecord(object_id, patch_object_id, patch_offset);
return pobj_.raw();
}
@@ -1071,6 +1074,7 @@ RawObject* SnapshotReader::AllocateUninitialized(intptr_t class_id,
ASSERT(class_id != kIllegalCid);
tags = RawObject::ClassIdTag::update(class_id, tags);
tags = RawObject::SizeTag::update(size, tags);
+ tags = RawObject::VMHeapObjectTag::update(is_vm_isolate(), tags);
raw_obj->ptr()->tags_ = tags;
return raw_obj;
}
@@ -1209,9 +1213,6 @@ void SnapshotReader::ArrayReadFrom(intptr_t object_id,
const Array& result,
intptr_t len,
intptr_t tags) {
- // Set the object tags.
- result.set_tags(tags);
-
// Setup the object fields.
const intptr_t typeargs_offset =
GrowableObjectArray::type_arguments_offset() / kWordSize;
@@ -2053,11 +2054,6 @@ void SnapshotWriter::WriteClassId(RawClass* cls) {
ASSERT(kind_ != Snapshot::kFull);
int class_id = cls->ptr()->id_;
ASSERT(!IsSingletonClassId(class_id) && !IsObjectStoreClassId(class_id));
- // TODO(5411462): Should restrict this to only core-lib classes in this
- // case.
- // Write out the class and tags information.
- WriteVMIsolateObject(kClassCid);
- WriteTags(GetObjectTags(cls));
// Write out the library url and class name.
RawLibrary* library = cls->ptr()->library_;
« no previous file with comments | « runtime/vm/snapshot.h ('k') | tests/isolate/isolate.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698