| 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 2028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2039 mov(result_end, Operand(isolate()->factory()->one_pointer_filler_map())); | 2039 mov(result_end, Operand(isolate()->factory()->one_pointer_filler_map())); |
| 2040 str(result_end, MemOperand(result, kDoubleSize / 2, PostIndex)); | 2040 str(result_end, MemOperand(result, kDoubleSize / 2, PostIndex)); |
| 2041 bind(&aligned); | 2041 bind(&aligned); |
| 2042 } | 2042 } |
| 2043 | 2043 |
| 2044 // Calculate new top and bail out if new space is exhausted. Use result | 2044 // Calculate new top and bail out if new space is exhausted. Use result |
| 2045 // to calculate the new top. We must preserve the ip register at this | 2045 // to calculate the new top. We must preserve the ip register at this |
| 2046 // point, so we cannot just use add(). | 2046 // point, so we cannot just use add(). |
| 2047 DCHECK(object_size > 0); | 2047 DCHECK(object_size > 0); |
| 2048 Register source = result; | 2048 Register source = result; |
| 2049 Condition cond = al; | |
| 2050 int shift = 0; | 2049 int shift = 0; |
| 2051 while (object_size != 0) { | 2050 while (object_size != 0) { |
| 2052 if (((object_size >> shift) & 0x03) == 0) { | 2051 if (((object_size >> shift) & 0x03) == 0) { |
| 2053 shift += 2; | 2052 shift += 2; |
| 2054 } else { | 2053 } else { |
| 2055 int bits = object_size & (0xff << shift); | 2054 int bits = object_size & (0xff << shift); |
| 2056 object_size -= bits; | 2055 object_size -= bits; |
| 2057 shift += 8; | 2056 shift += 8; |
| 2058 Operand bits_operand(bits); | 2057 Operand bits_operand(bits); |
| 2059 DCHECK(bits_operand.instructions_required(this) == 1); | 2058 DCHECK(bits_operand.instructions_required(this) == 1); |
| 2060 add(result_end, source, bits_operand, LeaveCC, cond); | 2059 add(result_end, source, bits_operand); |
| 2061 source = result_end; | 2060 source = result_end; |
| 2062 cond = cc; | |
| 2063 } | 2061 } |
| 2064 } | 2062 } |
| 2065 | 2063 |
| 2066 cmp(result_end, Operand(alloc_limit)); | 2064 cmp(result_end, Operand(alloc_limit)); |
| 2067 b(hi, gc_required); | 2065 b(hi, gc_required); |
| 2068 | 2066 |
| 2069 if ((flags & ALLOCATION_FOLDING_DOMINATOR) == 0) { | 2067 if ((flags & ALLOCATION_FOLDING_DOMINATOR) == 0) { |
| 2070 // The top pointer is not updated for allocation folding dominators. | 2068 // The top pointer is not updated for allocation folding dominators. |
| 2071 str(result_end, MemOperand(top_address)); | 2069 str(result_end, MemOperand(top_address)); |
| 2072 } | 2070 } |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2251 mov(result_end, Operand(isolate()->factory()->one_pointer_filler_map())); | 2249 mov(result_end, Operand(isolate()->factory()->one_pointer_filler_map())); |
| 2252 str(result_end, MemOperand(result, kDoubleSize / 2, PostIndex)); | 2250 str(result_end, MemOperand(result, kDoubleSize / 2, PostIndex)); |
| 2253 bind(&aligned); | 2251 bind(&aligned); |
| 2254 } | 2252 } |
| 2255 | 2253 |
| 2256 // Calculate new top using result. Object size may be in words so a shift is | 2254 // Calculate new top using result. Object size may be in words so a shift is |
| 2257 // required to get the number of bytes. We must preserve the ip register at | 2255 // required to get the number of bytes. We must preserve the ip register at |
| 2258 // this point, so we cannot just use add(). | 2256 // this point, so we cannot just use add(). |
| 2259 DCHECK(object_size > 0); | 2257 DCHECK(object_size > 0); |
| 2260 Register source = result; | 2258 Register source = result; |
| 2261 Condition cond = al; | |
| 2262 int shift = 0; | 2259 int shift = 0; |
| 2263 while (object_size != 0) { | 2260 while (object_size != 0) { |
| 2264 if (((object_size >> shift) & 0x03) == 0) { | 2261 if (((object_size >> shift) & 0x03) == 0) { |
| 2265 shift += 2; | 2262 shift += 2; |
| 2266 } else { | 2263 } else { |
| 2267 int bits = object_size & (0xff << shift); | 2264 int bits = object_size & (0xff << shift); |
| 2268 object_size -= bits; | 2265 object_size -= bits; |
| 2269 shift += 8; | 2266 shift += 8; |
| 2270 Operand bits_operand(bits); | 2267 Operand bits_operand(bits); |
| 2271 DCHECK(bits_operand.instructions_required(this) == 1); | 2268 DCHECK(bits_operand.instructions_required(this) == 1); |
| 2272 add(result_end, source, bits_operand, LeaveCC, cond); | 2269 add(result_end, source, bits_operand); |
| 2273 source = result_end; | 2270 source = result_end; |
| 2274 cond = cc; | |
| 2275 } | 2271 } |
| 2276 } | 2272 } |
| 2277 | 2273 |
| 2278 // The top pointer is not updated for allocation folding dominators. | 2274 // The top pointer is not updated for allocation folding dominators. |
| 2279 str(result_end, MemOperand(top_address)); | 2275 str(result_end, MemOperand(top_address)); |
| 2280 | 2276 |
| 2281 add(result, result, Operand(kHeapObjectTag)); | 2277 add(result, result, Operand(kHeapObjectTag)); |
| 2282 } | 2278 } |
| 2283 | 2279 |
| 2284 void MacroAssembler::AllocateTwoByteString(Register result, | 2280 void MacroAssembler::AllocateTwoByteString(Register result, |
| (...skipping 1882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4167 } | 4163 } |
| 4168 } | 4164 } |
| 4169 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); | 4165 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); |
| 4170 add(result, result, Operand(dividend, LSR, 31)); | 4166 add(result, result, Operand(dividend, LSR, 31)); |
| 4171 } | 4167 } |
| 4172 | 4168 |
| 4173 } // namespace internal | 4169 } // namespace internal |
| 4174 } // namespace v8 | 4170 } // namespace v8 |
| 4175 | 4171 |
| 4176 #endif // V8_TARGET_ARCH_ARM | 4172 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |