Commit d72bd654 authored by zhengxing.li's avatar zhengxing.li Committed by Commit bot

X87: [heap] Move to page lookups for SemiSpace, NewSpace, and Heap containment methods.

  port cfbd2561(r33857)

  original commit message:
  Preparing the young generation for (real) non-contiguous backing memory, this
  change removes object masks that are used to compute containment in semi and new
  space. The masks are replaced by lookups for object tags and page headers, where
  possible.

  Details:
  - Use the fast checks (page header lookups) for containment in regular code.
  - Use the slow version that masks out the page start adress and iterates all
    pages of a space for debugging/verification.
  - The slow version works for off-heap/unmapped memory.
  - Encapsulate all checks for the old->new barrier in Heap::RecordWrite().

BUG=

Review URL: https://codereview.chromium.org/1698803002

Cr-Commit-Position: refs/heads/master@{#33970}
parent 7c37571c
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment