From 6cdd310275bb0f8056aa0ae6d95614e9ca5b70c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Wed, 14 Jul 2021 11:30:07 +0200 Subject: deps: update V8 to 9.2.230.21 PR-URL: https://github.com/nodejs/node/pull/38990 Reviewed-By: Jiawen Geng Reviewed-By: Matteo Collina Reviewed-By: Robert Nagy Reviewed-By: Colin Ihrig --- .../v8/src/codegen/riscv64/assembler-riscv64-inl.h | 32 +++++++++++++++++----- 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'deps/v8/src/codegen/riscv64/assembler-riscv64-inl.h') diff --git a/deps/v8/src/codegen/riscv64/assembler-riscv64-inl.h b/deps/v8/src/codegen/riscv64/assembler-riscv64-inl.h index 40bd56d15b..d301a00bf4 100644 --- a/deps/v8/src/codegen/riscv64/assembler-riscv64-inl.h +++ b/deps/v8/src/codegen/riscv64/assembler-riscv64-inl.h @@ -63,11 +63,15 @@ void RelocInfo::apply(intptr_t delta) { if (IsInternalReference(rmode_) || IsInternalReferenceEncoded(rmode_)) { // Absolute code pointer inside code object moves with the code object. Assembler::RelocateInternalReference(rmode_, pc_, delta); + } else { + DCHECK(IsRelativeCodeTarget(rmode_)); + Assembler::RelocateRelativeReference(rmode_, pc_, delta); } } Address RelocInfo::target_address() { - DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || IsWasmCall(rmode_)); + DCHECK(IsCodeTargetMode(rmode_) || IsRuntimeEntry(rmode_) || + IsWasmCall(rmode_)); return Assembler::target_address_at(pc_, constant_pool_); } @@ -133,9 +137,13 @@ HeapObject RelocInfo::target_object_no_host(Isolate* isolate) { } Handle RelocInfo::target_object_handle(Assembler* origin) { - DCHECK(IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_)); - return Handle(reinterpret_cast( - Assembler::target_address_at(pc_, constant_pool_))); + if (IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_)) { + return Handle(reinterpret_cast( + Assembler::target_address_at(pc_, constant_pool_))); + } else { + DCHECK(IsRelativeCodeTarget(rmode_)); + return origin->relative_code_target_object_handle_at(pc_); + } } void RelocInfo::set_target_object(Heap* heap, HeapObject target, @@ -163,11 +171,11 @@ void RelocInfo::set_target_external_reference( } Address RelocInfo::target_internal_reference() { - if (rmode_ == INTERNAL_REFERENCE) { + if (IsInternalReference(rmode_)) { return Memory
(pc_); } else { // Encoded internal references are j/jal instructions. - DCHECK(rmode_ == INTERNAL_REFERENCE_ENCODED); + DCHECK(IsInternalReferenceEncoded(rmode_)); DCHECK(Assembler::IsLui(Assembler::instr_at(pc_ + 0 * kInstrSize))); Address address = Assembler::target_address_at(pc_); return address; @@ -175,10 +183,20 @@ Address RelocInfo::target_internal_reference() { } Address RelocInfo::target_internal_reference_address() { - DCHECK(rmode_ == INTERNAL_REFERENCE || rmode_ == INTERNAL_REFERENCE_ENCODED); + DCHECK(IsInternalReference(rmode_) || IsInternalReferenceEncoded(rmode_)); return pc_; } +Handle Assembler::relative_code_target_object_handle_at( + Address pc) const { + Instr instr1 = Assembler::instr_at(pc); + Instr instr2 = Assembler::instr_at(pc + kInstrSize); + DCHECK(IsAuipc(instr1)); + DCHECK(IsJalr(instr2)); + int32_t code_target_index = BrachlongOffset(instr1, instr2); + return GetCodeTarget(code_target_index); +} + Address RelocInfo::target_runtime_entry(Assembler* origin) { DCHECK(IsRuntimeEntry(rmode_)); return target_address(); -- cgit v1.2.1