Rename "Stackmap" to "StackMap"

And "stackmap" to "stack_map".

This commit is purely mechanical.
This commit is contained in:
Nick Fitzgerald
2020-08-06 16:41:59 -07:00
parent b5a6daedc4
commit 05bf9ea3f3
44 changed files with 218 additions and 211 deletions

View File

@@ -1,6 +1,6 @@
//! Provides functionality for compiling and running CLIF IR for `run` tests.
use core::{mem, ptr};
use cranelift_codegen::binemit::{NullRelocSink, NullStackmapSink, NullTrapSink};
use cranelift_codegen::binemit::{NullRelocSink, NullStackMapSink, NullTrapSink};
use cranelift_codegen::ir::{condcodes::IntCC, Function, InstBuilder, Signature, Type};
use cranelift_codegen::isa::TargetIsa;
use cranelift_codegen::{ir, settings, CodegenError, Context};
@@ -268,12 +268,12 @@ fn compile(function: Function, isa: &dyn TargetIsa) -> Result<Mmap, CompilationE
// Compile and encode the result to machine code.
let relocs = &mut NullRelocSink {};
let traps = &mut NullTrapSink {};
let stackmaps = &mut NullStackmapSink {};
let stack_maps = &mut NullStackMapSink {};
let code_info = context.compile(isa)?;
let mut code_page = MmapMut::map_anon(code_info.total_size as usize)?;
unsafe {
context.emit_to_memory(isa, code_page.as_mut_ptr(), relocs, traps, stackmaps);
context.emit_to_memory(isa, code_page.as_mut_ptr(), relocs, traps, stack_maps);
};
let code_page = code_page.make_exec()?;

View File

@@ -56,7 +56,7 @@ mod test_safepoint;
mod test_shrink;
mod test_simple_gvn;
mod test_simple_preopt;
mod test_stackmaps;
mod test_stack_maps;
mod test_unwind;
mod test_verifier;
@@ -140,7 +140,7 @@ fn new_subtest(parsed: &TestCommand) -> subtest::SubtestResult<Box<dyn subtest::
"shrink" => test_shrink::subtest(parsed),
"simple-gvn" => test_simple_gvn::subtest(parsed),
"simple_preopt" => test_simple_preopt::subtest(parsed),
"stackmaps" => test_stackmaps::subtest(parsed),
"stack_maps" => test_stack_maps::subtest(parsed),
"unwind" => test_unwind::subtest(parsed),
"verifier" => test_verifier::subtest(parsed),
_ => Err(format!("unknown test command '{}'", parsed.command)),

View File

@@ -108,7 +108,7 @@ impl binemit::CodeSink for TextSink {
}
fn begin_rodata(&mut self) {}
fn end_codegen(&mut self) {}
fn add_stackmap(
fn add_stack_map(
&mut self,
_: &[ir::entities::Value],
_: &ir::Function,

View File

@@ -129,7 +129,7 @@ impl binemit::CodeSink for SizeSink {
fn begin_jumptables(&mut self) {}
fn begin_rodata(&mut self) {}
fn end_codegen(&mut self) {}
fn add_stackmap(
fn add_stack_map(
&mut self,
_: &[ir::entities::Value],
_: &ir::Function,

View File

@@ -132,5 +132,5 @@ impl binemit::CodeSink for RodataSink {
"Expected rodata to be emitted before the end of codegen"
);
}
fn add_stackmap(&mut self, _: &[Value], _: &Function, _: &dyn TargetIsa) {}
fn add_stack_map(&mut self, _: &[Value], _: &Function, _: &dyn TargetIsa) {}
}

View File

@@ -1,5 +1,5 @@
use crate::subtest::{run_filecheck, Context, SubTest, SubtestResult};
use cranelift_codegen::binemit::{self, Addend, CodeOffset, CodeSink, Reloc, Stackmap};
use cranelift_codegen::binemit::{self, Addend, CodeOffset, CodeSink, Reloc, StackMap};
use cranelift_codegen::ir::*;
use cranelift_codegen::isa::TargetIsa;
use cranelift_codegen::print_errors::pretty_error;
@@ -7,27 +7,27 @@ use cranelift_reader::TestCommand;
use std::borrow::Cow;
use std::fmt::Write;
struct TestStackmaps;
struct TestStackMaps;
pub fn subtest(parsed: &TestCommand) -> SubtestResult<Box<dyn SubTest>> {
assert_eq!(parsed.command, "stackmaps");
assert_eq!(parsed.command, "stack_maps");
if !parsed.options.is_empty() {
Err(format!("No options allowed on {}", parsed))
} else {
Ok(Box::new(TestStackmaps))
Ok(Box::new(TestStackMaps))
}
}
impl SubTest for TestStackmaps {
impl SubTest for TestStackMaps {
fn name(&self) -> &'static str {
"stackmaps"
"stack_maps"
}
fn run(&self, func: Cow<Function>, context: &Context) -> SubtestResult<()> {
let mut comp_ctx = cranelift_codegen::Context::for_function(func.into_owned());
comp_ctx
.compile(context.isa.expect("`test stackmaps` requires an isa"))
.compile(context.isa.expect("`test stack_maps` requires an isa"))
.map_err(|e| pretty_error(&comp_ctx.func, context.isa, e))?;
let mut sink = TestStackMapsSink::default();
@@ -40,7 +40,7 @@ impl SubTest for TestStackmaps {
isa.emit_inst(func, inst, div, sink)
},
&mut sink,
context.isa.expect("`test stackmaps` requires an isa"),
context.isa.expect("`test stack_maps` requires an isa"),
);
let mut text = comp_ctx.func.display(context.isa).to_string();
@@ -48,6 +48,7 @@ impl SubTest for TestStackmaps {
text.push_str("Stack maps:\n");
text.push('\n');
text.push_str(&sink.text);
log::debug!("FITZGEN:\n{}", text);
run_filecheck(&text, context)
}
@@ -89,8 +90,8 @@ impl CodeSink for TestStackMapsSink {
fn begin_rodata(&mut self) {}
fn end_codegen(&mut self) {}
fn add_stackmap(&mut self, val_list: &[Value], func: &Function, isa: &dyn TargetIsa) {
let map = Stackmap::from_values(&val_list, func, isa);
fn add_stack_map(&mut self, val_list: &[Value], func: &Function, isa: &dyn TargetIsa) {
let map = StackMap::from_values(&val_list, func, isa);
writeln!(&mut self.text, " - mapped words: {}", map.mapped_words()).unwrap();
write!(&mut self.text, " - live: [").unwrap();