Commit 1ab7f2f8 authored by mbrandy's avatar mbrandy Committed by Commit bot

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

Port cfbd2561

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().

R=mlippautz@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=chromium:581412
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#33877}
parent d4bdd767
......@@ -302,13 +302,10 @@ void MacroAssembler::StoreRoot(Register source, Heap::RootListIndex index,
void MacroAssembler::InNewSpace(Register object, Register scratch,
Condition cond, Label* branch) {
// N.B. scratch may be same register as object
DCHECK(cond == eq || cond == ne);
mov(r0, Operand(ExternalReference::new_space_mask(isolate())));
and_(scratch, object, r0);
mov(r0, Operand(ExternalReference::new_space_start(isolate())));
cmp(scratch, r0);
b(cond, branch);
const int mask =
(1 << MemoryChunk::IN_FROM_SPACE) | (1 << MemoryChunk::IN_TO_SPACE);
CheckPageFlag(object, scratch, mask, cond, branch);
}
......
......@@ -203,13 +203,13 @@ class MacroAssembler : public Assembler {
// Check if object is in new space. Jumps if the object is not in new space.
// The register scratch can be object itself, but scratch will be clobbered.
void JumpIfNotInNewSpace(Register object, Register scratch, Label* branch) {
InNewSpace(object, scratch, ne, branch);
InNewSpace(object, scratch, eq, branch);
}
// Check if object is in new space. Jumps if the object is in new space.
// The register scratch can be object itself, but it will be clobbered.
void JumpIfInNewSpace(Register object, Register scratch, Label* branch) {
InNewSpace(object, scratch, eq, branch);
InNewSpace(object, scratch, ne, branch);
}
// Check if an object has a given incremental marking color.
......
......@@ -447,7 +447,8 @@ void PPCDebugger::Debug() {
HeapObject* obj = reinterpret_cast<HeapObject*>(*cur);
intptr_t value = *cur;
Heap* current_heap = sim_->isolate_->heap();
if (((value & 1) == 0) || current_heap->Contains(obj)) {
if (((value & 1) == 0) ||
current_heap->ContainsSlow(obj->address())) {
PrintF(" (");
if ((value & 1) == 0) {
PrintF("smi %d", PlatformSmiTagging::SmiToInt(obj));
......
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