| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/assembler_macros.h" | 9 #include "vm/assembler_macros.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 1827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1838 const intptr_t kInstantiatorTypeArgumentsInBytes = 1 * kWordSize; | 1838 const intptr_t kInstantiatorTypeArgumentsInBytes = 1 * kWordSize; |
| 1839 const intptr_t kInstanceOffsetInBytes = 2 * kWordSize; | 1839 const intptr_t kInstanceOffsetInBytes = 2 * kWordSize; |
| 1840 const intptr_t kCacheOffsetInBytes = 3 * kWordSize; | 1840 const intptr_t kCacheOffsetInBytes = 3 * kWordSize; |
| 1841 __ movq(RAX, Address(RSP, kInstanceOffsetInBytes)); | 1841 __ movq(RAX, Address(RSP, kInstanceOffsetInBytes)); |
| 1842 if (n > 1) { | 1842 if (n > 1) { |
| 1843 __ LoadClass(R10, RAX); | 1843 __ LoadClass(R10, RAX); |
| 1844 // Compute instance type arguments into R13. | 1844 // Compute instance type arguments into R13. |
| 1845 Label has_no_type_arguments; | 1845 Label has_no_type_arguments; |
| 1846 __ movq(R13, raw_null); | 1846 __ movq(R13, raw_null); |
| 1847 __ movq(RDI, FieldAddress(R10, | 1847 __ movq(RDI, FieldAddress(R10, |
| 1848 Class::type_arguments_field_offset_offset())); | 1848 Class::type_arguments_field_offset_in_words_offset())); |
| 1849 __ cmpq(RDI, Immediate(Class::kNoTypeArguments)); | 1849 __ cmpq(RDI, Immediate(Class::kNoTypeArguments)); |
| 1850 __ j(EQUAL, &has_no_type_arguments, Assembler::kNearJump); | 1850 __ j(EQUAL, &has_no_type_arguments, Assembler::kNearJump); |
| 1851 __ movq(R13, FieldAddress(RAX, RDI, TIMES_1, 0)); | 1851 __ movq(R13, FieldAddress(RAX, RDI, TIMES_8, 0)); |
| 1852 __ Bind(&has_no_type_arguments); | 1852 __ Bind(&has_no_type_arguments); |
| 1853 } | 1853 } |
| 1854 __ LoadClassId(R10, RAX); | 1854 __ LoadClassId(R10, RAX); |
| 1855 // RAX: instance, R10: instance class id. | 1855 // RAX: instance, R10: instance class id. |
| 1856 // R13: instance type arguments or null, used only if n > 1. | 1856 // R13: instance type arguments or null, used only if n > 1. |
| 1857 __ movq(RDX, Address(RSP, kCacheOffsetInBytes)); | 1857 __ movq(RDX, Address(RSP, kCacheOffsetInBytes)); |
| 1858 // RDX: SubtypeTestCache. | 1858 // RDX: SubtypeTestCache. |
| 1859 __ movq(RDX, FieldAddress(RDX, SubtypeTestCache::cache_offset())); | 1859 __ movq(RDX, FieldAddress(RDX, SubtypeTestCache::cache_offset())); |
| 1860 __ addq(RDX, Immediate(Array::data_offset() - kHeapObjectTag)); | 1860 __ addq(RDX, Immediate(Array::data_offset() - kHeapObjectTag)); |
| 1861 // RDX: Entry start. | 1861 // RDX: Entry start. |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2163 __ cmpq(left, right); | 2163 __ cmpq(left, right); |
| 2164 __ Bind(&done); | 2164 __ Bind(&done); |
| 2165 __ popq(right); | 2165 __ popq(right); |
| 2166 __ popq(left); | 2166 __ popq(left); |
| 2167 __ ret(); | 2167 __ ret(); |
| 2168 } | 2168 } |
| 2169 | 2169 |
| 2170 } // namespace dart | 2170 } // namespace dart |
| 2171 | 2171 |
| 2172 #endif // defined TARGET_ARCH_X64 | 2172 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |