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

Unified Diff: src/arm/virtual-frame-arm.h

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/arm/jump-target-arm.cc ('k') | src/arm/virtual-frame-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/virtual-frame-arm.h
===================================================================
--- src/arm/virtual-frame-arm.h (revision 2033)
+++ src/arm/virtual-frame-arm.h (working copy)
@@ -82,9 +82,12 @@
// Create a duplicate of an existing valid frame element.
FrameElement CopyElementAt(int index);
+ // The number of elements on the virtual frame.
+ int element_count() { return elements_.length(); }
+
// The height of the virtual expression stack.
int height() {
- return elements_.length() - expression_base_index();
+ return element_count() - expression_base_index();
}
int register_index(Register reg) {
@@ -108,7 +111,7 @@
// the frame after a runtime call). No code is emitted.
void Forget(int count) {
ASSERT(count >= 0);
- ASSERT(stack_pointer_ == elements_.length() - 1);
+ ASSERT(stack_pointer_ == element_count() - 1);
stack_pointer_ -= count;
ForgetElements(count);
}
@@ -204,7 +207,7 @@
}
void PushElementAt(int index) {
- PushFrameSlotAt(elements_.length() - index - 1);
+ PushFrameSlotAt(element_count() - index - 1);
}
// A frame-allocated local as an assembly operand.
@@ -335,7 +338,7 @@
void Drop() { Drop(1); }
// Duplicate the top element of the frame.
- void Dup() { PushFrameSlotAt(elements_.length() - 1); }
+ void Dup() { PushFrameSlotAt(element_count() - 1); }
// Pop an element from the top of the expression stack. Returns a
// Result, which may be a constant or a register.
@@ -419,8 +422,8 @@
// Convert a frame index into a frame pointer relative offset into the
// actual stack.
int fp_relative(int index) {
- ASSERT(index < elements_.length());
- ASSERT(frame_pointer() < elements_.length()); // FP is on the frame.
+ ASSERT(index < element_count());
+ ASSERT(frame_pointer() < element_count()); // FP is on the frame.
return (frame_pointer() - index) * kPointerSize;
}
« no previous file with comments | « src/arm/jump-target-arm.cc ('k') | src/arm/virtual-frame-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698