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

Unified Diff: src/virtual-frame.cc

Issue 113764: Add an elements_.length() accessor to the VirtualFrame class and use... (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 | « src/jump-target.cc ('k') | src/x64/virtual-frame-x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/virtual-frame.cc
===================================================================
--- src/virtual-frame.cc (revision 2033)
+++ src/virtual-frame.cc (working copy)
@@ -37,7 +37,7 @@
// When cloned, a frame is a deep copy of the original.
VirtualFrame::VirtualFrame(VirtualFrame* original)
- : elements_(original->elements_.length()),
+ : elements_(original->element_count()),
stack_pointer_(original->stack_pointer_) {
elements_.AddAll(original->elements_);
// Copy register locations from original.
@@ -49,7 +49,7 @@
FrameElement VirtualFrame::CopyElementAt(int index) {
ASSERT(index >= 0);
- ASSERT(index < elements_.length());
+ ASSERT(index < element_count());
FrameElement target = elements_[index];
FrameElement result;
@@ -95,7 +95,7 @@
// pushing an exception handler). No code is emitted.
void VirtualFrame::Adjust(int count) {
ASSERT(count >= 0);
- ASSERT(stack_pointer_ == elements_.length() - 1);
+ ASSERT(stack_pointer_ == element_count() - 1);
for (int i = 0; i < count; i++) {
elements_.Add(FrameElement::MemoryElement());
@@ -106,7 +106,7 @@
void VirtualFrame::ForgetElements(int count) {
ASSERT(count >= 0);
- ASSERT(elements_.length() >= count);
+ ASSERT(element_count() >= count);
for (int i = 0; i < count; i++) {
FrameElement last = elements_.RemoveLast();
@@ -172,7 +172,7 @@
// Make the type of all elements be MEMORY.
void VirtualFrame::SpillAll() {
- for (int i = 0; i < elements_.length(); i++) {
+ for (int i = 0; i < element_count(); i++) {
SpillElementAt(i);
}
}
@@ -182,7 +182,7 @@
// Perform state changes on this frame that will make merge to the
// expected frame simpler or else increase the likelihood that his
// frame will match another.
- for (int i = 0; i < elements_.length(); i++) {
+ for (int i = 0; i < element_count(); i++) {
FrameElement source = elements_[i];
FrameElement target = expected->elements_[i];
@@ -223,7 +223,7 @@
ASSERT(height() >= spilled_args);
ASSERT(dropped_args <= spilled_args);
- SyncRange(0, elements_.length() - 1);
+ SyncRange(0, element_count() - 1);
// Spill registers.
for (int i = 0; i < kNumRegisters; i++) {
if (is_used(i)) {
@@ -232,7 +232,7 @@
}
// Spill the arguments.
- for (int i = elements_.length() - spilled_args; i < elements_.length(); i++) {
+ for (int i = element_count() - spilled_args; i < element_count(); i++) {
if (!elements_[i].is_memory()) {
SpillElementAt(i);
}
@@ -256,9 +256,9 @@
void VirtualFrame::SetElementAt(int index, Result* value) {
- int frame_index = elements_.length() - index - 1;
+ int frame_index = element_count() - index - 1;
ASSERT(frame_index >= 0);
- ASSERT(frame_index < elements_.length());
+ ASSERT(frame_index < element_count());
ASSERT(value->is_valid());
FrameElement original = elements_[frame_index];
@@ -299,7 +299,7 @@
}
elements_[frame_index].clear_sync();
register_locations_[value->reg().code()] = frame_index;
- for (int j = i + 1; j < elements_.length(); j++) {
+ for (int j = i + 1; j < element_count(); j++) {
if (elements_[j].is_copy() && elements_[j].index() == i) {
elements_[j].set_index(frame_index);
}
@@ -335,7 +335,7 @@
ASSERT(static_type.merge(element.static_type()) == element.static_type());
elements_.Add(element);
} else {
- Use(reg, elements_.length());
+ Use(reg, element_count());
FrameElement element =
FrameElement::RegisterElement(reg,
FrameElement::NOT_SYNCED,
@@ -370,10 +370,10 @@
return false;
}
}
- if (elements_.length() != other->elements_.length()) return false;
+ if (element_count() != other->element_count()) return false;
#endif
if (stack_pointer_ != other->stack_pointer_) return false;
- for (int i = 0; i < elements_.length(); i++) {
+ for (int i = 0; i < element_count(); i++) {
if (!elements_[i].Equals(other->elements_[i])) return false;
}
« no previous file with comments | « src/jump-target.cc ('k') | src/x64/virtual-frame-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698