OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1841 __ b(eq, &adaptor_frame); | 1841 __ b(eq, &adaptor_frame); |
1842 | 1842 |
1843 // Get the length from the frame. | 1843 // Get the length from the frame. |
1844 __ ldr(r1, MemOperand(sp, 0)); | 1844 __ ldr(r1, MemOperand(sp, 0)); |
1845 __ b(&try_allocate); | 1845 __ b(&try_allocate); |
1846 | 1846 |
1847 // Patch the arguments.length and the parameters pointer. | 1847 // Patch the arguments.length and the parameters pointer. |
1848 __ bind(&adaptor_frame); | 1848 __ bind(&adaptor_frame); |
1849 __ ldr(r1, MemOperand(r2, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 1849 __ ldr(r1, MemOperand(r2, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
1850 if (has_new_target()) { | 1850 if (has_new_target()) { |
| 1851 __ cmp(r1, Operand(Smi::FromInt(0))); |
| 1852 Label skip_decrement; |
| 1853 __ b(eq, &skip_decrement); |
1851 // Subtract 1 from smi-tagged arguments count. | 1854 // Subtract 1 from smi-tagged arguments count. |
1852 __ sub(r1, r1, Operand(2)); | 1855 __ sub(r1, r1, Operand(2)); |
| 1856 __ bind(&skip_decrement); |
1853 } | 1857 } |
1854 __ str(r1, MemOperand(sp, 0)); | 1858 __ str(r1, MemOperand(sp, 0)); |
1855 __ add(r3, r2, Operand::PointerOffsetFromSmiKey(r1)); | 1859 __ add(r3, r2, Operand::PointerOffsetFromSmiKey(r1)); |
1856 __ add(r3, r3, Operand(StandardFrameConstants::kCallerSPOffset)); | 1860 __ add(r3, r3, Operand(StandardFrameConstants::kCallerSPOffset)); |
1857 __ str(r3, MemOperand(sp, 1 * kPointerSize)); | 1861 __ str(r3, MemOperand(sp, 1 * kPointerSize)); |
1858 | 1862 |
1859 // Try the new space allocation. Start out with computing the size | 1863 // Try the new space allocation. Start out with computing the size |
1860 // of the arguments object and the elements array in words. | 1864 // of the arguments object and the elements array in words. |
1861 Label add_arguments_object; | 1865 Label add_arguments_object; |
1862 __ bind(&try_allocate); | 1866 __ bind(&try_allocate); |
(...skipping 3423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5286 kStackUnwindSpace, NULL, | 5290 kStackUnwindSpace, NULL, |
5287 MemOperand(fp, 6 * kPointerSize), NULL); | 5291 MemOperand(fp, 6 * kPointerSize), NULL); |
5288 } | 5292 } |
5289 | 5293 |
5290 | 5294 |
5291 #undef __ | 5295 #undef __ |
5292 | 5296 |
5293 } } // namespace v8::internal | 5297 } } // namespace v8::internal |
5294 | 5298 |
5295 #endif // V8_TARGET_ARCH_ARM | 5299 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |