| 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 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 825 // ----------------------------------- | 825 // ----------------------------------- |
| 826 | 826 |
| 827 __ push(r1); | 827 __ push(r1); |
| 828 __ stm(db_w, sp, r2.bit() | r0.bit()); | 828 __ stm(db_w, sp, r2.bit() | r0.bit()); |
| 829 | 829 |
| 830 // Perform tail call to the entry. | 830 // Perform tail call to the entry. |
| 831 __ TailCallRuntime(ExternalReference(IC_Utility(kStoreIC_Miss)), 3, 1); | 831 __ TailCallRuntime(ExternalReference(IC_Utility(kStoreIC_Miss)), 3, 1); |
| 832 } | 832 } |
| 833 | 833 |
| 834 | 834 |
| 835 void StoreIC::GenerateArrayLength(MacroAssembler* masm) { | |
| 836 // ----------- S t a t e ------------- | |
| 837 // -- r0 : value | |
| 838 // -- r1 : receiver | |
| 839 // -- r2 : name | |
| 840 // -- lr : return address | |
| 841 // ----------------------------------- | |
| 842 // | |
| 843 // This accepts as a receiver anything JSObject::SetElementsLength accepts | |
| 844 // (currently anything except for external and pixel arrays which means | |
| 845 // anything with elements of FixedArray type.), but currently is restricted | |
| 846 // to JSArray. | |
| 847 // Value must be a number, but only smis are accepted as the most common case. | |
| 848 | |
| 849 Label miss; | |
| 850 | |
| 851 Register receiver = r1; | |
| 852 Register value = r0; | |
| 853 Register scratch = r3; | |
| 854 | |
| 855 // Check that the receiver isn't a smi. | |
| 856 __ BranchOnSmi(receiver, &miss); | |
| 857 | |
| 858 // Check that the object is a JS array. | |
| 859 __ CompareObjectType(receiver, scratch, scratch, JS_ARRAY_TYPE); | |
| 860 __ b(ne, &miss); | |
| 861 | |
| 862 // Check that elements are FixedArray. | |
| 863 __ ldr(scratch, FieldMemOperand(receiver, JSArray::kElementsOffset)); | |
| 864 __ CompareObjectType(scratch, scratch, scratch, FIXED_ARRAY_TYPE); | |
| 865 __ b(ne, &miss); | |
| 866 | |
| 867 // Check that value is a smi. | |
| 868 __ BranchOnNotSmi(value, &miss); | |
| 869 | |
| 870 // Prepare tail call to StoreIC_ArrayLength. | |
| 871 __ push(receiver); | |
| 872 __ push(value); | |
| 873 | |
| 874 __ TailCallRuntime(ExternalReference(IC_Utility(kStoreIC_ArrayLength)), 2, 1); | |
| 875 | |
| 876 __ bind(&miss); | |
| 877 | |
| 878 GenerateMiss(masm); | |
| 879 } | |
| 880 | |
| 881 | |
| 882 #undef __ | 835 #undef __ |
| 883 | 836 |
| 884 | 837 |
| 885 } } // namespace v8::internal | 838 } } // namespace v8::internal |
| OLD | NEW |