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_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
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 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1774 __ movl(EDX, Address(ESP, kCacheOffsetInBytes)); | 1774 __ movl(EDX, Address(ESP, kCacheOffsetInBytes)); |
1775 // EDX: SubtypeTestCache. | 1775 // EDX: SubtypeTestCache. |
1776 __ movl(EDX, FieldAddress(EDX, SubtypeTestCache::cache_offset())); | 1776 __ movl(EDX, FieldAddress(EDX, SubtypeTestCache::cache_offset())); |
1777 __ addl(EDX, Immediate(Array::data_offset() - kHeapObjectTag)); | 1777 __ addl(EDX, Immediate(Array::data_offset() - kHeapObjectTag)); |
1778 | 1778 |
1779 Label loop, found, not_found, next_iteration; | 1779 Label loop, found, not_found, next_iteration; |
1780 // EDX: Entry start. | 1780 // EDX: Entry start. |
1781 // ECX: instance class id. | 1781 // ECX: instance class id. |
1782 // EBX: instance type arguments. | 1782 // EBX: instance type arguments. |
1783 __ SmiTag(ECX); | 1783 __ SmiTag(ECX); |
| 1784 __ cmpl(ECX, Immediate(Smi::RawValue(kClosureCid))); |
| 1785 __ j(NOT_EQUAL, &loop, Assembler::kNearJump); |
| 1786 __ movl(ECX, FieldAddress(EAX, Closure::function_offset())); |
| 1787 // ECX: instance class id as Smi or function. |
1784 __ Bind(&loop); | 1788 __ Bind(&loop); |
1785 __ movl(EDI, Address(EDX, kWordSize * SubtypeTestCache::kInstanceClassId)); | 1789 __ movl(EDI, |
| 1790 Address(EDX, |
| 1791 kWordSize * SubtypeTestCache::kInstanceClassIdOrFunction)); |
1786 __ cmpl(EDI, raw_null); | 1792 __ cmpl(EDI, raw_null); |
1787 __ j(EQUAL, ¬_found, Assembler::kNearJump); | 1793 __ j(EQUAL, ¬_found, Assembler::kNearJump); |
1788 __ cmpl(EDI, ECX); | 1794 __ cmpl(EDI, ECX); |
1789 if (n == 1) { | 1795 if (n == 1) { |
1790 __ j(EQUAL, &found, Assembler::kNearJump); | 1796 __ j(EQUAL, &found, Assembler::kNearJump); |
1791 } else { | 1797 } else { |
1792 __ j(NOT_EQUAL, &next_iteration, Assembler::kNearJump); | 1798 __ j(NOT_EQUAL, &next_iteration, Assembler::kNearJump); |
1793 __ movl(EDI, | 1799 __ movl(EDI, |
1794 Address(EDX, kWordSize * SubtypeTestCache::kInstanceTypeArguments)); | 1800 Address(EDX, kWordSize * SubtypeTestCache::kInstanceTypeArguments)); |
1795 __ cmpl(EDI, EBX); | 1801 __ cmpl(EDI, EBX); |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2081 // Result: | 2087 // Result: |
2082 // EBX: target entry point | 2088 // EBX: target entry point |
2083 // EDX: arguments descriptor | 2089 // EDX: arguments descriptor |
2084 void StubCode::GenerateICLookupStub(Assembler* assembler) { | 2090 void StubCode::GenerateICLookupStub(Assembler* assembler) { |
2085 __ int3(); | 2091 __ int3(); |
2086 } | 2092 } |
2087 | 2093 |
2088 } // namespace dart | 2094 } // namespace dart |
2089 | 2095 |
2090 #endif // defined TARGET_ARCH_IA32 | 2096 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |