PPC/s390: [turbofan] Better checking of code start register.

Port 5586ecfc68

Original Commit Message:

    This decouples the checking of the {kJavaScriptCallCodeStartRegister}
    from the deoptimization checks. We now rely more heavily on the above
    register and should check its validity more broadly. Note that there
    also is a bug fix for the ARM port contained in this change.

R=mstarzinger@chromium.org, joransiu@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: Ic8b58994b083c6c0ec73173120cedf6391b1c964
Reviewed-on: https://chromium-review.googlesource.com/938522
Reviewed-by: Joran Siu <joransiu@ca.ibm.com>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#51620}
This commit is contained in:
Junliang Yan 2018-02-27 18:09:39 -05:00 committed by Commit Bot
parent 278b00c527
commit 1ce7a7f92a
2 changed files with 14 additions and 2 deletions

View File

@ -793,7 +793,15 @@ void CodeGenerator::AssembleTailCallAfterGap(Instruction* instr,
// Check that {kJavaScriptCallCodeStartRegister} is correct.
void CodeGenerator::AssembleCodeStartRegisterCheck() {
// TODO(mstarzinger): Implement me.
Register scratch = kScratchReg;
Label current_pc;
__ mov_label_addr(scratch, &current_pc);
__ bind(&current_pc);
__ subi(scratch, scratch, Operand(__ pc_offset()));
__ cmp(scratch, kJavaScriptCallCodeStartRegister);
__ Assert(eq, AbortReason::kWrongFunctionCodeStart);
}
// Check if the code object is marked for deoptimization. If it is, then it

View File

@ -1040,7 +1040,11 @@ void CodeGenerator::AssembleTailCallAfterGap(Instruction* instr,
// Check that {kJavaScriptCallCodeStartRegister} is correct.
void CodeGenerator::AssembleCodeStartRegisterCheck() {
// TODO(mstarzinger): Implement me.
Register scratch = r1;
int pc_offset = __ pc_offset();
__ larl(scratch, Operand(-pc_offset/2));
__ CmpP(scratch, kJavaScriptCallCodeStartRegister);
__ Assert(eq, AbortReason::kWrongFunctionCodeStart);
}
// Check if the code object is marked for deoptimization. If it is, then it