}
+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
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);
}
-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++) {
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());
}
}
+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);
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