36 #ifndef V8_MIPS_ASSEMBLER_MIPS_INL_H_
37 #define V8_MIPS_ASSEMBLER_MIPS_INL_H_
51 Operand::Operand(
int32_t immediate, RelocInfo::Mode rmode) {
58 Operand::Operand(
const ExternalReference& f) {
60 imm32_ =
reinterpret_cast<int32_t>(f.address());
61 rmode_ = RelocInfo::EXTERNAL_REFERENCE;
65 Operand::Operand(Smi* value) {
67 imm32_ =
reinterpret_cast<intptr_t
>(value);
72 Operand::Operand(Register rm) {
77 bool Operand::is_reg()
const {
78 return rm_.is_valid();
87 ASSERT(!reg.
is(kLithiumScratchDouble));
88 return (reg.
code() / 2);
95 void RelocInfo::apply(intptr_t delta) {
96 if (IsCodeTarget(rmode_)) {
97 uint32_t scope1 = (uint32_t) target_address() & ~
kImm28Mask;
98 uint32_t scope2 =
reinterpret_cast<uint32_t
>(pc_) & ~
kImm28Mask;
100 if (scope1 != scope2) {
104 if (IsInternalReference(rmode_)) {
106 byte* p =
reinterpret_cast<byte*
>(pc_);
113 Address RelocInfo::target_address() {
119 Address RelocInfo::target_address_address() {
120 ASSERT(IsCodeTarget(rmode_) ||
122 rmode_ == EMBEDDED_OBJECT ||
123 rmode_ == EXTERNAL_REFERENCE);
138 return reinterpret_cast<Address>(
143 int RelocInfo::target_address_size() {
153 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(
159 Object* RelocInfo::target_object() {
160 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
165 Handle<Object> RelocInfo::target_object_handle(Assembler* origin) {
166 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
167 return Handle<Object>(
reinterpret_cast<Object**
>(
172 Object** RelocInfo::target_object_address() {
175 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
176 reconstructed_obj_ptr_ =
178 return &reconstructed_obj_ptr_;
183 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
187 target->IsHeapObject()) {
188 host()->GetHeap()->incremental_marking()->RecordWrite(
194 Address* RelocInfo::target_reference_address() {
195 ASSERT(rmode_ == EXTERNAL_REFERENCE);
197 return &reconstructed_adr_ptr_;
201 Handle<JSGlobalPropertyCell> RelocInfo::target_cell_handle() {
202 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
204 return Handle<JSGlobalPropertyCell>(
205 reinterpret_cast<JSGlobalPropertyCell**
>(address));
209 JSGlobalPropertyCell* RelocInfo::target_cell() {
210 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
214 return reinterpret_cast<JSGlobalPropertyCell*
>(object);
218 void RelocInfo::set_target_cell(JSGlobalPropertyCell* cell,
220 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
226 host()->GetHeap()->incremental_marking()->RecordWrite(
232 Address RelocInfo::call_address() {
233 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) ||
234 (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()));
242 void RelocInfo::set_call_address(
Address target) {
243 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) ||
244 (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()));
249 if (host() !=
NULL) {
251 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(
257 Object* RelocInfo::call_object() {
258 return *call_object_address();
262 Object** RelocInfo::call_object_address() {
263 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) ||
264 (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()));
269 void RelocInfo::set_call_object(
Object* target) {
270 *call_object_address() = target;
274 bool RelocInfo::IsPatchedReturnSequence() {
281 ((instr2 & kOpcodeMask) ==
SPECIAL &&
283 return patched_return;
287 bool RelocInfo::IsPatchedDebugBreakSlotSequence() {
293 void RelocInfo::Visit(ObjectVisitor* visitor) {
294 RelocInfo::Mode mode = rmode();
295 if (mode == RelocInfo::EMBEDDED_OBJECT) {
296 visitor->VisitEmbeddedPointer(
this);
297 }
else if (RelocInfo::IsCodeTarget(mode)) {
298 visitor->VisitCodeTarget(
this);
299 }
else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) {
300 visitor->VisitGlobalPropertyCell(
this);
301 }
else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
302 visitor->VisitExternalReference(
this);
303 #ifdef ENABLE_DEBUGGER_SUPPORT
305 }
else if (((RelocInfo::IsJSReturn(mode) &&
306 IsPatchedReturnSequence()) ||
307 (RelocInfo::IsDebugBreakSlot(mode) &&
308 IsPatchedDebugBreakSlotSequence())) &&
309 Isolate::Current()->debug()->has_break_points()) {
310 visitor->VisitDebugTarget(
this);
313 visitor->VisitRuntimeEntry(
this);
318 template<
typename StaticVisitor>
319 void RelocInfo::Visit(Heap* heap) {
320 RelocInfo::Mode mode = rmode();
321 if (mode == RelocInfo::EMBEDDED_OBJECT) {
322 StaticVisitor::VisitEmbeddedPointer(heap,
this);
323 }
else if (RelocInfo::IsCodeTarget(mode)) {
324 StaticVisitor::VisitCodeTarget(heap,
this);
325 }
else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) {
326 StaticVisitor::VisitGlobalPropertyCell(heap,
this);
327 }
else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
328 StaticVisitor::VisitExternalReference(
this);
329 #ifdef ENABLE_DEBUGGER_SUPPORT
330 }
else if (heap->isolate()->debug()->has_break_points() &&
331 ((RelocInfo::IsJSReturn(mode) &&
332 IsPatchedReturnSequence()) ||
333 (RelocInfo::IsDebugBreakSlot(mode) &&
334 IsPatchedDebugBreakSlotSequence()))) {
335 StaticVisitor::VisitDebugTarget(heap,
this);
338 StaticVisitor::VisitRuntimeEntry(
this);
347 void Assembler::CheckBuffer() {
354 void Assembler::CheckTrampolinePoolQuick() {
361 void Assembler::emit(
Instr x) {
365 *
reinterpret_cast<Instr*
>(pc_) = x;
367 CheckTrampolinePoolQuick();
373 #endif // V8_MIPS_ASSEMBLER_MIPS_INL_H_
static Object *& Object_at(Address addr)
static int ToAllocationIndex(FPURegister reg)
static HeapObject * cast(Object *obj)
bool is(FPURegister creg) const
#define ASSERT(condition)
const int kFunctionFieldMask
void CheckTrampolinePool()
bool is_buffer_growth_blocked() const
static void JumpLabelToJumpRegister(Address pc)
static const int kSpecialTargetSize
static Address & Address_at(Address addr)
static void set_target_address_at(Address pc, Address target)
static const int kInstructionsFor32BitConstant
static Code * GetCodeFromTargetAddress(Address address)
static bool IsNop(Instr instr, int type=NON_MARKING_NOP)
static Address target_address_at(Address pc)
static int RelocateInternalReference(byte *pc, intptr_t pc_delta)
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)
static const int kInstrSize
#define RUNTIME_ENTRY(name, nargs, ressize)
static const int kNumAllocatableRegisters
static void FlushICache(void *start, size_t size)
static const int kValueOffset