}
+Object*& ExitFrame::constant_pool_slot() const {
+ ASSERT(FLAG_enable_ool_constant_pool);
+ const int offset = ExitFrameConstants::kConstantPoolOffset;
+ return Memory::Object_at(fp() + offset);
+}
+
+
} } // namespace v8::internal
#endif // V8_TARGET_ARCH_ARM
class ExitFrameConstants : public AllStatic {
public:
- static const int kCodeOffset = -2 * kPointerSize;
- static const int kSPOffset = -1 * kPointerSize;
+ static const int kFrameSize = FLAG_enable_ool_constant_pool ?
+ 3 * kPointerSize : 2 * kPointerSize;
+
+ static const int kConstantPoolOffset = FLAG_enable_ool_constant_pool ?
+ -3 * kPointerSize : 0;
+ static const int kCodeOffset = -2 * kPointerSize;
+ static const int kSPOffset = -1 * kPointerSize;
// The caller fields are below the frame pointer on the stack.
static const int kCallerFPOffset = 0 * kPointerSize;
safepoint.DefinePointerRegister(ToRegister(pointer), zone());
}
}
+ if (FLAG_enable_ool_constant_pool && (kind & Safepoint::kWithRegisters)) {
+ // Register pp always contains a pointer to the constant pool.
+ safepoint.DefinePointerRegister(pp, zone());
+ }
}
Push(lr, fp);
mov(fp, Operand(sp)); // Set up new frame pointer.
// Reserve room for saved entry sp and code object.
- sub(sp, sp, Operand(2 * kPointerSize));
+ sub(sp, sp, Operand(ExitFrameConstants::kFrameSize));
if (emit_debug_code()) {
mov(ip, Operand::Zero());
str(ip, MemOperand(fp, ExitFrameConstants::kSPOffset));
}
+ if (FLAG_enable_ool_constant_pool) {
+ str(pp, MemOperand(fp, ExitFrameConstants::kConstantPoolOffset));
+ }
mov(ip, Operand(CodeObject()));
str(ip, MemOperand(fp, ExitFrameConstants::kCodeOffset));
if (save_doubles) {
SaveFPRegs(sp, ip);
// Note that d0 will be accessible at
- // fp - 2 * kPointerSize - DwVfpRegister::kMaxNumRegisters * kDoubleSize,
- // since the sp slot and code slot were pushed after the fp.
+ // fp - ExitFrameConstants::kFrameSize -
+ // DwVfpRegister::kMaxNumRegisters * kDoubleSize,
+ // since the sp slot, code slot and constant pool slot (if
+ // FLAG_enable_ool_constant_pool) were pushed after the fp.
}
// Reserve place for the return address and stack space and align the frame
// Optionally restore all double registers.
if (save_doubles) {
// Calculate the stack location of the saved doubles and restore them.
- const int offset = 2 * kPointerSize;
+ const int offset = ExitFrameConstants::kFrameSize;
sub(r3, fp,
Operand(offset + DwVfpRegister::kMaxNumRegisters * kDoubleSize));
RestoreFPRegs(r3, ip);
#endif
// Tear down the exit frame, pop the arguments, and return.
+ if (FLAG_enable_ool_constant_pool) {
+ ldr(pp, MemOperand(fp, ExitFrameConstants::kConstantPoolOffset));
+ }
mov(sp, Operand(fp));
ldm(ia_w, sp, fp.bit() | lr.bit());
if (argument_count.is_valid()) {
// the calling frame.
IteratePc(v, pc_address(), LookupCode());
v->VisitPointer(&code_slot());
+ if (FLAG_enable_ool_constant_pool) {
+ v->VisitPointer(&constant_pool_slot());
+ }
}
void StandardFrame::IterateExpressions(ObjectVisitor* v) const {
- const int offset = StandardFrameConstants::kContextOffset;
+ const int offset = StandardFrameConstants::kLastObjectOffset;
Object** base = &Memory::Object_at(sp());
Object** limit = &Memory::Object_at(fp() + offset) + 1;
for (StackHandlerIterator it(this, top_handler()); !it.done(); it.Advance()) {
kFirstRegisterParameterFrameOffset);
v->VisitPointers(base, limit);
base = &Memory::Object_at(fp() + StandardFrameConstants::kMarkerOffset);
- const int offset = StandardFrameConstants::kContextOffset;
+ const int offset = StandardFrameConstants::kLastObjectOffset;
limit = &Memory::Object_at(fp() + offset) + 1;
v->VisitPointers(base, limit);
IteratePc(v, pc_address(), LookupCode());
inline Kind kind() const;
inline unsigned index() const;
+ inline Object** constant_pool_address() const;
inline Object** context_address() const;
inline Object** code_address() const;
inline void SetFp(Address slot, Address fp);
public:
// Fixed part of the frame consists of return address, caller fp,
// constant pool (if FLAG_enable_ool_constant_pool), context, and function.
- // StandardFrame::IterateExpressions assumes that kContextOffset is the last
- // object pointer.
+ // StandardFrame::IterateExpressions assumes that kLastObjectOffset is the
+ // last object pointer.
static const int kCPSlotSize =
FLAG_enable_ool_constant_pool ? kPointerSize : 0;
static const int kFixedFrameSizeFromFp = 2 * kPointerSize + kCPSlotSize;
static const int kCallerFPOffset = 0 * kPointerSize;
static const int kCallerPCOffset = +1 * kFPOnStackSize;
static const int kCallerSPOffset = kCallerPCOffset + 1 * kPCOnStackSize;
+
+ static const int kLastObjectOffset = FLAG_enable_ool_constant_pool ?
+ kConstantPoolOffset : kContextOffset;
};
virtual Code* unchecked_code() const;
Object*& code_slot() const;
+ Object*& constant_pool_slot() const;
// Garbage collection support.
virtual void Iterate(ObjectVisitor* v) const;
}
+Object*& ExitFrame::constant_pool_slot() const {
+ UNREACHABLE();
+ return Memory::Object_at(NULL);
+}
+
+
} } // namespace v8::internal
#endif // V8_TARGET_ARCH_IA32
class ExitFrameConstants : public AllStatic {
public:
+ static const int kFrameSize = 2 * kPointerSize;
+
static const int kCodeOffset = -2 * kPointerSize;
static const int kSPOffset = -1 * kPointerSize;
}
+Object*& ExitFrame::constant_pool_slot() const {
+ UNREACHABLE();
+ return Memory::Object_at(NULL);
+}
+
+
} } // namespace v8::internal
#endif // V8_TARGET_ARCH_MIPS
class ExitFrameConstants : public AllStatic {
public:
- // See some explanation in MacroAssembler::EnterExitFrame.
- // This marks the top of the extra allocated stack space.
- static const int kStackSpaceOffset = -3 * kPointerSize;
+ static const int kFrameSize = 2 * kPointerSize;
static const int kCodeOffset = -2 * kPointerSize;
-
static const int kSPOffset = -1 * kPointerSize;
// The caller fields are below the frame pointer on the stack.
constant_pool->first_ptr_index());
int last_ptr_offset = constant_pool->OffsetOfElementAt(
constant_pool->first_ptr_index() +
- constant_pool->count_of_ptr_entries());
+ constant_pool->count_of_ptr_entries() - 1);
StaticVisitor::VisitPointers(
heap,
HeapObject::RawField(object, first_ptr_offset),
if (count_of_ptr_entries() > 0) {
int first_ptr_offset = OffsetOfElementAt(first_ptr_index());
int last_ptr_offset =
- OffsetOfElementAt(first_ptr_index() + count_of_ptr_entries());
+ OffsetOfElementAt(first_ptr_index() + count_of_ptr_entries() - 1);
v->VisitPointers(
HeapObject::RawField(this, first_ptr_offset),
HeapObject::RawField(this, last_ptr_offset));
EXTERNAL_DOUBLE_ARRAY_TYPE,
EXTERNAL_PIXEL_ARRAY_TYPE, // LAST_EXTERNAL_ARRAY_TYPE
FIXED_DOUBLE_ARRAY_TYPE,
- CONSTANT_POOL_ARRAY_TYPE,
FILLER_TYPE, // LAST_DATA_TYPE
// Structs.
BREAK_POINT_INFO_TYPE,
FIXED_ARRAY_TYPE,
+ CONSTANT_POOL_ARRAY_TYPE,
SHARED_FUNCTION_INFO_TYPE,
JS_MESSAGE_OBJECT_TYPE,
}
+Object*& ExitFrame::constant_pool_slot() const {
+ UNREACHABLE();
+ return Memory::Object_at(NULL);
+}
+
+
} } // namespace v8::internal
#endif // V8_TARGET_ARCH_X64
class ExitFrameConstants : public AllStatic {
public:
+ static const int kFrameSize = 2 * kPointerSize;
+
static const int kCodeOffset = -2 * kPointerSize;
static const int kSPOffset = -1 * kPointerSize;