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

Unified Diff: runtime/vm/stub_code_arm.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/intermediate_language_x64.cc ('k') | runtime/vm/stub_code_arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_arm.cc
===================================================================
--- runtime/vm/stub_code_arm.cc (revision 37007)
+++ runtime/vm/stub_code_arm.cc (working copy)
@@ -1283,7 +1283,7 @@
// Preserve return address, since LR is needed for subroutine call.
__ mov(R8, Operand(LR));
// 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;
// R5: IC data object (preserved).
__ ldr(R6, FieldAddress(R5, ICData::ic_data_offset()));
// R6: ic_data_array with check entries: classes and target functions.
@@ -1295,7 +1295,7 @@
__ ldr(R7, FieldAddress(R4, ArgumentsDescriptor::count_offset()));
__ sub(R7, R7, Operand(Smi::RawValue(1)));
__ ldr(R0, Address(SP, R7, LSL, 1)); // R7 (argument_count - 1) is smi.
- __ bl(&get_class_id_as_smi);
+ __ LoadTaggedClassIdMayBeSmi(R0, R0);
// R7: argument_count - 1 (smi).
// R0: receiver's class ID (smi).
__ ldr(R1, Address(R6, 0)); // First class id (smi) to check.
@@ -1307,7 +1307,7 @@
// If not the first, load the next argument's class ID.
__ AddImmediate(R0, R7, Smi::RawValue(-i));
__ ldr(R0, Address(SP, R0, LSL, 1));
- __ bl(&get_class_id_as_smi);
+ __ LoadTaggedClassIdMayBeSmi(R0, R0);
// R0: next argument class ID (smi).
__ LoadFromOffset(kWord, R1, R6, i * kWordSize);
// R1: next class ID to check (smi).
@@ -1325,7 +1325,7 @@
// Reload receiver class ID. It has not been destroyed when num_args == 1.
if (num_args > 1) {
__ ldr(R0, Address(SP, R7, LSL, 1));
- __ bl(&get_class_id_as_smi);
+ __ LoadTaggedClassIdMayBeSmi(R0, R0);
}
const intptr_t entry_size = ICData::TestEntryLengthFor(num_args) * kWordSize;
@@ -1385,17 +1385,6 @@
__ ldr(R2, FieldAddress(R0, Function::instructions_offset()));
__ AddImmediate(R2, Instructions::HeaderSize() - kHeapObjectTag);
__ bx(R2);
-
- // Instance in R0, return its class-id in R0 as Smi.
- __ Bind(&get_class_id_as_smi);
-
- // Test if Smi -> load Smi class for comparison.
- __ tst(R0, Operand(kSmiTagMask));
- __ mov(R0, Operand(Smi::RawValue(kSmiCid)), EQ);
- __ bx(LR, EQ);
- __ LoadClassId(R0, R0);
- __ SmiTag(R0);
- __ bx(LR);
}
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | runtime/vm/stub_code_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698