cgen_->SetFrame(NULL, &empty);
__ jmp(&merge_labels_.last());
}
-
- is_linked_ = !is_bound_;
}
// the merge code is emitted.
AddReachingFrame(new VirtualFrame(cgen_->frame()));
__ b(cc, &merge_labels_.last());
- is_linked_ = true;
}
}
ASSERT(entry_frame_ == NULL);
AddReachingFrame(target_frame);
__ bl(&merge_labels_.last());
-
- is_linked_ = !is_bound_;
}
frame->stack_pointer_ -= difference;
__ add(sp, sp, Operand(difference * kPointerSize));
}
-
- is_bound_ = true;
+ __ bind(&entry_label_);
return;
}
frame->stack_pointer_ -= difference;
__ add(sp, sp, Operand(difference * kPointerSize));
}
-
- is_linked_ = false;
- is_bound_ = true;
+ __ bind(&entry_label_);
return;
}
}
cgen_->SetFrame(new VirtualFrame(entry_frame_), &reserved_registers);
}
- // There is certainly a current frame equal to the entry frame.
- // Bind the entry frame label.
- __ bind(&entry_label_);
-
// There may be unprocessed reaching frames that did not need
// merge code. They will have unbound merge labels. Bind their
// merge labels to be the same as the entry label and deallocate
cgen_->SetFrame(new VirtualFrame(reaching_frames_[0]), &reserved);
__ bind(&merge_labels_[0]);
cgen_->frame()->MergeTo(entry_frame_);
- __ bind(&entry_label_);
}
- is_linked_ = false;
- is_bound_ = true;
+ __ bind(&entry_label_);
}
#undef __
cgen_->SetFrame(NULL, &empty);
__ jmp(&merge_labels_.last());
}
-
- is_linked_ = !is_bound_;
}
// Forward branch with a preconfigured entry frame. Assert the
// current frame matches the expected one and branch to the block.
ASSERT(cgen_->frame()->Equals(entry_frame_));
- // Use masm_-> instead of __ as forward branches are expected to
- // be a fixed size (no inserted coverage-checking instructions
- // please). This is used in Reference::GetValue.
+ // Explicitly use the macro assembler instead of __ as forward
+ // branches are expected to be a fixed size (no inserted
+ // coverage-checking instructions please). This is used in
+ // Reference::GetValue.
masm_->j(cc, &entry_label_, hint);
- is_linked_ = true;
} else {
// Forward branch. A copy of the current frame is remembered and
- // a branch to the merge code is emitted.
+ // a branch to the merge code is emitted. Explicitly use the
+ // macro assembler instead of __ as forward branches are expected
+ // to be a fixed size (no inserted coverage-checking instructions
+ // please). This is used in Reference::GetValue.
AddReachingFrame(new VirtualFrame(cgen_->frame()));
masm_->j(cc, &merge_labels_.last(), hint);
- is_linked_ = true;
}
}
ASSERT(entry_frame_ == NULL);
AddReachingFrame(target_frame);
__ call(&merge_labels_.last());
-
- is_linked_ = !is_bound_;
}
entry_frame_ = NULL;
}
__ bind(&entry_label_);
- is_linked_ = false;
- is_bound_ = true;
return;
}
frame->stack_pointer_ -= difference;
__ add(Operand(esp), Immediate(difference * kPointerSize));
}
-
} else {
ASSERT(direction_ == BIDIRECTIONAL);
// Fast case: no forward jumps, possible backward ones. Remove
// frame and use it as the entry frame.
cgen_->frame()->MakeMergable(mergable_elements);
entry_frame_ = new VirtualFrame(cgen_->frame());
- __ bind(&entry_label_);
}
- is_bound_ = true;
+ __ bind(&entry_label_);
return;
}
__ add(Operand(esp), Immediate(difference * kPointerSize));
}
- is_linked_ = false;
- is_bound_ = true;
+ __ bind(&entry_label_);
return;
}
cgen_->SetFrame(new VirtualFrame(entry_frame_), &reserved_registers);
}
- // There is certainly a current frame equal to the entry frame.
- // Bind the entry frame label.
- __ bind(&entry_label_);
-
// There may be unprocessed reaching frames that did not need
// merge code. They will have unbound merge labels. Bind their
// merge labels to be the same as the entry label and deallocate
cgen_->SetFrame(new VirtualFrame(reaching_frames_[0]), &reserved);
__ bind(&merge_labels_[0]);
cgen_->frame()->MergeTo(entry_frame_);
- __ bind(&entry_label_);
}
- is_linked_ = false;
- is_bound_ = true;
+ __ bind(&entry_label_);
}
#undef __
JumpTarget::JumpTarget(CodeGenerator* cgen, Directionality direction)
: cgen_(cgen),
direction_(direction),
- is_bound_(false),
- is_linked_(false),
reaching_frames_(0),
merge_labels_(0),
entry_frame_(NULL) {
: cgen_(NULL),
masm_(NULL),
direction_(FORWARD_ONLY),
- is_bound_(false),
- is_linked_(false),
reaching_frames_(0),
merge_labels_(0),
entry_frame_(NULL) {
merge_labels_.Clear();
entry_frame_ = NULL;
entry_label_.Unuse();
- is_bound_ = false;
- is_linked_ = false;
}
}
destination->entry_frame_ = entry_frame_;
destination->entry_label_ = entry_label_;
- destination->is_bound_ = is_bound_;
- destination->is_linked_ = is_linked_;
destination->expected_height_ = expected_height_;
}
}
// Predicates testing the state of the encapsulated label.
- bool is_bound() const { return is_bound_; }
- bool is_linked() const { return is_linked_; }
- bool is_unused() const { return !is_bound() && !is_linked(); }
+ bool is_bound() const { return entry_label_.is_bound(); }
+ bool is_linked() const {
+ return !is_bound() && !reaching_frames_.is_empty();
+ }
+ bool is_unused() const {
+ // This is !is_bound() && !is_linked().
+ return !is_bound() && reaching_frames_.is_empty();
+ }
// Emit a jump to the target. There must be a current frame at the
// jump and there will be no current frame after the jump.
// Directionality flag set at initialization time.
Directionality direction_;
- // A target is bound if its Bind member function has been called.
- // It is linked if it is not bound but its Jump, Branch, or Call
- // member functions have been called.
- bool is_bound_;
- bool is_linked_;
-
// A list of frames reaching this block via forward jumps.
ZoneList<VirtualFrame*> reaching_frames_;