Index: src/mips/macro-assembler-mips.cc |
diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc |
index 1c1ea20afbdfa17e25661ef5e704bdd51a952e22..611ed32a9fb11c32c4db724d57f1095e64622fdc 100644 |
--- a/src/mips/macro-assembler-mips.cc |
+++ b/src/mips/macro-assembler-mips.cc |
@@ -5428,28 +5428,6 @@ void MacroAssembler::HasColor(Register object, |
} |
-// 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) { |
- DCHECK(!AreAliased(value, scratch, t8, no_reg)); |
- Label is_data_object; |
- lw(scratch, FieldMemOperand(value, HeapObject::kMapOffset)); |
- LoadRoot(t8, Heap::kHeapNumberMapRootIndex); |
- Branch(&is_data_object, eq, t8, Operand(scratch)); |
- 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. |
- lbu(scratch, FieldMemOperand(scratch, Map::kInstanceTypeOffset)); |
- And(t8, scratch, Operand(kIsIndirectStringMask | kIsNotStringMask)); |
- Branch(not_data_object, ne, t8, Operand(zero_reg)); |
- bind(&is_data_object); |
-} |
- |
- |
void MacroAssembler::GetMarkBits(Register addr_reg, |
Register bitmap_reg, |
Register mask_reg) { |
@@ -5465,12 +5443,9 @@ void MacroAssembler::GetMarkBits(Register addr_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, t8)); |
GetMarkBits(value, bitmap_scratch, mask_scratch); |
@@ -5480,97 +5455,11 @@ void MacroAssembler::EnsureNotWhite( |
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. |
lw(load_scratch, MemOperand(bitmap_scratch, MemoryChunk::kHeaderSize)); |
And(t8, mask_scratch, load_scratch); |
- Branch(&done, ne, t8, Operand(zero_reg)); |
- |
- if (emit_debug_code()) { |
- // Check for impossible bit pattern. |
- Label ok; |
- // sll may overflow, making the check conservative. |
- sll(t8, mask_scratch, 1); |
- And(t8, load_scratch, t8); |
- Branch(&ok, eq, t8, Operand(zero_reg)); |
- 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; |
- |
- // Check for heap-number |
- lw(map, FieldMemOperand(value, HeapObject::kMapOffset)); |
- LoadRoot(t8, Heap::kHeapNumberMapRootIndex); |
- { |
- Label skip; |
- Branch(&skip, ne, t8, Operand(map)); |
- li(length, HeapNumber::kSize); |
- Branch(&is_data_object); |
- bind(&skip); |
- } |
- |
- // 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; |
- lbu(instance_type, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
- And(t8, instance_type, Operand(kIsIndirectStringMask | kIsNotStringMask)); |
- Branch(value_is_white_and_not_data, ne, t8, Operand(zero_reg)); |
- // 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); |
- And(t8, instance_type, Operand(kExternalStringTag)); |
- { |
- Label skip; |
- Branch(&skip, eq, t8, Operand(zero_reg)); |
- li(length, ExternalString::kSize); |
- Branch(&is_data_object); |
- bind(&skip); |
- } |
- |
- // Sequential string, either Latin1 or UC16. |
- // For Latin1 (char-size of 1) we shift the smi tag away to get the length. |
- // For UC16 (char-size of 2) we just leave the smi tag in place, thereby |
- // getting the length multiplied by 2. |
- DCHECK(kOneByteStringTag == 4 && kStringEncodingMask == 4); |
- DCHECK(kSmiTag == 0 && kSmiTagSize == 1); |
- lw(t9, FieldMemOperand(value, String::kLengthOffset)); |
- And(t8, instance_type, Operand(kStringEncodingMask)); |
- { |
- Label skip; |
- Branch(&skip, eq, t8, Operand(zero_reg)); |
- srl(t9, t9, 1); |
- bind(&skip); |
- } |
- Addu(length, t9, Operand(SeqString::kHeaderSize + kObjectAlignmentMask)); |
- And(length, length, Operand(~kObjectAlignmentMask)); |
- |
- 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. |
- lw(t8, MemOperand(bitmap_scratch, MemoryChunk::kHeaderSize)); |
- Or(t8, t8, Operand(mask_scratch)); |
- sw(t8, MemOperand(bitmap_scratch, MemoryChunk::kHeaderSize)); |
- |
- And(bitmap_scratch, bitmap_scratch, Operand(~Page::kPageAlignmentMask)); |
- lw(t8, MemOperand(bitmap_scratch, MemoryChunk::kLiveBytesOffset)); |
- Addu(t8, t8, Operand(length)); |
- sw(t8, MemOperand(bitmap_scratch, MemoryChunk::kLiveBytesOffset)); |
- |
- bind(&done); |
+ Branch(value_is_white, eq, t8, Operand(zero_reg)); |
} |