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

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

Issue 1694016: Simplify the use of the stm instruction on ARM. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 8 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 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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 // -- r2 : name 440 // -- r2 : name
441 // -- lr : return address 441 // -- lr : return address
442 // ----------------------------------- 442 // -----------------------------------
443 443
444 // Get the receiver of the function from the stack. 444 // Get the receiver of the function from the stack.
445 __ ldr(r3, MemOperand(sp, argc * kPointerSize)); 445 __ ldr(r3, MemOperand(sp, argc * kPointerSize));
446 446
447 __ EnterInternalFrame(); 447 __ EnterInternalFrame();
448 448
449 // Push the receiver and the name of the function. 449 // Push the receiver and the name of the function.
450 __ stm(db_w, sp, r2.bit() | r3.bit()); 450 __ Push(r3, r2);
451 451
452 // Call the entry. 452 // Call the entry.
453 __ mov(r0, Operand(2)); 453 __ mov(r0, Operand(2));
454 __ mov(r1, Operand(ExternalReference(IC_Utility(kCallIC_Miss)))); 454 __ mov(r1, Operand(ExternalReference(IC_Utility(kCallIC_Miss))));
455 455
456 CEntryStub stub(1); 456 CEntryStub stub(1);
457 __ CallStub(&stub); 457 __ CallStub(&stub);
458 458
459 // Move result to r1 and leave the internal frame. 459 // Move result to r1 and leave the internal frame.
460 __ mov(r1, Operand(r0)); 460 __ mov(r1, Operand(r0));
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 638
639 639
640 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { 640 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) {
641 // ---------- S t a t e -------------- 641 // ---------- S t a t e --------------
642 // -- lr : return address 642 // -- lr : return address
643 // -- sp[0] : key 643 // -- sp[0] : key
644 // -- sp[4] : receiver 644 // -- sp[4] : receiver
645 // ----------------------------------- 645 // -----------------------------------
646 646
647 __ ldm(ia, sp, r2.bit() | r3.bit()); 647 __ ldm(ia, sp, r2.bit() | r3.bit());
648 __ stm(db_w, sp, r2.bit() | r3.bit()); 648 __ Push(r3, r2);
649 649
650 ExternalReference ref = ExternalReference(IC_Utility(kKeyedLoadIC_Miss)); 650 ExternalReference ref = ExternalReference(IC_Utility(kKeyedLoadIC_Miss));
651 __ TailCallExternalReference(ref, 2, 1); 651 __ TailCallExternalReference(ref, 2, 1);
652 } 652 }
653 653
654 654
655 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { 655 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
656 // ---------- S t a t e -------------- 656 // ---------- S t a t e --------------
657 // -- lr : return address 657 // -- lr : return address
658 // -- sp[0] : key 658 // -- sp[0] : key
659 // -- sp[4] : receiver 659 // -- sp[4] : receiver
660 // ----------------------------------- 660 // -----------------------------------
661 661
662 __ ldm(ia, sp, r2.bit() | r3.bit()); 662 __ ldm(ia, sp, r2.bit() | r3.bit());
663 __ stm(db_w, sp, r2.bit() | r3.bit()); 663 __ Push(r3, r2);
664 664
665 __ TailCallRuntime(Runtime::kGetProperty, 2, 1); 665 __ TailCallRuntime(Runtime::kGetProperty, 2, 1);
666 } 666 }
667 667
668 668
669 void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { 669 void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) {
670 // ---------- S t a t e -------------- 670 // ---------- S t a t e --------------
671 // -- lr : return address 671 // -- lr : return address
672 // -- sp[0] : key 672 // -- sp[0] : key
673 // -- sp[4] : receiver 673 // -- sp[4] : receiver
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
771 Condition is_string = masm->IsObjectStringType(r1, r2); 771 Condition is_string = masm->IsObjectStringType(r1, r2);
772 __ b(NegateCondition(is_string), &miss); 772 __ b(NegateCondition(is_string), &miss);
773 773
774 // Check if key is a smi or a heap number. 774 // Check if key is a smi or a heap number.
775 __ BranchOnSmi(r0, &index_ok); 775 __ BranchOnSmi(r0, &index_ok);
776 __ CheckMap(r0, r2, Factory::heap_number_map(), &miss, false); 776 __ CheckMap(r0, r2, Factory::heap_number_map(), &miss, false);
777 777
778 __ bind(&index_ok); 778 __ bind(&index_ok);
779 // Duplicate receiver and key since they are expected on the stack after 779 // Duplicate receiver and key since they are expected on the stack after
780 // the KeyedLoadIC call. 780 // the KeyedLoadIC call.
781 __ stm(db_w, sp, r0.bit() | r1.bit()); 781 __ Push(r1, r0);
782 __ InvokeBuiltin(Builtins::STRING_CHAR_AT, JUMP_JS); 782 __ InvokeBuiltin(Builtins::STRING_CHAR_AT, JUMP_JS);
783 783
784 __ bind(&miss); 784 __ bind(&miss);
785 GenerateGeneric(masm); 785 GenerateGeneric(masm);
786 } 786 }
787 787
788 788
789 // Convert unsigned integer with specified number of leading zeroes in binary 789 // Convert unsigned integer with specified number of leading zeroes in binary
790 // representation to IEEE 754 double. 790 // representation to IEEE 754 double.
791 // Integer to convert is passed in register hiword. 791 // Integer to convert is passed in register hiword.
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 __ ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset)); 1087 __ ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset));
1088 1088
1089 // Check that it has indexed interceptor and access checks 1089 // Check that it has indexed interceptor and access checks
1090 // are not enabled for this object. 1090 // are not enabled for this object.
1091 __ ldrb(r3, FieldMemOperand(r2, Map::kBitFieldOffset)); 1091 __ ldrb(r3, FieldMemOperand(r2, Map::kBitFieldOffset));
1092 __ and_(r3, r3, Operand(kSlowCaseBitFieldMask)); 1092 __ and_(r3, r3, Operand(kSlowCaseBitFieldMask));
1093 __ cmp(r3, Operand(1 << Map::kHasIndexedInterceptor)); 1093 __ cmp(r3, Operand(1 << Map::kHasIndexedInterceptor));
1094 __ b(ne, &slow); 1094 __ b(ne, &slow);
1095 1095
1096 // Everything is fine, call runtime. 1096 // Everything is fine, call runtime.
1097 __ push(r1); // receiver 1097 __ Push(r1, r0); // Receiver, key.
1098 __ push(r0); // key
1099 1098
1100 // Perform tail call to the entry. 1099 // Perform tail call to the entry.
1101 __ TailCallExternalReference(ExternalReference( 1100 __ TailCallExternalReference(ExternalReference(
1102 IC_Utility(kKeyedLoadPropertyWithInterceptor)), 2, 1); 1101 IC_Utility(kKeyedLoadPropertyWithInterceptor)), 2, 1);
1103 1102
1104 __ bind(&slow); 1103 __ bind(&slow);
1105 GenerateMiss(masm); 1104 GenerateMiss(masm);
1106 } 1105 }
1107 1106
1108 1107
1109 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { 1108 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
1110 // ---------- S t a t e -------------- 1109 // ---------- S t a t e --------------
1111 // -- r0 : value 1110 // -- r0 : value
1112 // -- lr : return address 1111 // -- lr : return address
1113 // -- sp[0] : key 1112 // -- sp[0] : key
1114 // -- sp[1] : receiver 1113 // -- sp[1] : receiver
1115 // ----------------------------------- 1114 // -----------------------------------
1116 1115
1117 __ ldm(ia, sp, r2.bit() | r3.bit()); 1116 __ ldm(ia, sp, r2.bit() | r3.bit());
1118 __ stm(db_w, sp, r0.bit() | r2.bit() | r3.bit()); 1117 __ Push(r3, r2, r0);
1119 1118
1120 ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss)); 1119 ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss));
1121 __ TailCallExternalReference(ref, 3, 1); 1120 __ TailCallExternalReference(ref, 3, 1);
1122 } 1121 }
1123 1122
1124 1123
1125 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm) { 1124 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm) {
1126 // ---------- S t a t e -------------- 1125 // ---------- S t a t e --------------
1127 // -- r0 : value 1126 // -- r0 : value
1128 // -- lr : return address 1127 // -- lr : return address
1129 // -- sp[0] : key 1128 // -- sp[0] : key
1130 // -- sp[1] : receiver 1129 // -- sp[1] : receiver
1131 // ----------------------------------- 1130 // -----------------------------------
1132 __ ldm(ia, sp, r1.bit() | r3.bit()); // r0 == value, r1 == key, r3 == object 1131 __ ldm(ia, sp, r1.bit() | r3.bit()); // r0 == value, r1 == key, r3 == object
1133 __ stm(db_w, sp, r0.bit() | r1.bit() | r3.bit()); 1132 __ Push(r3, r1, r0);
1134 1133
1135 __ TailCallRuntime(Runtime::kSetProperty, 3, 1); 1134 __ TailCallRuntime(Runtime::kSetProperty, 3, 1);
1136 } 1135 }
1137 1136
1138 1137
1139 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) { 1138 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) {
1140 // ---------- S t a t e -------------- 1139 // ---------- S t a t e --------------
1141 // -- r0 : value 1140 // -- r0 : value
1142 // -- lr : return address 1141 // -- lr : return address
1143 // -- sp[0] : key 1142 // -- sp[0] : key
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
1677 1676
1678 1677
1679 void StoreIC::GenerateMiss(MacroAssembler* masm) { 1678 void StoreIC::GenerateMiss(MacroAssembler* masm) {
1680 // ----------- S t a t e ------------- 1679 // ----------- S t a t e -------------
1681 // -- r0 : value 1680 // -- r0 : value
1682 // -- r1 : receiver 1681 // -- r1 : receiver
1683 // -- r2 : name 1682 // -- r2 : name
1684 // -- lr : return address 1683 // -- lr : return address
1685 // ----------------------------------- 1684 // -----------------------------------
1686 1685
1687 __ push(r1); 1686 __ Push(r1, r2, r0);
1688 __ stm(db_w, sp, r2.bit() | r0.bit());
1689 1687
1690 // Perform tail call to the entry. 1688 // Perform tail call to the entry.
1691 ExternalReference ref = ExternalReference(IC_Utility(kStoreIC_Miss)); 1689 ExternalReference ref = ExternalReference(IC_Utility(kStoreIC_Miss));
1692 __ TailCallExternalReference(ref, 3, 1); 1690 __ TailCallExternalReference(ref, 3, 1);
1693 } 1691 }
1694 1692
1695 1693
1696 void StoreIC::GenerateArrayLength(MacroAssembler* masm) { 1694 void StoreIC::GenerateArrayLength(MacroAssembler* masm) {
1697 // ----------- S t a t e ------------- 1695 // ----------- S t a t e -------------
1698 // -- r0 : value 1696 // -- r0 : value
(...skipping 23 matching lines...) Expand all
1722 1720
1723 // Check that elements are FixedArray. 1721 // Check that elements are FixedArray.
1724 __ ldr(scratch, FieldMemOperand(receiver, JSArray::kElementsOffset)); 1722 __ ldr(scratch, FieldMemOperand(receiver, JSArray::kElementsOffset));
1725 __ CompareObjectType(scratch, scratch, scratch, FIXED_ARRAY_TYPE); 1723 __ CompareObjectType(scratch, scratch, scratch, FIXED_ARRAY_TYPE);
1726 __ b(ne, &miss); 1724 __ b(ne, &miss);
1727 1725
1728 // Check that value is a smi. 1726 // Check that value is a smi.
1729 __ BranchOnNotSmi(value, &miss); 1727 __ BranchOnNotSmi(value, &miss);
1730 1728
1731 // Prepare tail call to StoreIC_ArrayLength. 1729 // Prepare tail call to StoreIC_ArrayLength.
1732 __ push(receiver); 1730 __ Push(receiver, value);
1733 __ push(value);
1734 1731
1735 ExternalReference ref = ExternalReference(IC_Utility(kStoreIC_ArrayLength)); 1732 ExternalReference ref = ExternalReference(IC_Utility(kStoreIC_ArrayLength));
1736 __ TailCallExternalReference(ref, 2, 1); 1733 __ TailCallExternalReference(ref, 2, 1);
1737 1734
1738 __ bind(&miss); 1735 __ bind(&miss);
1739 1736
1740 GenerateMiss(masm); 1737 GenerateMiss(masm);
1741 } 1738 }
1742 1739
1743 1740
1744 #undef __ 1741 #undef __
1745 1742
1746 1743
1747 } } // namespace v8::internal 1744 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698