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

@@ -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;
}
}