37 #ifndef V8_ARM_ASSEMBLER_ARM_INL_H_
38 #define V8_ARM_ASSEMBLER_ARM_INL_H_
57 void RelocInfo::apply(intptr_t delta) {
58 if (RelocInfo::IsInternalReference(rmode_)) {
68 Address RelocInfo::target_address() {
74 Address RelocInfo::target_address_address() {
76 || rmode_ == EMBEDDED_OBJECT
77 || rmode_ == EXTERNAL_REFERENCE);
78 return reinterpret_cast<Address>(Assembler::target_address_address_at(pc_));
82 int RelocInfo::target_address_size() {
92 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(
98 Object* RelocInfo::target_object() {
99 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
104 Handle<Object> RelocInfo::target_object_handle(Assembler* origin) {
105 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
110 Object** RelocInfo::target_object_address() {
111 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
112 return reinterpret_cast<Object**
>(Assembler::target_address_address_at(pc_));
117 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
121 target->IsHeapObject()) {
122 host()->GetHeap()->incremental_marking()->RecordWrite(
128 Address* RelocInfo::target_reference_address() {
129 ASSERT(rmode_ == EXTERNAL_REFERENCE);
130 return reinterpret_cast<Address*
>(Assembler::target_address_address_at(pc_));
134 Handle<JSGlobalPropertyCell> RelocInfo::target_cell_handle() {
135 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
137 return Handle<JSGlobalPropertyCell>(
138 reinterpret_cast<JSGlobalPropertyCell**
>(address));
142 JSGlobalPropertyCell* RelocInfo::target_cell() {
143 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
147 return reinterpret_cast<JSGlobalPropertyCell*
>(object);
151 void RelocInfo::set_target_cell(JSGlobalPropertyCell* cell,
153 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
159 host()->GetHeap()->incremental_marking()->RecordWrite(
165 Address RelocInfo::call_address() {
168 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) ||
169 (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()));
174 void RelocInfo::set_call_address(
Address target) {
175 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) ||
176 (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()));
178 if (host() !=
NULL) {
180 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(
186 Object* RelocInfo::call_object() {
187 return *call_object_address();
191 void RelocInfo::set_call_object(
Object* target) {
192 *call_object_address() = target;
196 Object** RelocInfo::call_object_address() {
197 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) ||
198 (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()));
203 bool RelocInfo::IsPatchedReturnSequence() {
222 bool RelocInfo::IsPatchedDebugBreakSlotSequence() {
228 void RelocInfo::Visit(ObjectVisitor* visitor) {
229 RelocInfo::Mode mode = rmode();
230 if (mode == RelocInfo::EMBEDDED_OBJECT) {
231 visitor->VisitEmbeddedPointer(
this);
232 }
else if (RelocInfo::IsCodeTarget(mode)) {
233 visitor->VisitCodeTarget(
this);
234 }
else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) {
235 visitor->VisitGlobalPropertyCell(
this);
236 }
else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
237 visitor->VisitExternalReference(
this);
238 #ifdef ENABLE_DEBUGGER_SUPPORT
240 }
else if (((RelocInfo::IsJSReturn(mode) &&
241 IsPatchedReturnSequence()) ||
242 (RelocInfo::IsDebugBreakSlot(mode) &&
243 IsPatchedDebugBreakSlotSequence())) &&
244 Isolate::Current()->debug()->has_break_points()) {
245 visitor->VisitDebugTarget(
this);
248 visitor->VisitRuntimeEntry(
this);
253 template<
typename StaticVisitor>
254 void RelocInfo::Visit(Heap* heap) {
255 RelocInfo::Mode mode = rmode();
256 if (mode == RelocInfo::EMBEDDED_OBJECT) {
257 StaticVisitor::VisitEmbeddedPointer(heap,
this);
258 }
else if (RelocInfo::IsCodeTarget(mode)) {
259 StaticVisitor::VisitCodeTarget(heap,
this);
260 }
else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) {
261 StaticVisitor::VisitGlobalPropertyCell(heap,
this);
262 }
else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
263 StaticVisitor::VisitExternalReference(
this);
264 #ifdef ENABLE_DEBUGGER_SUPPORT
265 }
else if (heap->isolate()->debug()->has_break_points() &&
266 ((RelocInfo::IsJSReturn(mode) &&
267 IsPatchedReturnSequence()) ||
268 (RelocInfo::IsDebugBreakSlot(mode) &&
269 IsPatchedDebugBreakSlotSequence()))) {
270 StaticVisitor::VisitDebugTarget(heap,
this);
273 StaticVisitor::VisitRuntimeEntry(
this);
278 Operand::Operand(
int32_t immediate, RelocInfo::Mode rmode) {
285 Operand::Operand(
const ExternalReference& f) {
287 imm32_ =
reinterpret_cast<int32_t>(f.address());
288 rmode_ = RelocInfo::EXTERNAL_REFERENCE;
292 Operand::Operand(Smi* value) {
294 imm32_ =
reinterpret_cast<intptr_t
>(value);
299 Operand::Operand(Register rm) {
307 bool Operand::is_reg()
const {
308 return rm_.is_valid() &&
315 void Assembler::CheckBuffer() {
325 void Assembler::emit(
Instr x) {
327 *
reinterpret_cast<Instr*
>(pc_) = x;
337 static const int32_t kBxInstMask = 0x0ffffff0;
338 static const int32_t kBxInstPattern = 0x012fff10;
339 if ((instr & kBxInstMask) == kBxInstPattern) {
354 int offset = instr & 0xfff;
355 if ((instr & (1 << 23)) == 0) offset = -offset;
358 return target_pc + offset + 8;
392 #endif // V8_ARM_ASSEMBLER_ARM_INL_H_
static Object *& Object_at(Address addr)
const Instr kLdrPCPattern
static void deserialization_set_special_target_at(Address constant_pool_entry, Address target)
static Handle< Object > & Object_Handle_at(Address addr)
static HeapObject * cast(Object *obj)
#define ASSERT(condition)
#define kScratchDoubleReg
static Address & Address_at(Address addr)
static void set_target_address_at(Address pc, Address target)
static int32_t & int32_at(Address addr)
static void set_external_target_at(Address constant_pool_entry, Address target)
static Code * GetCodeFromTargetAddress(Address address)
void CheckConstPool(bool force_emit, bool require_jump)
static bool IsNop(Instr instr, int type=NON_MARKING_NOP)
static Address target_address_at(Address pc)
static int ToAllocationIndex(DwVfpRegister reg)
const Instr kBlxRegPattern
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination trace on stack replacement optimize closures functions with arguments object optimize functions containing for in loops profiler considers IC stability primitive functions trigger their own optimization re try self optimization if it failed insert an interrupt check at function exit execution budget before interrupt is triggered call count before self optimization self_optimization count_based_interrupts weighted_back_edges trace_opt emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 enable use of ARMv7 instructions if enable use of MIPS FPU instructions if NULL
static HeapObject * FromAddress(Address address)
bool is(DwVfpRegister reg) const
static const int kInstrSize
#define RUNTIME_ENTRY(name, nargs, ressize)
static const int kValueOffset
static bool IsLdrPcImmediateOffset(Instr instr)