| 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 "bootstrapper.h" | 9 #include "bootstrapper.h" |
| 10 #include "codegen.h" | 10 #include "codegen.h" |
| (...skipping 4542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4553 // Set the map. The other fields are left uninitialized. | 4553 // Set the map. The other fields are left uninitialized. |
| 4554 LoadRoot(kScratchRegister, Heap::kConsStringMapRootIndex); | 4554 LoadRoot(kScratchRegister, Heap::kConsStringMapRootIndex); |
| 4555 movp(FieldOperand(result, HeapObject::kMapOffset), kScratchRegister); | 4555 movp(FieldOperand(result, HeapObject::kMapOffset), kScratchRegister); |
| 4556 } | 4556 } |
| 4557 | 4557 |
| 4558 | 4558 |
| 4559 void MacroAssembler::AllocateAsciiConsString(Register result, | 4559 void MacroAssembler::AllocateAsciiConsString(Register result, |
| 4560 Register scratch1, | 4560 Register scratch1, |
| 4561 Register scratch2, | 4561 Register scratch2, |
| 4562 Label* gc_required) { | 4562 Label* gc_required) { |
| 4563 Label allocate_new_space, install_map; | |
| 4564 AllocationFlags flags = TAG_OBJECT; | |
| 4565 | |
| 4566 ExternalReference high_promotion_mode = ExternalReference:: | |
| 4567 new_space_high_promotion_mode_active_address(isolate()); | |
| 4568 | |
| 4569 Load(scratch1, high_promotion_mode); | |
| 4570 testb(scratch1, Immediate(1)); | |
| 4571 j(zero, &allocate_new_space); | |
| 4572 Allocate(ConsString::kSize, | 4563 Allocate(ConsString::kSize, |
| 4573 result, | 4564 result, |
| 4574 scratch1, | 4565 scratch1, |
| 4575 scratch2, | 4566 scratch2, |
| 4576 gc_required, | 4567 gc_required, |
| 4577 static_cast<AllocationFlags>(flags | PRETENURE_OLD_POINTER_SPACE)); | 4568 TAG_OBJECT); |
| 4578 | |
| 4579 jmp(&install_map); | |
| 4580 | |
| 4581 bind(&allocate_new_space); | |
| 4582 Allocate(ConsString::kSize, | |
| 4583 result, | |
| 4584 scratch1, | |
| 4585 scratch2, | |
| 4586 gc_required, | |
| 4587 flags); | |
| 4588 | |
| 4589 bind(&install_map); | |
| 4590 | 4569 |
| 4591 // Set the map. The other fields are left uninitialized. | 4570 // Set the map. The other fields are left uninitialized. |
| 4592 LoadRoot(kScratchRegister, Heap::kConsAsciiStringMapRootIndex); | 4571 LoadRoot(kScratchRegister, Heap::kConsAsciiStringMapRootIndex); |
| 4593 movp(FieldOperand(result, HeapObject::kMapOffset), kScratchRegister); | 4572 movp(FieldOperand(result, HeapObject::kMapOffset), kScratchRegister); |
| 4594 } | 4573 } |
| 4595 | 4574 |
| 4596 | 4575 |
| 4597 void MacroAssembler::AllocateTwoByteSlicedString(Register result, | 4576 void MacroAssembler::AllocateTwoByteSlicedString(Register result, |
| 4598 Register scratch1, | 4577 Register scratch1, |
| 4599 Register scratch2, | 4578 Register scratch2, |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5234 if (ms.shift() > 0) sarl(rdx, Immediate(ms.shift())); | 5213 if (ms.shift() > 0) sarl(rdx, Immediate(ms.shift())); |
| 5235 movl(rax, dividend); | 5214 movl(rax, dividend); |
| 5236 shrl(rax, Immediate(31)); | 5215 shrl(rax, Immediate(31)); |
| 5237 addl(rdx, rax); | 5216 addl(rdx, rax); |
| 5238 } | 5217 } |
| 5239 | 5218 |
| 5240 | 5219 |
| 5241 } } // namespace v8::internal | 5220 } } // namespace v8::internal |
| 5242 | 5221 |
| 5243 #endif // V8_TARGET_ARCH_X64 | 5222 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |