diff --git a/cranelift/codegen/src/isa/aarch64/inst.isle b/cranelift/codegen/src/isa/aarch64/inst.isle index f6eed6f74e..041bda01c4 100644 --- a/cranelift/codegen/src/isa/aarch64/inst.isle +++ b/cranelift/codegen/src/isa/aarch64/inst.isle @@ -854,6 +854,7 @@ (type BranchTarget (primitive BranchTarget)) (type BoxJTSequenceInfo (primitive BoxJTSequenceInfo)) (type CodeOffset (primitive CodeOffset)) +(type VecMachLabel extern (enum)) (type ExtendOp extern (enum diff --git a/cranelift/codegen/src/isa/s390x/inst.isle b/cranelift/codegen/src/isa/s390x/inst.isle index 1ea06e94dd..6f545d71fa 100644 --- a/cranelift/codegen/src/isa/s390x/inst.isle +++ b/cranelift/codegen/src/isa/s390x/inst.isle @@ -880,6 +880,7 @@ (type BoxCallInfo (primitive BoxCallInfo)) (type BoxCallIndInfo (primitive BoxCallIndInfo)) (type BoxJTSequenceInfo (primitive BoxJTSequenceInfo)) +(type VecMachLabel extern (enum)) ;; An ALU operation. (type ALUOp diff --git a/cranelift/codegen/src/isa/x64/inst.isle b/cranelift/codegen/src/isa/x64/inst.isle index 5e2322a13a..52c0685960 100644 --- a/cranelift/codegen/src/isa/x64/inst.isle +++ b/cranelift/codegen/src/isa/x64/inst.isle @@ -371,8 +371,7 @@ (tmp1 WritableReg) (tmp2 WritableReg) (default_target MachLabel) - (targets VecMachLabel) - (targets_for_term VecMachLabel)) + (targets BoxVecMachLabel)) ;; Indirect jump: jmpq (reg mem). (JmpUnknown (target RegMem)) @@ -504,6 +503,8 @@ (type BoxCallInfo extern (enum)) +(type BoxVecMachLabel extern (enum)) + ;; Get the `OperandSize` for a given `Type`, rounding smaller types up to 32 bits. (decl operand_size_of_type_32_64 (Type) OperandSize) (extern constructor operand_size_of_type_32_64 operand_size_of_type_32_64) diff --git a/cranelift/codegen/src/isa/x64/inst/mod.rs b/cranelift/codegen/src/isa/x64/inst/mod.rs index a7de41a7d5..52f6907139 100644 --- a/cranelift/codegen/src/isa/x64/inst/mod.rs +++ b/cranelift/codegen/src/isa/x64/inst/mod.rs @@ -48,7 +48,7 @@ pub struct CallInfo { fn inst_size_test() { // This test will help with unintentionally growing the size // of the Inst enum. - assert_eq!(72, std::mem::size_of::()); + assert_eq!(48, std::mem::size_of::()); } pub(crate) fn low32_will_sign_extend_to_64(x: u64) -> bool { diff --git a/cranelift/codegen/src/isa/x64/lower.rs b/cranelift/codegen/src/isa/x64/lower.rs index 53867dd54b..e6563538fb 100644 --- a/cranelift/codegen/src/isa/x64/lower.rs +++ b/cranelift/codegen/src/isa/x64/lower.rs @@ -17,7 +17,7 @@ use crate::machinst::lower::*; use crate::machinst::*; use crate::result::CodegenResult; use crate::settings::{Flags, TlsModel}; -use alloc::vec::Vec; +use alloc::boxed::Box; use log::trace; use smallvec::SmallVec; use std::convert::TryFrom; @@ -3236,10 +3236,10 @@ impl LowerBackend for X64Backend { }; ctx.emit(Inst::cmp_rmi_r(cmp_size, RegMemImm::imm(jt_size), idx)); - let targets_for_term: Vec = targets.to_vec(); let default_target = targets[0]; - let jt_targets: Vec = targets.iter().skip(1).cloned().collect(); + let jt_targets: Box> = + Box::new(targets.iter().skip(1).cloned().collect()); ctx.emit(Inst::JmpTableSeq { idx, @@ -3247,7 +3247,6 @@ impl LowerBackend for X64Backend { tmp2, default_target, targets: jt_targets, - targets_for_term, }); } diff --git a/cranelift/codegen/src/isa/x64/lower/isle.rs b/cranelift/codegen/src/isa/x64/lower/isle.rs index 9166e7b90c..70de66846b 100644 --- a/cranelift/codegen/src/isa/x64/lower/isle.rs +++ b/cranelift/codegen/src/isa/x64/lower/isle.rs @@ -30,10 +30,12 @@ use crate::{ VCodeConstantData, }, }; +use smallvec::SmallVec; use std::boxed::Box; use std::convert::TryFrom; type BoxCallInfo = Box; +type BoxVecMachLabel = Box>; pub struct SinkableLoad { inst: Inst, diff --git a/cranelift/codegen/src/machinst/isle.rs b/cranelift/codegen/src/machinst/isle.rs index 796656c0ff..5f7b490dcb 100644 --- a/cranelift/codegen/src/machinst/isle.rs +++ b/cranelift/codegen/src/machinst/isle.rs @@ -25,7 +25,6 @@ pub type ValueRegs = crate::machinst::ValueRegs; pub type WritableValueRegs = crate::machinst::ValueRegs; pub type InstOutput = SmallVec<[ValueRegs; 2]>; pub type InstOutputBuilder = Cell; -pub type VecMachLabel = Vec; pub type BoxExternalName = Box; pub type Range = (usize, usize); diff --git a/cranelift/codegen/src/prelude.isle b/cranelift/codegen/src/prelude.isle index 4b7ec8fd73..733df9e48b 100644 --- a/cranelift/codegen/src/prelude.isle +++ b/cranelift/codegen/src/prelude.isle @@ -195,7 +195,6 @@ ;;;; Common Mach Types ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (type MachLabel (primitive MachLabel)) -(type VecMachLabel extern (enum)) (type ValueLabel (primitive ValueLabel)) (type UnwindInst (primitive UnwindInst)) (type ExternalName (primitive ExternalName))