Commit 03caf2c2 authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

PPC/s390: [turbofan] Support poisoning arguments in JavaScript.

Port be4cd67c

Original Commit Message:

    This adds support for poisoning the stack pointer and implicit register
    arguments like the context register and the function register in the
    prologue of generated code with JavaScript linkage. The speculation
    poison is computed similarly to the interpreter by matching expected
    with actual code start addresses.

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

Change-Id: I0d015fd8a8f05982d947a4a1c0be1a825ac19d64
Reviewed-on: https://chromium-review.googlesource.com/940460Reviewed-by: 's avatarJoran Siu <joransiu@ca.ibm.com>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#51621}
parent 1ce7a7f9
......@@ -858,6 +858,12 @@ void CodeGenerator::GenerateSpeculationPoison() {
__ notx(kSpeculationPoisonRegister, kSpeculationPoisonRegister);
}
void CodeGenerator::AssembleRegisterArgumentPoisoning() {
__ and_(kJSFunctionRegister, kJSFunctionRegister, kSpeculationPoisonRegister);
__ and_(kContextRegister, kContextRegister, kSpeculationPoisonRegister);
__ and_(sp, sp, kSpeculationPoisonRegister);
}
// Assembles an instruction after register allocation, producing machine code.
CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
Instruction* instr) {
......
......@@ -1098,6 +1098,12 @@ void CodeGenerator::GenerateSpeculationPoison() {
__ NotP(kSpeculationPoisonRegister, kSpeculationPoisonRegister);
}
void CodeGenerator::AssembleRegisterArgumentPoisoning() {
__ AndP(kJSFunctionRegister, kJSFunctionRegister, kSpeculationPoisonRegister);
__ AndP(kContextRegister, kContextRegister, kSpeculationPoisonRegister);
__ AndP(sp, sp, kSpeculationPoisonRegister);
}
// Assembles an instruction after register allocation, producing machine code.
CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
Instruction* instr) {
......
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