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

Unified Diff: runtime/vm/stub_code_mips.cc

Issue 313083008: Add LoadTaggedClassIdMayBeSmi to assembly and improve performance of inline cache stubs. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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/stub_code_ia32.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_mips.cc
===================================================================
--- runtime/vm/stub_code_mips.cc (revision 37007)
+++ runtime/vm/stub_code_mips.cc (working copy)
@@ -1445,7 +1445,7 @@
// Preserve return address, since RA is needed for subroutine call.
__ mov(T2, RA);
// Loop that checks if there is an IC data match.
- Label loop, update, test, found, get_class_id_as_smi;
+ Label loop, update, test, found;
// S5: IC data object (preserved).
__ lw(T0, FieldAddress(S5, ICData::ic_data_offset()));
// T0: ic_data_array with check entries: classes and target functions.
@@ -1459,8 +1459,9 @@
__ subu(T1, T1, TMP);
__ sll(T3, T1, 1); // T1 (argument_count - 1) is smi.
__ addu(T3, T3, SP);
- __ bal(&get_class_id_as_smi);
- __ delay_slot()->lw(T3, Address(T3));
+ __ lw(T3, Address(T3));
+ __ LoadTaggedClassIdMayBeSmi(T3, T3);
+
// T1: argument_count - 1 (smi).
// T3: receiver's class ID (smi).
__ b(&test);
@@ -1474,8 +1475,8 @@
__ addu(T3, T1, T3);
__ sll(T3, T3, 1);
__ addu(T3, SP, T3);
- __ bal(&get_class_id_as_smi);
- __ delay_slot()->lw(T3, Address(T3));
+ __ lw(T3, Address(T3));
+ __ LoadTaggedClassIdMayBeSmi(T3, T3);
// T3: next argument class ID (smi).
__ lw(T4, Address(T0, i * kWordSize));
// T4: next class ID to check (smi).
@@ -1496,8 +1497,8 @@
if (num_args > 1) {
__ sll(T3, T1, 1);
__ addu(T3, T3, SP);
- __ bal(&get_class_id_as_smi);
- __ delay_slot()->lw(T3, Address(T3));
+ __ lw(T3, Address(T3));
+ __ LoadTaggedClassIdMayBeSmi(T3, T3);
}
const intptr_t entry_size = ICData::TestEntryLengthFor(num_args) * kWordSize;
@@ -1572,20 +1573,6 @@
__ lw(T4, FieldAddress(T0, Function::instructions_offset()));
__ AddImmediate(T4, Instructions::HeaderSize() - kHeapObjectTag);
__ jr(T4);
-
- // Instance in T3, return its class-id in T3 as Smi.
- __ Bind(&get_class_id_as_smi);
- Label not_smi;
- // Test if Smi -> load Smi class for comparison.
- __ andi(CMPRES1, T3, Immediate(kSmiTagMask));
- __ bne(CMPRES1, ZR, &not_smi);
- __ jr(RA);
- __ delay_slot()->addiu(T3, ZR, Immediate(Smi::RawValue(kSmiCid)));
-
- __ Bind(&not_smi);
- __ LoadClassId(T3, T3);
- __ jr(RA);
- __ delay_slot()->SmiTag(T3);
}
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698