Index: src/x87/macro-assembler-x87.cc |
diff --git a/src/x87/macro-assembler-x87.cc b/src/x87/macro-assembler-x87.cc |
index bb8654a4c3deec4e4dccaa578f7a2f1b23c2a0d4..4f6f01d5d76a26bf52b219391026285d5e0926e7 100644 |
--- a/src/x87/macro-assembler-x87.cc |
+++ b/src/x87/macro-assembler-x87.cc |
@@ -164,28 +164,12 @@ void MacroAssembler::PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1, |
} |
} |
-void MacroAssembler::InNewSpace( |
- Register object, |
- Register scratch, |
- Condition cc, |
- Label* condition_met, |
- Label::Distance condition_met_distance) { |
- DCHECK(cc == equal || cc == not_equal); |
- if (scratch.is(object)) { |
- and_(scratch, Immediate(~Page::kPageAlignmentMask)); |
- } else { |
- mov(scratch, Immediate(~Page::kPageAlignmentMask)); |
- and_(scratch, object); |
- } |
- // Check that we can use a test_b. |
- DCHECK(MemoryChunk::IN_FROM_SPACE < 8); |
- DCHECK(MemoryChunk::IN_TO_SPACE < 8); |
- int mask = (1 << MemoryChunk::IN_FROM_SPACE) |
- | (1 << MemoryChunk::IN_TO_SPACE); |
- // If non-zero, the page belongs to new-space. |
- test_b(Operand(scratch, MemoryChunk::kFlagsOffset), |
- static_cast<uint8_t>(mask)); |
- j(cc, condition_met, condition_met_distance); |
+void MacroAssembler::InNewSpace(Register object, Register scratch, Condition cc, |
+ Label* condition_met, |
+ Label::Distance distance) { |
+ const int mask = |
+ (1 << MemoryChunk::IN_FROM_SPACE) | (1 << MemoryChunk::IN_TO_SPACE); |
+ CheckPageFlag(object, scratch, mask, cc, condition_met, distance); |
} |