Make some things private

This commit is contained in:
bjorn3
2020-10-11 16:16:39 +02:00
parent 4fd90dccab
commit 2346fe7de6

View File

@@ -151,14 +151,14 @@ struct StackMapRecord {
} }
#[derive(Clone)] #[derive(Clone)]
pub struct SimpleJITCompiledFunction { struct SimpleJITCompiledFunction {
code: *mut u8, code: *mut u8,
size: usize, size: usize,
relocs: Vec<RelocRecord>, relocs: Vec<RelocRecord>,
} }
#[derive(Clone)] #[derive(Clone)]
pub struct SimpleJITCompiledData { struct SimpleJITCompiledData {
storage: *mut u8, storage: *mut u8,
size: usize, size: usize,
relocs: Vec<RelocRecord>, relocs: Vec<RelocRecord>,
@@ -451,8 +451,8 @@ impl<'simple_jit_backend> Module for SimpleJITModule {
self.record_function_for_perf(ptr, size, &decl.name); self.record_function_for_perf(ptr, size, &decl.name);
let mut reloc_sink = SimpleJITRelocSink::new(); let mut reloc_sink = SimpleJITRelocSink::default();
let mut stack_map_sink = SimpleJITStackMapSink::new(); let mut stack_map_sink = SimpleJITStackMapSink::default();
unsafe { unsafe {
ctx.emit_to_memory( ctx.emit_to_memory(
&*self.isa, &*self.isa,
@@ -673,14 +673,9 @@ fn lookup_with_dlsym(name: &str) -> *const u8 {
} }
} }
#[derive(Default)]
struct SimpleJITRelocSink { struct SimpleJITRelocSink {
pub relocs: Vec<RelocRecord>, relocs: Vec<RelocRecord>,
}
impl SimpleJITRelocSink {
pub fn new() -> Self {
Self { relocs: Vec::new() }
}
} }
impl RelocSink for SimpleJITRelocSink { impl RelocSink for SimpleJITRelocSink {
@@ -729,16 +724,9 @@ impl RelocSink for SimpleJITRelocSink {
} }
} }
#[derive(Default)]
struct SimpleJITStackMapSink { struct SimpleJITStackMapSink {
pub stack_maps: Vec<StackMapRecord>, stack_maps: Vec<StackMapRecord>,
}
impl SimpleJITStackMapSink {
pub fn new() -> Self {
Self {
stack_maps: Vec::new(),
}
}
} }
impl StackMapSink for SimpleJITStackMapSink { impl StackMapSink for SimpleJITStackMapSink {