| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 // to the unmapped lookup with the parameter map in scratch1. | 781 // to the unmapped lookup with the parameter map in scratch1. |
| 782 __ lw(scratch2, FieldMemOperand(scratch1, FixedArray::kLengthOffset)); | 782 __ lw(scratch2, FieldMemOperand(scratch1, FixedArray::kLengthOffset)); |
| 783 __ Subu(scratch2, scratch2, Operand(Smi::FromInt(2))); | 783 __ Subu(scratch2, scratch2, Operand(Smi::FromInt(2))); |
| 784 __ Branch(unmapped_case, Ugreater_equal, key, Operand(scratch2)); | 784 __ Branch(unmapped_case, Ugreater_equal, key, Operand(scratch2)); |
| 785 | 785 |
| 786 // Load element index and check whether it is the hole. | 786 // Load element index and check whether it is the hole. |
| 787 const int kOffset = | 787 const int kOffset = |
| 788 FixedArray::kHeaderSize + 2 * kPointerSize - kHeapObjectTag; | 788 FixedArray::kHeaderSize + 2 * kPointerSize - kHeapObjectTag; |
| 789 | 789 |
| 790 __ li(scratch3, Operand(kPointerSize >> 1)); | 790 __ li(scratch3, Operand(kPointerSize >> 1)); |
| 791 __ mul(scratch3, key, scratch3); | 791 __ Mul(scratch3, key, scratch3); |
| 792 __ Addu(scratch3, scratch3, Operand(kOffset)); | 792 __ Addu(scratch3, scratch3, Operand(kOffset)); |
| 793 | 793 |
| 794 __ Addu(scratch2, scratch1, scratch3); | 794 __ Addu(scratch2, scratch1, scratch3); |
| 795 __ lw(scratch2, MemOperand(scratch2)); | 795 __ lw(scratch2, MemOperand(scratch2)); |
| 796 __ LoadRoot(scratch3, Heap::kTheHoleValueRootIndex); | 796 __ LoadRoot(scratch3, Heap::kTheHoleValueRootIndex); |
| 797 __ Branch(unmapped_case, eq, scratch2, Operand(scratch3)); | 797 __ Branch(unmapped_case, eq, scratch2, Operand(scratch3)); |
| 798 | 798 |
| 799 // Load value from context and return it. We can reuse scratch1 because | 799 // Load value from context and return it. We can reuse scratch1 because |
| 800 // we do not jump to the unmapped lookup (which requires the parameter | 800 // we do not jump to the unmapped lookup (which requires the parameter |
| 801 // map in scratch1). | 801 // map in scratch1). |
| 802 __ lw(scratch1, FieldMemOperand(scratch1, FixedArray::kHeaderSize)); | 802 __ lw(scratch1, FieldMemOperand(scratch1, FixedArray::kHeaderSize)); |
| 803 __ li(scratch3, Operand(kPointerSize >> 1)); | 803 __ li(scratch3, Operand(kPointerSize >> 1)); |
| 804 __ mul(scratch3, scratch2, scratch3); | 804 __ Mul(scratch3, scratch2, scratch3); |
| 805 __ Addu(scratch3, scratch3, Operand(Context::kHeaderSize - kHeapObjectTag)); | 805 __ Addu(scratch3, scratch3, Operand(Context::kHeaderSize - kHeapObjectTag)); |
| 806 __ Addu(scratch2, scratch1, scratch3); | 806 __ Addu(scratch2, scratch1, scratch3); |
| 807 return MemOperand(scratch2); | 807 return MemOperand(scratch2); |
| 808 } | 808 } |
| 809 | 809 |
| 810 | 810 |
| 811 static MemOperand GenerateUnmappedArgumentsLookup(MacroAssembler* masm, | 811 static MemOperand GenerateUnmappedArgumentsLookup(MacroAssembler* masm, |
| 812 Register key, | 812 Register key, |
| 813 Register parameter_map, | 813 Register parameter_map, |
| 814 Register scratch, | 814 Register scratch, |
| 815 Label* slow_case) { | 815 Label* slow_case) { |
| 816 // Element is in arguments backing store, which is referenced by the | 816 // Element is in arguments backing store, which is referenced by the |
| 817 // second element of the parameter_map. The parameter_map register | 817 // second element of the parameter_map. The parameter_map register |
| 818 // must be loaded with the parameter map of the arguments object and is | 818 // must be loaded with the parameter map of the arguments object and is |
| 819 // overwritten. | 819 // overwritten. |
| 820 const int kBackingStoreOffset = FixedArray::kHeaderSize + kPointerSize; | 820 const int kBackingStoreOffset = FixedArray::kHeaderSize + kPointerSize; |
| 821 Register backing_store = parameter_map; | 821 Register backing_store = parameter_map; |
| 822 __ lw(backing_store, FieldMemOperand(parameter_map, kBackingStoreOffset)); | 822 __ lw(backing_store, FieldMemOperand(parameter_map, kBackingStoreOffset)); |
| 823 Handle<Map> fixed_array_map(masm->isolate()->heap()->fixed_array_map()); | 823 Handle<Map> fixed_array_map(masm->isolate()->heap()->fixed_array_map()); |
| 824 __ CheckMap(backing_store, scratch, fixed_array_map, slow_case, | 824 __ CheckMap(backing_store, scratch, fixed_array_map, slow_case, |
| 825 DONT_DO_SMI_CHECK); | 825 DONT_DO_SMI_CHECK); |
| 826 __ lw(scratch, FieldMemOperand(backing_store, FixedArray::kLengthOffset)); | 826 __ lw(scratch, FieldMemOperand(backing_store, FixedArray::kLengthOffset)); |
| 827 __ Branch(slow_case, Ugreater_equal, key, Operand(scratch)); | 827 __ Branch(slow_case, Ugreater_equal, key, Operand(scratch)); |
| 828 __ li(scratch, Operand(kPointerSize >> 1)); | 828 __ li(scratch, Operand(kPointerSize >> 1)); |
| 829 __ mul(scratch, key, scratch); | 829 __ Mul(scratch, key, scratch); |
| 830 __ Addu(scratch, | 830 __ Addu(scratch, |
| 831 scratch, | 831 scratch, |
| 832 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 832 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
| 833 __ Addu(scratch, backing_store, scratch); | 833 __ Addu(scratch, backing_store, scratch); |
| 834 return MemOperand(scratch); | 834 return MemOperand(scratch); |
| 835 } | 835 } |
| 836 | 836 |
| 837 | 837 |
| 838 void KeyedLoadIC::GenerateNonStrictArguments(MacroAssembler* masm) { | 838 void KeyedLoadIC::GenerateNonStrictArguments(MacroAssembler* masm) { |
| 839 // ---------- S t a t e -------------- | 839 // ---------- S t a t e -------------- |
| (...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1752 Register reg = Register::from_code(Assembler::GetRs(instr_at_patch)); | 1752 Register reg = Register::from_code(Assembler::GetRs(instr_at_patch)); |
| 1753 patcher.masm()->andi(at, reg, kSmiTagMask); | 1753 patcher.masm()->andi(at, reg, kSmiTagMask); |
| 1754 patcher.ChangeBranchCondition(eq); | 1754 patcher.ChangeBranchCondition(eq); |
| 1755 } | 1755 } |
| 1756 } | 1756 } |
| 1757 | 1757 |
| 1758 | 1758 |
| 1759 } } // namespace v8::internal | 1759 } } // namespace v8::internal |
| 1760 | 1760 |
| 1761 #endif // V8_TARGET_ARCH_MIPS | 1761 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |