Modify JumpTarget::ComputeEntryFrame to mark copied elements
immediately when putting a copy in the entry frame, rather than as part of a separate pass after fully constructing the entry fraem. Review URL: http://codereview.chromium.org/113198 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1907 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
bcab3697f6
commit
fc6834c5ea
@ -195,13 +195,17 @@ void JumpTarget::ComputeEntryFrame(int mergable_elements) {
|
|||||||
entry_frame_ = new VirtualFrame(cgen_);
|
entry_frame_ = new VirtualFrame(cgen_);
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for (; index < entry_frame_->elements_.length(); index++) {
|
for (; index < entry_frame_->elements_.length(); index++) {
|
||||||
// If the element is determined, set it now and count registers.
|
// If the element is determined, set it now. Count registers. Mark
|
||||||
// Undetermined elements are initially recorded as if in memory.
|
// elements as copied exactly when they have a copy. Undetermined
|
||||||
|
// elements are initially recorded as if in memory.
|
||||||
if (elements[index] != NULL) {
|
if (elements[index] != NULL) {
|
||||||
entry_frame_->elements_[index] = *elements[index];
|
entry_frame_->elements_[index] = *elements[index];
|
||||||
|
entry_frame_->elements_[index].clear_copied();
|
||||||
if (elements[index]->is_register()) {
|
if (elements[index]->is_register()) {
|
||||||
entry_frame_->register_locations_[elements[index]->reg().code()] =
|
entry_frame_->register_locations_[elements[index]->reg().code()] =
|
||||||
index;
|
index;
|
||||||
|
} else if (elements[index]->is_copy()) {
|
||||||
|
entry_frame_->elements_[elements[index]->index()].set_copied();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -211,9 +215,12 @@ void JumpTarget::ComputeEntryFrame(int mergable_elements) {
|
|||||||
entry_frame_->elements_.Add(FrameElement::MemoryElement());
|
entry_frame_->elements_.Add(FrameElement::MemoryElement());
|
||||||
} else {
|
} else {
|
||||||
entry_frame_->elements_.Add(*elements[index]);
|
entry_frame_->elements_.Add(*elements[index]);
|
||||||
|
entry_frame_->elements_[index].clear_copied();
|
||||||
if (elements[index]->is_register()) {
|
if (elements[index]->is_register()) {
|
||||||
entry_frame_->register_locations_[elements[index]->reg().code()] =
|
entry_frame_->register_locations_[elements[index]->reg().code()] =
|
||||||
index;
|
index;
|
||||||
|
} else if (elements[index]->is_copy()) {
|
||||||
|
entry_frame_->elements_[elements[index]->index()].set_copied();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -261,27 +268,25 @@ void JumpTarget::ComputeEntryFrame(int mergable_elements) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there was a register choice, use it. If not do nothing
|
|
||||||
// (the element is already recorded as in memory)
|
|
||||||
if (best_reg_code != no_reg.code_) {
|
if (best_reg_code != no_reg.code_) {
|
||||||
|
// If there was a register choice, use it. Preserve the copied
|
||||||
|
// flag on the element.
|
||||||
|
bool is_copied = entry_frame_->elements_[i].is_copied();
|
||||||
Register reg = { best_reg_code };
|
Register reg = { best_reg_code };
|
||||||
entry_frame_->elements_[i] =
|
entry_frame_->elements_[i] =
|
||||||
FrameElement::RegisterElement(reg,
|
FrameElement::RegisterElement(reg,
|
||||||
FrameElement::NOT_SYNCED);
|
FrameElement::NOT_SYNCED);
|
||||||
|
if (is_copied) entry_frame_->elements_[i].set_copied();
|
||||||
entry_frame_->register_locations_[best_reg_code] = i;
|
entry_frame_->register_locations_[best_reg_code] = i;
|
||||||
}
|
}
|
||||||
|
// If there was no register found, the element is already
|
||||||
|
// recorded as in memory.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the copied flags in the frame to be exact. This assumes that
|
// Set the static type of frame elements.
|
||||||
// the backing store of copies is always lower in the frame.
|
|
||||||
for (int i = 0; i < length; i++) {
|
for (int i = 0; i < length; i++) {
|
||||||
FrameElement* current = &entry_frame_->elements_[i];
|
FrameElement* current = &entry_frame_->elements_[i];
|
||||||
current->clear_copied();
|
|
||||||
if (current->is_copy()) {
|
|
||||||
entry_frame_->elements_[current->index()].set_copied();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (direction_ == BIDIRECTIONAL && i >= high_water_mark) {
|
if (direction_ == BIDIRECTIONAL && i >= high_water_mark) {
|
||||||
current->set_static_type(StaticType::unknown());
|
current->set_static_type(StaticType::unknown());
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user