diff options
author | Michaël Zasso <targos@protonmail.com> | 2020-10-15 20:17:08 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2020-10-18 20:16:47 +0200 |
commit | a1d639ba5de4ff34e34fb575fbb6cc1d41ec3cce (patch) | |
tree | abc7d41c12f1495b1208fa4449cb2508c92c5e85 /deps/v8/src/codegen/mips64 | |
parent | 089d654dd85f8e548597329f60a41d6029260caa (diff) | |
download | node-new-a1d639ba5de4ff34e34fb575fbb6cc1d41ec3cce.tar.gz |
deps: update V8 to 8.6.395
PR-URL: https://github.com/nodejs/node/pull/35415
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'deps/v8/src/codegen/mips64')
4 files changed, 76 insertions, 35 deletions
diff --git a/deps/v8/src/codegen/mips64/assembler-mips64.cc b/deps/v8/src/codegen/mips64/assembler-mips64.cc index 751d0f8703..b64005155d 100644 --- a/deps/v8/src/codegen/mips64/assembler-mips64.cc +++ b/deps/v8/src/codegen/mips64/assembler-mips64.cc @@ -3596,7 +3596,7 @@ void Assembler::insve_d(MSARegister wd, uint32_t n, MSARegister ws) { } void Assembler::move_v(MSARegister wd, MSARegister ws) { - DCHECK((kArchVariant == kMips64r6) && IsEnabled(MIPS_SIMD)); + DCHECK(IsEnabled(MIPS_SIMD)); DCHECK(ws.is_valid() && wd.is_valid()); Instr instr = MSA | MOVE_V | (ws.code() << kWsShift) | (wd.code() << kWdShift) | MSA_ELM_MINOR; @@ -3604,7 +3604,7 @@ void Assembler::move_v(MSARegister wd, MSARegister ws) { } void Assembler::ctcmsa(MSAControlRegister cd, Register rs) { - DCHECK((kArchVariant == kMips64r6) && IsEnabled(MIPS_SIMD)); + DCHECK(IsEnabled(MIPS_SIMD)); DCHECK(cd.is_valid() && rs.is_valid()); Instr instr = MSA | CTCMSA | (rs.code() << kWsShift) | (cd.code() << kWdShift) | MSA_ELM_MINOR; @@ -3612,7 +3612,7 @@ void Assembler::ctcmsa(MSAControlRegister cd, Register rs) { } void Assembler::cfcmsa(Register rd, MSAControlRegister cs) { - DCHECK((kArchVariant == kMips64r6) && IsEnabled(MIPS_SIMD)); + DCHECK(IsEnabled(MIPS_SIMD)); DCHECK(rd.is_valid() && cs.is_valid()); Instr instr = MSA | CFCMSA | (cs.code() << kWsShift) | (rd.code() << kWdShift) | MSA_ELM_MINOR; @@ -3763,17 +3763,20 @@ void Assembler::GrowBuffer() { void Assembler::db(uint8_t data) { CheckForEmitInForbiddenSlot(); - EmitHelper(data); + *reinterpret_cast<uint8_t*>(pc_) = data; + pc_ += sizeof(uint8_t); } void Assembler::dd(uint32_t data) { CheckForEmitInForbiddenSlot(); - EmitHelper(data); + *reinterpret_cast<uint32_t*>(pc_) = data; + pc_ += sizeof(uint32_t); } void Assembler::dq(uint64_t data) { CheckForEmitInForbiddenSlot(); - EmitHelper(data); + *reinterpret_cast<uint64_t*>(pc_) = data; + pc_ += sizeof(uint64_t); } void Assembler::dd(Label* label) { @@ -3856,8 +3859,12 @@ void Assembler::CheckTrampolinePool() { } } nop(); - bind(&after_pool); + // If unbound_labels_count_ is big enough, label after_pool will + // need a trampoline too, so we must create the trampoline before + // the bind operation to make sure function 'bind' can get this + // information. trampoline_ = Trampoline(pool_start, unbound_labels_count_); + bind(&after_pool); trampoline_emitted_ = true; // As we are only going to emit trampoline once, we need to prevent any diff --git a/deps/v8/src/codegen/mips64/assembler-mips64.h b/deps/v8/src/codegen/mips64/assembler-mips64.h index f70e46f81b..b5edc75676 100644 --- a/deps/v8/src/codegen/mips64/assembler-mips64.h +++ b/deps/v8/src/codegen/mips64/assembler-mips64.h @@ -168,6 +168,35 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase { // Unused on this architecture. void MaybeEmitOutOfLineConstantPool() {} + // Mips uses BlockTrampolinePool to prevent generating trampoline inside a + // continuous instruction block. For Call instruction, it prevents generating + // trampoline between jalr and delay slot instruction. In the destructor of + // BlockTrampolinePool, it must check if it needs to generate trampoline + // immediately, if it does not do this, the branch range will go beyond the + // max branch offset, that means the pc_offset after call CheckTrampolinePool + // may be not the Call instruction's location. So we use last_call_pc here for + // safepoint record. + int pc_offset_for_safepoint() { +#ifdef DEBUG + Instr instr1 = + instr_at(static_cast<int>(last_call_pc_ - buffer_start_ - kInstrSize)); + Instr instr2 = instr_at( + static_cast<int>(last_call_pc_ - buffer_start_ - kInstrSize * 2)); + if (GetOpcodeField(instr1) != SPECIAL) { // instr1 == jialc. + DCHECK((kArchVariant == kMips64r6) && GetOpcodeField(instr1) == POP76 && + GetRs(instr1) == 0); + } else { + if (GetFunctionField(instr1) == SLL) { // instr1 == nop, instr2 == jalr. + DCHECK(GetOpcodeField(instr2) == SPECIAL && + GetFunctionField(instr2) == JALR); + } else { // instr1 == jalr. + DCHECK(GetFunctionField(instr1) == JALR); + } + } +#endif + return static_cast<int>(last_call_pc_ - buffer_start_); + } + // Label operations & relative jumps (PPUM Appendix D). // // Takes a branch opcode (cc) and a label (L) and generates @@ -1629,6 +1658,8 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase { } } + void set_last_call_pc_(byte* pc) { last_call_pc_ = pc; } + private: // Avoid overflows for displacements etc. static const int kMaximalBufferSize = 512 * MB; @@ -1882,6 +1913,11 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase { Trampoline trampoline_; bool internal_trampoline_exception_; + // Keep track of the last Call's position to ensure that safepoint can get the + // correct information even if there is a trampoline immediately after the + // Call. + byte* last_call_pc_; + RegList scratch_register_list_; private: diff --git a/deps/v8/src/codegen/mips64/interface-descriptors-mips64.cc b/deps/v8/src/codegen/mips64/interface-descriptors-mips64.cc index 077b49fa99..9e33d39eba 100644 --- a/deps/v8/src/codegen/mips64/interface-descriptors-mips64.cc +++ b/deps/v8/src/codegen/mips64/interface-descriptors-mips64.cc @@ -39,14 +39,6 @@ void WasmI32AtomicWait32Descriptor::InitializePlatformSpecific( data->InitializePlatformSpecific(kParameterCount, default_stub_registers); } -void WasmI32AtomicWait64Descriptor::InitializePlatformSpecific( - CallInterfaceDescriptorData* data) { - const Register default_stub_registers[] = {a0, a1, a2}; - CHECK_EQ(static_cast<size_t>(kParameterCount), - arraysize(default_stub_registers)); - data->InitializePlatformSpecific(kParameterCount, default_stub_registers); -} - void WasmI64AtomicWait32Descriptor::InitializePlatformSpecific( CallInterfaceDescriptorData* data) { const Register default_stub_registers[] = {a0, a1, a2, a3, a4}; @@ -56,14 +48,6 @@ void WasmI64AtomicWait32Descriptor::InitializePlatformSpecific( default_stub_registers); } -void WasmI64AtomicWait64Descriptor::InitializePlatformSpecific( - CallInterfaceDescriptorData* data) { - const Register default_stub_registers[] = {a0, a1, a2}; - CHECK_EQ(static_cast<size_t>(kParameterCount), - arraysize(default_stub_registers)); - data->InitializePlatformSpecific(kParameterCount, default_stub_registers); -} - void RecordWriteDescriptor::InitializePlatformSpecific( CallInterfaceDescriptorData* data) { const Register default_stub_registers[] = {a0, a1, a2, a3, kReturnRegister0}; @@ -88,11 +72,6 @@ void EphemeronKeyBarrierDescriptor::InitializePlatformSpecific( data->InitializePlatformSpecific(kParameterCount, default_stub_registers); } -const Register FastNewFunctionContextDescriptor::ScopeInfoRegister() { - return a1; -} -const Register FastNewFunctionContextDescriptor::SlotsRegister() { return a0; } - const Register LoadDescriptor::ReceiverRegister() { return a1; } const Register LoadDescriptor::NameRegister() { return a2; } const Register LoadDescriptor::SlotRegister() { return a0; } @@ -233,12 +212,6 @@ void AbortDescriptor::InitializePlatformSpecific( data->InitializePlatformSpecific(arraysize(registers), registers); } -void AllocateHeapNumberDescriptor::InitializePlatformSpecific( - CallInterfaceDescriptorData* data) { - // register state - data->InitializePlatformSpecific(0, nullptr); -} - void CompareDescriptor::InitializePlatformSpecific( CallInterfaceDescriptorData* data) { Register registers[] = {a1, a0}; @@ -338,6 +311,30 @@ void CallTrampoline_WithFeedbackDescriptor::InitializePlatformSpecific( DefaultInitializePlatformSpecific(data, 4); } +void CallWithArrayLike_WithFeedbackDescriptor::InitializePlatformSpecific( + CallInterfaceDescriptorData* data) { + // TODO(v8:8888): Implement on this platform. + DefaultInitializePlatformSpecific(data, 4); +} + +void CallWithSpread_WithFeedbackDescriptor::InitializePlatformSpecific( + CallInterfaceDescriptorData* data) { + // TODO(v8:8888): Implement on this platform. + DefaultInitializePlatformSpecific(data, 4); +} + +void ConstructWithArrayLike_WithFeedbackDescriptor::InitializePlatformSpecific( + CallInterfaceDescriptorData* data) { + // TODO(v8:8888): Implement on this platform. + DefaultInitializePlatformSpecific(data, 4); +} + +void ConstructWithSpread_WithFeedbackDescriptor::InitializePlatformSpecific( + CallInterfaceDescriptorData* data) { + // TODO(v8:8888): Implement on this platform. + DefaultInitializePlatformSpecific(data, 4); +} + void Compare_WithFeedbackDescriptor::InitializePlatformSpecific( CallInterfaceDescriptorData* data) { // TODO(v8:8888): Implement on this platform. diff --git a/deps/v8/src/codegen/mips64/macro-assembler-mips64.cc b/deps/v8/src/codegen/mips64/macro-assembler-mips64.cc index a665b76e80..785cf4aa5c 100644 --- a/deps/v8/src/codegen/mips64/macro-assembler-mips64.cc +++ b/deps/v8/src/codegen/mips64/macro-assembler-mips64.cc @@ -4235,6 +4235,7 @@ void TurboAssembler::Call(Register target, Condition cond, Register rs, // Emit a nop in the branch delay slot if required. if (bd == PROTECT) nop(); } + set_last_call_pc_(pc_); } void MacroAssembler::JumpIfIsInRange(Register value, unsigned lower_limit, @@ -5753,7 +5754,7 @@ void TurboAssembler::CallCFunctionHelper(Register function, void TurboAssembler::CheckPageFlag(Register object, Register scratch, int mask, Condition cc, Label* condition_met) { And(scratch, object, Operand(~kPageAlignmentMask)); - Ld(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset)); + Ld(scratch, MemOperand(scratch, BasicMemoryChunk::kFlagsOffset)); And(scratch, scratch, Operand(mask)); Branch(condition_met, cc, scratch, Operand(zero_reg)); } |