OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 <assert.h> // For assert | 5 #include <assert.h> // For assert |
6 #include <limits.h> // For LONG_MIN, LONG_MAX. | 6 #include <limits.h> // For LONG_MIN, LONG_MAX. |
7 | 7 |
8 #if V8_TARGET_ARCH_PPC | 8 #if V8_TARGET_ARCH_PPC |
9 | 9 |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 2749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2760 | 2760 |
2761 // If the expected number of arguments of the runtime function is | 2761 // If the expected number of arguments of the runtime function is |
2762 // constant, we check that the actual number of arguments match the | 2762 // constant, we check that the actual number of arguments match the |
2763 // expectation. | 2763 // expectation. |
2764 CHECK(f->nargs < 0 || f->nargs == num_arguments); | 2764 CHECK(f->nargs < 0 || f->nargs == num_arguments); |
2765 | 2765 |
2766 // TODO(1236192): Most runtime routines don't need the number of | 2766 // TODO(1236192): Most runtime routines don't need the number of |
2767 // arguments passed in because it is constant. At some point we | 2767 // arguments passed in because it is constant. At some point we |
2768 // should remove this need and make the runtime routine entry code | 2768 // should remove this need and make the runtime routine entry code |
2769 // smarter. | 2769 // smarter. |
2770 mov(r3, Operand(num_arguments)); | 2770 if (num_arguments >= 0) { |
| 2771 mov(r3, Operand(num_arguments)); |
| 2772 } |
2771 mov(r4, Operand(ExternalReference(f, isolate()))); | 2773 mov(r4, Operand(ExternalReference(f, isolate()))); |
2772 CEntryStub stub(isolate(), | 2774 CEntryStub stub(isolate(), |
2773 #if V8_TARGET_ARCH_PPC64 | 2775 #if V8_TARGET_ARCH_PPC64 |
2774 f->result_size, | 2776 f->result_size, |
2775 #else | 2777 #else |
2776 1, | 2778 1, |
2777 #endif | 2779 #endif |
2778 save_doubles); | 2780 save_doubles); |
2779 CallStub(&stub); | 2781 CallStub(&stub); |
2780 } | 2782 } |
(...skipping 2137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4918 } | 4920 } |
4919 if (mag.shift > 0) srawi(result, result, mag.shift); | 4921 if (mag.shift > 0) srawi(result, result, mag.shift); |
4920 ExtractBit(r0, dividend, 31); | 4922 ExtractBit(r0, dividend, 31); |
4921 add(result, result, r0); | 4923 add(result, result, r0); |
4922 } | 4924 } |
4923 | 4925 |
4924 } // namespace internal | 4926 } // namespace internal |
4925 } // namespace v8 | 4927 } // namespace v8 |
4926 | 4928 |
4927 #endif // V8_TARGET_ARCH_PPC | 4929 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |