MIPS64: Externalize deoptimization reasons.

Port 2491a639bf

BUG=

Review URL: https://codereview.chromium.org/888143004

Cr-Commit-Position: refs/heads/master@{#26473}
This commit is contained in:
akos.palfi 2015-02-05 15:54:57 -08:00 committed by Commit bot
parent b67b3c5401
commit 1ffaf13b2d
4 changed files with 29 additions and 13 deletions

View File

@ -2581,6 +2581,15 @@ void Assembler::RecordComment(const char* msg) {
}
void Assembler::RecordDeoptReason(const int reason, const int raw_position) {
if (FLAG_trace_deopt) {
EnsureSpace ensure_space(this);
RecordRelocInfo(RelocInfo::POSITION, raw_position);
RecordRelocInfo(RelocInfo::DEOPT_REASON, reason);
}
}
int Assembler::RelocateInternalReference(byte* pc, intptr_t pc_delta) {
Instr instr = instr_at(pc);
DCHECK(IsJ(instr) || IsLui(instr));

View File

@ -1055,6 +1055,10 @@ class Assembler : public AssemblerBase {
// Use --code-comments to enable.
void RecordComment(const char* msg);
// Record a deoptimization reason that can be used by a log or cpu profiler.
// Use --trace-deopt to enable.
void RecordDeoptReason(const int reason, const int raw_position);
static int RelocateInternalReference(byte* pc, intptr_t pc_delta);
// Writes a single byte or word of data in the code stream. Used for

View File

@ -763,9 +763,9 @@ void LCodeGen::RegisterEnvironmentForDeoptimization(LEnvironment* environment,
void LCodeGen::DeoptimizeIf(Condition condition, LInstruction* instr,
Deoptimizer::DeoptReason deopt_reason,
Deoptimizer::BailoutType bailout_type,
const char* detail, Register src1,
const Operand& src2) {
Register src1, const Operand& src2) {
LEnvironment* environment = instr->environment();
RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt);
DCHECK(environment->HasBeenRegistered());
@ -807,7 +807,7 @@ void LCodeGen::DeoptimizeIf(Condition condition, LInstruction* instr,
}
Deoptimizer::Reason reason(instr->hydrogen_value()->position().raw(),
instr->Mnemonic(), detail);
instr->Mnemonic(), deopt_reason);
DCHECK(info()->IsStub() || frame_is_built_);
// Go through jump table if we need to handle condition, build frame, or
// restore caller doubles.
@ -830,12 +830,12 @@ void LCodeGen::DeoptimizeIf(Condition condition, LInstruction* instr,
void LCodeGen::DeoptimizeIf(Condition condition, LInstruction* instr,
const char* detail, Register src1,
const Operand& src2) {
Deoptimizer::DeoptReason deopt_reason,
Register src1, const Operand& src2) {
Deoptimizer::BailoutType bailout_type = info()->IsStub()
? Deoptimizer::LAZY
: Deoptimizer::EAGER;
DeoptimizeIf(condition, instr, bailout_type, detail, src1, src2);
DeoptimizeIf(condition, instr, deopt_reason, bailout_type, src1, src2);
}
@ -3275,7 +3275,8 @@ void LCodeGen::DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr) {
if (instr->hydrogen()->RequiresHoleCheck()) {
__ lwu(scratch, MemOperand(scratch, sizeof(kHoleNanLower32)));
DeoptimizeIf(eq, instr, Deopt::kHole, scratch, Operand(kHoleNanUpper32));
DeoptimizeIf(eq, instr, Deoptimizer::kHole, scratch,
Operand(kHoleNanUpper32));
}
}
@ -5055,7 +5056,7 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) {
__ bind(&check_false);
__ LoadRoot(at, Heap::kFalseValueRootIndex);
DeoptimizeIf(ne, instr, Deoptimizer::kNotAHeapNumberUndefinedTrueFalse,
DeoptimizeIf(ne, instr, Deoptimizer::kNotAHeapNumberUndefinedBoolean,
scratch2, Operand(at));
__ Branch(USE_DELAY_SLOT, &done);
__ mov(input_reg, zero_reg); // In delay slot.
@ -5817,7 +5818,7 @@ void LCodeGen::DoDeoptimize(LDeoptimize* instr) {
type = Deoptimizer::LAZY;
}
DeoptimizeIf(al, instr, type, instr->hydrogen()->reason(), zero_reg,
DeoptimizeIf(al, instr, instr->hydrogen()->reason(), type, zero_reg,
Operand(zero_reg));
}

View File

@ -223,12 +223,14 @@ class LCodeGen: public LCodeGenBase {
void RegisterEnvironmentForDeoptimization(LEnvironment* environment,
Safepoint::DeoptMode mode);
void DeoptimizeIf(Condition condition, LInstruction* instr,
Deoptimizer::BailoutType bailout_type, const char* detail,
Deoptimizer::DeoptReason deopt_reason,
Deoptimizer::BailoutType bailout_type,
Register src1 = zero_reg,
const Operand& src2 = Operand(zero_reg));
void DeoptimizeIf(Condition condition, LInstruction* instr,
const char* detail, Register src1 = zero_reg,
const Operand& src2 = Operand(zero_reg));
void DeoptimizeIf(
Condition condition, LInstruction* instr,
Deoptimizer::DeoptReason deopt_reason = Deoptimizer::kNoReason,
Register src1 = zero_reg, const Operand& src2 = Operand(zero_reg));
void AddToTranslation(LEnvironment* environment,
Translation* translation,