Skip to content

Commit 3bd3149

Browse files
committed
Use Vecs for debug metadata in MachBuffer to avoid SmallVec size penalty in not-used case.
1 parent cd03b2a commit 3bd3149

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cranelift/codegen/src/machinst/buffer.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,9 @@ pub struct MachBuffer<I: VCodeInst> {
255255
/// Any source location mappings referring to this code.
256256
srclocs: SmallVec<[MachSrcLoc<Stencil>; 64]>,
257257
/// Any debug tags referring to this code.
258-
debug_tags: SmallVec<[MachDebugTags; 64]>,
258+
debug_tags: Vec<MachDebugTags>,
259259
/// Pool of debug tags referenced by `MachDebugTags` entries.
260-
debug_tag_pool: SmallVec<[DebugTag; 64]>,
260+
debug_tag_pool: Vec<DebugTag>,
261261
/// Any user stack maps for this code.
262262
///
263263
/// Each entry is an `(offset, span, stack_map)` triple. Entries are sorted
@@ -379,9 +379,9 @@ pub struct MachBufferFinalized<T: CompilePhase> {
379379
/// Any source location mappings referring to this code.
380380
pub(crate) srclocs: SmallVec<[T::MachSrcLocType; 64]>,
381381
/// Any debug tags referring to this code.
382-
pub(crate) debug_tags: SmallVec<[MachDebugTags; 64]>,
382+
pub(crate) debug_tags: Vec<MachDebugTags>,
383383
/// Pool of debug tags referenced by `MachDebugTags` entries.
384-
pub(crate) debug_tag_pool: SmallVec<[DebugTag; 64]>,
384+
pub(crate) debug_tag_pool: Vec<DebugTag>,
385385
/// Any user stack maps for this code.
386386
///
387387
/// Each entry is an `(offset, span, stack_map)` triple. Entries are sorted
@@ -466,8 +466,8 @@ impl<I: VCodeInst> MachBuffer<I> {
466466
call_sites: SmallVec::new(),
467467
exception_handlers: SmallVec::new(),
468468
srclocs: SmallVec::new(),
469-
debug_tags: SmallVec::new(),
470-
debug_tag_pool: SmallVec::new(),
469+
debug_tags: vec![],
470+
debug_tag_pool: vec![],
471471
user_stack_maps: SmallVec::new(),
472472
unwind_info: SmallVec::new(),
473473
cur_srcloc: None,

0 commit comments

Comments
 (0)