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 4286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4297 // Update allocation top. | 4297 // Update allocation top. |
4298 UpdateAllocationTopHelper(result_end, scratch, flags); | 4298 UpdateAllocationTopHelper(result_end, scratch, flags); |
4299 | 4299 |
4300 // Tag the result if requested. | 4300 // Tag the result if requested. |
4301 if ((flags & TAG_OBJECT) != 0) { | 4301 if ((flags & TAG_OBJECT) != 0) { |
4302 addp(result, Immediate(kHeapObjectTag)); | 4302 addp(result, Immediate(kHeapObjectTag)); |
4303 } | 4303 } |
4304 } | 4304 } |
4305 | 4305 |
4306 | 4306 |
4307 void MacroAssembler::UndoAllocationInNewSpace(Register object) { | |
4308 ExternalReference new_space_allocation_top = | |
4309 ExternalReference::new_space_allocation_top_address(isolate()); | |
4310 | |
4311 // Make sure the object has no tag before resetting top. | |
4312 andp(object, Immediate(~kHeapObjectTagMask)); | |
4313 Operand top_operand = ExternalOperand(new_space_allocation_top); | |
4314 #ifdef DEBUG | |
4315 cmpp(object, top_operand); | |
4316 Check(below, kUndoAllocationOfNonAllocatedMemory); | |
4317 #endif | |
4318 movp(top_operand, object); | |
4319 } | |
4320 | |
4321 | |
4322 void MacroAssembler::AllocateHeapNumber(Register result, | 4307 void MacroAssembler::AllocateHeapNumber(Register result, |
4323 Register scratch, | 4308 Register scratch, |
4324 Label* gc_required, | 4309 Label* gc_required, |
4325 MutableMode mode) { | 4310 MutableMode mode) { |
4326 // Allocate heap number in new space. | 4311 // Allocate heap number in new space. |
4327 Allocate(HeapNumber::kSize, result, scratch, no_reg, gc_required, TAG_OBJECT); | 4312 Allocate(HeapNumber::kSize, result, scratch, no_reg, gc_required, TAG_OBJECT); |
4328 | 4313 |
4329 Heap::RootListIndex map_index = mode == MUTABLE | 4314 Heap::RootListIndex map_index = mode == MUTABLE |
4330 ? Heap::kMutableHeapNumberMapRootIndex | 4315 ? Heap::kMutableHeapNumberMapRootIndex |
4331 : Heap::kHeapNumberMapRootIndex; | 4316 : Heap::kHeapNumberMapRootIndex; |
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5090 movl(rax, dividend); | 5075 movl(rax, dividend); |
5091 shrl(rax, Immediate(31)); | 5076 shrl(rax, Immediate(31)); |
5092 addl(rdx, rax); | 5077 addl(rdx, rax); |
5093 } | 5078 } |
5094 | 5079 |
5095 | 5080 |
5096 } // namespace internal | 5081 } // namespace internal |
5097 } // namespace v8 | 5082 } // namespace v8 |
5098 | 5083 |
5099 #endif // V8_TARGET_ARCH_X64 | 5084 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |