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

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

Issue 201042: Win64 - Allow returning two values from a runtime function. (Closed)
Patch Set: Fixed typo. Created 11 years, 3 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
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 384
385 __ EnterInternalFrame(); 385 __ EnterInternalFrame();
386 386
387 // Push the receiver and the name of the function. 387 // Push the receiver and the name of the function.
388 __ stm(db_w, sp, r1.bit() | r2.bit()); 388 __ stm(db_w, sp, r1.bit() | r2.bit());
389 389
390 // Call the entry. 390 // Call the entry.
391 __ mov(r0, Operand(2)); 391 __ mov(r0, Operand(2));
392 __ mov(r1, Operand(f)); 392 __ mov(r1, Operand(f));
393 393
394 CEntryStub stub; 394 CEntryStub stub(1);
395 __ CallStub(&stub); 395 __ CallStub(&stub);
396 396
397 // Move result to r1 and leave the internal frame. 397 // Move result to r1 and leave the internal frame.
398 __ mov(r1, Operand(r0)); 398 __ mov(r1, Operand(r0));
399 __ LeaveInternalFrame(); 399 __ LeaveInternalFrame();
400 400
401 // Check if the receiver is a global object of some sort. 401 // Check if the receiver is a global object of some sort.
402 Label invoke, global; 402 Label invoke, global;
403 __ ldr(r2, MemOperand(sp, argc * kPointerSize)); // receiver 403 __ ldr(r2, MemOperand(sp, argc * kPointerSize)); // receiver
404 __ tst(r2, Operand(kSmiTagMask)); 404 __ tst(r2, Operand(kSmiTagMask));
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 // ----------- S t a t e ------------- 496 // ----------- S t a t e -------------
497 // -- r2 : name 497 // -- r2 : name
498 // -- lr : return address 498 // -- lr : return address
499 // -- [sp] : receiver 499 // -- [sp] : receiver
500 // ----------------------------------- 500 // -----------------------------------
501 501
502 __ ldr(r3, MemOperand(sp, 0)); 502 __ ldr(r3, MemOperand(sp, 0));
503 __ stm(db_w, sp, r2.bit() | r3.bit()); 503 __ stm(db_w, sp, r2.bit() | r3.bit());
504 504
505 // Perform tail call to the entry. 505 // Perform tail call to the entry.
506 __ TailCallRuntime(f, 2); 506 __ TailCallRuntime(f, 2, 1);
507 } 507 }
508 508
509 509
510 // TODO(181): Implement map patching once loop nesting is tracked on the 510 // TODO(181): Implement map patching once loop nesting is tracked on the
511 // ARM platform so we can generate inlined fast-case code loads in 511 // ARM platform so we can generate inlined fast-case code loads in
512 // loops. 512 // loops.
513 void LoadIC::ClearInlinedVersion(Address address) {} 513 void LoadIC::ClearInlinedVersion(Address address) {}
514 bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) { 514 bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) {
515 return false; 515 return false;
516 } 516 }
(...skipping 19 matching lines...) Expand all
536 536
537 537
538 void KeyedLoadIC::Generate(MacroAssembler* masm, const ExternalReference& f) { 538 void KeyedLoadIC::Generate(MacroAssembler* masm, const ExternalReference& f) {
539 // ---------- S t a t e -------------- 539 // ---------- S t a t e --------------
540 // -- lr : return address 540 // -- lr : return address
541 // -- sp[0] : key 541 // -- sp[0] : key
542 // -- sp[4] : receiver 542 // -- sp[4] : receiver
543 __ ldm(ia, sp, r2.bit() | r3.bit()); 543 __ ldm(ia, sp, r2.bit() | r3.bit());
544 __ stm(db_w, sp, r2.bit() | r3.bit()); 544 __ stm(db_w, sp, r2.bit() | r3.bit());
545 545
546 __ TailCallRuntime(f, 2); 546 __ TailCallRuntime(f, 2, 1);
547 } 547 }
548 548
549 549
550 void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { 550 void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) {
551 // ---------- S t a t e -------------- 551 // ---------- S t a t e --------------
552 // -- lr : return address 552 // -- lr : return address
553 // -- sp[0] : key 553 // -- sp[0] : key
554 // -- sp[4] : receiver 554 // -- sp[4] : receiver
555 Label slow, fast; 555 Label slow, fast;
556 556
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 __ ldr(r3, FieldMemOperand(r1, Array::kLengthOffset)); 592 __ ldr(r3, FieldMemOperand(r1, Array::kLengthOffset));
593 __ cmp(r0, Operand(r3)); 593 __ cmp(r0, Operand(r3));
594 __ b(lo, &fast); 594 __ b(lo, &fast);
595 595
596 // Slow case: Push extra copies of the arguments (2). 596 // Slow case: Push extra copies of the arguments (2).
597 __ bind(&slow); 597 __ bind(&slow);
598 __ IncrementCounter(&Counters::keyed_load_generic_slow, 1, r0, r1); 598 __ IncrementCounter(&Counters::keyed_load_generic_slow, 1, r0, r1);
599 __ ldm(ia, sp, r0.bit() | r1.bit()); 599 __ ldm(ia, sp, r0.bit() | r1.bit());
600 __ stm(db_w, sp, r0.bit() | r1.bit()); 600 __ stm(db_w, sp, r0.bit() | r1.bit());
601 // Do tail-call to runtime routine. 601 // Do tail-call to runtime routine.
602 __ TailCallRuntime(ExternalReference(Runtime::kGetProperty), 2); 602 __ TailCallRuntime(ExternalReference(Runtime::kGetProperty), 2, 1);
603 603
604 // Fast case: Do the load. 604 // Fast case: Do the load.
605 __ bind(&fast); 605 __ bind(&fast);
606 __ add(r3, r1, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 606 __ add(r3, r1, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
607 __ ldr(r0, MemOperand(r3, r0, LSL, kPointerSizeLog2)); 607 __ ldr(r0, MemOperand(r3, r0, LSL, kPointerSizeLog2));
608 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); 608 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
609 __ cmp(r0, ip); 609 __ cmp(r0, ip);
610 // In case the loaded value is the_hole we have to consult GetProperty 610 // In case the loaded value is the_hole we have to consult GetProperty
611 // to ensure the prototype chain is searched. 611 // to ensure the prototype chain is searched.
612 __ b(eq, &slow); 612 __ b(eq, &slow);
613 613
614 __ Ret(); 614 __ Ret();
615 } 615 }
616 616
617 617
618 void KeyedStoreIC::Generate(MacroAssembler* masm, 618 void KeyedStoreIC::Generate(MacroAssembler* masm,
619 const ExternalReference& f) { 619 const ExternalReference& f) {
620 // ---------- S t a t e -------------- 620 // ---------- S t a t e --------------
621 // -- r0 : value 621 // -- r0 : value
622 // -- lr : return address 622 // -- lr : return address
623 // -- sp[0] : key 623 // -- sp[0] : key
624 // -- sp[1] : receiver 624 // -- sp[1] : receiver
625 625
626 __ ldm(ia, sp, r2.bit() | r3.bit()); 626 __ ldm(ia, sp, r2.bit() | r3.bit());
627 __ stm(db_w, sp, r0.bit() | r2.bit() | r3.bit()); 627 __ stm(db_w, sp, r0.bit() | r2.bit() | r3.bit());
628 628
629 __ TailCallRuntime(f, 3); 629 __ TailCallRuntime(f, 3, 1);
630 } 630 }
631 631
632 632
633 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) { 633 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) {
634 // ---------- S t a t e -------------- 634 // ---------- S t a t e --------------
635 // -- r0 : value 635 // -- r0 : value
636 // -- lr : return address 636 // -- lr : return address
637 // -- sp[0] : key 637 // -- sp[0] : key
638 // -- sp[1] : receiver 638 // -- sp[1] : receiver
639 Label slow, fast, array, extra, exit; 639 Label slow, fast, array, extra, exit;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 __ ldr(ip, FieldMemOperand(r3, FixedArray::kLengthOffset)); 677 __ ldr(ip, FieldMemOperand(r3, FixedArray::kLengthOffset));
678 __ cmp(r1, Operand(ip)); 678 __ cmp(r1, Operand(ip));
679 __ b(lo, &fast); 679 __ b(lo, &fast);
680 680
681 681
682 // Slow case: Push extra copies of the arguments (3). 682 // Slow case: Push extra copies of the arguments (3).
683 __ bind(&slow); 683 __ bind(&slow);
684 __ ldm(ia, sp, r1.bit() | r3.bit()); // r0 == value, r1 == key, r3 == object 684 __ ldm(ia, sp, r1.bit() | r3.bit()); // r0 == value, r1 == key, r3 == object
685 __ stm(db_w, sp, r0.bit() | r1.bit() | r3.bit()); 685 __ stm(db_w, sp, r0.bit() | r1.bit() | r3.bit());
686 // Do tail-call to runtime routine. 686 // Do tail-call to runtime routine.
687 __ TailCallRuntime(ExternalReference(Runtime::kSetProperty), 3); 687 __ TailCallRuntime(ExternalReference(Runtime::kSetProperty), 3, 1);
688 688
689 // Extra capacity case: Check if there is extra capacity to 689 // Extra capacity case: Check if there is extra capacity to
690 // perform the store and update the length. Used for adding one 690 // perform the store and update the length. Used for adding one
691 // element to the array by writing to array[array.length]. 691 // element to the array by writing to array[array.length].
692 // r0 == value, r1 == key, r2 == elements, r3 == object 692 // r0 == value, r1 == key, r2 == elements, r3 == object
693 __ bind(&extra); 693 __ bind(&extra);
694 __ b(ne, &slow); // do not leave holes in the array 694 __ b(ne, &slow); // do not leave holes in the array
695 __ mov(r1, Operand(r1, ASR, kSmiTagSize)); // untag 695 __ mov(r1, Operand(r1, ASR, kSmiTagSize)); // untag
696 __ ldr(ip, FieldMemOperand(r2, Array::kLengthOffset)); 696 __ ldr(ip, FieldMemOperand(r2, Array::kLengthOffset));
697 __ cmp(r1, Operand(ip)); 697 __ cmp(r1, Operand(ip));
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 // -- lr : return address 754 // -- lr : return address
755 // -- sp[0] : key 755 // -- sp[0] : key
756 // -- sp[1] : receiver 756 // -- sp[1] : receiver
757 // ----------- S t a t e ------------- 757 // ----------- S t a t e -------------
758 758
759 __ ldm(ia, sp, r2.bit() | r3.bit()); 759 __ ldm(ia, sp, r2.bit() | r3.bit());
760 __ stm(db_w, sp, r0.bit() | r2.bit() | r3.bit()); 760 __ stm(db_w, sp, r0.bit() | r2.bit() | r3.bit());
761 761
762 // Perform tail call to the entry. 762 // Perform tail call to the entry.
763 __ TailCallRuntime( 763 __ TailCallRuntime(
764 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3); 764 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3, 1);
765 } 765 }
766 766
767 767
768 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { 768 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) {
769 // ----------- S t a t e ------------- 769 // ----------- S t a t e -------------
770 // -- r0 : value 770 // -- r0 : value
771 // -- r2 : name 771 // -- r2 : name
772 // -- lr : return address 772 // -- lr : return address
773 // -- [sp] : receiver 773 // -- [sp] : receiver
774 // ----------------------------------- 774 // -----------------------------------
(...skipping 16 matching lines...) Expand all
791 // -- r2 : name 791 // -- r2 : name
792 // -- lr : return address 792 // -- lr : return address
793 // -- [sp] : receiver 793 // -- [sp] : receiver
794 // ----------------------------------- 794 // -----------------------------------
795 795
796 __ ldr(r3, MemOperand(sp)); // copy receiver 796 __ ldr(r3, MemOperand(sp)); // copy receiver
797 __ stm(db_w, sp, r0.bit() | r2.bit() | r3.bit()); 797 __ stm(db_w, sp, r0.bit() | r2.bit() | r3.bit());
798 798
799 // Perform tail call to the entry. 799 // Perform tail call to the entry.
800 __ TailCallRuntime( 800 __ TailCallRuntime(
801 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3); 801 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3, 1);
802 } 802 }
803 803
804 804
805 void StoreIC::Generate(MacroAssembler* masm, const ExternalReference& f) { 805 void StoreIC::Generate(MacroAssembler* masm, const ExternalReference& f) {
806 // ----------- S t a t e ------------- 806 // ----------- S t a t e -------------
807 // -- r0 : value 807 // -- r0 : value
808 // -- r2 : name 808 // -- r2 : name
809 // -- lr : return address 809 // -- lr : return address
810 // -- [sp] : receiver 810 // -- [sp] : receiver
811 // ----------------------------------- 811 // -----------------------------------
812 812
813 __ ldr(r3, MemOperand(sp)); // copy receiver 813 __ ldr(r3, MemOperand(sp)); // copy receiver
814 __ stm(db_w, sp, r0.bit() | r2.bit() | r3.bit()); 814 __ stm(db_w, sp, r0.bit() | r2.bit() | r3.bit());
815 815
816 // Perform tail call to the entry. 816 // Perform tail call to the entry.
817 __ TailCallRuntime(f, 3); 817 __ TailCallRuntime(f, 3, 1);
818 } 818 }
819 819
820 820
821 #undef __ 821 #undef __
822 822
823 823
824 } } // namespace v8::internal 824 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/codegen-arm.cc ('k') | src/arm/macro-assembler-arm.h » ('j') | src/codegen.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698