Index: src/ia32/macro-assembler-ia32.cc |
diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc |
index 0495bc81f22d2193339acbc27f34bf04e1d6ea55..2a5c696913f8b9afe95a4be4d0488c9e56b22054 100644 |
--- a/src/ia32/macro-assembler-ia32.cc |
+++ b/src/ia32/macro-assembler-ia32.cc |
@@ -170,28 +170,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); |
} |