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

Unified Diff: src/arm64/ic-arm64.cc

Issue 338963003: KeyedLoadIC should have same register spec as LoadIC. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: ARM and ARM64 ports. 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
Index: src/arm64/ic-arm64.cc
diff --git a/src/arm64/ic-arm64.cc b/src/arm64/ic-arm64.cc
index f1de3fa790fe1a92d653b562b95fc8ddfc97c1f5..ebff9b11b09be91284cc8b9f9f0f4d4409cea4b1 100644
--- a/src/arm64/ic-arm64.cc
+++ b/src/arm64/ic-arm64.cc
@@ -410,15 +410,15 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- x2 : name
// -- lr : return address
Jakob Kummerow 2014/06/30 14:12:45 another comment that can be trimmed to "The return
mvstanton 2014/06/30 14:59:00 Done.
- // -- x0 : receiver
+ // -- x1 : receiver
// -----------------------------------
- ASSERT(x0.is(ReceiverRegister()));
+ ASSERT(x1.is(ReceiverRegister()));
ASSERT(x2.is(NameRegister()));
// Probe the stub cache.
Code::Flags flags = Code::ComputeHandlerFlags(Code::LOAD_IC);
masm->isolate()->stub_cache()->GenerateProbe(
- masm, flags, x0, x2, x3, x4, x5, x6);
+ masm, flags, x1, x2, x3, x4, x5, x6);
// Cache miss: Jump to runtime.
GenerateMiss(masm);
@@ -429,16 +429,16 @@ void LoadIC::GenerateNormal(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- x2 : name
// -- lr : return address
- // -- x0 : receiver
+ // -- x1 : receiver
// -----------------------------------
- ASSERT(x0.is(ReceiverRegister()));
+ ASSERT(x1.is(ReceiverRegister()));
ASSERT(x2.is(NameRegister()));
Label miss, slow;
- GenerateNameDictionaryReceiverCheck(masm, x0, x1, x3, x4, &miss);
+ GenerateNameDictionaryReceiverCheck(masm, x1, x0, x3, x4, &miss);
- // x1 now holds the property dictionary.
- GenerateDictionaryLoad(masm, &slow, x1, x2, x0, x3, x4);
+ // x0 now holds the property dictionary.
+ GenerateDictionaryLoad(masm, &slow, x0, x2, x0, x3, x4);
__ Ret();
// Dictionary load failed, go slow (but don't miss).
@@ -474,20 +474,16 @@ void LoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) {
- // ---------- S t a t e --------------
- // -- lr : return address
- // -- x0 : key
- // -- x1 : receiver
- // -----------------------------------
+ // The return address is on the stack.
Register result = x0;
Register receiver = ReceiverRegister();
Register key = NameRegister();
ASSERT(receiver.is(x1));
- ASSERT(key.is(x0));
+ ASSERT(key.is(x2));
Label miss, unmapped;
- Register map_scratch = x2;
+ Register map_scratch = x0;
MemOperand mapped_location = GenerateMappedArgumentsLookup(
masm, receiver, key, map_scratch, x3, x4, &unmapped, &miss);
__ Ldr(result, mapped_location);
@@ -497,10 +493,8 @@ void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) {
// Parameter map is left in map_scratch when a jump on unmapped is done.
MemOperand unmapped_location =
GenerateUnmappedArgumentsLookup(masm, key, map_scratch, x3, &miss);
- __ Ldr(x2, unmapped_location);
- __ JumpIfRoot(x2, Heap::kTheHoleValueRootIndex, &miss);
- // Move the result in x0. x0 must be preserved on miss.
- __ Mov(result, x2);
+ __ Ldr(x0, unmapped_location);
Jakob Kummerow 2014/06/30 14:12:45 I'd s/x0/result/ here (and in the next line)
mvstanton 2014/06/30 14:59:00 Done.
+ __ JumpIfRoot(x0, Heap::kTheHoleValueRootIndex, &miss);
__ Ret();
__ Bind(&miss);
@@ -576,10 +570,8 @@ void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
// IC register specifications
-const Register LoadIC::ReceiverRegister() { return x0; }
+const Register LoadIC::ReceiverRegister() { return x1; }
const Register LoadIC::NameRegister() { return x2; }
-const Register KeyedLoadIC::ReceiverRegister() { return x1; }
-const Register KeyedLoadIC::NameRegister() { return x0; }
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
@@ -753,34 +745,30 @@ static void GenerateKeyedLoadWithNameKey(MacroAssembler* masm,
void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) {
- // ---------- S t a t e --------------
- // -- lr : return address
- // -- x0 : key
- // -- x1 : receiver
- // -----------------------------------
+ // The return address is on the stack.
Label slow, check_name, index_smi, index_name;
Register key = NameRegister();
Register receiver = ReceiverRegister();
- ASSERT(key.is(x0));
+ ASSERT(key.is(x2));
ASSERT(receiver.is(x1));
__ JumpIfNotSmi(key, &check_name);
__ Bind(&index_smi);
// Now the key is known to be a smi. This place is also jumped to from below
// where a numeric string is converted to a smi.
- GenerateKeyedLoadWithSmiKey(masm, key, receiver, x2, x3, x4, x5, x6, &slow);
+ GenerateKeyedLoadWithSmiKey(masm, key, receiver, x7, x3, x4, x5, x6, &slow);
- // Slow case, key and receiver still in x0 and x1.
+ // Slow case
Jakob Kummerow 2014/06/30 14:12:45 nit: trailing full stop please.
mvstanton 2014/06/30 14:59:00 Done.
__ Bind(&slow);
__ IncrementCounter(
- masm->isolate()->counters()->keyed_load_generic_slow(), 1, x2, x3);
+ masm->isolate()->counters()->keyed_load_generic_slow(), 1, x4, x3);
GenerateRuntimeGetProperty(masm);
__ Bind(&check_name);
- GenerateKeyNameCheck(masm, key, x2, x3, &index_name, &slow);
+ GenerateKeyNameCheck(masm, key, x0, x3, &index_name, &slow);
- GenerateKeyedLoadWithNameKey(masm, key, receiver, x2, x3, x4, x5, x6, &slow);
+ GenerateKeyedLoadWithNameKey(masm, key, receiver, x7, x3, x4, x5, x6, &slow);
__ Bind(&index_name);
__ IndexFromHash(x3, key);
@@ -824,8 +812,8 @@ void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
Register receiver = ReceiverRegister();
Register key = NameRegister();
- Register scratch1 = x2;
- Register scratch2 = x3;
+ Register scratch1 = x3;
+ Register scratch2 = x4;
ASSERT(!scratch1.is(receiver) && !scratch1.is(key));
ASSERT(!scratch2.is(receiver) && !scratch2.is(key));

Powered by Google App Engine
This is Rietveld 408576698