Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(551)

Unified Diff: runtime/vm/stub_code_ia32.cc

Issue 10352012: Using SubtypeTestCache object instead of an array, that way we do not need to patch and can communi… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/raw_object_snapshot.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_ia32.cc
===================================================================
--- runtime/vm/stub_code_ia32.cc (revision 7302)
+++ 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, &not_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(&not_found);
@@ -1888,7 +1889,7 @@
__ ret();
__ Bind(&found);
- __ movl(ECX, Address(EDX, kWordSize * SubTypeTestCache::kTestResult));
+ __ movl(ECX, Address(EDX, kWordSize * SubtypeTestCache::kTestResult));
__ ret();
}
« no previous file with comments | « runtime/vm/raw_object_snapshot.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698