Index: src/ppc/macro-assembler-ppc.cc |
diff --git a/src/ppc/macro-assembler-ppc.cc b/src/ppc/macro-assembler-ppc.cc |
index 0b9459fb2d44358f1c279751f7e03c5f316860d6..2424a4abc883c6d2c89fddf8b5e8fac292d112cd 100644 |
--- a/src/ppc/macro-assembler-ppc.cc |
+++ b/src/ppc/macro-assembler-ppc.cc |
@@ -3203,27 +3203,6 @@ void MacroAssembler::HasColor(Register object, Register bitmap_scratch, |
} |
-// Detect some, but not all, common pointer-free objects. This is used by the |
-// incremental write barrier which doesn't care about oddballs (they are always |
-// marked black immediately so this code is not hit). |
-void MacroAssembler::JumpIfDataObject(Register value, Register scratch, |
- Label* not_data_object) { |
- Label is_data_object; |
- LoadP(scratch, FieldMemOperand(value, HeapObject::kMapOffset)); |
- CompareRoot(scratch, Heap::kHeapNumberMapRootIndex); |
- beq(&is_data_object); |
- DCHECK(kIsIndirectStringTag == 1 && kIsIndirectStringMask == 1); |
- DCHECK(kNotStringTag == 0x80 && kIsNotStringMask == 0x80); |
- // If it's a string and it's not a cons string then it's an object containing |
- // no GC pointers. |
- lbz(scratch, FieldMemOperand(scratch, Map::kInstanceTypeOffset)); |
- STATIC_ASSERT((kIsIndirectStringMask | kIsNotStringMask) == 0x81); |
- andi(scratch, scratch, Operand(kIsIndirectStringMask | kIsNotStringMask)); |
- bne(not_data_object, cr0); |
- bind(&is_data_object); |
-} |
- |
- |
void MacroAssembler::GetMarkBits(Register addr_reg, Register bitmap_reg, |
Register mask_reg) { |
DCHECK(!AreAliased(addr_reg, bitmap_reg, mask_reg, no_reg)); |
@@ -3240,10 +3219,9 @@ void MacroAssembler::GetMarkBits(Register addr_reg, Register bitmap_reg, |
} |
-void MacroAssembler::EnsureNotWhite(Register value, Register bitmap_scratch, |
- Register mask_scratch, |
- Register load_scratch, |
- Label* value_is_white_and_not_data) { |
+void MacroAssembler::JumpIfWhite(Register value, Register bitmap_scratch, |
+ Register mask_scratch, Register load_scratch, |
+ Label* value_is_white) { |
DCHECK(!AreAliased(value, bitmap_scratch, mask_scratch, ip)); |
GetMarkBits(value, bitmap_scratch, mask_scratch); |
@@ -3253,104 +3231,11 @@ void MacroAssembler::EnsureNotWhite(Register value, Register bitmap_scratch, |
DCHECK(strcmp(Marking::kGreyBitPattern, "11") == 0); |
DCHECK(strcmp(Marking::kImpossibleBitPattern, "01") == 0); |
- Label done; |
- |
// Since both black and grey have a 1 in the first position and white does |
// not have a 1 there we only need to check one bit. |
lwz(load_scratch, MemOperand(bitmap_scratch, MemoryChunk::kHeaderSize)); |
and_(r0, mask_scratch, load_scratch, SetRC); |
- bne(&done, cr0); |
- |
- if (emit_debug_code()) { |
- // Check for impossible bit pattern. |
- Label ok; |
- // LSL may overflow, making the check conservative. |
- slwi(r0, mask_scratch, Operand(1)); |
- and_(r0, load_scratch, r0, SetRC); |
- beq(&ok, cr0); |
- stop("Impossible marking bit pattern"); |
- bind(&ok); |
- } |
- |
- // Value is white. We check whether it is data that doesn't need scanning. |
- // Currently only checks for HeapNumber and non-cons strings. |
- Register map = load_scratch; // Holds map while checking type. |
- Register length = load_scratch; // Holds length of object after testing type. |
- Label is_data_object, maybe_string_object, is_string_object, is_encoded; |
-#if V8_TARGET_ARCH_PPC64 |
- Label length_computed; |
-#endif |
- |
- |
- // Check for heap-number |
- LoadP(map, FieldMemOperand(value, HeapObject::kMapOffset)); |
- CompareRoot(map, Heap::kHeapNumberMapRootIndex); |
- bne(&maybe_string_object); |
- li(length, Operand(HeapNumber::kSize)); |
- b(&is_data_object); |
- bind(&maybe_string_object); |
- |
- // Check for strings. |
- DCHECK(kIsIndirectStringTag == 1 && kIsIndirectStringMask == 1); |
- DCHECK(kNotStringTag == 0x80 && kIsNotStringMask == 0x80); |
- // If it's a string and it's not a cons string then it's an object containing |
- // no GC pointers. |
- Register instance_type = load_scratch; |
- lbz(instance_type, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
- andi(r0, instance_type, Operand(kIsIndirectStringMask | kIsNotStringMask)); |
- bne(value_is_white_and_not_data, cr0); |
- // It's a non-indirect (non-cons and non-slice) string. |
- // If it's external, the length is just ExternalString::kSize. |
- // Otherwise it's String::kHeaderSize + string->length() * (1 or 2). |
- // External strings are the only ones with the kExternalStringTag bit |
- // set. |
- DCHECK_EQ(0, kSeqStringTag & kExternalStringTag); |
- DCHECK_EQ(0, kConsStringTag & kExternalStringTag); |
- andi(r0, instance_type, Operand(kExternalStringTag)); |
- beq(&is_string_object, cr0); |
- li(length, Operand(ExternalString::kSize)); |
- b(&is_data_object); |
- bind(&is_string_object); |
- |
- // Sequential string, either Latin1 or UC16. |
- // For Latin1 (char-size of 1) we untag the smi to get the length. |
- // For UC16 (char-size of 2): |
- // - (32-bit) we just leave the smi tag in place, thereby getting |
- // the length multiplied by 2. |
- // - (64-bit) we compute the offset in the 2-byte array |
- DCHECK(kOneByteStringTag == 4 && kStringEncodingMask == 4); |
- LoadP(ip, FieldMemOperand(value, String::kLengthOffset)); |
- andi(r0, instance_type, Operand(kStringEncodingMask)); |
- beq(&is_encoded, cr0); |
- SmiUntag(ip); |
-#if V8_TARGET_ARCH_PPC64 |
- b(&length_computed); |
-#endif |
- bind(&is_encoded); |
-#if V8_TARGET_ARCH_PPC64 |
- SmiToShortArrayOffset(ip, ip); |
- bind(&length_computed); |
-#else |
- DCHECK(kSmiShift == 1); |
-#endif |
- addi(length, ip, Operand(SeqString::kHeaderSize + kObjectAlignmentMask)); |
- li(r0, Operand(~kObjectAlignmentMask)); |
- and_(length, length, r0); |
- |
- bind(&is_data_object); |
- // Value is a data object, and it is white. Mark it black. Since we know |
- // that the object is white we can make it black by flipping one bit. |
- lwz(ip, MemOperand(bitmap_scratch, MemoryChunk::kHeaderSize)); |
- orx(ip, ip, mask_scratch); |
- stw(ip, MemOperand(bitmap_scratch, MemoryChunk::kHeaderSize)); |
- |
- mov(ip, Operand(~Page::kPageAlignmentMask)); |
- and_(bitmap_scratch, bitmap_scratch, ip); |
- lwz(ip, MemOperand(bitmap_scratch, MemoryChunk::kLiveBytesOffset)); |
- add(ip, ip, length); |
- stw(ip, MemOperand(bitmap_scratch, MemoryChunk::kLiveBytesOffset)); |
- |
- bind(&done); |
+ beq(value_is_white, cr0); |
} |