| 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 "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
| 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 4101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4112 AllocationFlags flags) { | 4112 AllocationFlags flags) { |
| 4113 if (kPointerSize == kDoubleSize) { | 4113 if (kPointerSize == kDoubleSize) { |
| 4114 if (FLAG_debug_code) { | 4114 if (FLAG_debug_code) { |
| 4115 testl(result, Immediate(kDoubleAlignmentMask)); | 4115 testl(result, Immediate(kDoubleAlignmentMask)); |
| 4116 Check(zero, kAllocationIsNotDoubleAligned); | 4116 Check(zero, kAllocationIsNotDoubleAligned); |
| 4117 } | 4117 } |
| 4118 } else { | 4118 } else { |
| 4119 // Align the next allocation. Storing the filler map without checking top | 4119 // Align the next allocation. Storing the filler map without checking top |
| 4120 // is safe in new-space because the limit of the heap is aligned there. | 4120 // is safe in new-space because the limit of the heap is aligned there. |
| 4121 DCHECK(kPointerSize * 2 == kDoubleSize); | 4121 DCHECK(kPointerSize * 2 == kDoubleSize); |
| 4122 DCHECK((flags & PRETENURE_OLD_POINTER_SPACE) == 0); |
| 4122 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); | 4123 DCHECK(kPointerAlignment * 2 == kDoubleAlignment); |
| 4123 // Make sure scratch is not clobbered by this function as it might be | 4124 // Make sure scratch is not clobbered by this function as it might be |
| 4124 // used in UpdateAllocationTopHelper later. | 4125 // used in UpdateAllocationTopHelper later. |
| 4125 DCHECK(!scratch.is(kScratchRegister)); | 4126 DCHECK(!scratch.is(kScratchRegister)); |
| 4126 Label aligned; | 4127 Label aligned; |
| 4127 testl(result, Immediate(kDoubleAlignmentMask)); | 4128 testl(result, Immediate(kDoubleAlignmentMask)); |
| 4128 j(zero, &aligned, Label::kNear); | 4129 j(zero, &aligned, Label::kNear); |
| 4129 if ((flags & PRETENURE) != 0) { | 4130 if ((flags & PRETENURE_OLD_DATA_SPACE) != 0) { |
| 4130 ExternalReference allocation_limit = | 4131 ExternalReference allocation_limit = |
| 4131 AllocationUtils::GetAllocationLimitReference(isolate(), flags); | 4132 AllocationUtils::GetAllocationLimitReference(isolate(), flags); |
| 4132 cmpp(result, ExternalOperand(allocation_limit)); | 4133 cmpp(result, ExternalOperand(allocation_limit)); |
| 4133 j(above_equal, gc_required); | 4134 j(above_equal, gc_required); |
| 4134 } | 4135 } |
| 4135 LoadRoot(kScratchRegister, Heap::kOnePointerFillerMapRootIndex); | 4136 LoadRoot(kScratchRegister, Heap::kOnePointerFillerMapRootIndex); |
| 4136 movp(Operand(result, 0), kScratchRegister); | 4137 movp(Operand(result, 0), kScratchRegister); |
| 4137 addp(result, Immediate(kDoubleSize / 2)); | 4138 addp(result, Immediate(kDoubleSize / 2)); |
| 4138 bind(&aligned); | 4139 bind(&aligned); |
| 4139 } | 4140 } |
| (...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5075 if (mag.shift > 0) sarl(rdx, Immediate(mag.shift)); | 5076 if (mag.shift > 0) sarl(rdx, Immediate(mag.shift)); |
| 5076 movl(rax, dividend); | 5077 movl(rax, dividend); |
| 5077 shrl(rax, Immediate(31)); | 5078 shrl(rax, Immediate(31)); |
| 5078 addl(rdx, rax); | 5079 addl(rdx, rax); |
| 5079 } | 5080 } |
| 5080 | 5081 |
| 5081 | 5082 |
| 5082 } } // namespace v8::internal | 5083 } } // namespace v8::internal |
| 5083 | 5084 |
| 5084 #endif // V8_TARGET_ARCH_X64 | 5085 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |