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

Unified Diff: runtime/vm/snapshot.cc

Issue 2953753002: Revert "Inline instance object hash code into object header on 64 bit." (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/snapshot.h ('k') | runtime/vm/stub_code_arm.cc » ('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 01f99f0a7b1645d3df10a917579f237a1d3d98a5..609262e3e5cad5927ea6e82d383542d1a5614635 100644
--- a/runtime/vm/snapshot.cc
+++ b/runtime/vm/snapshot.cc
@@ -755,9 +755,6 @@ void ImageWriter::WriteROData(WriteStream* stream) {
uword marked_tags = obj.raw()->ptr()->tags_;
marked_tags = RawObject::VMHeapObjectTag::update(true, marked_tags);
marked_tags = RawObject::MarkBit::update(true, marked_tags);
-#if defined(HASH_IN_OBJECT_HEADER)
- marked_tags |= static_cast<uword>(obj.raw()->ptr()->hash_) << 32;
-#endif
stream->WriteWord(marked_tags);
start += sizeof(uword);
for (uword* cursor = reinterpret_cast<uword*>(start);
@@ -844,11 +841,6 @@ void AssemblyImageWriter::WriteText(WriteStream* clustered_stream, bool vm) {
uword marked_tags = insns.raw_ptr()->tags_;
marked_tags = RawObject::VMHeapObjectTag::update(true, marked_tags);
marked_tags = RawObject::MarkBit::update(true, marked_tags);
-#if defined(HASH_IN_OBJECT_HEADER)
- // Can't use GetObjectTagsAndHash because the update methods discard the
- // high bits.
- marked_tags |= static_cast<uword>(insns.raw_ptr()->hash_) << 32;
-#endif
WriteWordLiteralText(marked_tags);
beginning += sizeof(uword);
@@ -1054,11 +1046,6 @@ void BlobImageWriter::WriteText(WriteStream* clustered_stream, bool vm) {
uword marked_tags = insns.raw_ptr()->tags_;
marked_tags = RawObject::VMHeapObjectTag::update(true, marked_tags);
marked_tags = RawObject::MarkBit::update(true, marked_tags);
-#if defined(HASH_IN_OBJECT_HEADER)
- // Can't use GetObjectTagsAndHash because the update methods discard the
- // high bits.
- marked_tags |= static_cast<uword>(insns.raw_ptr()->hash_) << 32;
-#endif
instructions_blob_stream_.WriteWord(marked_tags);
beginning += sizeof(uword);
@@ -1363,20 +1350,11 @@ void SnapshotWriter::WriteObject(RawObject* rawobj) {
}
-uint32_t SnapshotWriter::GetObjectTags(RawObject* raw) {
+uword SnapshotWriter::GetObjectTags(RawObject* raw) {
return raw->ptr()->tags_;
}
-uword SnapshotWriter::GetObjectTagsAndHash(RawObject* raw) {
- uword result = raw->ptr()->tags_;
-#if defined(HASH_IN_OBJECT_HEADER)
- result |= static_cast<uword>(raw->ptr()->hash_) << 32;
-#endif
- return result;
-}
-
-
#define VM_OBJECT_CLASS_LIST(V) \
V(OneByteString) \
V(TwoByteString) \
@@ -1600,7 +1578,7 @@ void SnapshotWriter::WriteObjectImpl(RawObject* raw, bool as_reference) {
// When we know that we are dealing with leaf or shallow objects we write
// these objects inline even when 'as_reference' is true.
const bool write_as_reference = as_reference && !raw->IsCanonical();
- uintptr_t tags = GetObjectTagsAndHash(raw);
+ intptr_t tags = raw->ptr()->tags_;
// Add object to the forward ref list and mark it so that future references
// to this object in the snapshot will use this object id. Mark the
@@ -1677,7 +1655,7 @@ class WriteInlinedObjectVisitor : public ObjectVisitor {
virtual void VisitObject(RawObject* obj) {
intptr_t object_id = writer_->forward_list_->FindObject(obj);
ASSERT(object_id != kInvalidIndex);
- intptr_t tags = MessageWriter::GetObjectTagsAndHash(obj);
+ intptr_t tags = writer_->GetObjectTags(obj);
writer_->WriteMarkedObjectImpl(obj, tags, object_id, kAsInlinedObject);
}
@@ -1842,7 +1820,7 @@ RawFunction* SnapshotWriter::IsSerializableClosure(RawClosure* closure) {
RawClass* SnapshotWriter::GetFunctionOwner(RawFunction* func) {
RawObject* owner = func->ptr()->owner_;
- uint32_t tags = GetObjectTags(owner);
+ uword tags = GetObjectTags(owner);
intptr_t class_id = RawObject::ClassIdTag::decode(tags);
if (class_id == kClassCid) {
return reinterpret_cast<RawClass*>(owner);
« no previous file with comments | « runtime/vm/snapshot.h ('k') | runtime/vm/stub_code_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698