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 "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "codegen.h" | 9 #include "codegen.h" |
10 #include "macro-assembler.h" | 10 #include "macro-assembler.h" |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 if (mode == TRACK_ALLOCATION_SITE) { | 226 if (mode == TRACK_ALLOCATION_SITE) { |
227 __ JumpIfJSArrayHasAllocationMemento(rdx, rdi, fail); | 227 __ JumpIfJSArrayHasAllocationMemento(rdx, rdi, fail); |
228 } | 228 } |
229 | 229 |
230 // Check for empty arrays, which only require a map transition and no changes | 230 // Check for empty arrays, which only require a map transition and no changes |
231 // to the backing store. | 231 // to the backing store. |
232 __ movp(r8, FieldOperand(rdx, JSObject::kElementsOffset)); | 232 __ movp(r8, FieldOperand(rdx, JSObject::kElementsOffset)); |
233 __ CompareRoot(r8, Heap::kEmptyFixedArrayRootIndex); | 233 __ CompareRoot(r8, Heap::kEmptyFixedArrayRootIndex); |
234 __ j(equal, &only_change_map); | 234 __ j(equal, &only_change_map); |
235 | 235 |
236 // Check backing store for COW-ness. For COW arrays we have to | |
237 // allocate a new backing store. | |
238 __ SmiToInteger32(r9, FieldOperand(r8, FixedDoubleArray::kLengthOffset)); | 236 __ SmiToInteger32(r9, FieldOperand(r8, FixedDoubleArray::kLengthOffset)); |
239 __ CompareRoot(FieldOperand(r8, HeapObject::kMapOffset), | 237 if (kPointerSize == kDoubleSize) { |
240 Heap::kFixedCOWArrayMapRootIndex); | 238 // Check backing store for COW-ness. For COW arrays we have to |
241 __ j(equal, &new_backing_store); | 239 // allocate a new backing store. |
| 240 __ CompareRoot(FieldOperand(r8, HeapObject::kMapOffset), |
| 241 Heap::kFixedCOWArrayMapRootIndex); |
| 242 __ j(equal, &new_backing_store); |
| 243 } else { |
| 244 // For x32 port we have to allocate a new backing store as SMI size is |
| 245 // not equal with double size. |
| 246 ASSERT(kDoubleSize == 2 * kPointerSize); |
| 247 __ jmp(&new_backing_store); |
| 248 } |
| 249 |
242 // Check if the backing store is in new-space. If not, we need to allocate | 250 // Check if the backing store is in new-space. If not, we need to allocate |
243 // a new one since the old one is in pointer-space. | 251 // a new one since the old one is in pointer-space. |
244 // If in new space, we can reuse the old backing store because it is | 252 // If in new space, we can reuse the old backing store because it is |
245 // the same size. | 253 // the same size. |
246 __ JumpIfNotInNewSpace(r8, rdi, &new_backing_store); | 254 __ JumpIfNotInNewSpace(r8, rdi, &new_backing_store); |
247 | 255 |
248 __ movp(r14, r8); // Destination array equals source array. | 256 __ movp(r14, r8); // Destination array equals source array. |
249 | 257 |
250 // r8 : source FixedArray | 258 // r8 : source FixedArray |
251 // r9 : elements array length | 259 // r9 : elements array length |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 // argument_count_reg_ * times_pointer_size + (receiver - 1) * kPointerSize. | 695 // argument_count_reg_ * times_pointer_size + (receiver - 1) * kPointerSize. |
688 return Operand(base_reg_, argument_count_reg_, times_pointer_size, | 696 return Operand(base_reg_, argument_count_reg_, times_pointer_size, |
689 displacement_to_last_argument + (receiver - 1 - index) * kPointerSize); | 697 displacement_to_last_argument + (receiver - 1 - index) * kPointerSize); |
690 } | 698 } |
691 } | 699 } |
692 | 700 |
693 | 701 |
694 } } // namespace v8::internal | 702 } } // namespace v8::internal |
695 | 703 |
696 #endif // V8_TARGET_ARCH_X64 | 704 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |