Commit 6b069023 authored by ager@chromium.org's avatar ager@chromium.org

Generalize fix for overflowing of the frame-element constant pool.

BUG=74627

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7018 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 043a876e
......@@ -1339,6 +1339,20 @@ void VirtualFrame::Push(Expression* expr) {
}
void VirtualFrame::Push(Handle<Object> value) {
if (ConstantPoolOverflowed()) {
Result temp = cgen()->allocator()->Allocate();
ASSERT(temp.is_valid());
__ Set(temp.reg(), Immediate(value));
Push(&temp);
} else {
FrameElement element =
FrameElement::ConstantElement(value, FrameElement::NOT_SYNCED);
elements_.Add(element);
}
}
#undef __
} } // namespace v8::internal
......
......@@ -422,8 +422,8 @@ class VirtualFrame: public ZoneObject {
inline bool ConstantPoolOverflowed();
// Push an element on the virtual frame.
void Push(Handle<Object> value);
inline void Push(Register reg, TypeInfo info = TypeInfo::Unknown());
inline void Push(Handle<Object> value);
inline void Push(Smi* value);
void PushUntaggedElement(Handle<Object> value);
......
......@@ -87,14 +87,6 @@ bool VirtualFrame::ConstantPoolOverflowed() {
}
void VirtualFrame::Push(Handle<Object> value) {
ASSERT(!ConstantPoolOverflowed());
FrameElement element =
FrameElement::ConstantElement(value, FrameElement::NOT_SYNCED);
elements_.Add(element);
}
bool VirtualFrame::Equals(VirtualFrame* other) {
#ifdef DEBUG
for (int i = 0; i < RegisterAllocator::kNumRegisters; i++) {
......
......@@ -4696,18 +4696,7 @@ void CodeGenerator::VisitVariableProxy(VariableProxy* node) {
void CodeGenerator::VisitLiteral(Literal* node) {
Comment cmnt(masm_, "[ Literal");
if (frame_->ConstantPoolOverflowed()) {
Result temp = allocator_->Allocate();
ASSERT(temp.is_valid());
if (node->handle()->IsSmi()) {
__ Move(temp.reg(), Smi::cast(*node->handle()));
} else {
__ movq(temp.reg(), node->handle(), RelocInfo::EMBEDDED_OBJECT);
}
frame_->Push(&temp);
} else {
frame_->Push(node->handle());
}
frame_->Push(node->handle());
}
......
......@@ -274,6 +274,24 @@ void VirtualFrame::Push(Expression* expr) {
}
void VirtualFrame::Push(Handle<Object> value) {
if (ConstantPoolOverflowed()) {
Result temp = cgen()->allocator()->Allocate();
ASSERT(temp.is_valid());
if (value->IsSmi()) {
__ Move(temp.reg(), Smi::cast(*value));
} else {
__ movq(temp.reg(), value, RelocInfo::EMBEDDED_OBJECT);
}
Push(&temp);
} else {
FrameElement element =
FrameElement::ConstantElement(value, FrameElement::NOT_SYNCED);
elements_.Add(element);
}
}
void VirtualFrame::Drop(int count) {
ASSERT(count >= 0);
ASSERT(height() >= count);
......
......@@ -403,8 +403,8 @@ class VirtualFrame : public ZoneObject {
inline bool ConstantPoolOverflowed();
// Push an element on the virtual frame.
void Push(Handle<Object> value);
inline void Push(Register reg, TypeInfo info = TypeInfo::Unknown());
inline void Push(Handle<Object> value);
inline void Push(Smi* value);
// Pushing a result invalidates it (its contents become owned by the
......
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