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 1751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1762 // RDX: SubtypeTestCache. | 1762 // RDX: SubtypeTestCache. |
1763 __ movq(RDX, FieldAddress(RDX, SubtypeTestCache::cache_offset())); | 1763 __ movq(RDX, FieldAddress(RDX, SubtypeTestCache::cache_offset())); |
1764 __ addq(RDX, Immediate(Array::data_offset() - kHeapObjectTag)); | 1764 __ addq(RDX, Immediate(Array::data_offset() - kHeapObjectTag)); |
1765 // RDX: Entry start. | 1765 // RDX: Entry start. |
1766 // R10: instance class id. | 1766 // R10: instance class id. |
1767 // R13: instance type arguments (still null if closure). | 1767 // R13: instance type arguments (still null if closure). |
1768 Label loop, found, not_found, next_iteration; | 1768 Label loop, found, not_found, next_iteration; |
1769 __ SmiTag(R10); | 1769 __ SmiTag(R10); |
1770 __ cmpq(R10, Immediate(Smi::RawValue(kClosureCid))); | 1770 __ cmpq(R10, Immediate(Smi::RawValue(kClosureCid))); |
1771 __ j(NOT_EQUAL, &loop, Assembler::kNearJump); | 1771 __ j(NOT_EQUAL, &loop, Assembler::kNearJump); |
1772 __ movq(R13, FieldAddress(RAX, Closure::instantiator_offset())); | 1772 __ movq(R13, FieldAddress(RAX, Closure::function_type_arguments_offset())); |
| 1773 __ cmpq(R13, R9); // Cache cannot be used for generic closures. |
| 1774 __ j(NOT_EQUAL, ¬_found, Assembler::kNearJump); |
| 1775 __ movq(R13, |
| 1776 FieldAddress(RAX, Closure::instantiator_type_arguments_offset())); |
1773 __ movq(R10, FieldAddress(RAX, Closure::function_offset())); | 1777 __ movq(R10, FieldAddress(RAX, Closure::function_offset())); |
1774 // R10: instance class id as Smi or function. | 1778 // R10: instance class id as Smi or function. |
1775 __ Bind(&loop); | 1779 __ Bind(&loop); |
1776 __ movq(RDI, Address(RDX, kWordSize * | 1780 __ movq(RDI, Address(RDX, kWordSize * |
1777 SubtypeTestCache::kInstanceClassIdOrFunction)); | 1781 SubtypeTestCache::kInstanceClassIdOrFunction)); |
1778 __ cmpq(RDI, R9); | 1782 __ cmpq(RDI, R9); |
1779 __ j(EQUAL, ¬_found, Assembler::kNearJump); | 1783 __ j(EQUAL, ¬_found, Assembler::kNearJump); |
1780 __ cmpq(RDI, R10); | 1784 __ cmpq(RDI, R10); |
1781 if (n == 1) { | 1785 if (n == 1) { |
1782 __ j(EQUAL, &found, Assembler::kNearJump); | 1786 __ j(EQUAL, &found, Assembler::kNearJump); |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2294 } | 2298 } |
2295 | 2299 |
2296 | 2300 |
2297 void StubCode::GenerateAsynchronousGapMarkerStub(Assembler* assembler) { | 2301 void StubCode::GenerateAsynchronousGapMarkerStub(Assembler* assembler) { |
2298 __ int3(); | 2302 __ int3(); |
2299 } | 2303 } |
2300 | 2304 |
2301 } // namespace dart | 2305 } // namespace dart |
2302 | 2306 |
2303 #endif // defined TARGET_ARCH_X64 | 2307 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |