| OLD | NEW |
| 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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 // ----------- S t a t e ------------- | 461 // ----------- S t a t e ------------- |
| 462 // -- r2 : name | 462 // -- r2 : name |
| 463 // -- lr : return address | 463 // -- lr : return address |
| 464 // -- [sp] : receiver | 464 // -- [sp] : receiver |
| 465 // ----------------------------------- | 465 // ----------------------------------- |
| 466 | 466 |
| 467 __ ldr(r3, MemOperand(sp, 0)); | 467 __ ldr(r3, MemOperand(sp, 0)); |
| 468 __ stm(db_w, sp, r2.bit() | r3.bit()); | 468 __ stm(db_w, sp, r2.bit() | r3.bit()); |
| 469 | 469 |
| 470 // Perform tail call to the entry. | 470 // Perform tail call to the entry. |
| 471 __ TailCallRuntime(ExternalReference(IC_Utility(kLoadIC_Miss)), 2, 1); | 471 ExternalReference ref = ExternalReference(IC_Utility(kLoadIC_Miss)); |
| 472 __ TailCallExternalReference(ref, 2, 1); |
| 472 } | 473 } |
| 473 | 474 |
| 474 | 475 |
| 475 // TODO(181): Implement map patching once loop nesting is tracked on the | 476 // TODO(181): Implement map patching once loop nesting is tracked on the |
| 476 // ARM platform so we can generate inlined fast-case code loads in | 477 // ARM platform so we can generate inlined fast-case code loads in |
| 477 // loops. | 478 // loops. |
| 478 void LoadIC::ClearInlinedVersion(Address address) {} | 479 void LoadIC::ClearInlinedVersion(Address address) {} |
| 479 bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) { | 480 bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) { |
| 480 return false; | 481 return false; |
| 481 } | 482 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 498 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | 499 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
| 499 // ---------- S t a t e -------------- | 500 // ---------- S t a t e -------------- |
| 500 // -- lr : return address | 501 // -- lr : return address |
| 501 // -- sp[0] : key | 502 // -- sp[0] : key |
| 502 // -- sp[4] : receiver | 503 // -- sp[4] : receiver |
| 503 // ----------------------------------- | 504 // ----------------------------------- |
| 504 | 505 |
| 505 __ ldm(ia, sp, r2.bit() | r3.bit()); | 506 __ ldm(ia, sp, r2.bit() | r3.bit()); |
| 506 __ stm(db_w, sp, r2.bit() | r3.bit()); | 507 __ stm(db_w, sp, r2.bit() | r3.bit()); |
| 507 | 508 |
| 508 __ TailCallRuntime(ExternalReference(IC_Utility(kKeyedLoadIC_Miss)), 2, 1); | 509 ExternalReference ref = ExternalReference(IC_Utility(kKeyedLoadIC_Miss)); |
| 510 __ TailCallExternalReference(ref, 2, 1); |
| 509 } | 511 } |
| 510 | 512 |
| 511 | 513 |
| 512 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { | 514 void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) { |
| 513 // ---------- S t a t e -------------- | 515 // ---------- S t a t e -------------- |
| 514 // -- lr : return address | 516 // -- lr : return address |
| 515 // -- sp[0] : key | 517 // -- sp[0] : key |
| 516 // -- sp[4] : receiver | 518 // -- sp[4] : receiver |
| 517 // ----------------------------------- | 519 // ----------------------------------- |
| 518 | 520 |
| 519 __ ldm(ia, sp, r2.bit() | r3.bit()); | 521 __ ldm(ia, sp, r2.bit() | r3.bit()); |
| 520 __ stm(db_w, sp, r2.bit() | r3.bit()); | 522 __ stm(db_w, sp, r2.bit() | r3.bit()); |
| 521 | 523 |
| 522 __ TailCallRuntime(ExternalReference(Runtime::kGetProperty), 2, 1); | 524 __ TailCallRuntime(Runtime::kGetProperty, 2, 1); |
| 523 } | 525 } |
| 524 | 526 |
| 525 | 527 |
| 526 void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { | 528 void KeyedLoadIC::GenerateGeneric(MacroAssembler* masm) { |
| 527 // ---------- S t a t e -------------- | 529 // ---------- S t a t e -------------- |
| 528 // -- lr : return address | 530 // -- lr : return address |
| 529 // -- sp[0] : key | 531 // -- sp[0] : key |
| 530 // -- sp[4] : receiver | 532 // -- sp[4] : receiver |
| 531 // ----------------------------------- | 533 // ----------------------------------- |
| 532 Label slow, fast; | 534 Label slow, fast; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 __ ldrb(r3, FieldMemOperand(r2, Map::kBitFieldOffset)); | 631 __ ldrb(r3, FieldMemOperand(r2, Map::kBitFieldOffset)); |
| 630 __ and_(r3, r3, Operand(kSlowCaseBitFieldMask)); | 632 __ and_(r3, r3, Operand(kSlowCaseBitFieldMask)); |
| 631 __ cmp(r3, Operand(1 << Map::kHasIndexedInterceptor)); | 633 __ cmp(r3, Operand(1 << Map::kHasIndexedInterceptor)); |
| 632 __ b(ne, &slow); | 634 __ b(ne, &slow); |
| 633 | 635 |
| 634 // Everything is fine, call runtime. | 636 // Everything is fine, call runtime. |
| 635 __ push(r1); // receiver | 637 __ push(r1); // receiver |
| 636 __ push(r0); // key | 638 __ push(r0); // key |
| 637 | 639 |
| 638 // Perform tail call to the entry. | 640 // Perform tail call to the entry. |
| 639 __ TailCallRuntime(ExternalReference( | 641 __ TailCallExternalReference(ExternalReference( |
| 640 IC_Utility(kKeyedLoadPropertyWithInterceptor)), 2, 1); | 642 IC_Utility(kKeyedLoadPropertyWithInterceptor)), 2, 1); |
| 641 | 643 |
| 642 __ bind(&slow); | 644 __ bind(&slow); |
| 643 GenerateMiss(masm); | 645 GenerateMiss(masm); |
| 644 } | 646 } |
| 645 | 647 |
| 646 | 648 |
| 647 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { | 649 void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { |
| 648 // ---------- S t a t e -------------- | 650 // ---------- S t a t e -------------- |
| 649 // -- r0 : value | 651 // -- r0 : value |
| 650 // -- lr : return address | 652 // -- lr : return address |
| 651 // -- sp[0] : key | 653 // -- sp[0] : key |
| 652 // -- sp[1] : receiver | 654 // -- sp[1] : receiver |
| 653 // ----------------------------------- | 655 // ----------------------------------- |
| 654 | 656 |
| 655 __ ldm(ia, sp, r2.bit() | r3.bit()); | 657 __ ldm(ia, sp, r2.bit() | r3.bit()); |
| 656 __ stm(db_w, sp, r0.bit() | r2.bit() | r3.bit()); | 658 __ stm(db_w, sp, r0.bit() | r2.bit() | r3.bit()); |
| 657 | 659 |
| 658 __ TailCallRuntime(ExternalReference(IC_Utility(kKeyedStoreIC_Miss)), 3, 1); | 660 ExternalReference ref = ExternalReference(IC_Utility(kKeyedStoreIC_Miss)); |
| 661 __ TailCallExternalReference(ref, 3, 1); |
| 659 } | 662 } |
| 660 | 663 |
| 661 | 664 |
| 662 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm) { | 665 void KeyedStoreIC::GenerateRuntimeSetProperty(MacroAssembler* masm) { |
| 663 // ---------- S t a t e -------------- | 666 // ---------- S t a t e -------------- |
| 664 // -- r0 : value | 667 // -- r0 : value |
| 665 // -- lr : return address | 668 // -- lr : return address |
| 666 // -- sp[0] : key | 669 // -- sp[0] : key |
| 667 // -- sp[1] : receiver | 670 // -- sp[1] : receiver |
| 668 // ----------------------------------- | 671 // ----------------------------------- |
| 669 __ ldm(ia, sp, r1.bit() | r3.bit()); // r0 == value, r1 == key, r3 == object | 672 __ ldm(ia, sp, r1.bit() | r3.bit()); // r0 == value, r1 == key, r3 == object |
| 670 __ stm(db_w, sp, r0.bit() | r1.bit() | r3.bit()); | 673 __ stm(db_w, sp, r0.bit() | r1.bit() | r3.bit()); |
| 671 | 674 |
| 672 __ TailCallRuntime(ExternalReference(Runtime::kSetProperty), 3, 1); | 675 __ TailCallRuntime(Runtime::kSetProperty, 3, 1); |
| 673 } | 676 } |
| 674 | 677 |
| 675 | 678 |
| 676 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) { | 679 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) { |
| 677 // ---------- S t a t e -------------- | 680 // ---------- S t a t e -------------- |
| 678 // -- r0 : value | 681 // -- r0 : value |
| 679 // -- lr : return address | 682 // -- lr : return address |
| 680 // -- sp[0] : key | 683 // -- sp[0] : key |
| 681 // -- sp[1] : receiver | 684 // -- sp[1] : receiver |
| 682 // ----------------------------------- | 685 // ----------------------------------- |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 821 // -- r0 : value | 824 // -- r0 : value |
| 822 // -- r1 : receiver | 825 // -- r1 : receiver |
| 823 // -- r2 : name | 826 // -- r2 : name |
| 824 // -- lr : return address | 827 // -- lr : return address |
| 825 // ----------------------------------- | 828 // ----------------------------------- |
| 826 | 829 |
| 827 __ push(r1); | 830 __ push(r1); |
| 828 __ stm(db_w, sp, r2.bit() | r0.bit()); | 831 __ stm(db_w, sp, r2.bit() | r0.bit()); |
| 829 | 832 |
| 830 // Perform tail call to the entry. | 833 // Perform tail call to the entry. |
| 831 __ TailCallRuntime(ExternalReference(IC_Utility(kStoreIC_Miss)), 3, 1); | 834 ExternalReference ref = ExternalReference(IC_Utility(kStoreIC_Miss)); |
| 835 __ TailCallExternalReference(ref, 3, 1); |
| 832 } | 836 } |
| 833 | 837 |
| 834 | 838 |
| 835 void StoreIC::GenerateArrayLength(MacroAssembler* masm) { | 839 void StoreIC::GenerateArrayLength(MacroAssembler* masm) { |
| 836 // ----------- S t a t e ------------- | 840 // ----------- S t a t e ------------- |
| 837 // -- r0 : value | 841 // -- r0 : value |
| 838 // -- r1 : receiver | 842 // -- r1 : receiver |
| 839 // -- r2 : name | 843 // -- r2 : name |
| 840 // -- lr : return address | 844 // -- lr : return address |
| 841 // ----------------------------------- | 845 // ----------------------------------- |
| (...skipping 22 matching lines...) Expand all Loading... |
| 864 __ CompareObjectType(scratch, scratch, scratch, FIXED_ARRAY_TYPE); | 868 __ CompareObjectType(scratch, scratch, scratch, FIXED_ARRAY_TYPE); |
| 865 __ b(ne, &miss); | 869 __ b(ne, &miss); |
| 866 | 870 |
| 867 // Check that value is a smi. | 871 // Check that value is a smi. |
| 868 __ BranchOnNotSmi(value, &miss); | 872 __ BranchOnNotSmi(value, &miss); |
| 869 | 873 |
| 870 // Prepare tail call to StoreIC_ArrayLength. | 874 // Prepare tail call to StoreIC_ArrayLength. |
| 871 __ push(receiver); | 875 __ push(receiver); |
| 872 __ push(value); | 876 __ push(value); |
| 873 | 877 |
| 874 __ TailCallRuntime(ExternalReference(IC_Utility(kStoreIC_ArrayLength)), 2, 1); | 878 ExternalReference ref = ExternalReference(IC_Utility(kStoreIC_ArrayLength)); |
| 879 __ TailCallExternalReference(ref, 2, 1); |
| 875 | 880 |
| 876 __ bind(&miss); | 881 __ bind(&miss); |
| 877 | 882 |
| 878 GenerateMiss(masm); | 883 GenerateMiss(masm); |
| 879 } | 884 } |
| 880 | 885 |
| 881 | 886 |
| 882 #undef __ | 887 #undef __ |
| 883 | 888 |
| 884 | 889 |
| 885 } } // namespace v8::internal | 890 } } // namespace v8::internal |
| OLD | NEW |