| 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 1928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1939 mov(result_end, Operand(isolate()->factory()->one_pointer_filler_map())); | 1939 mov(result_end, Operand(isolate()->factory()->one_pointer_filler_map())); |
| 1940 str(result_end, MemOperand(result, kDoubleSize / 2, PostIndex)); | 1940 str(result_end, MemOperand(result, kDoubleSize / 2, PostIndex)); |
| 1941 bind(&aligned); | 1941 bind(&aligned); |
| 1942 } | 1942 } |
| 1943 | 1943 |
| 1944 // Calculate new top and bail out if new space is exhausted. Use result | 1944 // Calculate new top and bail out if new space is exhausted. Use result |
| 1945 // to calculate the new top. We must preserve the ip register at this | 1945 // to calculate the new top. We must preserve the ip register at this |
| 1946 // point, so we cannot just use add(). | 1946 // point, so we cannot just use add(). |
| 1947 DCHECK(object_size > 0); | 1947 DCHECK(object_size > 0); |
| 1948 Register source = result; | 1948 Register source = result; |
| 1949 Condition cond = al; | |
| 1950 int shift = 0; | 1949 int shift = 0; |
| 1951 while (object_size != 0) { | 1950 while (object_size != 0) { |
| 1952 if (((object_size >> shift) & 0x03) == 0) { | 1951 if (((object_size >> shift) & 0x03) == 0) { |
| 1953 shift += 2; | 1952 shift += 2; |
| 1954 } else { | 1953 } else { |
| 1955 int bits = object_size & (0xff << shift); | 1954 int bits = object_size & (0xff << shift); |
| 1956 object_size -= bits; | 1955 object_size -= bits; |
| 1957 shift += 8; | 1956 shift += 8; |
| 1958 Operand bits_operand(bits); | 1957 Operand bits_operand(bits); |
| 1959 DCHECK(bits_operand.instructions_required(this) == 1); | 1958 DCHECK(bits_operand.instructions_required(this) == 1); |
| 1960 add(result_end, source, bits_operand, LeaveCC, cond); | 1959 add(result_end, source, bits_operand); |
| 1961 source = result_end; | 1960 source = result_end; |
| 1962 cond = cc; | |
| 1963 } | 1961 } |
| 1964 } | 1962 } |
| 1965 | 1963 |
| 1966 cmp(result_end, Operand(alloc_limit)); | 1964 cmp(result_end, Operand(alloc_limit)); |
| 1967 b(hi, gc_required); | 1965 b(hi, gc_required); |
| 1968 | 1966 |
| 1969 if ((flags & ALLOCATION_FOLDING_DOMINATOR) == 0) { | 1967 if ((flags & ALLOCATION_FOLDING_DOMINATOR) == 0) { |
| 1970 // The top pointer is not updated for allocation folding dominators. | 1968 // The top pointer is not updated for allocation folding dominators. |
| 1971 str(result_end, MemOperand(top_address)); | 1969 str(result_end, MemOperand(top_address)); |
| 1972 } | 1970 } |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2151 mov(result_end, Operand(isolate()->factory()->one_pointer_filler_map())); | 2149 mov(result_end, Operand(isolate()->factory()->one_pointer_filler_map())); |
| 2152 str(result_end, MemOperand(result, kDoubleSize / 2, PostIndex)); | 2150 str(result_end, MemOperand(result, kDoubleSize / 2, PostIndex)); |
| 2153 bind(&aligned); | 2151 bind(&aligned); |
| 2154 } | 2152 } |
| 2155 | 2153 |
| 2156 // Calculate new top using result. Object size may be in words so a shift is | 2154 // Calculate new top using result. Object size may be in words so a shift is |
| 2157 // required to get the number of bytes. We must preserve the ip register at | 2155 // required to get the number of bytes. We must preserve the ip register at |
| 2158 // this point, so we cannot just use add(). | 2156 // this point, so we cannot just use add(). |
| 2159 DCHECK(object_size > 0); | 2157 DCHECK(object_size > 0); |
| 2160 Register source = result; | 2158 Register source = result; |
| 2161 Condition cond = al; | |
| 2162 int shift = 0; | 2159 int shift = 0; |
| 2163 while (object_size != 0) { | 2160 while (object_size != 0) { |
| 2164 if (((object_size >> shift) & 0x03) == 0) { | 2161 if (((object_size >> shift) & 0x03) == 0) { |
| 2165 shift += 2; | 2162 shift += 2; |
| 2166 } else { | 2163 } else { |
| 2167 int bits = object_size & (0xff << shift); | 2164 int bits = object_size & (0xff << shift); |
| 2168 object_size -= bits; | 2165 object_size -= bits; |
| 2169 shift += 8; | 2166 shift += 8; |
| 2170 Operand bits_operand(bits); | 2167 Operand bits_operand(bits); |
| 2171 DCHECK(bits_operand.instructions_required(this) == 1); | 2168 DCHECK(bits_operand.instructions_required(this) == 1); |
| 2172 add(result_end, source, bits_operand, LeaveCC, cond); | 2169 add(result_end, source, bits_operand); |
| 2173 source = result_end; | 2170 source = result_end; |
| 2174 cond = cc; | |
| 2175 } | 2171 } |
| 2176 } | 2172 } |
| 2177 | 2173 |
| 2178 // The top pointer is not updated for allocation folding dominators. | 2174 // The top pointer is not updated for allocation folding dominators. |
| 2179 str(result_end, MemOperand(top_address)); | 2175 str(result_end, MemOperand(top_address)); |
| 2180 | 2176 |
| 2181 add(result, result, Operand(kHeapObjectTag)); | 2177 add(result, result, Operand(kHeapObjectTag)); |
| 2182 } | 2178 } |
| 2183 | 2179 |
| 2184 void MacroAssembler::AllocateTwoByteString(Register result, | 2180 void MacroAssembler::AllocateTwoByteString(Register result, |
| (...skipping 1813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3998 } | 3994 } |
| 3999 } | 3995 } |
| 4000 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); | 3996 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); |
| 4001 add(result, result, Operand(dividend, LSR, 31)); | 3997 add(result, result, Operand(dividend, LSR, 31)); |
| 4002 } | 3998 } |
| 4003 | 3999 |
| 4004 } // namespace internal | 4000 } // namespace internal |
| 4005 } // namespace v8 | 4001 } // namespace v8 |
| 4006 | 4002 |
| 4007 #endif // V8_TARGET_ARCH_ARM | 4003 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |