| 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 2942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2953 | 2953 |
| 2954 | 2954 |
| 2955 void MacroAssembler::CallCFunction(Register function, int num_arguments) { | 2955 void MacroAssembler::CallCFunction(Register function, int num_arguments) { |
| 2956 CallCFunction(function, num_arguments, 0); | 2956 CallCFunction(function, num_arguments, 0); |
| 2957 } | 2957 } |
| 2958 | 2958 |
| 2959 | 2959 |
| 2960 void MacroAssembler::CallCFunctionHelper(Register function, | 2960 void MacroAssembler::CallCFunctionHelper(Register function, |
| 2961 int num_reg_arguments, | 2961 int num_reg_arguments, |
| 2962 int num_double_arguments) { | 2962 int num_double_arguments) { |
| 2963 DCHECK_LE(num_reg_arguments + num_double_arguments, kMaxCParameters); |
| 2963 DCHECK(has_frame()); | 2964 DCHECK(has_frame()); |
| 2964 | 2965 |
| 2965 // Just call directly. The function called cannot cause a GC, or | 2966 // Just call directly. The function called cannot cause a GC, or |
| 2966 // allow preemption, so the return address in the link register | 2967 // allow preemption, so the return address in the link register |
| 2967 // stays correct. | 2968 // stays correct. |
| 2968 Register dest = function; | 2969 Register dest = function; |
| 2969 if (ABI_USES_FUNCTION_DESCRIPTORS) { | 2970 if (ABI_USES_FUNCTION_DESCRIPTORS) { |
| 2970 // AIX/PPC64BE Linux uses a function descriptor. When calling C code be | 2971 // AIX/PPC64BE Linux uses a function descriptor. When calling C code be |
| 2971 // aware of this descriptor and pick up values from it | 2972 // aware of this descriptor and pick up values from it |
| 2972 LoadP(ToRegister(ABI_TOC_REGISTER), MemOperand(function, kPointerSize)); | 2973 LoadP(ToRegister(ABI_TOC_REGISTER), MemOperand(function, kPointerSize)); |
| (...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4258 } | 4259 } |
| 4259 if (mag.shift > 0) srawi(result, result, mag.shift); | 4260 if (mag.shift > 0) srawi(result, result, mag.shift); |
| 4260 ExtractBit(r0, dividend, 31); | 4261 ExtractBit(r0, dividend, 31); |
| 4261 add(result, result, r0); | 4262 add(result, result, r0); |
| 4262 } | 4263 } |
| 4263 | 4264 |
| 4264 } // namespace internal | 4265 } // namespace internal |
| 4265 } // namespace v8 | 4266 } // namespace v8 |
| 4266 | 4267 |
| 4267 #endif // V8_TARGET_ARCH_PPC | 4268 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |