Address review comments.
This commit is contained in:
@@ -1318,8 +1318,9 @@ pub struct MachSrcLoc {
|
||||
pub struct MachStackMap {
|
||||
/// The code offset at which this stackmap applies.
|
||||
pub offset: CodeOffset,
|
||||
/// The code offset at the *end* of the instruction at which this stackmap
|
||||
/// applies.
|
||||
/// The code offset just past the "end" of the instruction: that is, the
|
||||
/// offset of the first byte of the following instruction, or equivalently,
|
||||
/// the start offset plus the instruction length.
|
||||
pub offset_end: CodeOffset,
|
||||
/// The Stackmap itself.
|
||||
pub stackmap: Stackmap,
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
use crate::entity::SecondaryMap;
|
||||
use crate::fx::{FxHashMap, FxHashSet};
|
||||
use crate::inst_predicates::is_safepoint;
|
||||
use crate::inst_predicates::{has_side_effect_or_load, is_constant_64bit};
|
||||
use crate::ir::instructions::BranchInfo;
|
||||
use crate::ir::types::I64;
|
||||
@@ -94,8 +93,6 @@ pub trait LowerCtx {
|
||||
/// every side-effecting op; the backend should not try to merge across
|
||||
/// side-effect colors unless the op being merged is known to be pure.
|
||||
fn inst_color(&self, ir_inst: Inst) -> InstColor;
|
||||
/// Determine whether an instruction is a safepoint.
|
||||
fn is_safepoint(&self, ir_inst: Inst) -> bool;
|
||||
|
||||
// Instruction input/output queries:
|
||||
|
||||
@@ -899,13 +896,6 @@ impl<'func, I: VCodeInst> LowerCtx for Lower<'func, I> {
|
||||
self.inst_colors[ir_inst]
|
||||
}
|
||||
|
||||
fn is_safepoint(&self, ir_inst: Inst) -> bool {
|
||||
// There is no safepoint metadata at all if we have no reftyped values
|
||||
// in this function; lack of metadata implies "nothing to trace", and
|
||||
// avoids overhead.
|
||||
self.vcode.have_ref_values() && is_safepoint(self.f, ir_inst)
|
||||
}
|
||||
|
||||
fn num_inputs(&self, ir_inst: Inst) -> usize {
|
||||
self.f.dfg.inst_args(ir_inst).len()
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ pub trait MachInst: Clone + Debug {
|
||||
|
||||
/// What is the register class used for reference types (GC-observable pointers)? Can
|
||||
/// be dependent on compilation flags.
|
||||
fn ref_type_rc(_flags: &Flags) -> RegClass;
|
||||
fn ref_type_regclass(_flags: &Flags) -> RegClass;
|
||||
|
||||
/// A label-use kind: a type that describes the types of label references that
|
||||
/// can occur in an instruction.
|
||||
|
||||
@@ -132,7 +132,7 @@ pub struct VCodeBuilder<I: VCodeInst> {
|
||||
impl<I: VCodeInst> VCodeBuilder<I> {
|
||||
/// Create a new VCodeBuilder.
|
||||
pub fn new(abi: Box<dyn ABIBody<I = I>>, block_order: BlockLoweringOrder) -> VCodeBuilder<I> {
|
||||
let reftype_class = I::ref_type_rc(abi.flags());
|
||||
let reftype_class = I::ref_type_regclass(abi.flags());
|
||||
let vcode = VCode::new(abi, block_order);
|
||||
let stackmap_info = StackmapRequestInfo {
|
||||
reftype_class,
|
||||
@@ -257,7 +257,7 @@ fn is_redundant_move<I: VCodeInst>(insn: &I) -> bool {
|
||||
|
||||
/// Is this type a reference type?
|
||||
fn is_reftype(ty: Type) -> bool {
|
||||
ty == types::R32 || ty == types::R64
|
||||
ty == types::R64 || ty == types::R32
|
||||
}
|
||||
|
||||
impl<I: VCodeInst> VCode<I> {
|
||||
|
||||
Reference in New Issue
Block a user