Commit b237b8a7 authored by mbrandy's avatar mbrandy Committed by Commit bot

PPC: [turbofan] Fix trampoline pool blocking.

R=joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com, dstence@us.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#31950}
parent 50d83f90
...@@ -621,6 +621,8 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { ...@@ -621,6 +621,8 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
switch (opcode) { switch (opcode) {
case kArchCallCodeObject: { case kArchCallCodeObject: {
v8::internal::Assembler::BlockTrampolinePoolScope block_trampoline_pool(
masm());
EnsureSpaceForLazyDeopt(); EnsureSpaceForLazyDeopt();
if (HasRegisterInput(instr, 0)) { if (HasRegisterInput(instr, 0)) {
__ addi(ip, i.InputRegister(0), __ addi(ip, i.InputRegister(0),
...@@ -651,6 +653,8 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { ...@@ -651,6 +653,8 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
break; break;
} }
case kArchCallJSFunction: { case kArchCallJSFunction: {
v8::internal::Assembler::BlockTrampolinePoolScope block_trampoline_pool(
masm());
EnsureSpaceForLazyDeopt(); EnsureSpaceForLazyDeopt();
Register func = i.InputRegister(0); Register func = i.InputRegister(0);
if (FLAG_debug_code) { if (FLAG_debug_code) {
...@@ -682,6 +686,8 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { ...@@ -682,6 +686,8 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
break; break;
} }
case kArchLazyBailout: { case kArchLazyBailout: {
v8::internal::Assembler::BlockTrampolinePoolScope block_trampoline_pool(
masm());
EnsureSpaceForLazyDeopt(); EnsureSpaceForLazyDeopt();
RecordCallPosition(instr); RecordCallPosition(instr);
break; break;
...@@ -1707,6 +1713,9 @@ void CodeGenerator::EnsureSpaceForLazyDeopt() { ...@@ -1707,6 +1713,9 @@ void CodeGenerator::EnsureSpaceForLazyDeopt() {
// instruction for patching the code here. // instruction for patching the code here.
int current_pc = masm()->pc_offset(); int current_pc = masm()->pc_offset();
if (current_pc < last_lazy_deopt_pc_ + space_needed) { if (current_pc < last_lazy_deopt_pc_ + space_needed) {
// Block tramoline pool emission for duration of padding.
v8::internal::Assembler::BlockTrampolinePoolScope block_trampoline_pool(
masm());
int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
DCHECK_EQ(0, padding_size % v8::internal::Assembler::kInstrSize); DCHECK_EQ(0, padding_size % v8::internal::Assembler::kInstrSize);
while (padding_size > 0) { while (padding_size > 0) {
......
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