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

Side by Side Diff: src/arm64/stub-cache-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: Last comment response. Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arm64/lithium-codegen-arm64.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_ARM64 7 #if V8_TARGET_ARCH_ARM64
8 8
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/ic-inl.h" 10 #include "src/ic-inl.h"
(...skipping 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after
1240 // TODO(all): The so-called scratch registers are significant in some cases. For 1240 // TODO(all): The so-called scratch registers are significant in some cases. For
1241 // example, KeyedStoreStubCompiler::registers()[3] (x3) is actually used for 1241 // example, KeyedStoreStubCompiler::registers()[3] (x3) is actually used for
1242 // KeyedStoreCompiler::transition_map(). We should verify which registers are 1242 // KeyedStoreCompiler::transition_map(). We should verify which registers are
1243 // actually scratch registers, and which are important. For now, we use the same 1243 // actually scratch registers, and which are important. For now, we use the same
1244 // assignments as ARM to remain on the safe side. 1244 // assignments as ARM to remain on the safe side.
1245 1245
1246 Register* LoadStubCompiler::registers() { 1246 Register* LoadStubCompiler::registers() {
1247 // receiver, name, scratch1, scratch2, scratch3, scratch4. 1247 // receiver, name, scratch1, scratch2, scratch3, scratch4.
1248 Register receiver = LoadIC::ReceiverRegister(); 1248 Register receiver = LoadIC::ReceiverRegister();
1249 Register name = LoadIC::NameRegister(); 1249 Register name = LoadIC::NameRegister();
1250 static Register registers[] = { receiver, name, x3, x1, x4, x5 }; 1250 static Register registers[] = { receiver, name, x3, x0, x4, x5 };
1251 return registers; 1251 return registers;
1252 } 1252 }
1253 1253
1254 1254
1255 Register* KeyedLoadStubCompiler::registers() { 1255 Register* KeyedLoadStubCompiler::registers() {
1256 // receiver, name, scratch1, scratch2, scratch3, scratch4. 1256 // receiver, name, scratch1, scratch2, scratch3, scratch4.
1257 Register receiver = KeyedLoadIC::ReceiverRegister(); 1257 Register receiver = LoadIC::ReceiverRegister();
1258 Register name = KeyedLoadIC::NameRegister(); 1258 Register name = LoadIC::NameRegister();
1259 static Register registers[] = { receiver, name, x2, x3, x4, x5 }; 1259 static Register registers[] = { receiver, name, x3, x0, x4, x5 };
1260 return registers; 1260 return registers;
1261 } 1261 }
1262 1262
1263 1263
1264 Register StoreStubCompiler::value() { 1264 Register StoreStubCompiler::value() {
1265 return x0; 1265 return x0;
1266 } 1266 }
1267 1267
1268 1268
1269 Register* StoreStubCompiler::registers() { 1269 Register* StoreStubCompiler::registers() {
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 return GetICCode( 1442 return GetICCode(
1443 kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC); 1443 kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC);
1444 } 1444 }
1445 1445
1446 1446
1447 #undef __ 1447 #undef __
1448 #define __ ACCESS_MASM(masm) 1448 #define __ ACCESS_MASM(masm)
1449 1449
1450 void KeyedLoadStubCompiler::GenerateLoadDictionaryElement( 1450 void KeyedLoadStubCompiler::GenerateLoadDictionaryElement(
1451 MacroAssembler* masm) { 1451 MacroAssembler* masm) {
1452 // ---------- S t a t e -------------- 1452 // The return address is in lr.
1453 // -- lr : return address
1454 // -- x0 : key
1455 // -- x1 : receiver
1456 // -----------------------------------
1457 ASSERT(x1.is(KeyedLoadIC::ReceiverRegister()));
1458 ASSERT(x0.is(KeyedLoadIC::NameRegister()));
1459 Label slow, miss; 1453 Label slow, miss;
1460 1454
1461 Register result = x0; 1455 Register result = x0;
1462 Register key = x0; 1456 Register key = LoadIC::NameRegister();
1463 Register receiver = x1; 1457 Register receiver = LoadIC::ReceiverRegister();
1458 ASSERT(receiver.is(x1));
1459 ASSERT(key.is(x2));
1464 1460
1465 __ JumpIfNotSmi(key, &miss); 1461 __ JumpIfNotSmi(key, &miss);
1466 __ Ldr(x4, FieldMemOperand(receiver, JSObject::kElementsOffset)); 1462 __ Ldr(x4, FieldMemOperand(receiver, JSObject::kElementsOffset));
1467 __ LoadFromNumberDictionary(&slow, x4, key, result, x2, x3, x5, x6); 1463 __ LoadFromNumberDictionary(&slow, x4, key, result, x7, x3, x5, x6);
1468 __ Ret(); 1464 __ Ret();
1469 1465
1470 __ Bind(&slow); 1466 __ Bind(&slow);
1471 __ IncrementCounter( 1467 __ IncrementCounter(
1472 masm->isolate()->counters()->keyed_load_external_array_slow(), 1, x2, x3); 1468 masm->isolate()->counters()->keyed_load_external_array_slow(), 1, x4, x3);
1473 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow); 1469 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow);
1474 1470
1475 // Miss case, call the runtime. 1471 // Miss case, call the runtime.
1476 __ Bind(&miss); 1472 __ Bind(&miss);
1477 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 1473 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
1478 } 1474 }
1479 1475
1480 1476
1481 } } // namespace v8::internal 1477 } } // namespace v8::internal
1482 1478
1483 #endif // V8_TARGET_ARCH_ARM64 1479 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm64/lithium-codegen-arm64.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698