Index: runtime/vm/stub_code_ia32.cc |
diff --git a/runtime/vm/stub_code_ia32.cc b/runtime/vm/stub_code_ia32.cc |
index 22b494a30d9e8c0454a7387a5ca05a99f6e44a6b..2995bfab503dbe3d8b81dc6d9d6213188425e285 100644 |
--- a/runtime/vm/stub_code_ia32.cc |
+++ b/runtime/vm/stub_code_ia32.cc |
@@ -1680,20 +1680,21 @@ void StubCode::GenerateDebugStepCheckStub(Assembler* assembler) { |
// Used to check class and type arguments. Arguments passed on stack: |
// TOS + 0: return address. |
-// TOS + 1: instantiator type arguments (can be NULL). |
-// TOS + 2: instance. |
-// TOS + 3: SubtypeTestCache. |
+// TOS + 1: function type arguments (only if n == 4, can be raw_null). |
+// TOS + 2: instantiator type arguments (only if n == 4, can be raw_null). |
+// TOS + 3: instance. |
+// TOS + 4: 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 kCacheOffsetInBytes = 3 * kWordSize; |
+ ASSERT((n == 1) || (n == 2) || (n == 4)); |
+ const intptr_t kFunctionTypeArgumentsInBytes = 1 * kWordSize; |
+ const intptr_t kInstantiatorTypeArgumentsInBytes = 2 * kWordSize; |
+ const intptr_t kInstanceOffsetInBytes = 3 * kWordSize; |
+ const intptr_t kCacheOffsetInBytes = 4 * kWordSize; |
const Immediate& raw_null = |
Immediate(reinterpret_cast<intptr_t>(Object::null())); |
__ movl(EAX, Address(ESP, kInstanceOffsetInBytes)); |
if (n > 1) { |
- // Get instance type arguments. |
__ LoadClass(ECX, EAX, EBX); |
// Compute instance type arguments into EBX. |
Label has_no_type_arguments; |
@@ -1745,6 +1746,10 @@ static void GenerateSubtypeNTestCacheStub(Assembler* assembler, int n) { |
Address(EDX, kWordSize * |
SubtypeTestCache::kInstantiatorTypeArguments)); |
__ cmpl(EDI, Address(ESP, kInstantiatorTypeArgumentsInBytes)); |
+ __ j(NOT_EQUAL, &next_iteration, Assembler::kNearJump); |
+ __ movl(EDI, Address(EDX, kWordSize * |
+ SubtypeTestCache::kFunctionTypeArguments)); |
+ __ cmpl(EDI, Address(ESP, kFunctionTypeArgumentsInBytes)); |
__ j(EQUAL, &found, Assembler::kNearJump); |
} |
} |
@@ -1764,9 +1769,10 @@ static void GenerateSubtypeNTestCacheStub(Assembler* assembler, int n) { |
// Used to check class and type arguments. Arguments passed on stack: |
// TOS + 0: return address. |
-// TOS + 1: instantiator type arguments or NULL. |
-// TOS + 2: instance. |
-// TOS + 3: cache array. |
+// TOS + 1: raw_null. |
+// TOS + 2: raw_null. |
+// TOS + 3: instance. |
+// TOS + 4: SubtypeTestCache. |
// Result in ECX: null -> not found, otherwise result (true or false). |
void StubCode::GenerateSubtype1TestCacheStub(Assembler* assembler) { |
GenerateSubtypeNTestCacheStub(assembler, 1); |
@@ -1775,9 +1781,10 @@ void StubCode::GenerateSubtype1TestCacheStub(Assembler* assembler) { |
// Used to check class and type arguments. Arguments passed on stack: |
// TOS + 0: return address. |
-// TOS + 1: instantiator type arguments or NULL. |
-// TOS + 2: instance. |
-// TOS + 3: cache array. |
+// TOS + 1: raw_null. |
+// TOS + 2: raw_null. |
+// TOS + 3: instance. |
+// TOS + 4: SubtypeTestCache. |
// Result in ECX: null -> not found, otherwise result (true or false). |
void StubCode::GenerateSubtype2TestCacheStub(Assembler* assembler) { |
GenerateSubtypeNTestCacheStub(assembler, 2); |
@@ -1786,12 +1793,13 @@ void StubCode::GenerateSubtype2TestCacheStub(Assembler* assembler) { |
// Used to check class and type arguments. Arguments passed on stack: |
// TOS + 0: return address. |
-// TOS + 1: instantiator type arguments. |
-// TOS + 2: instance. |
-// TOS + 3: cache array. |
+// TOS + 1: function type arguments (can be raw_null). |
+// TOS + 2: instantiator type arguments (can be raw_null). |
+// TOS + 3: instance. |
+// TOS + 4: SubtypeTestCache. |
// Result in ECX: null -> not found, otherwise result (true or false). |
-void StubCode::GenerateSubtype3TestCacheStub(Assembler* assembler) { |
- GenerateSubtypeNTestCacheStub(assembler, 3); |
+void StubCode::GenerateSubtype4TestCacheStub(Assembler* assembler) { |
+ GenerateSubtypeNTestCacheStub(assembler, 4); |
} |