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

Side by Side Diff: src/x64/stub-cache-x64.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/x64/lithium-x64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after
1217 1217
1218 // Return the generated code. 1218 // Return the generated code.
1219 return GetCode(kind(), Code::FAST, name); 1219 return GetCode(kind(), Code::FAST, name);
1220 } 1220 }
1221 1221
1222 1222
1223 Register* LoadStubCompiler::registers() { 1223 Register* LoadStubCompiler::registers() {
1224 // receiver, name, scratch1, scratch2, scratch3, scratch4. 1224 // receiver, name, scratch1, scratch2, scratch3, scratch4.
1225 Register receiver = LoadIC::ReceiverRegister(); 1225 Register receiver = LoadIC::ReceiverRegister();
1226 Register name = LoadIC::NameRegister(); 1226 Register name = LoadIC::NameRegister();
1227 static Register registers[] = { receiver, name, rdx, rbx, rdi, r8 }; 1227 static Register registers[] = { receiver, name, rax, rbx, rdi, r8 };
1228 return registers; 1228 return registers;
1229 } 1229 }
1230 1230
1231 1231
1232 Register* KeyedLoadStubCompiler::registers() { 1232 Register* KeyedLoadStubCompiler::registers() {
1233 // receiver, name, scratch1, scratch2, scratch3, scratch4. 1233 // receiver, name, scratch1, scratch2, scratch3, scratch4.
1234 Register receiver = KeyedLoadIC::ReceiverRegister(); 1234 Register receiver = LoadIC::ReceiverRegister();
1235 Register name = KeyedLoadIC::NameRegister(); 1235 Register name = LoadIC::NameRegister();
1236 static Register registers[] = { receiver, name, rbx, rcx, rdi, r8 }; 1236 static Register registers[] = { receiver, name, rax, rbx, rdi, r8 };
1237 return registers; 1237 return registers;
1238 } 1238 }
1239 1239
1240 1240
1241 Register StoreStubCompiler::value() { 1241 Register StoreStubCompiler::value() {
1242 return rax; 1242 return rax;
1243 } 1243 }
1244 1244
1245 1245
1246 Register* StoreStubCompiler::registers() { 1246 Register* StoreStubCompiler::registers() {
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1387 } 1387 }
1388 1388
1389 1389
1390 #undef __ 1390 #undef __
1391 #define __ ACCESS_MASM(masm) 1391 #define __ ACCESS_MASM(masm)
1392 1392
1393 1393
1394 void KeyedLoadStubCompiler::GenerateLoadDictionaryElement( 1394 void KeyedLoadStubCompiler::GenerateLoadDictionaryElement(
1395 MacroAssembler* masm) { 1395 MacroAssembler* masm) {
1396 // ----------- S t a t e ------------- 1396 // ----------- S t a t e -------------
1397 // -- rax : key 1397 // -- rcx : key
1398 // -- rdx : receiver 1398 // -- rdx : receiver
1399 // -- rsp[0] : return address 1399 // -- rsp[0] : return address
1400 // ----------------------------------- 1400 // -----------------------------------
1401 ASSERT(rdx.is(KeyedLoadIC::ReceiverRegister())); 1401 ASSERT(rdx.is(LoadIC::ReceiverRegister()));
1402 ASSERT(rax.is(KeyedLoadIC::NameRegister())); 1402 ASSERT(rcx.is(LoadIC::NameRegister()));
1403 Label slow, miss; 1403 Label slow, miss;
1404 1404
1405 // This stub is meant to be tail-jumped to, the receiver must already 1405 // This stub is meant to be tail-jumped to, the receiver must already
1406 // have been verified by the caller to not be a smi. 1406 // have been verified by the caller to not be a smi.
1407 1407
1408 __ JumpIfNotSmi(rax, &miss); 1408 __ JumpIfNotSmi(rcx, &miss);
1409 __ SmiToInteger32(rbx, rax); 1409 __ SmiToInteger32(rbx, rcx);
1410 __ movp(rcx, FieldOperand(rdx, JSObject::kElementsOffset)); 1410 __ movp(rax, FieldOperand(rdx, JSObject::kElementsOffset));
1411 1411
1412 // Check whether the elements is a number dictionary. 1412 // Check whether the elements is a number dictionary.
1413 // rdx: receiver 1413 // rdx: receiver
1414 // rax: key 1414 // rcx: key
1415 // rbx: key as untagged int32 1415 // rbx: key as untagged int32
1416 // rcx: elements 1416 // rax: elements
1417 __ LoadFromNumberDictionary(&slow, rcx, rax, rbx, r9, rdi, rax); 1417 __ LoadFromNumberDictionary(&slow, rax, rcx, rbx, r9, rdi, rax);
1418 __ ret(0); 1418 __ ret(0);
1419 1419
1420 __ bind(&slow); 1420 __ bind(&slow);
1421 // ----------- S t a t e ------------- 1421 // ----------- S t a t e -------------
1422 // -- rax : key 1422 // -- rcx : key
1423 // -- rdx : receiver 1423 // -- rdx : receiver
1424 // -- rsp[0] : return address 1424 // -- rsp[0] : return address
1425 // ----------------------------------- 1425 // -----------------------------------
1426 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow); 1426 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow);
1427 1427
1428 __ bind(&miss); 1428 __ bind(&miss);
1429 // ----------- S t a t e ------------- 1429 // ----------- S t a t e -------------
1430 // -- rax : key 1430 // -- rcx : key
1431 // -- rdx : receiver 1431 // -- rdx : receiver
1432 // -- rsp[0] : return address 1432 // -- rsp[0] : return address
1433 // ----------------------------------- 1433 // -----------------------------------
1434 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 1434 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
1435 } 1435 }
1436 1436
1437 1437
1438 #undef __ 1438 #undef __
1439 1439
1440 } } // namespace v8::internal 1440 } } // namespace v8::internal
1441 1441
1442 #endif // V8_TARGET_ARCH_X64 1442 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698