OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
900 Register scratch2, | 900 Register scratch2, |
901 Register scratch3, | 901 Register scratch3, |
902 Label* unmapped_case, | 902 Label* unmapped_case, |
903 Label* slow_case) { | 903 Label* slow_case) { |
904 Heap* heap = masm->isolate()->heap(); | 904 Heap* heap = masm->isolate()->heap(); |
905 | 905 |
906 // Check that the receiver isn't a smi. | 906 // Check that the receiver isn't a smi. |
907 __ JumpIfSmi(object, slow_case); | 907 __ JumpIfSmi(object, slow_case); |
908 | 908 |
909 // Check that the key is a positive smi. | 909 // Check that the key is a positive smi. |
910 __ And(scratch1, scratch1, Operand(0x8000001)); | 910 __ And(scratch1, key, Operand(0x8000001)); |
911 __ Branch(slow_case, ne, key, Operand(scratch1)); | 911 __ Branch(slow_case, ne, scratch1, Operand(zero_reg)); |
912 | 912 |
913 // Load the elements into scratch1 and check its map. | 913 // Load the elements into scratch1 and check its map. |
914 Handle<Map> arguments_map(heap->non_strict_arguments_elements_map()); | 914 Handle<Map> arguments_map(heap->non_strict_arguments_elements_map()); |
915 __ lw(scratch1, FieldMemOperand(object, JSObject::kElementsOffset)); | 915 __ lw(scratch1, FieldMemOperand(object, JSObject::kElementsOffset)); |
916 __ CheckMap(scratch1, scratch2, arguments_map, slow_case, DONT_DO_SMI_CHECK); | 916 __ CheckMap(scratch1, scratch2, arguments_map, slow_case, DONT_DO_SMI_CHECK); |
917 | 917 |
918 // Check if element is in the range of mapped arguments. If not, jump | 918 // Check if element is in the range of mapped arguments. If not, jump |
919 // to the unmapped lookup with the parameter map in scratch1. | 919 // to the unmapped lookup with the parameter map in scratch1. |
920 __ lw(scratch2, FieldMemOperand(scratch1, FixedArray::kLengthOffset)); | 920 __ lw(scratch2, FieldMemOperand(scratch1, FixedArray::kLengthOffset)); |
921 __ Subu(scratch2, scratch2, Operand(Smi::FromInt(2))); | 921 __ Subu(scratch2, scratch2, Operand(Smi::FromInt(2))); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 | 971 |
972 | 972 |
973 void KeyedLoadIC::GenerateNonStrictArguments(MacroAssembler* masm) { | 973 void KeyedLoadIC::GenerateNonStrictArguments(MacroAssembler* masm) { |
974 // ---------- S t a t e -------------- | 974 // ---------- S t a t e -------------- |
975 // -- lr : return address | 975 // -- lr : return address |
976 // -- a0 : key | 976 // -- a0 : key |
977 // -- a1 : receiver | 977 // -- a1 : receiver |
978 // ----------------------------------- | 978 // ----------------------------------- |
979 Label slow, notin; | 979 Label slow, notin; |
980 MemOperand mapped_location = | 980 MemOperand mapped_location = |
981 GenerateMappedArgumentsLookup(masm, a1, v0, a2, a3, t0, ¬in, &slow); | 981 GenerateMappedArgumentsLookup(masm, a1, a0, a2, a3, t0, ¬in, &slow); |
982 __ lw(v0, mapped_location); | 982 __ lw(v0, mapped_location); |
983 __ Ret(); | 983 __ Ret(); |
984 __ bind(¬in); | 984 __ bind(¬in); |
985 // The unmapped lookup expects that the parameter map is in a2. | 985 // The unmapped lookup expects that the parameter map is in a2. |
986 MemOperand unmapped_location = | 986 MemOperand unmapped_location = |
987 GenerateUnmappedArgumentsLookup(masm, v0, a2, a3, &slow); | 987 GenerateUnmappedArgumentsLookup(masm, a0, a2, a3, &slow); |
988 __ lw(a2, unmapped_location); | 988 __ lw(a2, unmapped_location); |
989 __ Branch(&slow, eq, a2, Operand(a3)); | 989 __ Branch(&slow, eq, a2, Operand(a3)); |
990 __ LoadRoot(a3, Heap::kTheHoleValueRootIndex); | 990 __ LoadRoot(a3, Heap::kTheHoleValueRootIndex); |
991 __ mov(v0, a2); | 991 __ mov(v0, a2); |
992 __ Ret(); | 992 __ Ret(); |
993 __ bind(&slow); | 993 __ bind(&slow); |
994 GenerateMiss(masm, false); | 994 GenerateMiss(masm, false); |
995 } | 995 } |
996 | 996 |
997 | 997 |
998 void KeyedStoreIC::GenerateNonStrictArguments(MacroAssembler* masm) { | 998 void KeyedStoreIC::GenerateNonStrictArguments(MacroAssembler* masm) { |
999 // ---------- S t a t e -------------- | 999 // ---------- S t a t e -------------- |
1000 // -- v0 : value | 1000 // -- a0 : value |
1001 // -- a1 : key | 1001 // -- a1 : key |
1002 // -- a2 : receiver | 1002 // -- a2 : receiver |
1003 // -- lr : return address | 1003 // -- lr : return address |
1004 // ----------------------------------- | 1004 // ----------------------------------- |
1005 Label slow, notin; | 1005 Label slow, notin; |
1006 MemOperand mapped_location = | 1006 MemOperand mapped_location = |
1007 GenerateMappedArgumentsLookup(masm, a2, a1, a3, t0, t1, ¬in, &slow); | 1007 GenerateMappedArgumentsLookup(masm, a2, a1, a3, t0, t1, ¬in, &slow); |
1008 __ sw(v0, mapped_location); | 1008 __ sw(a0, mapped_location); |
1009 __ Ret(); | 1009 __ Ret(USE_DELAY_SLOT); |
| 1010 __ mov(v0, a0); // (In delay slot) return the value stored in v0. |
1010 __ bind(¬in); | 1011 __ bind(¬in); |
1011 // The unmapped lookup expects that the parameter map is in a3. | 1012 // The unmapped lookup expects that the parameter map is in a3. |
1012 MemOperand unmapped_location = | 1013 MemOperand unmapped_location = |
1013 GenerateUnmappedArgumentsLookup(masm, a1, a3, t0, &slow); | 1014 GenerateUnmappedArgumentsLookup(masm, a1, a3, t0, &slow); |
1014 __ sw(v0, unmapped_location); | 1015 __ sw(a0, unmapped_location); |
1015 __ Ret(); | 1016 __ Ret(USE_DELAY_SLOT); |
| 1017 __ mov(v0, a0); // (In delay slot) return the value stored in v0. |
1016 __ bind(&slow); | 1018 __ bind(&slow); |
1017 GenerateMiss(masm, false); | 1019 GenerateMiss(masm, false); |
1018 } | 1020 } |
1019 | 1021 |
1020 | 1022 |
1021 void KeyedCallIC::GenerateNonStrictArguments(MacroAssembler* masm, | 1023 void KeyedCallIC::GenerateNonStrictArguments(MacroAssembler* masm, |
1022 int argc) { | 1024 int argc) { |
1023 // ----------- S t a t e ------------- | 1025 // ----------- S t a t e ------------- |
1024 // -- a2 : name | 1026 // -- a2 : name |
1025 // -- lr : return address | 1027 // -- lr : return address |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1725 Register reg = Register::from_code(Assembler::GetRs(instr_at_patch)); | 1727 Register reg = Register::from_code(Assembler::GetRs(instr_at_patch)); |
1726 patcher.masm()->andi(at, reg, kSmiTagMask); | 1728 patcher.masm()->andi(at, reg, kSmiTagMask); |
1727 patcher.ChangeBranchCondition(eq); | 1729 patcher.ChangeBranchCondition(eq); |
1728 } | 1730 } |
1729 } | 1731 } |
1730 | 1732 |
1731 | 1733 |
1732 } } // namespace v8::internal | 1734 } } // namespace v8::internal |
1733 | 1735 |
1734 #endif // V8_TARGET_ARCH_MIPS | 1736 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |