diff options
author | Michaël Zasso <targos@protonmail.com> | 2021-09-17 14:34:02 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2021-10-02 08:40:27 +0200 |
commit | 4f722915218862b108c90371503d26a3fe89f4c9 (patch) | |
tree | cd1577faff9acc20eb8e4a0e2d6ed1856bf308fd /deps/v8/src/codegen/mips64/assembler-mips64.cc | |
parent | 606bb521591a29df5401732bfbd19c1e31239ed9 (diff) | |
download | node-new-4f722915218862b108c90371503d26a3fe89f4c9.tar.gz |
deps: update V8 to 9.4.146.18
PR-URL: https://github.com/nodejs/node/pull/39945
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Diffstat (limited to 'deps/v8/src/codegen/mips64/assembler-mips64.cc')
-rw-r--r-- | deps/v8/src/codegen/mips64/assembler-mips64.cc | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/deps/v8/src/codegen/mips64/assembler-mips64.cc b/deps/v8/src/codegen/mips64/assembler-mips64.cc index 73fbe4ce4d..0379cd65ce 100644 --- a/deps/v8/src/codegen/mips64/assembler-mips64.cc +++ b/deps/v8/src/codegen/mips64/assembler-mips64.cc @@ -3736,7 +3736,27 @@ int Assembler::RelocateInternalReference(RelocInfo::Mode rmode, Address pc, } } +void Assembler::FixOnHeapReferences(bool update_embedded_objects) { + if (!update_embedded_objects) return; + for (auto p : saved_handles_for_raw_object_ptr_) { + Address address = reinterpret_cast<Address>(buffer_->start() + p.first); + Handle<HeapObject> object(reinterpret_cast<Address*>(p.second)); + set_target_value_at(address, object->ptr()); + } +} + +void Assembler::FixOnHeapReferencesToHandles() { + for (auto p : saved_handles_for_raw_object_ptr_) { + Address address = reinterpret_cast<Address>(buffer_->start() + p.first); + set_target_value_at(address, p.second); + } + saved_handles_for_raw_object_ptr_.clear(); +} + void Assembler::GrowBuffer() { + bool previously_on_heap = buffer_->IsOnHeap(); + int previous_on_heap_gc_count = OnHeapGCCount(); + // Compute new buffer size. int old_size = buffer_->size(); int new_size = std::min(2 * old_size, old_size + 1 * MB); @@ -3778,6 +3798,16 @@ void Assembler::GrowBuffer() { RelocateInternalReference(rmode, it.rinfo()->pc(), pc_delta); } } + + // Fix on-heap references. + if (previously_on_heap) { + if (buffer_->IsOnHeap()) { + FixOnHeapReferences(previous_on_heap_gc_count != OnHeapGCCount()); + } else { + FixOnHeapReferencesToHandles(); + } + } + DCHECK(!overflow()); } @@ -3790,7 +3820,8 @@ void Assembler::db(uint8_t data) { void Assembler::dd(uint32_t data, RelocInfo::Mode rmode) { CheckForEmitInForbiddenSlot(); if (!RelocInfo::IsNone(rmode)) { - DCHECK(RelocInfo::IsDataEmbeddedObject(rmode)); + DCHECK(RelocInfo::IsDataEmbeddedObject(rmode) || + RelocInfo::IsLiteralConstant(rmode)); RecordRelocInfo(rmode); } *reinterpret_cast<uint32_t*>(pc_) = data; @@ -3800,7 +3831,8 @@ void Assembler::dd(uint32_t data, RelocInfo::Mode rmode) { void Assembler::dq(uint64_t data, RelocInfo::Mode rmode) { CheckForEmitInForbiddenSlot(); if (!RelocInfo::IsNone(rmode)) { - DCHECK(RelocInfo::IsDataEmbeddedObject(rmode)); + DCHECK(RelocInfo::IsDataEmbeddedObject(rmode) || + RelocInfo::IsLiteralConstant(rmode)); RecordRelocInfo(rmode); } *reinterpret_cast<uint64_t*>(pc_) = data; |