From e043a7453ea5c4bf5b04130a5e3b1c86a36ab181 Mon Sep 17 00:00:00 2001 From: Alexander Markov Date: Tue, 9 Jun 2026 10:29:39 -0700 Subject: [PATCH] [vm] Cleanup unused UntaggedPcDescriptors::kBSSRelocation TEST=ci Change-Id: Ifd926f3bd3630b80c9659dbe60892c3c229bf838 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/510400 Reviewed-by: Ryan Macnak Commit-Queue: Alexander Markov --- runtime/vm/code_descriptors.cc | 4 +--- runtime/vm/image_snapshot.cc | 33 +-------------------------------- runtime/vm/object.cc | 2 -- runtime/vm/raw_object.h | 4 +--- 4 files changed, 3 insertions(+), 40 deletions(-) diff --git a/runtime/vm/code_descriptors.cc b/runtime/vm/code_descriptors.cc index 2951a3f4e37..44a1fe04785 100644 --- a/runtime/vm/code_descriptors.cc +++ b/runtime/vm/code_descriptors.cc @@ -40,7 +40,6 @@ void DescriptorList::AddDescriptor(UntaggedPcDescriptors::Kind kind, RELEASE_ASSERT(yield_index != 0); ASSERT((kind == UntaggedPcDescriptors::kRuntimeCall) || - (kind == UntaggedPcDescriptors::kBSSRelocation) || (kind == UntaggedPcDescriptors::kOther) || (yield_index != UntaggedPcDescriptors::kInvalidYieldIndex) || (deopt_id != DeoptId::kNone)); @@ -48,8 +47,7 @@ void DescriptorList::AddDescriptor(UntaggedPcDescriptors::Kind kind, // When precompiling, we only use pc descriptors for exceptions, // relocations and yield indices. if (!FLAG_precompiled_mode || try_index != -1 || - yield_index != UntaggedPcDescriptors::kInvalidYieldIndex || - kind == UntaggedPcDescriptors::kBSSRelocation) { + yield_index != UntaggedPcDescriptors::kInvalidYieldIndex) { const int32_t kind_and_metadata = UntaggedPcDescriptors::KindAndMetadata::Encode(kind, try_index, yield_index); diff --git a/runtime/vm/image_snapshot.cc b/runtime/vm/image_snapshot.cc index 1a29c7a1988..4fbf025428a 100644 --- a/runtime/vm/image_snapshot.cc +++ b/runtime/vm/image_snapshot.cc @@ -867,10 +867,6 @@ void ImageWriter::WriteText(bool vm) { FrameUnwindPrologue(); #endif -#if defined(DART_PRECOMPILER) - PcDescriptors& descriptors = PcDescriptors::Handle(zone_); -#endif - // We don't expect more than 64 bytes of padding. uint8_t padding_bytes[64]; memset(&padding_bytes[0], 0, sizeof(padding_bytes)); @@ -959,34 +955,7 @@ void ImageWriter::WriteText(bool vm) { // target-sized words starting from that address. ASSERT(Utils::IsAligned(payload_start, compiler::target::kWordSize)); const uword payload_size = insns.Size(); - auto const payload_end = payload_start + payload_size; - auto cursor = payload_start; -#if defined(DART_PRECOMPILER) - descriptors = code.pc_descriptors(); - PcDescriptors::Iterator iterator( - descriptors, /*kind_mask=*/UntaggedPcDescriptors::kBSSRelocation); - while (iterator.MoveNext()) { - // We only generate BSS relocations in the precompiler. - ASSERT(FLAG_precompiled_mode); - auto const next_reloc_offset = iterator.PcOffset(); - auto const next_reloc_address = payload_start + next_reloc_offset; - // We only generate BSS relocations that are target word-sized and at - // target word-aligned offsets in the payload. Double-check this. - ASSERT( - Utils::IsAligned(next_reloc_address, compiler::target::kWordSize)); - text_offset += WriteBytes(cursor, next_reloc_address - cursor); - - // The instruction stream at the relocation position holds the target - // offset into the BSS section. - const auto target_offset = - *reinterpret_cast( - next_reloc_address); - text_offset += Relocation(text_offset, instructions_label, text_offset, - bss_label, target_offset); - cursor = next_reloc_address + compiler::target::kWordSize; - } -#endif - text_offset += WriteBytes(cursor, payload_end - cursor); + text_offset += WriteBytes(payload_start, payload_size); } // 4. Add appropriate padding. Note we can't simply copy from the object diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc index 35654dc3345..6256dba1e6a 100644 --- a/runtime/vm/object.cc +++ b/runtime/vm/object.cc @@ -16326,8 +16326,6 @@ const char* PcDescriptors::KindAsStr(UntaggedPcDescriptors::Kind kind) { return "osr-entry"; case UntaggedPcDescriptors::kRewind: return "rewind"; - case UntaggedPcDescriptors::kBSSRelocation: - return "bss reloc"; case UntaggedPcDescriptors::kOther: return "other"; case UntaggedPcDescriptors::kAnyKind: diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h index 1bcad00381f..52d54c74f06 100644 --- a/runtime/vm/raw_object.h +++ b/runtime/vm/raw_object.h @@ -2260,9 +2260,7 @@ class UntaggedPcDescriptors : public UntaggedObject { V(OsrEntry, kRuntimeCall << 1) \ /* Call rewind target address. */ \ V(Rewind, kOsrEntry << 1) \ - /* Target-word-size relocation. */ \ - V(BSSRelocation, kRewind << 1) \ - V(Other, kBSSRelocation << 1) \ + V(Other, kRewind << 1) \ V(AnyKind, -1) enum Kind {