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