diff options
Diffstat (limited to 'deps/v8/src/compiler/backend/ppc')
-rw-r--r-- | deps/v8/src/compiler/backend/ppc/code-generator-ppc.cc | 38 | ||||
-rw-r--r-- | deps/v8/src/compiler/backend/ppc/instruction-selector-ppc.cc | 40 |
2 files changed, 43 insertions, 35 deletions
diff --git a/deps/v8/src/compiler/backend/ppc/code-generator-ppc.cc b/deps/v8/src/compiler/backend/ppc/code-generator-ppc.cc index 5289812cb5..5c69bc34a1 100644 --- a/deps/v8/src/compiler/backend/ppc/code-generator-ppc.cc +++ b/deps/v8/src/compiler/backend/ppc/code-generator-ppc.cc @@ -1024,13 +1024,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( Label start_call; bool isWasmCapiFunction = linkage()->GetIncomingDescriptor()->IsWasmCapiFunction(); - constexpr int offset = 12; + constexpr int offset = 9 * kInstrSize; if (isWasmCapiFunction) { - __ mflr(kScratchReg); + __ mflr(r0); __ bind(&start_call); - __ LoadPC(r0); - __ addi(r0, r0, Operand(offset)); - __ StoreP(r0, MemOperand(fp, WasmExitFrameConstants::kCallingPCOffset)); + __ LoadPC(kScratchReg); + __ addi(kScratchReg, kScratchReg, Operand(offset)); + __ StoreP(kScratchReg, + MemOperand(fp, WasmExitFrameConstants::kCallingPCOffset)); __ mtlr(r0); } if (instr->InputAt(0)->IsImmediate()) { @@ -1040,11 +1041,11 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( Register func = i.InputRegister(0); __ CallCFunction(func, num_parameters); } - // TODO(miladfar): In the above block, r0 must be populated with the - // strictly-correct PC, which is the return address at this spot. The - // offset is set to 12 right now, which is counted from where we are - // binding to the label and ends at this spot. If failed, replace it it - // with the correct offset suggested. More info on f5ab7d3. + // TODO(miladfar): In the above block, kScratchReg must be populated with + // the strictly-correct PC, which is the return address at this spot. The + // offset is set to 36 (9 * kInstrSize) right now, which is counted from + // where we are binding to the label and ends at this spot. If failed, + // replace it with the correct offset suggested. More info on f5ab7d3. if (isWasmCapiFunction) CHECK_EQ(offset, __ SizeOfCodeGeneratedSince(&start_call)); @@ -1104,10 +1105,9 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( DCHECK_EQ(LeaveRC, i.OutputRCBit()); break; case kArchDeoptimize: { - int deopt_state_id = + DeoptimizationExit* exit = BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore()); - CodeGenResult result = - AssembleDeoptimizerCall(deopt_state_id, current_source_position_); + CodeGenResult result = AssembleDeoptimizerCall(exit); if (result != kSuccess) return result; break; } @@ -1115,10 +1115,6 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( AssembleReturn(instr->InputAt(0)); DCHECK_EQ(LeaveRC, i.OutputRCBit()); break; - case kArchStackPointer: - __ mr(i.OutputRegister(), sp); - DCHECK_EQ(LeaveRC, i.OutputRCBit()); - break; case kArchFramePointer: __ mr(i.OutputRegister(), fp); DCHECK_EQ(LeaveRC, i.OutputRCBit()); @@ -1130,6 +1126,12 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( __ mr(i.OutputRegister(), fp); } break; + case kArchStackPointerGreaterThan: { + constexpr size_t kValueIndex = 0; + DCHECK(instr->InputAt(kValueIndex)->IsRegister()); + __ cmpl(sp, i.InputRegister(kValueIndex), cr0); + break; + } case kArchTruncateDoubleToI: __ TruncateDoubleToI(isolate(), zone(), i.OutputRegister(), i.InputDoubleRegister(0), DetermineStubCallMode()); @@ -2516,6 +2518,8 @@ void CodeGenerator::AssembleReturn(InstructionOperand* pop) { void CodeGenerator::FinishCode() {} +void CodeGenerator::PrepareForDeoptimizationExits(int deopt_count) {} + void CodeGenerator::AssembleMove(InstructionOperand* source, InstructionOperand* destination) { PPCOperandConverter g(this, nullptr); diff --git a/deps/v8/src/compiler/backend/ppc/instruction-selector-ppc.cc b/deps/v8/src/compiler/backend/ppc/instruction-selector-ppc.cc index bfc77b9412..ef8490a726 100644 --- a/deps/v8/src/compiler/backend/ppc/instruction-selector-ppc.cc +++ b/deps/v8/src/compiler/backend/ppc/instruction-selector-ppc.cc @@ -65,17 +65,6 @@ class PPCOperandGenerator final : public OperandGenerator { } return false; } - - // Use the stack pointer if the node is LoadStackPointer, otherwise assign a - // register. - InstructionOperand UseRegisterOrStackPointer(Node* node) { - if (node->opcode() == IrOpcode::kLoadStackPointer) { - return LocationOperand(LocationOperand::EXPLICIT, - LocationOperand::REGISTER, - MachineRepresentation::kWord32, sp.code()); - } - return UseRegister(node); - } }; namespace { @@ -267,7 +256,8 @@ void InstructionSelector::VisitStore(Node* node) { rep = store_rep.representation(); } - if (write_barrier_kind != kNoWriteBarrier) { + if (write_barrier_kind != kNoWriteBarrier && + V8_LIKELY(!FLAG_disable_write_barriers)) { DCHECK(CanBeTaggedPointer(rep)); AddressingMode addressing_mode; InstructionOperand inputs[3]; @@ -558,6 +548,15 @@ void InstructionSelector::VisitWord32Xor(Node* node) { } } +void InstructionSelector::VisitStackPointerGreaterThan( + Node* node, FlagsContinuation* cont) { + Node* const value = node->InputAt(0); + InstructionCode opcode = kArchStackPointerGreaterThan; + + PPCOperandGenerator g(this); + EmitWithContinuation(opcode, g.UseRegister(value), cont); +} + #if V8_TARGET_ARCH_PPC64 void InstructionSelector::VisitWord64Xor(Node* node) { PPCOperandGenerator g(this); @@ -1456,15 +1455,15 @@ void VisitWordCompare(InstructionSelector* selector, Node* node, // Match immediates on left or right side of comparison. if (g.CanBeImmediate(right, immediate_mode)) { - VisitCompare(selector, opcode, g.UseRegisterOrStackPointer(left), - g.UseImmediate(right), cont); + VisitCompare(selector, opcode, g.UseRegister(left), g.UseImmediate(right), + cont); } else if (g.CanBeImmediate(left, immediate_mode)) { if (!commutative) cont->Commute(); - VisitCompare(selector, opcode, g.UseRegisterOrStackPointer(right), - g.UseImmediate(left), cont); + VisitCompare(selector, opcode, g.UseRegister(right), g.UseImmediate(left), + cont); } else { - VisitCompare(selector, opcode, g.UseRegisterOrStackPointer(left), - g.UseRegisterOrStackPointer(right), cont); + VisitCompare(selector, opcode, g.UseRegister(left), g.UseRegister(right), + cont); } } @@ -1639,6 +1638,9 @@ void InstructionSelector::VisitWordCompareZero(Node* user, Node* value, // case IrOpcode::kWord64Shr: // case IrOpcode::kWord64Ror: #endif + case IrOpcode::kStackPointerGreaterThan: + cont->OverwriteAndNegateIfEqual(kStackPointerGreaterThanCondition); + return VisitStackPointerGreaterThan(value, cont); default: break; } @@ -2281,6 +2283,8 @@ void InstructionSelector::VisitF32x4Sub(Node* node) { UNIMPLEMENTED(); } void InstructionSelector::VisitF32x4Mul(Node* node) { UNIMPLEMENTED(); } +void InstructionSelector::VisitF32x4Div(Node* node) { UNIMPLEMENTED(); } + void InstructionSelector::VisitF32x4Min(Node* node) { UNIMPLEMENTED(); } void InstructionSelector::VisitF32x4Max(Node* node) { UNIMPLEMENTED(); } |