Commit a080d4c5 authored by zhengxing.li's avatar zhengxing.li Committed by Commit bot

X87: fix the deoptimization issue.

       On X87 the count of double register number is landed on the top
       of x87 register stack for deoptimization. (chunyang.dai@intle.com)

R=weiliang.lin@intel.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#31728}
parent 8a93f129
......@@ -415,6 +415,26 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
case kArchDeoptimize: {
int deopt_state_id =
BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore());
int double_register_param_count = 0;
int x87_layout = 0;
for (size_t i = 0; i < instr->InputCount(); i++) {
if (instr->InputAt(i)->IsDoubleRegister()) {
double_register_param_count++;
}
}
// Currently we use only one X87 register. If we use more X87 register
// in the future. we need to generate the x87 layout according to the
// used double registers.
DCHECK(double_register_param_count < 2);
if (double_register_param_count == 1) {
x87_layout = (0 << 3) | 1;
}
// The layout of x87 register stack is loaded on the top of FPU register
// stack for deoptimization.
__ push(Immediate(x87_layout));
__ fild_s(MemOperand(esp, 0));
__ lea(esp, Operand(esp, kPointerSize));
AssembleDeoptimizerCall(deopt_state_id, Deoptimizer::EAGER);
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment