OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 2892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2903 | 2903 |
2904 | 2904 |
2905 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { | 2905 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { |
2906 Register arguments = ToRegister(instr->arguments()); | 2906 Register arguments = ToRegister(instr->arguments()); |
2907 Register result = ToRegister(instr->result()); | 2907 Register result = ToRegister(instr->result()); |
2908 | 2908 |
2909 if (instr->length()->IsConstantOperand() && | 2909 if (instr->length()->IsConstantOperand() && |
2910 instr->index()->IsConstantOperand()) { | 2910 instr->index()->IsConstantOperand()) { |
2911 int32_t const_index = ToInteger32(LConstantOperand::cast(instr->index())); | 2911 int32_t const_index = ToInteger32(LConstantOperand::cast(instr->index())); |
2912 int32_t const_length = ToInteger32(LConstantOperand::cast(instr->length())); | 2912 int32_t const_length = ToInteger32(LConstantOperand::cast(instr->length())); |
2913 if (const_index < const_length) { | 2913 StackArgumentsAccessor args(arguments, const_length, |
2914 StackArgumentsAccessor args(arguments, const_length, | 2914 ARGUMENTS_DONT_CONTAIN_RECEIVER); |
2915 ARGUMENTS_DONT_CONTAIN_RECEIVER); | 2915 __ movp(result, args.GetArgumentOperand(const_index)); |
2916 __ movp(result, args.GetArgumentOperand(const_index)); | |
2917 } else { | |
2918 // This code should never be executed; just stop here. | |
2919 __ int3(); | |
2920 } | |
2921 } else { | 2916 } else { |
2922 Register length = ToRegister(instr->length()); | 2917 Register length = ToRegister(instr->length()); |
2923 // There are two words between the frame pointer and the last argument. | 2918 // There are two words between the frame pointer and the last argument. |
2924 // Subtracting from length accounts for one of them add one more. | 2919 // Subtracting from length accounts for one of them add one more. |
2925 if (instr->index()->IsRegister()) { | 2920 if (instr->index()->IsRegister()) { |
2926 __ subl(length, ToRegister(instr->index())); | 2921 __ subl(length, ToRegister(instr->index())); |
2927 } else { | 2922 } else { |
2928 __ subl(length, ToOperand(instr->index())); | 2923 __ subl(length, ToOperand(instr->index())); |
2929 } | 2924 } |
2930 StackArgumentsAccessor args(arguments, length, | 2925 StackArgumentsAccessor args(arguments, length, |
(...skipping 2720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5651 FixedArray::kHeaderSize - kPointerSize)); | 5646 FixedArray::kHeaderSize - kPointerSize)); |
5652 __ bind(&done); | 5647 __ bind(&done); |
5653 } | 5648 } |
5654 | 5649 |
5655 | 5650 |
5656 #undef __ | 5651 #undef __ |
5657 | 5652 |
5658 } } // namespace v8::internal | 5653 } } // namespace v8::internal |
5659 | 5654 |
5660 #endif // V8_TARGET_ARCH_X64 | 5655 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |