| 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 3101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3112 CalculateStackPassedWords(num_reg_arguments, num_double_arguments); | 3112 CalculateStackPassedWords(num_reg_arguments, num_double_arguments); |
| 3113 int stack_space = kNumRequiredStackFrameSlots + stack_passed_arguments; | 3113 int stack_space = kNumRequiredStackFrameSlots + stack_passed_arguments; |
| 3114 if (ActivationFrameAlignment() > kPointerSize) { | 3114 if (ActivationFrameAlignment() > kPointerSize) { |
| 3115 LoadP(sp, MemOperand(sp, stack_space * kPointerSize)); | 3115 LoadP(sp, MemOperand(sp, stack_space * kPointerSize)); |
| 3116 } else { | 3116 } else { |
| 3117 addi(sp, sp, Operand(stack_space * kPointerSize)); | 3117 addi(sp, sp, Operand(stack_space * kPointerSize)); |
| 3118 } | 3118 } |
| 3119 } | 3119 } |
| 3120 | 3120 |
| 3121 | 3121 |
| 3122 void MacroAssembler::FlushICache(Register address, size_t size, | |
| 3123 Register scratch) { | |
| 3124 if (CpuFeatures::IsSupported(INSTR_AND_DATA_CACHE_COHERENCY)) { | |
| 3125 sync(); | |
| 3126 icbi(r0, address); | |
| 3127 isync(); | |
| 3128 return; | |
| 3129 } | |
| 3130 | |
| 3131 Label done; | |
| 3132 | |
| 3133 dcbf(r0, address); | |
| 3134 sync(); | |
| 3135 icbi(r0, address); | |
| 3136 isync(); | |
| 3137 | |
| 3138 // This code handles ranges which cross a single cacheline boundary. | |
| 3139 // scratch is last cacheline which intersects range. | |
| 3140 const int kCacheLineSizeLog2 = WhichPowerOf2(CpuFeatures::cache_line_size()); | |
| 3141 | |
| 3142 DCHECK(size > 0 && size <= (size_t)(1 << kCacheLineSizeLog2)); | |
| 3143 addi(scratch, address, Operand(size - 1)); | |
| 3144 ClearRightImm(scratch, scratch, Operand(kCacheLineSizeLog2)); | |
| 3145 cmpl(scratch, address); | |
| 3146 ble(&done); | |
| 3147 | |
| 3148 dcbf(r0, scratch); | |
| 3149 sync(); | |
| 3150 icbi(r0, scratch); | |
| 3151 isync(); | |
| 3152 | |
| 3153 bind(&done); | |
| 3154 } | |
| 3155 | |
| 3156 | |
| 3157 void MacroAssembler::DecodeConstantPoolOffset(Register result, | 3122 void MacroAssembler::DecodeConstantPoolOffset(Register result, |
| 3158 Register location) { | 3123 Register location) { |
| 3159 Label overflow_access, done; | 3124 Label overflow_access, done; |
| 3160 DCHECK(!AreAliased(result, location, r0)); | 3125 DCHECK(!AreAliased(result, location, r0)); |
| 3161 | 3126 |
| 3162 // Determine constant pool access type | 3127 // Determine constant pool access type |
| 3163 // Caller has already placed the instruction word at location in result. | 3128 // Caller has already placed the instruction word at location in result. |
| 3164 ExtractBitRange(r0, result, 31, 26); | 3129 ExtractBitRange(r0, result, 31, 26); |
| 3165 cmpi(r0, Operand(ADDIS >> 26)); | 3130 cmpi(r0, Operand(ADDIS >> 26)); |
| 3166 beq(&overflow_access); | 3131 beq(&overflow_access); |
| (...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4330 } | 4295 } |
| 4331 if (mag.shift > 0) srawi(result, result, mag.shift); | 4296 if (mag.shift > 0) srawi(result, result, mag.shift); |
| 4332 ExtractBit(r0, dividend, 31); | 4297 ExtractBit(r0, dividend, 31); |
| 4333 add(result, result, r0); | 4298 add(result, result, r0); |
| 4334 } | 4299 } |
| 4335 | 4300 |
| 4336 } // namespace internal | 4301 } // namespace internal |
| 4337 } // namespace v8 | 4302 } // namespace v8 |
| 4338 | 4303 |
| 4339 #endif // V8_TARGET_ARCH_PPC | 4304 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |