Make another small virtual frame function inlined.

Move a constructor to the platform-independent -inl.h file.

Review URL: http://codereview.chromium.org/660175

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3975 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 46440e6f
...@@ -35,27 +35,8 @@ ...@@ -35,27 +35,8 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
// -------------------------------------------------------------------------
// VirtualFrame implementation.
#define __ ACCESS_MASM(masm()) #define __ ACCESS_MASM(masm())
// On entry to a function, the virtual frame already contains the
// receiver and the parameters. All initial frame elements are in
// memory.
VirtualFrame::VirtualFrame()
: elements_(parameter_count() + local_count() + kPreallocatedElements),
stack_pointer_(parameter_count()) { // 0-based index of TOS.
for (int i = 0; i <= stack_pointer_; i++) {
elements_.Add(FrameElement::MemoryElement(NumberInfo::kUnknown));
}
for (int i = 0; i < RegisterAllocator::kNumRegisters; i++) {
register_locations_[i] = kIllegalIndex;
}
}
void VirtualFrame::SyncElementBelowStackPointer(int index) { void VirtualFrame::SyncElementBelowStackPointer(int index) {
UNREACHABLE(); UNREACHABLE();
} }
......
...@@ -59,7 +59,7 @@ class VirtualFrame : public ZoneObject { ...@@ -59,7 +59,7 @@ class VirtualFrame : public ZoneObject {
static const int kIllegalIndex = -1; static const int kIllegalIndex = -1;
// Construct an initial virtual frame on entry to a JS function. // Construct an initial virtual frame on entry to a JS function.
VirtualFrame(); inline VirtualFrame();
// Construct a virtual frame as a clone of an existing one. // Construct a virtual frame as a clone of an existing one.
explicit inline VirtualFrame(VirtualFrame* original); explicit inline VirtualFrame(VirtualFrame* original);
......
...@@ -37,23 +37,6 @@ namespace internal { ...@@ -37,23 +37,6 @@ namespace internal {
#define __ ACCESS_MASM(masm()) #define __ ACCESS_MASM(masm())
// -------------------------------------------------------------------------
// VirtualFrame implementation.
// On entry to a function, the virtual frame already contains the receiver,
// the parameters, and a return address. All frame elements are in memory.
VirtualFrame::VirtualFrame()
: elements_(parameter_count() + local_count() + kPreallocatedElements),
stack_pointer_(parameter_count() + 1) { // 0-based index of TOS.
for (int i = 0; i <= stack_pointer_; i++) {
elements_.Add(FrameElement::MemoryElement(NumberInfo::kUnknown));
}
for (int i = 0; i < RegisterAllocator::kNumRegisters; i++) {
register_locations_[i] = kIllegalIndex;
}
}
void VirtualFrame::SyncElementBelowStackPointer(int index) { void VirtualFrame::SyncElementBelowStackPointer(int index) {
// Emit code to write elements below the stack pointer to their // Emit code to write elements below the stack pointer to their
// (already allocated) stack address. // (already allocated) stack address.
......
...@@ -73,7 +73,7 @@ class VirtualFrame: public ZoneObject { ...@@ -73,7 +73,7 @@ class VirtualFrame: public ZoneObject {
static const int kIllegalIndex = -1; static const int kIllegalIndex = -1;
// Construct an initial virtual frame on entry to a JS function. // Construct an initial virtual frame on entry to a JS function.
VirtualFrame(); inline VirtualFrame();
// Construct a virtual frame as a clone of an existing one. // Construct a virtual frame as a clone of an existing one.
explicit inline VirtualFrame(VirtualFrame* original); explicit inline VirtualFrame(VirtualFrame* original);
......
...@@ -33,6 +33,21 @@ ...@@ -33,6 +33,21 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
// On entry to a function, the virtual frame already contains the receiver,
// the parameters, and a return address. All frame elements are in memory.
VirtualFrame::VirtualFrame()
: elements_(parameter_count() + local_count() + kPreallocatedElements),
stack_pointer_(parameter_count() + 1) { // 0-based index of TOS.
for (int i = 0; i <= stack_pointer_; i++) {
elements_.Add(FrameElement::MemoryElement(NumberInfo::kUnknown));
}
for (int i = 0; i < RegisterAllocator::kNumRegisters; i++) {
register_locations_[i] = kIllegalIndex;
}
}
// When cloned, a frame is a deep copy of the original. // When cloned, a frame is a deep copy of the original.
VirtualFrame::VirtualFrame(VirtualFrame* original) VirtualFrame::VirtualFrame(VirtualFrame* original)
: elements_(original->element_count()), : elements_(original->element_count()),
......
...@@ -37,23 +37,6 @@ namespace internal { ...@@ -37,23 +37,6 @@ namespace internal {
#define __ ACCESS_MASM(masm()) #define __ ACCESS_MASM(masm())
// -------------------------------------------------------------------------
// VirtualFrame implementation.
// On entry to a function, the virtual frame already contains the receiver,
// the parameters, and a return address. All frame elements are in memory.
VirtualFrame::VirtualFrame()
: elements_(parameter_count() + local_count() + kPreallocatedElements),
stack_pointer_(parameter_count() + 1) { // 0-based index of TOS.
for (int i = 0; i <= stack_pointer_; i++) {
elements_.Add(FrameElement::MemoryElement(NumberInfo::kUnknown));
}
for (int i = 0; i < RegisterAllocator::kNumRegisters; i++) {
register_locations_[i] = kIllegalIndex;
}
}
void VirtualFrame::Enter() { void VirtualFrame::Enter() {
// Registers live on entry to a JS frame: // Registers live on entry to a JS frame:
// rsp: stack pointer, points to return address from this function. // rsp: stack pointer, points to return address from this function.
......
...@@ -73,7 +73,7 @@ class VirtualFrame : public ZoneObject { ...@@ -73,7 +73,7 @@ class VirtualFrame : public ZoneObject {
static const int kIllegalIndex = -1; static const int kIllegalIndex = -1;
// Construct an initial virtual frame on entry to a JS function. // Construct an initial virtual frame on entry to a JS function.
VirtualFrame(); inline VirtualFrame();
// Construct a virtual frame as a clone of an existing one. // Construct a virtual frame as a clone of an existing one.
explicit inline VirtualFrame(VirtualFrame* original); explicit inline VirtualFrame(VirtualFrame* original);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment