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

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

Issue 598072: Direct call C++ functions (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
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 ExternalReference ref =
612 IC_Utility(kKeyedLoadPropertyWithInterceptor)), 2, 1); 613 ExternalReference(IC_Utility(kKeyedLoadPropertyWithInterceptor));
614 __ TailCallExternalReference(ref, 2, 1);
613 615
614 __ bind(&slow); 616 __ bind(&slow);
615 GenerateMiss(masm); 617 GenerateMiss(masm);
616 } 618 }
617 619
618 620
619 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { 621 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
620 // ----------- S t a t e ------------- 622 // ----------- S t a t e -------------
621 // -- rax : value 623 // -- rax : value
622 // -- rsp[0] : return address 624 // -- rsp[0] : return address
623 // -- rsp[8] : key 625 // -- rsp[8] : key
624 // -- rsp[16] : receiver 626 // -- rsp[16] : receiver
625 // ----------------------------------- 627 // -----------------------------------
626 628
627 __ pop(rcx); 629 __ pop(rcx);
628 __ push(Operand(rsp, 1 * kPointerSize)); // receiver 630 __ push(Operand(rsp, 1 * kPointerSize)); // receiver
629 __ push(Operand(rsp, 1 * kPointerSize)); // key 631 __ push(Operand(rsp, 1 * kPointerSize)); // key
630 __ push(rax); // value 632 __ push(rax); // value
631 __ push(rcx); // return address 633 __ push(rcx); // return address
632 634
633 // Do tail-call to runtime routine. 635 // Do tail-call to runtime routine.
634 __ TailCallRuntime(ExternalReference(IC_Utility(kKeyedStoreIC_Miss)), 3, 1); 636 ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss));
637 __ TailCallExternalReference(ref, 3, 1);
635 } 638 }
636 639
637 640
638 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm) { 641 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm) {
639 // ----------- S t a t e ------------- 642 // ----------- S t a t e -------------
640 // -- rax : value 643 // -- rax : value
641 // -- rsp[0] : return address 644 // -- rsp[0] : return address
642 // -- rsp[8] : key 645 // -- rsp[8] : key
643 // -- rsp[16] : receiver 646 // -- rsp[16] : receiver
644 // ----------------------------------- 647 // -----------------------------------
645 648
646 __ pop(rcx); 649 __ pop(rcx);
647 __ push(Operand(rsp, 1 * kPointerSize)); // receiver 650 __ push(Operand(rsp, 1 * kPointerSize)); // receiver
648 __ push(Operand(rsp, 1 * kPointerSize)); // key 651 __ push(Operand(rsp, 1 * kPointerSize)); // key
649 __ push(rax); // value 652 __ push(rax); // value
650 __ push(rcx); // return address 653 __ push(rcx); // return address
651 654
652 // Do tail-call to runtime routine. 655 // Do tail-call to runtime routine.
653 __ TailCallRuntime(ExternalReference(Runtime::kSetProperty), 3, 1); 656 __ TailCallRuntime(Runtime::kSetProperty, 3, 1);
654 } 657 }
655 658
656 659
657 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) { 660 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) {
658 // ----------- S t a t e ------------- 661 // ----------- S t a t e -------------
659 // -- rax : value 662 // -- rax : value
660 // -- rsp[0] : return address 663 // -- rsp[0] : return address
661 // -- rsp[8] : key 664 // -- rsp[8] : key
662 // -- rsp[16] : receiver 665 // -- rsp[16] : receiver
663 // ----------------------------------- 666 // -----------------------------------
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
1216 // -- rsp[0] : return address 1219 // -- rsp[0] : return address
1217 // -- rsp[8] : receiver 1220 // -- rsp[8] : receiver
1218 // ----------------------------------- 1221 // -----------------------------------
1219 1222
1220 __ pop(rbx); 1223 __ pop(rbx);
1221 __ push(Operand(rsp, 0)); // receiver 1224 __ push(Operand(rsp, 0)); // receiver
1222 __ push(rcx); // name 1225 __ push(rcx); // name
1223 __ push(rbx); // return address 1226 __ push(rbx); // return address
1224 1227
1225 // Perform tail call to the entry. 1228 // Perform tail call to the entry.
1226 __ TailCallRuntime(ExternalReference(IC_Utility(kLoadIC_Miss)), 2, 1); 1229 ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss));
1230 __ TailCallExternalReference(ref, 2, 1);
1227 } 1231 }
1228 1232
1229 1233
1230 void LoadIC::GenerateArrayLength(MacroAssembler* masm) { 1234 void LoadIC::GenerateArrayLength(MacroAssembler* masm) {
1231 // ----------- S t a t e ------------- 1235 // ----------- S t a t e -------------
1232 // -- rcx : name 1236 // -- rcx : name
1233 // -- rsp[0] : return address 1237 // -- rsp[0] : return address
1234 // -- rsp[8] : receiver 1238 // -- rsp[8] : receiver
1235 // ----------------------------------- 1239 // -----------------------------------
1236 Label miss; 1240 Label miss;
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1378 // -- rsp[0] : return address 1382 // -- rsp[0] : return address
1379 // ----------------------------------- 1383 // -----------------------------------
1380 1384
1381 __ pop(rbx); 1385 __ pop(rbx);
1382 __ push(rdx); // receiver 1386 __ push(rdx); // receiver
1383 __ push(rcx); // name 1387 __ push(rcx); // name
1384 __ push(rax); // value 1388 __ push(rax); // value
1385 __ push(rbx); // return address 1389 __ push(rbx); // return address
1386 1390
1387 // Perform tail call to the entry. 1391 // Perform tail call to the entry.
1388 __ TailCallRuntime(ExternalReference(IC_Utility(kStoreIC_Miss)), 3, 1); 1392 ExternalReference ref = ExternalReference(IC_Utility(kStoreIC_Miss));
1393 __ TailCallExternalReference(ref, 3, 1);
1389 } 1394 }
1390 1395
1391 1396
1392 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { 1397 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) {
1393 // ----------- S t a t e ------------- 1398 // ----------- S t a t e -------------
1394 // -- rax : value 1399 // -- rax : value
1395 // -- rcx : name 1400 // -- rcx : name
1396 // -- rdx : receiver 1401 // -- rdx : receiver
1397 // -- rsp[0] : return address 1402 // -- rsp[0] : return address
1398 // ----------------------------------- 1403 // -----------------------------------
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 1447
1443 // Check that value is a smi. 1448 // Check that value is a smi.
1444 __ JumpIfNotSmi(value, &miss); 1449 __ JumpIfNotSmi(value, &miss);
1445 1450
1446 // Prepare tail call to StoreIC_ArrayLength. 1451 // Prepare tail call to StoreIC_ArrayLength.
1447 __ pop(scratch); 1452 __ pop(scratch);
1448 __ push(receiver); 1453 __ push(receiver);
1449 __ push(value); 1454 __ push(value);
1450 __ push(scratch); // return address 1455 __ push(scratch); // return address
1451 1456
1452 __ TailCallRuntime(ExternalReference(IC_Utility(kStoreIC_ArrayLength)), 2, 1); 1457 ExternalReference ref = ExternalReference(IC_Utility(kStoreIC_ArrayLength));
1458 __ TailCallExternalReference(ref, 2, 1);
1453 1459
1454 __ bind(&miss); 1460 __ bind(&miss);
1455 1461
1456 GenerateMiss(masm); 1462 GenerateMiss(masm);
1457 } 1463 }
1458 1464
1459 1465
1460 #undef __ 1466 #undef __
1461 1467
1462 1468
1463 } } // namespace v8::internal 1469 } } // namespace v8::internal
OLDNEW
« src/runtime.h ('K') | « src/x64/full-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