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

Side by Side Diff: src/x64/ic-x64.cc

Issue 652118: Refactored TailCallRuntime (splitted to TailCallRuntime and TailCallExternalReference) (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 10 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/codegen-x64.cc ('k') | src/x64/macro-assembler-x64.h » ('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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 // -- rsp[8] : name 234 // -- rsp[8] : name
235 // -- rsp[16] : receiver 235 // -- rsp[16] : receiver
236 // ----------------------------------- 236 // -----------------------------------
237 237
238 __ pop(rbx); 238 __ pop(rbx);
239 __ push(Operand(rsp, 1 * kPointerSize)); // receiver 239 __ push(Operand(rsp, 1 * kPointerSize)); // receiver
240 __ push(Operand(rsp, 1 * kPointerSize)); // name 240 __ push(Operand(rsp, 1 * kPointerSize)); // name
241 __ push(rbx); // return address 241 __ push(rbx); // return address
242 242
243 // Perform tail call to the entry. 243 // Perform tail call to the entry.
244 __ TailCallRuntime(ExternalReference(IC_Utility(kKeyedLoadIC_Miss)), 2, 1); 244 ExternalReference ref = ExternalReference(IC_Utility(kKeyedLoadIC_Miss));
245 __ TailCallExternalReference(ref, 2, 1);
245 } 246 }
246 247
247 248
248 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { 249 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
249 // ----------- S t a t e ------------- 250 // ----------- S t a t e -------------
250 // -- rsp[0] : return address 251 // -- rsp[0] : return address
251 // -- rsp[8] : name 252 // -- rsp[8] : name
252 // -- rsp[16] : receiver 253 // -- rsp[16] : receiver
253 // ----------------------------------- 254 // -----------------------------------
254 255
255 __ pop(rbx); 256 __ pop(rbx);
256 __ push(Operand(rsp, 1 * kPointerSize)); // receiver 257 __ push(Operand(rsp, 1 * kPointerSize)); // receiver
257 __ push(Operand(rsp, 1 * kPointerSize)); // name 258 __ push(Operand(rsp, 1 * kPointerSize)); // name
258 __ push(rbx); // return address 259 __ push(rbx); // return address
259 260
260 // Perform tail call to the entry. 261 // Perform tail call to the entry.
261 __ TailCallRuntime(ExternalReference(Runtime::kKeyedGetProperty), 2, 1); 262 __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1);
262 } 263 }
263 264
264 265
265 void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { 266 void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) {
266 // ----------- S t a t e ------------- 267 // ----------- S t a t e -------------
267 // -- rsp[0] : return address 268 // -- rsp[0] : return address
268 // -- rsp[8] : name 269 // -- rsp[8] : name
269 // -- rsp[16] : receiver 270 // -- rsp[16] : receiver
270 // ----------------------------------- 271 // -----------------------------------
271 Label slow, check_string, index_int, index_string; 272 Label slow, check_string, index_int, index_string;
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 __ cmpb(rdx, Immediate(1 << Map::kHasIndexedInterceptor)); 602 __ cmpb(rdx, Immediate(1 << Map::kHasIndexedInterceptor));
602 __ j(not_zero, &slow); 603 __ j(not_zero, &slow);
603 604
604 // Everything is fine, call runtime. 605 // Everything is fine, call runtime.
605 __ pop(rdx); 606 __ pop(rdx);
606 __ push(rcx); // receiver 607 __ push(rcx); // receiver
607 __ push(rax); // key 608 __ push(rax); // key
608 __ push(rdx); // return address 609 __ push(rdx); // return address
609 610
610 // Perform tail call to the entry. 611 // Perform tail call to the entry.
611 __ TailCallRuntime(ExternalReference( 612 __ TailCallExternalReference(ExternalReference(
612 IC_Utility(kKeyedLoadPropertyWithInterceptor)), 2, 1); 613 IC_Utility(kKeyedLoadPropertyWithInterceptor)), 2, 1);
613 614
614 __ bind(&slow); 615 __ bind(&slow);
615 GenerateMiss(masm); 616 GenerateMiss(masm);
616 } 617 }
617 618
618 619
619 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { 620 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
620 // ----------- S t a t e ------------- 621 // ----------- S t a t e -------------
621 // -- rax : value 622 // -- rax : value
622 // -- rsp[0] : return address 623 // -- rsp[0] : return address
623 // -- rsp[8] : key 624 // -- rsp[8] : key
624 // -- rsp[16] : receiver 625 // -- rsp[16] : receiver
625 // ----------------------------------- 626 // -----------------------------------
626 627
627 __ pop(rcx); 628 __ pop(rcx);
628 __ push(Operand(rsp, 1 * kPointerSize)); // receiver 629 __ push(Operand(rsp, 1 * kPointerSize)); // receiver
629 __ push(Operand(rsp, 1 * kPointerSize)); // key 630 __ push(Operand(rsp, 1 * kPointerSize)); // key
630 __ push(rax); // value 631 __ push(rax); // value
631 __ push(rcx); // return address 632 __ push(rcx); // return address
632 633
633 // Do tail-call to runtime routine. 634 // Do tail-call to runtime routine.
634 __ TailCallRuntime(ExternalReference(IC_Utility(kKeyedStoreIC_Miss)), 3, 1); 635 ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss));
636 __ TailCallExternalReference(ref, 3, 1);
635 } 637 }
636 638
637 639
638 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm) { 640 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm) {
639 // ----------- S t a t e ------------- 641 // ----------- S t a t e -------------
640 // -- rax : value 642 // -- rax : value
641 // -- rsp[0] : return address 643 // -- rsp[0] : return address
642 // -- rsp[8] : key 644 // -- rsp[8] : key
643 // -- rsp[16] : receiver 645 // -- rsp[16] : receiver
644 // ----------------------------------- 646 // -----------------------------------
645 647
646 __ pop(rcx); 648 __ pop(rcx);
647 __ push(Operand(rsp, 1 * kPointerSize)); // receiver 649 __ push(Operand(rsp, 1 * kPointerSize)); // receiver
648 __ push(Operand(rsp, 1 * kPointerSize)); // key 650 __ push(Operand(rsp, 1 * kPointerSize)); // key
649 __ push(rax); // value 651 __ push(rax); // value
650 __ push(rcx); // return address 652 __ push(rcx); // return address
651 653
652 // Do tail-call to runtime routine. 654 // Do tail-call to runtime routine.
653 __ TailCallRuntime(ExternalReference(Runtime::kSetProperty), 3, 1); 655 __ TailCallRuntime(Runtime::kSetProperty, 3, 1);
654 } 656 }
655 657
656 658
657 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) { 659 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) {
658 // ----------- S t a t e ------------- 660 // ----------- S t a t e -------------
659 // -- rax : value 661 // -- rax : value
660 // -- rsp[0] : return address 662 // -- rsp[0] : return address
661 // -- rsp[8] : key 663 // -- rsp[8] : key
662 // -- rsp[16] : receiver 664 // -- rsp[16] : receiver
663 // ----------------------------------- 665 // -----------------------------------
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
1216 // -- rsp[0] : return address 1218 // -- rsp[0] : return address
1217 // -- rsp[8] : receiver 1219 // -- rsp[8] : receiver
1218 // ----------------------------------- 1220 // -----------------------------------
1219 1221
1220 __ pop(rbx); 1222 __ pop(rbx);
1221 __ push(Operand(rsp, 0)); // receiver 1223 __ push(Operand(rsp, 0)); // receiver
1222 __ push(rcx); // name 1224 __ push(rcx); // name
1223 __ push(rbx); // return address 1225 __ push(rbx); // return address
1224 1226
1225 // Perform tail call to the entry. 1227 // Perform tail call to the entry.
1226 __ TailCallRuntime(ExternalReference(IC_Utility(kLoadIC_Miss)), 2, 1); 1228 ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss));
1229 __ TailCallExternalReference(ref, 2, 1);
1227 } 1230 }
1228 1231
1229 1232
1230 void LoadIC::GenerateArrayLength(MacroAssembler* masm) { 1233 void LoadIC::GenerateArrayLength(MacroAssembler* masm) {
1231 // ----------- S t a t e ------------- 1234 // ----------- S t a t e -------------
1232 // -- rcx : name 1235 // -- rcx : name
1233 // -- rsp[0] : return address 1236 // -- rsp[0] : return address
1234 // -- rsp[8] : receiver 1237 // -- rsp[8] : receiver
1235 // ----------------------------------- 1238 // -----------------------------------
1236 Label miss; 1239 Label miss;
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1378 // -- rsp[0] : return address 1381 // -- rsp[0] : return address
1379 // ----------------------------------- 1382 // -----------------------------------
1380 1383
1381 __ pop(rbx); 1384 __ pop(rbx);
1382 __ push(rdx); // receiver 1385 __ push(rdx); // receiver
1383 __ push(rcx); // name 1386 __ push(rcx); // name
1384 __ push(rax); // value 1387 __ push(rax); // value
1385 __ push(rbx); // return address 1388 __ push(rbx); // return address
1386 1389
1387 // Perform tail call to the entry. 1390 // Perform tail call to the entry.
1388 __ TailCallRuntime(ExternalReference(IC_Utility(kStoreIC_Miss)), 3, 1); 1391 ExternalReference ref = ExternalReference(IC_Utility(kStoreIC_Miss));
1392 __ TailCallExternalReference(ref, 3, 1);
1389 } 1393 }
1390 1394
1391 1395
1392 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { 1396 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) {
1393 // ----------- S t a t e ------------- 1397 // ----------- S t a t e -------------
1394 // -- rax : value 1398 // -- rax : value
1395 // -- rcx : name 1399 // -- rcx : name
1396 // -- rdx : receiver 1400 // -- rdx : receiver
1397 // -- rsp[0] : return address 1401 // -- rsp[0] : return address
1398 // ----------------------------------- 1402 // -----------------------------------
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 1446
1443 // Check that value is a smi. 1447 // Check that value is a smi.
1444 __ JumpIfNotSmi(value, &miss); 1448 __ JumpIfNotSmi(value, &miss);
1445 1449
1446 // Prepare tail call to StoreIC_ArrayLength. 1450 // Prepare tail call to StoreIC_ArrayLength.
1447 __ pop(scratch); 1451 __ pop(scratch);
1448 __ push(receiver); 1452 __ push(receiver);
1449 __ push(value); 1453 __ push(value);
1450 __ push(scratch); // return address 1454 __ push(scratch); // return address
1451 1455
1452 __ TailCallRuntime(ExternalReference(IC_Utility(kStoreIC_ArrayLength)), 2, 1); 1456 ExternalReference ref = ExternalReference(IC_Utility(kStoreIC_ArrayLength));
1457 __ TailCallExternalReference(ref, 2, 1);
1453 1458
1454 __ bind(&miss); 1459 __ bind(&miss);
1455 1460
1456 GenerateMiss(masm); 1461 GenerateMiss(masm);
1457 } 1462 }
1458 1463
1459 1464
1460 #undef __ 1465 #undef __
1461 1466
1462 1467
1463 } } // namespace v8::internal 1468 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/x64/codegen-x64.cc ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698