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

Unified Diff: runtime/vm/stub_code_x64.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_mips.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_x64.cc
===================================================================
--- runtime/vm/stub_code_x64.cc (revision 37007)
+++ runtime/vm/stub_code_x64.cc (working copy)
@@ -1248,7 +1248,7 @@
// Load arguments descriptor into R10.
__ movq(R10, FieldAddress(RBX, ICData::arguments_descriptor_offset()));
// 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;
// RBX: IC data object (preserved).
__ movq(R12, FieldAddress(RBX, ICData::ic_data_offset()));
// R12: ic_data_array with check entries: classes and target functions.
@@ -1259,7 +1259,7 @@
// arguments descriptor array and then access the receiver from the stack).
__ movq(RAX, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
__ movq(RAX, Address(RSP, RAX, TIMES_4, 0)); // RAX (argument count) is Smi.
- __ call(&get_class_id_as_smi);
+ __ LoadTaggedClassIdMayBeSmi(RAX, RAX);
// RAX: receiver's class ID as smi.
__ movq(R13, Address(R12, 0)); // First class ID (Smi) to check.
__ jmp(&test);
@@ -1270,7 +1270,7 @@
// If not the first, load the next argument's class ID.
__ movq(RAX, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
__ movq(RAX, Address(RSP, RAX, TIMES_4, - i * kWordSize));
- __ call(&get_class_id_as_smi);
+ __ LoadTaggedClassIdMayBeSmi(RAX, RAX);
// RAX: next argument class ID (smi).
__ movq(R13, Address(R12, i * kWordSize));
// R13: next class ID to check (smi).
@@ -1288,7 +1288,7 @@
if (num_args > 1) {
__ movq(RAX, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
__ movq(RAX, Address(RSP, RAX, TIMES_4, 0));
- __ call(&get_class_id_as_smi);
+ __ LoadTaggedClassIdMayBeSmi(RAX, RAX);
}
const intptr_t entry_size = ICData::TestEntryLengthFor(num_args) * kWordSize;
@@ -1343,19 +1343,6 @@
__ movq(RCX, FieldAddress(RAX, Function::instructions_offset()));
__ addq(RCX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
__ jmp(RCX);
-
- __ Bind(&get_class_id_as_smi);
- Label not_smi;
- // Test if Smi -> load Smi class for comparison.
- __ testq(RAX, Immediate(kSmiTagMask));
- __ j(NOT_ZERO, &not_smi, Assembler::kNearJump);
- __ movq(RAX, Immediate(Smi::RawValue(kSmiCid)));
- __ ret();
-
- __ Bind(&not_smi);
- __ LoadClassId(RAX, RAX);
- __ SmiTag(RAX);
- __ ret();
}
« no previous file with comments | « runtime/vm/stub_code_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698