Merge pull request #2111 from fitzgen/rename-stackmap-to-stack-map

Rename "Stackmap" to "StackMap"
This commit is contained in:
Nick Fitzgerald
2020-08-07 10:46:38 -07:00
committed by GitHub
44 changed files with 218 additions and 211 deletions

View File

@@ -90,7 +90,7 @@
//! - Return v1 in memory at `[P+8]`.
//! - Return v0 in memory at `[P+16]`.
use crate::binemit::Stackmap;
use crate::binemit::StackMap;
use crate::ir;
use crate::ir::types;
use crate::ir::types::*;
@@ -1074,10 +1074,10 @@ impl ABIBody for AArch64ABIBody {
store_stack(MemArg::NominalSPOffset(sp_off, ty), from_reg, ty)
}
fn spillslots_to_stackmap(&self, slots: &[SpillSlot], state: &EmitState) -> Stackmap {
fn spillslots_to_stack_map(&self, slots: &[SpillSlot], state: &EmitState) -> StackMap {
assert!(state.virtual_sp_offset >= 0);
trace!(
"spillslots_to_stackmap: slots = {:?}, state = {:?}",
"spillslots_to_stack_map: slots = {:?}, state = {:?}",
slots,
state
);
@@ -1094,7 +1094,7 @@ impl ABIBody for AArch64ABIBody {
bits[first_spillslot_word + slot] = true;
}
Stackmap::from_slice(&bits[..])
StackMap::from_slice(&bits[..])
}
fn gen_prologue(&mut self) -> Vec<Inst> {

View File

@@ -1,6 +1,6 @@
//! AArch64 ISA: binary code emission.
use crate::binemit::{CodeOffset, Reloc, Stackmap};
use crate::binemit::{CodeOffset, Reloc, StackMap};
use crate::ir::constant::ConstantData;
use crate::ir::types::*;
use crate::ir::TrapCode;
@@ -429,8 +429,8 @@ pub struct EmitState {
pub(crate) virtual_sp_offset: i64,
/// Offset of FP from nominal-SP.
pub(crate) nominal_sp_to_fp: i64,
/// Safepoint stackmap for upcoming instruction, as provided to `pre_safepoint()`.
stackmap: Option<Stackmap>,
/// Safepoint stack map for upcoming instruction, as provided to `pre_safepoint()`.
stack_map: Option<StackMap>,
}
impl MachInstEmitState<Inst> for EmitState {
@@ -438,22 +438,22 @@ impl MachInstEmitState<Inst> for EmitState {
EmitState {
virtual_sp_offset: 0,
nominal_sp_to_fp: abi.frame_size() as i64,
stackmap: None,
stack_map: None,
}
}
fn pre_safepoint(&mut self, stackmap: Stackmap) {
self.stackmap = Some(stackmap);
fn pre_safepoint(&mut self, stack_map: StackMap) {
self.stack_map = Some(stack_map);
}
}
impl EmitState {
fn take_stackmap(&mut self) -> Option<Stackmap> {
self.stackmap.take()
fn take_stack_map(&mut self) -> Option<StackMap> {
self.stack_map.take()
}
fn clear_post_insn(&mut self) {
self.stackmap = None;
self.stack_map = None;
}
}
@@ -1854,8 +1854,8 @@ impl MachInstEmit for Inst {
// Noop; this is just a placeholder for epilogues.
}
&Inst::Call { ref info } => {
if let Some(s) = state.take_stackmap() {
sink.add_stackmap(StackmapExtent::UpcomingBytes(4), s);
if let Some(s) = state.take_stack_map() {
sink.add_stack_map(StackMapExtent::UpcomingBytes(4), s);
}
sink.add_reloc(info.loc, Reloc::Arm64Call, &info.dest, 0);
sink.put4(enc_jump26(0b100101, 0));
@@ -1864,8 +1864,8 @@ impl MachInstEmit for Inst {
}
}
&Inst::CallInd { ref info } => {
if let Some(s) = state.take_stackmap() {
sink.add_stackmap(StackmapExtent::UpcomingBytes(4), s);
if let Some(s) = state.take_stack_map() {
sink.add_stack_map(StackMapExtent::UpcomingBytes(4), s);
}
sink.put4(0b1101011_0001_11111_000000_00000_00000 | (machreg_to_gpr(info.rn) << 5));
if info.opcode.is_call() {
@@ -1922,8 +1922,8 @@ impl MachInstEmit for Inst {
&Inst::Udf { trap_info } => {
let (srcloc, code) = trap_info;
sink.add_trap(srcloc, code);
if let Some(s) = state.take_stackmap() {
sink.add_stackmap(StackmapExtent::UpcomingBytes(4), s);
if let Some(s) = state.take_stack_map() {
sink.add_stack_map(StackMapExtent::UpcomingBytes(4), s);
}
sink.put4(0xd4a00000);
}

View File

@@ -82,7 +82,7 @@ impl CodeSink for TestCodeSink {
fn end_codegen(&mut self) {}
fn add_stackmap(&mut self, _val_list: &[Value], _func: &Function, _isa: &dyn TargetIsa) {}
fn add_stack_map(&mut self, _val_list: &[Value], _func: &Function, _isa: &dyn TargetIsa) {}
fn add_call_site(&mut self, _opcode: Opcode, _srcloc: SourceLoc) {}
}

View File

@@ -1,6 +1,6 @@
//! Implementation of the standard x64 ABI.
use crate::binemit::Stackmap;
use crate::binemit::StackMap;
use crate::ir::{self, types, ArgumentExtension, StackSlot, Type};
use crate::isa::{x64::inst::*, CallConv};
use crate::machinst::*;
@@ -492,10 +492,10 @@ impl ABIBody for X64ABIBody {
)
}
fn spillslots_to_stackmap(&self, slots: &[SpillSlot], state: &EmitState) -> Stackmap {
fn spillslots_to_stack_map(&self, slots: &[SpillSlot], state: &EmitState) -> StackMap {
assert!(state.virtual_sp_offset >= 0);
trace!(
"spillslots_to_stackmap: slots = {:?}, state = {:?}",
"spillslots_to_stack_map: slots = {:?}, state = {:?}",
slots,
state
);
@@ -511,7 +511,7 @@ impl ABIBody for X64ABIBody {
bits[first_spillslot_word + slot] = true;
}
Stackmap::from_slice(&bits[..])
StackMap::from_slice(&bits[..])
}
fn gen_prologue(&mut self) -> Vec<Inst> {

View File

@@ -1349,8 +1349,8 @@ pub(crate) fn emit(
Inst::CallKnown {
dest, loc, opcode, ..
} => {
if let Some(s) = state.take_stackmap() {
sink.add_stackmap(StackmapExtent::UpcomingBytes(5), s);
if let Some(s) = state.take_stack_map() {
sink.add_stack_map(StackMapExtent::UpcomingBytes(5), s);
}
sink.put1(0xE8);
// The addend adjusts for the difference between the end of the instruction and the
@@ -1393,8 +1393,8 @@ pub(crate) fn emit(
);
}
}
if let Some(s) = state.take_stackmap() {
sink.add_stackmap(StackmapExtent::StartedAtOffset(start_offset), s);
if let Some(s) = state.take_stack_map() {
sink.add_stack_map(StackMapExtent::StartedAtOffset(start_offset), s);
}
if opcode.is_call() {
sink.add_call_site(*loc, *opcode);
@@ -2432,8 +2432,8 @@ pub(crate) fn emit(
Inst::Ud2 { trap_info } => {
sink.add_trap(trap_info.0, trap_info.1);
if let Some(s) = state.take_stackmap() {
sink.add_stackmap(StackmapExtent::UpcomingBytes(2), s);
if let Some(s) = state.take_stack_map() {
sink.add_stack_map(StackMapExtent::UpcomingBytes(2), s);
}
sink.put1(0x0f);
sink.put1(0x0b);

View File

@@ -4,7 +4,7 @@
#![allow(non_snake_case)]
#![allow(non_camel_case_types)]
use crate::binemit::{CodeOffset, Stackmap};
use crate::binemit::{CodeOffset, StackMap};
use crate::ir::{types, ExternalName, Opcode, SourceLoc, TrapCode, Type};
use crate::machinst::*;
use crate::{settings, settings::Flags, CodegenError, CodegenResult};
@@ -2225,8 +2225,8 @@ pub struct EmitState {
pub(crate) virtual_sp_offset: i64,
/// Offset of FP from nominal-SP.
pub(crate) nominal_sp_to_fp: i64,
/// Safepoint stackmap for upcoming instruction, as provided to `pre_safepoint()`.
stackmap: Option<Stackmap>,
/// Safepoint stack map for upcoming instruction, as provided to `pre_safepoint()`.
stack_map: Option<StackMap>,
}
impl MachInstEmit for Inst {
@@ -2246,22 +2246,22 @@ impl MachInstEmitState<Inst> for EmitState {
EmitState {
virtual_sp_offset: 0,
nominal_sp_to_fp: abi.frame_size() as i64,
stackmap: None,
stack_map: None,
}
}
fn pre_safepoint(&mut self, stackmap: Stackmap) {
self.stackmap = Some(stackmap);
fn pre_safepoint(&mut self, stack_map: StackMap) {
self.stack_map = Some(stack_map);
}
}
impl EmitState {
fn take_stackmap(&mut self) -> Option<Stackmap> {
self.stackmap.take()
fn take_stack_map(&mut self) -> Option<StackMap> {
self.stack_map.take()
}
fn clear_post_insn(&mut self) {
self.stackmap = None;
self.stack_map = None;
}
}