Commit 2c7de324 authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

PPC/s390: [Intepreter] Add poisoning to bytecode operand reads.

Port c9941af2

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

Change-Id: Id1f6a45169a24f06605297a404461a6cbdf78347
Reviewed-on: https://chromium-review.googlesource.com/894305Reviewed-by: 's avatarJoran Siu <joransiu@ca.ibm.com>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#51007}
parent 51c63156
......@@ -1034,9 +1034,11 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
__ mov(kInterpreterDispatchTableRegister,
Operand(ExternalReference::interpreter_dispatch_table_address(
masm->isolate())));
__ lbzx(r4, MemOperand(kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister));
__ ShiftLeftImm(ip, r4, Operand(kPointerSizeLog2));
__ lbzx(kInterpreterTargetBytecodeRegister,
MemOperand(kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister));
__ ShiftLeftImm(ip, kInterpreterTargetBytecodeRegister,
Operand(kPointerSizeLog2));
__ LoadPX(ip, MemOperand(kInterpreterDispatchTableRegister, ip));
__ Call(ip);
......@@ -1261,9 +1263,11 @@ static void Generate_InterpreterEnterBytecode(MacroAssembler* masm) {
__ SmiUntag(kInterpreterBytecodeOffsetRegister);
// Dispatch to the target bytecode.
__ lbzx(r4, MemOperand(kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister));
__ ShiftLeftImm(ip, r4, Operand(kPointerSizeLog2));
__ lbzx(kInterpreterTargetBytecodeRegister,
MemOperand(kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister));
__ ShiftLeftImm(ip, kInterpreterTargetBytecodeRegister,
Operand(kPointerSizeLog2));
__ LoadPX(ip, MemOperand(kInterpreterDispatchTableRegister, ip));
__ Jump(ip);
}
......
......@@ -1033,9 +1033,11 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
Operand(ExternalReference::interpreter_dispatch_table_address(
masm->isolate())));
__ LoadlB(r3, MemOperand(kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister));
__ ShiftLeftP(ip, r3, Operand(kPointerSizeLog2));
__ LoadlB(kInterpreterTargetBytecodeRegister,
MemOperand(kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister));
__ ShiftLeftP(ip, kInterpreterTargetBytecodeRegister,
Operand(kPointerSizeLog2));
__ LoadP(ip, MemOperand(kInterpreterDispatchTableRegister, ip));
__ Call(ip);
......@@ -1258,9 +1260,11 @@ static void Generate_InterpreterEnterBytecode(MacroAssembler* masm) {
__ SmiUntag(kInterpreterBytecodeOffsetRegister);
// Dispatch to the target bytecode.
__ LoadlB(r3, MemOperand(kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister));
__ ShiftLeftP(ip, r3, Operand(kPointerSizeLog2));
__ LoadlB(kInterpreterTargetBytecodeRegister,
MemOperand(kInterpreterBytecodeArrayRegister,
kInterpreterBytecodeOffsetRegister));
__ ShiftLeftP(ip, kInterpreterTargetBytecodeRegister,
Operand(kPointerSizeLog2));
__ LoadP(ip, MemOperand(kInterpreterDispatchTableRegister, ip));
__ Jump(ip);
}
......
......@@ -290,8 +290,9 @@ void ApiCallbackDescriptor::InitializePlatformSpecific(
void InterpreterDispatchDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {
kInterpreterAccumulatorRegister, kInterpreterBytecodeOffsetRegister,
kInterpreterBytecodeArrayRegister, kInterpreterDispatchTableRegister};
kInterpreterAccumulatorRegister, kInterpreterBytecodeOffsetRegister,
kInterpreterBytecodeArrayRegister, kInterpreterDispatchTableRegister,
kInterpreterTargetBytecodeRegister};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
......
......@@ -25,6 +25,7 @@ const Register kInterpreterAccumulatorRegister = r3;
const Register kInterpreterBytecodeOffsetRegister = r15;
const Register kInterpreterBytecodeArrayRegister = r16;
const Register kInterpreterDispatchTableRegister = r17;
const Register kInterpreterTargetBytecodeRegister = r14;
const Register kJavaScriptCallArgCountRegister = r3;
const Register kJavaScriptCallNewTargetRegister = r6;
const Register kRuntimeCallFunctionRegister = r4;
......
......@@ -285,7 +285,8 @@ void InterpreterDispatchDescriptor::InitializePlatformSpecific(
CallInterfaceDescriptorData* data) {
Register registers[] = {
kInterpreterAccumulatorRegister, kInterpreterBytecodeOffsetRegister,
kInterpreterBytecodeArrayRegister, kInterpreterDispatchTableRegister};
kInterpreterBytecodeArrayRegister, kInterpreterDispatchTableRegister,
kInterpreterTargetBytecodeRegister};
data->InitializePlatformSpecific(arraysize(registers), registers);
}
......
......@@ -24,6 +24,7 @@ const Register kInterpreterAccumulatorRegister = r2;
const Register kInterpreterBytecodeOffsetRegister = r6;
const Register kInterpreterBytecodeArrayRegister = r7;
const Register kInterpreterDispatchTableRegister = r8;
const Register kInterpreterTargetBytecodeRegister = r5;
const Register kJavaScriptCallArgCountRegister = r2;
const Register kJavaScriptCallNewTargetRegister = r5;
const Register kRuntimeCallFunctionRegister = r3;
......
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