diff options
author | Ujjwal Sharma <usharma1998@gmail.com> | 2019-03-15 18:35:06 +0530 |
---|---|---|
committer | Refael Ackermann <refack@gmail.com> | 2019-03-28 16:36:18 -0400 |
commit | f579e1194046c50f2e6bb54348d48c8e7d1a53cf (patch) | |
tree | 9125787c758358365f74f9fd9673c14f57e67870 /deps/v8/src/compiler/backend/ppc | |
parent | 2c73868b0471fbd4038f500d076df056cbf697fe (diff) | |
download | android-node-v8-f579e1194046c50f2e6bb54348d48c8e7d1a53cf.tar.gz android-node-v8-f579e1194046c50f2e6bb54348d48c8e7d1a53cf.tar.bz2 android-node-v8-f579e1194046c50f2e6bb54348d48c8e7d1a53cf.zip |
deps: update V8 to 7.4.288.13
PR-URL: https://github.com/nodejs/node/pull/26685
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'deps/v8/src/compiler/backend/ppc')
4 files changed, 59 insertions, 30 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 b74834df17..b861c3d026 100644 --- a/deps/v8/src/compiler/backend/ppc/code-generator-ppc.cc +++ b/deps/v8/src/compiler/backend/ppc/code-generator-ppc.cc @@ -11,6 +11,7 @@ #include "src/compiler/node-matchers.h" #include "src/compiler/osr.h" #include "src/double.h" +#include "src/heap/heap-inl.h" // crbug.com/v8/8499 #include "src/macro-assembler.h" #include "src/optimized-compilation-info.h" #include "src/wasm/wasm-code-manager.h" @@ -1154,6 +1155,24 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( __ and_(i.OutputRegister(), i.InputRegister(0), kSpeculationPoisonRegister); break; + case kPPC_Peek: { + // The incoming value is 0-based, but we need a 1-based value. + int reverse_slot = i.InputInt32(0) + 1; + int offset = + FrameSlotToFPOffset(frame()->GetTotalFrameSlotCount() - reverse_slot); + if (instr->OutputAt(0)->IsFPRegister()) { + LocationOperand* op = LocationOperand::cast(instr->OutputAt(0)); + if (op->representation() == MachineRepresentation::kFloat64) { + __ LoadDouble(i.OutputDoubleRegister(), MemOperand(fp, offset), r0); + } else { + DCHECK_EQ(MachineRepresentation::kFloat32, op->representation()); + __ LoadFloat32(i.OutputFloatRegister(), MemOperand(fp, offset), r0); + } + } else { + __ LoadP(i.OutputRegister(), MemOperand(fp, offset), r0); + } + break; + } case kPPC_And: if (HasRegisterInput(instr, 1)) { __ and_(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1), @@ -1554,11 +1573,9 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( case kIeee754Float64Log10: ASSEMBLE_IEEE754_UNOP(log10); break; - case kIeee754Float64Pow: { - __ Call(BUILTIN_CODE(isolate(), MathPowInternal), RelocInfo::CODE_TARGET); - __ Move(d1, d3); + case kIeee754Float64Pow: + ASSEMBLE_IEEE754_BINOP(pow); break; - } case kPPC_Neg: __ neg(i.OutputRegister(), i.InputRegister(0), LeaveOE, i.OutputRCBit()); break; @@ -2324,8 +2341,8 @@ void CodeGenerator::AssembleConstructFrame() { } } - int shrink_slots = frame()->GetTotalFrameSlotCount() - - call_descriptor->CalculateFixedFrameSize(); + int required_slots = frame()->GetTotalFrameSlotCount() - + call_descriptor->CalculateFixedFrameSize(); if (info()->is_osr()) { // TurboFan OSR-compiled functions cannot be entered directly. __ Abort(AbortReason::kShouldNotDirectlyEnterOsrFunction); @@ -2336,7 +2353,7 @@ void CodeGenerator::AssembleConstructFrame() { // remaining stack slots. if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); osr_pc_offset_ = __ pc_offset(); - shrink_slots -= osr_helper()->UnoptimizedFrameSlots(); + required_slots -= osr_helper()->UnoptimizedFrameSlots(); ResetSpeculationPoison(); } @@ -2346,8 +2363,8 @@ void CodeGenerator::AssembleConstructFrame() { ~kConstantPoolRegister.bit() : call_descriptor->CalleeSavedRegisters(); - if (shrink_slots > 0) { - if (info()->IsWasm() && shrink_slots > 128) { + if (required_slots > 0) { + if (info()->IsWasm() && required_slots > 128) { // For WebAssembly functions with big frames we have to do the stack // overflow check before we construct the frame. Otherwise we may not // have enough space on the stack to call the runtime for the stack @@ -2357,24 +2374,19 @@ void CodeGenerator::AssembleConstructFrame() { // If the frame is bigger than the stack, we throw the stack overflow // exception unconditionally. Thereby we can avoid the integer overflow // check in the condition code. - if ((shrink_slots * kSystemPointerSize) < (FLAG_stack_size * 1024)) { + if ((required_slots * kSystemPointerSize) < (FLAG_stack_size * 1024)) { Register scratch = ip; __ LoadP( scratch, FieldMemOperand(kWasmInstanceRegister, WasmInstanceObject::kRealStackLimitAddressOffset)); __ LoadP(scratch, MemOperand(scratch), r0); - __ Add(scratch, scratch, shrink_slots * kSystemPointerSize, r0); + __ Add(scratch, scratch, required_slots * kSystemPointerSize, r0); __ cmpl(sp, scratch); __ bge(&done); } - __ LoadP(r5, - FieldMemOperand(kWasmInstanceRegister, - WasmInstanceObject::kCEntryStubOffset), - r0); - __ Move(cp, Smi::zero()); - __ CallRuntimeWithCEntry(Runtime::kThrowWasmStackOverflow, r5); + __ Call(wasm::WasmCode::kWasmStackOverflow, RelocInfo::WASM_STUB_CALL); // We come from WebAssembly, there are no references for the GC. ReferenceMap* reference_map = new (zone()) ReferenceMap(zone()); RecordSafepoint(reference_map, Safepoint::kSimple, @@ -2387,11 +2399,11 @@ void CodeGenerator::AssembleConstructFrame() { } // Skip callee-saved and return slots, which are pushed below. - shrink_slots -= base::bits::CountPopulation(saves); - shrink_slots -= frame()->GetReturnSlotCount(); - shrink_slots -= (kDoubleSize / kSystemPointerSize) * - base::bits::CountPopulation(saves_fp); - __ Add(sp, sp, -shrink_slots * kSystemPointerSize, r0); + required_slots -= base::bits::CountPopulation(saves); + required_slots -= frame()->GetReturnSlotCount(); + required_slots -= (kDoubleSize / kSystemPointerSize) * + base::bits::CountPopulation(saves_fp); + __ Add(sp, sp, -required_slots * kSystemPointerSize, r0); } // Save callee-saved Double registers. @@ -2469,7 +2481,7 @@ void CodeGenerator::AssembleReturn(InstructionOperand* pop) { __ Ret(); } -void CodeGenerator::FinishCode() { __ EmitConstantPool(); } +void CodeGenerator::FinishCode() {} void CodeGenerator::AssembleMove(InstructionOperand* source, InstructionOperand* destination) { diff --git a/deps/v8/src/compiler/backend/ppc/instruction-codes-ppc.h b/deps/v8/src/compiler/backend/ppc/instruction-codes-ppc.h index 1c241711b9..8491acba4b 100644 --- a/deps/v8/src/compiler/backend/ppc/instruction-codes-ppc.h +++ b/deps/v8/src/compiler/backend/ppc/instruction-codes-ppc.h @@ -12,6 +12,7 @@ namespace compiler { // PPC-specific opcodes that specify which assembly sequence to emit. // Most opcodes specify a single instruction. #define TARGET_ARCH_OPCODE_LIST(V) \ + V(PPC_Peek) \ V(PPC_And) \ V(PPC_AndComplement) \ V(PPC_Or) \ diff --git a/deps/v8/src/compiler/backend/ppc/instruction-scheduler-ppc.cc b/deps/v8/src/compiler/backend/ppc/instruction-scheduler-ppc.cc index 423dd7ac99..7ed0d1d585 100644 --- a/deps/v8/src/compiler/backend/ppc/instruction-scheduler-ppc.cc +++ b/deps/v8/src/compiler/backend/ppc/instruction-scheduler-ppc.cc @@ -121,6 +121,11 @@ int InstructionScheduler::GetTargetInstructionFlags( case kPPC_LoadWord64: case kPPC_LoadFloat32: case kPPC_LoadDouble: + case kPPC_AtomicLoadUint8: + case kPPC_AtomicLoadUint16: + case kPPC_AtomicLoadWord32: + case kPPC_AtomicLoadWord64: + case kPPC_Peek: return kIsLoadOperation; case kPPC_StoreWord8: @@ -134,12 +139,6 @@ int InstructionScheduler::GetTargetInstructionFlags( case kPPC_StoreToStackSlot: return kHasSideEffect; - case kPPC_AtomicLoadUint8: - case kPPC_AtomicLoadUint16: - case kPPC_AtomicLoadWord32: - case kPPC_AtomicLoadWord64: - return kIsLoadOperation; - case kPPC_AtomicStoreUint8: case kPPC_AtomicStoreUint16: case kPPC_AtomicStoreWord32: 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 9dcae4d465..d5b93e86d0 100644 --- a/deps/v8/src/compiler/backend/ppc/instruction-selector-ppc.cc +++ b/deps/v8/src/compiler/backend/ppc/instruction-selector-ppc.cc @@ -2232,7 +2232,24 @@ void InstructionSelector::VisitF32x4ReplaceLane(Node* node) { UNIMPLEMENTED(); } void InstructionSelector::EmitPrepareResults( ZoneVector<PushParameter>* results, const CallDescriptor* call_descriptor, Node* node) { - // TODO(John): Port. + PPCOperandGenerator g(this); + + int reverse_slot = 0; + for (PushParameter output : *results) { + if (!output.location.IsCallerFrameSlot()) continue; + // Skip any alignment holes in nodes. + if (output.node != nullptr) { + DCHECK(!call_descriptor->IsCFunctionCall()); + if (output.location.GetType() == MachineType::Float32()) { + MarkAsFloat32(output.node); + } else if (output.location.GetType() == MachineType::Float64()) { + MarkAsFloat64(output.node); + } + Emit(kPPC_Peek, g.DefineAsRegister(output.node), + g.UseImmediate(reverse_slot)); + } + reverse_slot += output.location.GetSizeInPointers(); + } } void InstructionSelector::VisitF32x4Add(Node* node) { UNIMPLEMENTED(); } |