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();
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(
164 Object* RelocInfo::target_object() {
165 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
170 Handle<Object> RelocInfo::target_object_handle(Assembler* origin) {
171 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
172 return Handle<Object>(
reinterpret_cast<Object**
>(
177 Object** RelocInfo::target_object_address() {
180 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
181 reconstructed_obj_ptr_ =
183 return &reconstructed_obj_ptr_;
188 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
192 target->IsHeapObject()) {
193 host()->GetHeap()->incremental_marking()->RecordWrite(
199 Address* RelocInfo::target_reference_address() {
200 ASSERT(rmode_ == EXTERNAL_REFERENCE);
202 return &reconstructed_adr_ptr_;
206 Handle<JSGlobalPropertyCell> RelocInfo::target_cell_handle() {
207 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
209 return Handle<JSGlobalPropertyCell>(
210 reinterpret_cast<JSGlobalPropertyCell**
>(address));
214 JSGlobalPropertyCell* RelocInfo::target_cell() {
215 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
220 void RelocInfo::set_target_cell(JSGlobalPropertyCell* cell,
222 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
228 host()->GetHeap()->incremental_marking()->RecordWrite(
234 Address RelocInfo::call_address() {
235 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) ||
236 (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()));
244 void RelocInfo::set_call_address(
Address target) {
245 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) ||
246 (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()));
251 if (host() !=
NULL) {
253 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(
259 Object* RelocInfo::call_object() {
260 return *call_object_address();
264 Object** RelocInfo::call_object_address() {
265 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) ||
266 (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()));
271 void RelocInfo::set_call_object(
Object* target) {
272 *call_object_address() = target;
276 bool RelocInfo::IsPatchedReturnSequence() {
283 ((instr2 & kOpcodeMask) ==
SPECIAL &&
285 return patched_return;
289 bool RelocInfo::IsPatchedDebugBreakSlotSequence() {
295 void RelocInfo::Visit(ObjectVisitor* visitor) {
296 RelocInfo::Mode mode = rmode();
297 if (mode == RelocInfo::EMBEDDED_OBJECT) {
298 visitor->VisitEmbeddedPointer(
this);
299 }
else if (RelocInfo::IsCodeTarget(mode)) {
300 visitor->VisitCodeTarget(
this);
301 }
else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) {
302 visitor->VisitGlobalPropertyCell(
this);
303 }
else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
304 visitor->VisitExternalReference(
this);
305 #ifdef ENABLE_DEBUGGER_SUPPORT
307 }
else if (((RelocInfo::IsJSReturn(mode) &&
308 IsPatchedReturnSequence()) ||
309 (RelocInfo::IsDebugBreakSlot(mode) &&
310 IsPatchedDebugBreakSlotSequence())) &&
311 Isolate::Current()->debug()->has_break_points()) {
312 visitor->VisitDebugTarget(
this);
315 visitor->VisitRuntimeEntry(
this);
320 template<
typename StaticVisitor>
321 void RelocInfo::Visit(Heap* heap) {
322 RelocInfo::Mode mode = rmode();
323 if (mode == RelocInfo::EMBEDDED_OBJECT) {
324 StaticVisitor::VisitEmbeddedPointer(heap,
this);
325 }
else if (RelocInfo::IsCodeTarget(mode)) {
326 StaticVisitor::VisitCodeTarget(heap,
this);
327 }
else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) {
328 StaticVisitor::VisitGlobalPropertyCell(heap,
this);
329 }
else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
330 StaticVisitor::VisitExternalReference(
this);
331 #ifdef ENABLE_DEBUGGER_SUPPORT
332 }
else if (heap->isolate()->debug()->has_break_points() &&
333 ((RelocInfo::IsJSReturn(mode) &&
334 IsPatchedReturnSequence()) ||
335 (RelocInfo::IsDebugBreakSlot(mode) &&
336 IsPatchedDebugBreakSlotSequence()))) {
337 StaticVisitor::VisitDebugTarget(heap,
this);
340 StaticVisitor::VisitRuntimeEntry(
this);
349 void Assembler::CheckBuffer() {
356 void Assembler::CheckTrampolinePoolQuick() {
363 void Assembler::emit(
Instr x) {
367 *
reinterpret_cast<Instr*
>(pc_) = x;
369 CheckTrampolinePoolQuick();
375 #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)
#define kLithiumScratchDouble
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 const int kCallTargetAddressOffset
static bool IsNop(Instr instr, int type=NON_MARKING_NOP)
static Address target_address_at(Address pc)
static JSGlobalPropertyCell * FromValueAddress(Address value)
static Address target_address_from_return_address(Address pc)
static int RelocateInternalReference(byte *pc, intptr_t pc_delta)
static const int kInstrSize
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 use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra 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 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if NULL
#define RUNTIME_ENTRY(name, nargs, ressize)
static const int kNumAllocatableRegisters
static void FlushICache(void *start, size_t size)
static const int kValueOffset