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

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

Issue 2954453002: VM: Reland Inline instance object hash code into object header on 64bit. (Closed)
Patch Set: Incorporate last minute code review feedback 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/intrinsifier_arm64.cc ('k') | runtime/vm/method_recognizer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/globals.h" // Needed here to get TARGET_ARCH_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/intrinsifier.h" 8 #include "vm/intrinsifier.h"
9 9
10 #include "vm/assembler.h" 10 #include "vm/assembler.h"
(...skipping 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after
1747 ASSERT(kSmiTag == 0); 1747 ASSERT(kSmiTag == 0);
1748 ASSERT(kSmiTagShift == 1); 1748 ASSERT(kSmiTagShift == 1);
1749 __ addq(RAX, RAX); // Smi tag RAX, setting Z flag. 1749 __ addq(RAX, RAX); // Smi tag RAX, setting Z flag.
1750 __ j(ZERO, &fall_through, Assembler::kNearJump); 1750 __ j(ZERO, &fall_through, Assembler::kNearJump);
1751 __ ret(); 1751 __ ret();
1752 __ Bind(&fall_through); 1752 __ Bind(&fall_through);
1753 // Hash not yet computed. 1753 // Hash not yet computed.
1754 } 1754 }
1755 1755
1756 1756
1757 void Intrinsifier::Object_getHash(Assembler* assembler) {
1758 __ movq(RAX, Address(RSP, +1 * kWordSize)); // Object.
1759 __ movl(RAX, FieldAddress(RAX, String::hash_offset()));
1760 __ SmiTag(RAX);
1761 __ ret();
1762 }
1763
1764
1765 void Intrinsifier::Object_setHash(Assembler* assembler) {
1766 __ movq(RAX, Address(RSP, +2 * kWordSize)); // Object.
1767 __ movq(RDX, Address(RSP, +1 * kWordSize)); // Value.
1768 __ SmiUntag(RDX);
1769 __ movl(FieldAddress(RAX, String::hash_offset()), RDX);
1770 __ ret();
1771 }
1772
1773
1757 void GenerateSubstringMatchesSpecialization(Assembler* assembler, 1774 void GenerateSubstringMatchesSpecialization(Assembler* assembler,
1758 intptr_t receiver_cid, 1775 intptr_t receiver_cid,
1759 intptr_t other_cid, 1776 intptr_t other_cid,
1760 Label* return_true, 1777 Label* return_true,
1761 Label* return_false) { 1778 Label* return_false) {
1762 __ movq(R8, FieldAddress(RAX, String::length_offset())); 1779 __ movq(R8, FieldAddress(RAX, String::length_offset()));
1763 __ movq(R9, FieldAddress(RCX, String::length_offset())); 1780 __ movq(R9, FieldAddress(RCX, String::length_offset()));
1764 1781
1765 // if (other.length == 0) return true; 1782 // if (other.length == 0) return true;
1766 __ testq(R9, R9); 1783 __ testq(R9, R9);
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
2302 __ movq(Address(THR, Thread::async_stack_trace_offset()), RAX); 2319 __ movq(Address(THR, Thread::async_stack_trace_offset()), RAX);
2303 __ LoadObject(RAX, Object::null_object()); 2320 __ LoadObject(RAX, Object::null_object());
2304 __ ret(); 2321 __ ret();
2305 } 2322 }
2306 2323
2307 #undef __ 2324 #undef __
2308 2325
2309 } // namespace dart 2326 } // namespace dart
2310 2327
2311 #endif // defined TARGET_ARCH_X64 2328 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_arm64.cc ('k') | runtime/vm/method_recognizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698