| 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 <limits.h> // For LONG_MIN, LONG_MAX. | 5 #include <limits.h> // For LONG_MIN, LONG_MAX. |
| 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/base/division-by-constant.h" | 10 #include "src/base/division-by-constant.h" |
| (...skipping 2818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2829 | 2829 |
| 2830 // If the expected number of arguments of the runtime function is | 2830 // If the expected number of arguments of the runtime function is |
| 2831 // constant, we check that the actual number of arguments match the | 2831 // constant, we check that the actual number of arguments match the |
| 2832 // expectation. | 2832 // expectation. |
| 2833 CHECK(f->nargs < 0 || f->nargs == num_arguments); | 2833 CHECK(f->nargs < 0 || f->nargs == num_arguments); |
| 2834 | 2834 |
| 2835 // TODO(1236192): Most runtime routines don't need the number of | 2835 // TODO(1236192): Most runtime routines don't need the number of |
| 2836 // arguments passed in because it is constant. At some point we | 2836 // arguments passed in because it is constant. At some point we |
| 2837 // should remove this need and make the runtime routine entry code | 2837 // should remove this need and make the runtime routine entry code |
| 2838 // smarter. | 2838 // smarter. |
| 2839 mov(r0, Operand(num_arguments)); | 2839 if (num_arguments >= 0) { |
| 2840 mov(r0, Operand(num_arguments)); |
| 2841 } |
| 2840 mov(r1, Operand(ExternalReference(f, isolate()))); | 2842 mov(r1, Operand(ExternalReference(f, isolate()))); |
| 2841 CEntryStub stub(isolate(), 1, save_doubles); | 2843 CEntryStub stub(isolate(), 1, save_doubles); |
| 2842 CallStub(&stub); | 2844 CallStub(&stub); |
| 2843 } | 2845 } |
| 2844 | 2846 |
| 2845 | 2847 |
| 2846 void MacroAssembler::CallExternalReference(const ExternalReference& ext, | 2848 void MacroAssembler::CallExternalReference(const ExternalReference& ext, |
| 2847 int num_arguments) { | 2849 int num_arguments) { |
| 2848 mov(r0, Operand(num_arguments)); | 2850 mov(r0, Operand(num_arguments)); |
| 2849 mov(r1, Operand(ext)); | 2851 mov(r1, Operand(ext)); |
| (...skipping 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4028 } | 4030 } |
| 4029 } | 4031 } |
| 4030 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); | 4032 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); |
| 4031 add(result, result, Operand(dividend, LSR, 31)); | 4033 add(result, result, Operand(dividend, LSR, 31)); |
| 4032 } | 4034 } |
| 4033 | 4035 |
| 4034 } // namespace internal | 4036 } // namespace internal |
| 4035 } // namespace v8 | 4037 } // namespace v8 |
| 4036 | 4038 |
| 4037 #endif // V8_TARGET_ARCH_ARM | 4039 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |