Index: src/virtual-frame.cc |
=================================================================== |
--- src/virtual-frame.cc (revision 3957) |
+++ src/virtual-frame.cc (working copy) |
@@ -29,6 +29,7 @@ |
#include "codegen-inl.h" |
#include "register-allocator-inl.h" |
+#include "virtual-frame-inl.h" |
namespace v8 { |
namespace internal { |
@@ -36,18 +37,6 @@ |
// ------------------------------------------------------------------------- |
// VirtualFrame implementation. |
-// When cloned, a frame is a deep copy of the original. |
-VirtualFrame::VirtualFrame(VirtualFrame* original) |
- : elements_(original->element_count()), |
- stack_pointer_(original->stack_pointer_) { |
- elements_.AddAll(original->elements_); |
- // Copy register locations from original. |
- memcpy(®ister_locations_, |
- original->register_locations_, |
- sizeof(register_locations_)); |
-} |
- |
- |
// Create a duplicate of an existing valid frame element. |
// We can pass an optional number type information that will override the |
// existing information about the backing element. The new information must |
@@ -338,61 +327,6 @@ |
} |
-void VirtualFrame::PushFrameSlotAt(int index) { |
- elements_.Add(CopyElementAt(index)); |
-} |
- |
- |
-void VirtualFrame::Push(Register reg, NumberInfo::Type info) { |
- if (is_used(reg)) { |
- int index = register_location(reg); |
- FrameElement element = CopyElementAt(index, info); |
- elements_.Add(element); |
- } else { |
- Use(reg, element_count()); |
- FrameElement element = |
- FrameElement::RegisterElement(reg, FrameElement::NOT_SYNCED, info); |
- elements_.Add(element); |
- } |
-} |
- |
- |
-void VirtualFrame::Push(Handle<Object> value) { |
- FrameElement element = |
- FrameElement::ConstantElement(value, FrameElement::NOT_SYNCED); |
- elements_.Add(element); |
-} |
- |
- |
-void VirtualFrame::Nip(int num_dropped) { |
- ASSERT(num_dropped >= 0); |
- if (num_dropped == 0) return; |
- Result tos = Pop(); |
- if (num_dropped > 1) { |
- Drop(num_dropped - 1); |
- } |
- SetElementAt(0, &tos); |
-} |
- |
- |
-bool VirtualFrame::Equals(VirtualFrame* other) { |
-#ifdef DEBUG |
- for (int i = 0; i < RegisterAllocator::kNumRegisters; i++) { |
- if (register_location(i) != other->register_location(i)) { |
- return false; |
- } |
- } |
- if (element_count() != other->element_count()) return false; |
-#endif |
- if (stack_pointer_ != other->stack_pointer_) return false; |
- for (int i = 0; i < element_count(); i++) { |
- if (!elements_[i].Equals(other->elements_[i])) return false; |
- } |
- |
- return true; |
-} |
- |
- |
// Specialization of List::ResizeAdd to non-inlined version for FrameElements. |
// The function ResizeAdd becomes a real function, whose implementation is the |
// inlined ResizeAddInternal. |