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