Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(426)

Unified Diff: src/jump-target.cc

Issue 113198: Modify JumpTarget::ComputeEntryFrame to mark copied elements... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/jump-target.cc
===================================================================
--- src/jump-target.cc (revision 1906)
+++ src/jump-target.cc (working copy)
@@ -195,13 +195,17 @@
entry_frame_ = new VirtualFrame(cgen_);
int index = 0;
for (; index < entry_frame_->elements_.length(); index++) {
- // If the element is determined, set it now and count registers.
- // Undetermined elements are initially recorded as if in memory.
+ // If the element is determined, set it now. Count registers.
+ // Mark elements as copied exactly if they are. Undetermined
+ // elements are initially recorded as if in memory.
if (elements[index] != NULL) {
entry_frame_->elements_[index] = *elements[index];
+ entry_frame_->elements_[index].clear_copied();
if (elements[index]->is_register()) {
entry_frame_->register_locations_[elements[index]->reg().code()] =
index;
+ } else if (elements[index]->is_copy()) {
+ entry_frame_->elements_[elements[index]->index()].set_copied();
}
}
}
@@ -211,9 +215,12 @@
entry_frame_->elements_.Add(FrameElement::MemoryElement());
} else {
entry_frame_->elements_.Add(*elements[index]);
+ entry_frame_->elements_[index].clear_copied();
if (elements[index]->is_register()) {
entry_frame_->register_locations_[elements[index]->reg().code()] =
index;
+ } else if (elements[index]->is_copy()) {
+ entry_frame_->elements_[elements[index]->index()].set_copied();
}
}
}
@@ -261,27 +268,25 @@
}
}
- // 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 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 };
entry_frame_->elements_[i] =
FrameElement::RegisterElement(reg,
FrameElement::NOT_SYNCED);
+ if (is_copied) entry_frame_->elements_[i].set_copied();
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
- // the backing store of copies is always lower in the frame.
+ // Set the static type of frame elements.
for (int i = 0; i < length; 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) {
current->set_static_type(StaticType::unknown());
} else {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698