Port: r17485 (0d82025)
Original commit message:
When --optimize-for-size is true, the prologue generation outputs the
pre-aging code stub address directly to the instruction stream. Previously
this was done using dd() which failed if there was any pending constant
pool entries left to be written. This CL introduces an emit_code_stub_address()
for this purpose instead.
BUG=v8:2968
Patch from Balazs Kilvady <kilvadyb@homejinni.com>.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17508
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
}
+void Assembler::emit_code_stub_address(Code* stub) {
+ CheckBuffer();
+ *reinterpret_cast<uint32_t*>(pc_) =
+ reinterpret_cast<uint32_t>(stub->instruction_start());
+ pc_ += sizeof(uint32_t);
+}
+
+
void Assembler::RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data) {
// We do not try to reuse pool constants.
RelocInfo rinfo(pc_, rmode, data, NULL);
void db(uint8_t data);
void dd(uint32_t data);
+ // Emits the address of the code stub's first instruction.
+ void emit_code_stub_address(Code* stub);
+
PositionsRecorder* positions_recorder() { return &positions_recorder_; }
// Postpone the generation of the trampoline pool for the specified number of
Operand(reinterpret_cast<uint32_t>(stub->instruction_start())));
patcher.masm()->Call(t9);
// Record the stub address in the empty space for GetCodeAgeAndParity()
- patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start()));
+ patcher.masm()->emit_code_stub_address(stub);
}
}
Code* stub = Code::GetPreAgedCodeAgeStub(isolate());
nop(Assembler::CODE_AGE_MARKER_NOP);
// Save the function's original return address
- // (it will be clobbered by Call(t9))
+ // (it will be clobbered by Call(t9)).
mov(at, ra);
- // Load the stub address to t9 and call it
+ // Load the stub address to t9 and call it.
li(t9,
Operand(reinterpret_cast<uint32_t>(stub->instruction_start())));
Call(t9);
- // Record the stub address in the empty space for GetCodeAgeAndParity()
- dd(reinterpret_cast<uint32_t>(stub->instruction_start()));
+ // Record the stub address in the empty space for GetCodeAgeAndParity().
+ emit_code_stub_address(stub);
} else {
Push(ra, fp, cp, a1);
nop(Assembler::CODE_AGE_SEQUENCE_NOP);