OLD | NEW |
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" | 5 #include "vm/globals.h" |
6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 1729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1740 } | 1740 } |
1741 __ LoadClassId(R10, RAX); | 1741 __ LoadClassId(R10, RAX); |
1742 // RAX: instance, R10: instance class id. | 1742 // RAX: instance, R10: instance class id. |
1743 // R13: instance type arguments or null, used only if n > 1. | 1743 // R13: instance type arguments or null, used only if n > 1. |
1744 __ movq(RDX, Address(RSP, kCacheOffsetInBytes)); | 1744 __ movq(RDX, Address(RSP, kCacheOffsetInBytes)); |
1745 // RDX: SubtypeTestCache. | 1745 // RDX: SubtypeTestCache. |
1746 __ movq(RDX, FieldAddress(RDX, SubtypeTestCache::cache_offset())); | 1746 __ movq(RDX, FieldAddress(RDX, SubtypeTestCache::cache_offset())); |
1747 __ addq(RDX, Immediate(Array::data_offset() - kHeapObjectTag)); | 1747 __ addq(RDX, Immediate(Array::data_offset() - kHeapObjectTag)); |
1748 // RDX: Entry start. | 1748 // RDX: Entry start. |
1749 // R10: instance class id. | 1749 // R10: instance class id. |
1750 // R13: instance type arguments. | 1750 // R13: instance type arguments (still null if closure). |
1751 Label loop, found, not_found, next_iteration; | 1751 Label loop, found, not_found, next_iteration; |
1752 __ SmiTag(R10); | 1752 __ SmiTag(R10); |
1753 __ cmpq(R10, Immediate(Smi::RawValue(kClosureCid))); | 1753 __ cmpq(R10, Immediate(Smi::RawValue(kClosureCid))); |
1754 __ j(NOT_EQUAL, &loop, Assembler::kNearJump); | 1754 __ j(NOT_EQUAL, &loop, Assembler::kNearJump); |
| 1755 __ movq(R13, FieldAddress(RAX, Closure::instantiator_offset())); |
1755 __ movq(R10, FieldAddress(RAX, Closure::function_offset())); | 1756 __ movq(R10, FieldAddress(RAX, Closure::function_offset())); |
1756 // R10: instance class id as Smi or function. | 1757 // R10: instance class id as Smi or function. |
1757 __ Bind(&loop); | 1758 __ Bind(&loop); |
1758 __ movq(RDI, Address(RDX, kWordSize * | 1759 __ movq(RDI, Address(RDX, kWordSize * |
1759 SubtypeTestCache::kInstanceClassIdOrFunction)); | 1760 SubtypeTestCache::kInstanceClassIdOrFunction)); |
1760 __ cmpq(RDI, R9); | 1761 __ cmpq(RDI, R9); |
1761 __ j(EQUAL, ¬_found, Assembler::kNearJump); | 1762 __ j(EQUAL, ¬_found, Assembler::kNearJump); |
1762 __ cmpq(RDI, R10); | 1763 __ cmpq(RDI, R10); |
1763 if (n == 1) { | 1764 if (n == 1) { |
1764 __ j(EQUAL, &found, Assembler::kNearJump); | 1765 __ j(EQUAL, &found, Assembler::kNearJump); |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2269 } | 2270 } |
2270 | 2271 |
2271 | 2272 |
2272 void StubCode::GenerateAsynchronousGapMarkerStub(Assembler* assembler) { | 2273 void StubCode::GenerateAsynchronousGapMarkerStub(Assembler* assembler) { |
2273 __ int3(); | 2274 __ int3(); |
2274 } | 2275 } |
2275 | 2276 |
2276 } // namespace dart | 2277 } // namespace dart |
2277 | 2278 |
2278 #endif // defined TARGET_ARCH_X64 | 2279 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |