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

Unified Diff: runtime/vm/stub_code_arm64.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_arm.cc ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_arm64.cc
===================================================================
--- runtime/vm/stub_code_arm64.cc (revision 37007)
+++ runtime/vm/stub_code_arm64.cc (working copy)
@@ -1387,24 +1387,8 @@
// R0 <- [SP + (R7 << 3)]
__ ldr(R0, Address(SP, R7, UXTX, Address::Scaled));
+ __ LoadTaggedClassIdMayBeSmi(R0, R0);
- {
- // TODO(zra): Put this code in a subroutine call as with other architectures
- // when we have a bl(Label& l) instruction.
- // Instance in R0, return its class-id in R0 as Smi.
- // Test if Smi -> load Smi class for comparison.
- Label not_smi, done;
- __ tsti(R0, kSmiTagMask);
- __ b(&not_smi, NE);
- __ LoadImmediate(R0, Smi::RawValue(kSmiCid), kNoPP);
- __ b(&done);
-
- __ Bind(&not_smi);
- __ LoadClassId(R0, R0, kNoPP);
- __ SmiTag(R0);
- __ Bind(&done);
- }
-
// R7: argument_count - 1 (untagged).
// R0: receiver's class ID (smi).
__ ldr(R1, Address(R6)); // First class id (smi) to check.
@@ -1417,20 +1401,7 @@
__ AddImmediate(R0, R7, -i, kNoPP);
// R0 <- [SP + (R0 << 3)]
__ ldr(R0, Address(SP, R0, UXTX, Address::Scaled));
- {
- // Instance in R0, return its class-id in R0 as Smi.
- // Test if Smi -> load Smi class for comparison.
- Label not_smi, done;
- __ tsti(R0, kSmiTagMask);
- __ b(&not_smi, NE);
- __ LoadImmediate(R0, Smi::RawValue(kSmiCid), kNoPP);
- __ b(&done);
-
- __ Bind(&not_smi);
- __ LoadClassId(R0, R0, kNoPP);
- __ SmiTag(R0);
- __ Bind(&done);
- }
+ __ LoadTaggedClassIdMayBeSmi(R0, R0);
// R0: next argument class ID (smi).
__ LoadFromOffset(R1, R6, i * kWordSize, kNoPP);
// R1: next class ID to check (smi).
@@ -1447,20 +1418,7 @@
// Reload receiver class ID. It has not been destroyed when num_args == 1.
if (num_args > 1) {
__ ldr(R0, Address(SP, R7, UXTX, Address::Scaled));
- {
- // Instance in R0, return its class-id in R0 as Smi.
- // Test if Smi -> load Smi class for comparison.
- Label not_smi, done;
- __ tsti(R0, kSmiTagMask);
- __ b(&not_smi, NE);
- __ LoadImmediate(R0, Smi::RawValue(kSmiCid), kNoPP);
- __ b(&done);
-
- __ Bind(&not_smi);
- __ LoadClassId(R0, R0, kNoPP);
- __ SmiTag(R0);
- __ Bind(&done);
- }
+ __ LoadTaggedClassIdMayBeSmi(R0, R0);
}
const intptr_t entry_size = ICData::TestEntryLengthFor(num_args) * kWordSize;
« no previous file with comments | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698