Generalize fix for overflowing of the frame-element constant pool.
authorager@chromium.org <ager@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 2 Mar 2011 11:45:31 +0000 (11:45 +0000)
committerager@chromium.org <ager@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 2 Mar 2011 11:45:31 +0000 (11:45 +0000)
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

src/ia32/virtual-frame-ia32.cc
src/ia32/virtual-frame-ia32.h
src/virtual-frame-heavy-inl.h
src/x64/codegen-x64.cc
src/x64/virtual-frame-x64.cc
src/x64/virtual-frame-x64.h

index 5e2cbee..93d711e 100644 (file)
@@ -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
index f5d0e8d..5187430 100644 (file)
@@ -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);
index ac844b4..cf12eca 100644 (file)
@@ -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++) {
index 6a71e6f..ad114c2 100644 (file)
@@ -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());
 }
 
 
index 1787044..c4d7e65 100644 (file)
@@ -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);
index b568a78..7396db1 100644 (file)
@@ -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