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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
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 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1487 if ((flags & TAG_OBJECT) != 0) { | 1487 if ((flags & TAG_OBJECT) != 0) { |
1488 DCHECK(kHeapObjectTag == 1); | 1488 DCHECK(kHeapObjectTag == 1); |
1489 inc(result); | 1489 inc(result); |
1490 } | 1490 } |
1491 | 1491 |
1492 // Update allocation top. | 1492 // Update allocation top. |
1493 UpdateAllocationTopHelper(result_end, scratch, flags); | 1493 UpdateAllocationTopHelper(result_end, scratch, flags); |
1494 } | 1494 } |
1495 | 1495 |
1496 | 1496 |
1497 void MacroAssembler::UndoAllocationInNewSpace(Register object) { | |
1498 ExternalReference new_space_allocation_top = | |
1499 ExternalReference::new_space_allocation_top_address(isolate()); | |
1500 | |
1501 // Make sure the object has no tag before resetting top. | |
1502 and_(object, Immediate(~kHeapObjectTagMask)); | |
1503 #ifdef DEBUG | |
1504 cmp(object, Operand::StaticVariable(new_space_allocation_top)); | |
1505 Check(below, kUndoAllocationOfNonAllocatedMemory); | |
1506 #endif | |
1507 mov(Operand::StaticVariable(new_space_allocation_top), object); | |
1508 } | |
1509 | |
1510 | |
1511 void MacroAssembler::AllocateHeapNumber(Register result, | 1497 void MacroAssembler::AllocateHeapNumber(Register result, |
1512 Register scratch1, | 1498 Register scratch1, |
1513 Register scratch2, | 1499 Register scratch2, |
1514 Label* gc_required, | 1500 Label* gc_required, |
1515 MutableMode mode) { | 1501 MutableMode mode) { |
1516 // Allocate heap number in new space. | 1502 // Allocate heap number in new space. |
1517 Allocate(HeapNumber::kSize, result, scratch1, scratch2, gc_required, | 1503 Allocate(HeapNumber::kSize, result, scratch1, scratch2, gc_required, |
1518 TAG_OBJECT); | 1504 TAG_OBJECT); |
1519 | 1505 |
1520 Handle<Map> map = mode == MUTABLE | 1506 Handle<Map> map = mode == MUTABLE |
(...skipping 1703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3224 mov(eax, dividend); | 3210 mov(eax, dividend); |
3225 shr(eax, 31); | 3211 shr(eax, 31); |
3226 add(edx, eax); | 3212 add(edx, eax); |
3227 } | 3213 } |
3228 | 3214 |
3229 | 3215 |
3230 } // namespace internal | 3216 } // namespace internal |
3231 } // namespace v8 | 3217 } // namespace v8 |
3232 | 3218 |
3233 #endif // V8_TARGET_ARCH_IA32 | 3219 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |