Reviewers: Vyacheslav Egorov, Description: Merge revision 7018 from bleeding_edge to 3.0 branch to fix overflow of constant pools in classic codegen.
Please review this at http://codereview.chromium.org/6592098/ SVN Base: http://v8.googlecode.com/svn/branches/3.0/ Affected files: M src/ia32/virtual-frame-ia32.h M src/ia32/virtual-frame-ia32.cc M src/version.cc M src/virtual-frame-heavy-inl.h M src/x64/codegen-x64.cc M src/x64/virtual-frame-x64.h M src/x64/virtual-frame-x64.cc Index: src/ia32/virtual-frame-ia32.cc =================================================================== --- src/ia32/virtual-frame-ia32.cc (revision 7018) +++ src/ia32/virtual-frame-ia32.cc (working copy) @@ -1329,6 +1329,20 @@ } +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 Index: src/ia32/virtual-frame-ia32.h =================================================================== --- src/ia32/virtual-frame-ia32.h (revision 7018) +++ src/ia32/virtual-frame-ia32.h (working copy) @@ -421,8 +421,8 @@ 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); Index: src/version.cc =================================================================== --- src/version.cc (revision 7018) +++ src/version.cc (working copy) @@ -35,7 +35,7 @@ #define MAJOR_VERSION 3 #define MINOR_VERSION 0 #define BUILD_NUMBER 12 -#define PATCH_LEVEL 29 +#define PATCH_LEVEL 30 #define CANDIDATE_VERSION false // Define SONAME to have the SCons build the put a specific SONAME into the Index: src/virtual-frame-heavy-inl.h =================================================================== --- src/virtual-frame-heavy-inl.h (revision 7018) +++ src/virtual-frame-heavy-inl.h (working copy) @@ -87,14 +87,6 @@ } -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++) { Index: src/x64/codegen-x64.cc =================================================================== --- src/x64/codegen-x64.cc (revision 7018) +++ src/x64/codegen-x64.cc (working copy) @@ -4694,18 +4694,7 @@ 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()); } Index: src/x64/virtual-frame-x64.cc =================================================================== --- src/x64/virtual-frame-x64.cc (revision 7018) +++ src/x64/virtual-frame-x64.cc (working copy) @@ -274,6 +274,24 @@ } +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); Index: src/x64/virtual-frame-x64.h =================================================================== --- src/x64/virtual-frame-x64.h (revision 7018) +++ src/x64/virtual-frame-x64.h (working copy) @@ -402,8 +402,8 @@ 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 -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
