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_X87 | 7 #if V8_TARGET_ARCH_X87 |
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 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1453 if ((flags & TAG_OBJECT) != 0) { | 1453 if ((flags & TAG_OBJECT) != 0) { |
1454 DCHECK(kHeapObjectTag == 1); | 1454 DCHECK(kHeapObjectTag == 1); |
1455 inc(result); | 1455 inc(result); |
1456 } | 1456 } |
1457 | 1457 |
1458 // Update allocation top. | 1458 // Update allocation top. |
1459 UpdateAllocationTopHelper(result_end, scratch, flags); | 1459 UpdateAllocationTopHelper(result_end, scratch, flags); |
1460 } | 1460 } |
1461 | 1461 |
1462 | 1462 |
1463 void MacroAssembler::UndoAllocationInNewSpace(Register object) { | |
1464 ExternalReference new_space_allocation_top = | |
1465 ExternalReference::new_space_allocation_top_address(isolate()); | |
1466 | |
1467 // Make sure the object has no tag before resetting top. | |
1468 and_(object, Immediate(~kHeapObjectTagMask)); | |
1469 #ifdef DEBUG | |
1470 cmp(object, Operand::StaticVariable(new_space_allocation_top)); | |
1471 Check(below, kUndoAllocationOfNonAllocatedMemory); | |
1472 #endif | |
1473 mov(Operand::StaticVariable(new_space_allocation_top), object); | |
1474 } | |
1475 | |
1476 | |
1477 void MacroAssembler::AllocateHeapNumber(Register result, | 1463 void MacroAssembler::AllocateHeapNumber(Register result, |
1478 Register scratch1, | 1464 Register scratch1, |
1479 Register scratch2, | 1465 Register scratch2, |
1480 Label* gc_required, | 1466 Label* gc_required, |
1481 MutableMode mode) { | 1467 MutableMode mode) { |
1482 // Allocate heap number in new space. | 1468 // Allocate heap number in new space. |
1483 Allocate(HeapNumber::kSize, result, scratch1, scratch2, gc_required, | 1469 Allocate(HeapNumber::kSize, result, scratch1, scratch2, gc_required, |
1484 TAG_OBJECT); | 1470 TAG_OBJECT); |
1485 | 1471 |
1486 Handle<Map> map = mode == MUTABLE | 1472 Handle<Map> map = mode == MUTABLE |
(...skipping 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3101 mov(eax, dividend); | 3087 mov(eax, dividend); |
3102 shr(eax, 31); | 3088 shr(eax, 31); |
3103 add(edx, eax); | 3089 add(edx, eax); |
3104 } | 3090 } |
3105 | 3091 |
3106 | 3092 |
3107 } // namespace internal | 3093 } // namespace internal |
3108 } // namespace v8 | 3094 } // namespace v8 |
3109 | 3095 |
3110 #endif // V8_TARGET_ARCH_X87 | 3096 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |