| Index: runtime/vm/stub_code_ia32.cc
|
| ===================================================================
|
| --- runtime/vm/stub_code_ia32.cc (revision 7292)
|
| +++ runtime/vm/stub_code_ia32.cc (working copy)
|
| @@ -1822,13 +1822,13 @@
|
| // TOS + 0: return address.
|
| // TOS + 1: instantiator type arguments (can be NULL).
|
| // TOS + 2: instance.
|
| -// TOS + 3: cache array.
|
| +// TOS + 3: SubtypeTestCache.
|
| // Result in ECX: null -> not found, otherwise result (true or false).
|
| static void GenerateSubtypeNTestCacheStub(Assembler* assembler, int n) {
|
| ASSERT((1 <= n) && (n <= 3));
|
| const intptr_t kInstantiatorTypeArgumentsInBytes = 1 * kWordSize;
|
| const intptr_t kInstanceOffsetInBytes = 2 * kWordSize;
|
| - const intptr_t kCacheArrayOffsetInBytes = 3 * kWordSize;
|
| + const intptr_t kCacheOffsetInBytes = 3 * kWordSize;
|
| const Immediate raw_null =
|
| Immediate(reinterpret_cast<intptr_t>(Object::null()));
|
| Label not_found;
|
| @@ -1848,8 +1848,9 @@
|
| __ Bind(&has_no_type_arguments);
|
| }
|
| // EBX: instance type arguments (null if none).
|
| - __ movl(EDX, Address(ESP, kCacheArrayOffsetInBytes));
|
| - // EDX: cache.
|
| + __ movl(EDX, Address(ESP, kCacheOffsetInBytes));
|
| + // EDX: SubtypeTestCache.
|
| + __ movl(EDX, FieldAddress(EDX, SubtypeTestCache::cache_offset()));
|
| __ addl(EDX, Immediate(Array::data_offset() - kHeapObjectTag));
|
|
|
| Label loop, found, next_iteration;
|
| @@ -1857,7 +1858,7 @@
|
| // ECX: instance class.
|
| // EBX: instance type arguments
|
| __ Bind(&loop);
|
| - __ movl(EDI, Address(EDX, kWordSize * SubTypeTestCache::kInstanceClass));
|
| + __ movl(EDI, Address(EDX, kWordSize * SubtypeTestCache::kInstanceClass));
|
| __ cmpl(EDI, raw_null);
|
| __ j(EQUAL, ¬_found, Assembler::kNearJump);
|
| __ cmpl(EDI, ECX);
|
| @@ -1866,7 +1867,7 @@
|
| } else {
|
| __ j(NOT_EQUAL, &next_iteration, Assembler::kNearJump);
|
| __ movl(EDI,
|
| - Address(EDX, kWordSize * SubTypeTestCache::kInstanceTypeArguments));
|
| + Address(EDX, kWordSize * SubtypeTestCache::kInstanceTypeArguments));
|
| __ cmpl(EDI, EBX);
|
| if (n == 2) {
|
| __ j(EQUAL, &found, Assembler::kNearJump);
|
| @@ -1874,13 +1875,13 @@
|
| __ j(NOT_EQUAL, &next_iteration, Assembler::kNearJump);
|
| __ movl(EDI,
|
| Address(EDX, kWordSize *
|
| - SubTypeTestCache::kInstantiatorTypeArguments));
|
| + SubtypeTestCache::kInstantiatorTypeArguments));
|
| __ cmpl(EDI, Address(ESP, kInstantiatorTypeArgumentsInBytes));
|
| __ j(EQUAL, &found, Assembler::kNearJump);
|
| }
|
| }
|
| __ Bind(&next_iteration);
|
| - __ addl(EDX, Immediate(kWordSize * SubTypeTestCache::kNumEntries));
|
| + __ addl(EDX, Immediate(kWordSize * SubtypeTestCache::kTestEntryLength));
|
| __ jmp(&loop, Assembler::kNearJump);
|
| // Fall through to not found.
|
| __ Bind(¬_found);
|
| @@ -1888,7 +1889,7 @@
|
| __ ret();
|
|
|
| __ Bind(&found);
|
| - __ movl(ECX, Address(EDX, kWordSize * SubTypeTestCache::kTestResult));
|
| + __ movl(ECX, Address(EDX, kWordSize * SubtypeTestCache::kTestResult));
|
| __ ret();
|
| }
|
|
|
|
|