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

Unified Diff: runtime/vm/intrinsifier_x64.cc

Issue 2965723002: VM: Reland Inline instance object hash code into object header on 64bit. (Closed)
Patch Set: Fix snapshot incompatibility that sank Flutter Gallery 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
Index: runtime/vm/intrinsifier_x64.cc
diff --git a/runtime/vm/intrinsifier_x64.cc b/runtime/vm/intrinsifier_x64.cc
index f0ca5913f9164fb4d092aecb7eee663df629afac..3b97a1bf80b551b928e90e98d4abb018a306f006 100644
--- a/runtime/vm/intrinsifier_x64.cc
+++ b/runtime/vm/intrinsifier_x64.cc
@@ -1754,6 +1754,23 @@ void Intrinsifier::String_getHashCode(Assembler* assembler) {
}
+void Intrinsifier::Object_getHash(Assembler* assembler) {
+ __ movq(RAX, Address(RSP, +1 * kWordSize)); // Object.
+ __ movl(RAX, FieldAddress(RAX, String::hash_offset()));
+ __ SmiTag(RAX);
+ __ ret();
+}
+
+
+void Intrinsifier::Object_setHash(Assembler* assembler) {
+ __ movq(RAX, Address(RSP, +2 * kWordSize)); // Object.
+ __ movq(RDX, Address(RSP, +1 * kWordSize)); // Value.
+ __ SmiUntag(RDX);
+ __ movl(FieldAddress(RAX, String::hash_offset()), RDX);
+ __ ret();
+}
+
+
void GenerateSubstringMatchesSpecialization(Assembler* assembler,
intptr_t receiver_cid,
intptr_t other_cid,

Powered by Google App Engine
This is Rietveld 408576698