Cranelift backend update to fork of clif version 0.43.1

This commit is contained in:
Brandon Fish
2019-09-21 13:06:54 -05:00
parent 7d9e6d8caa
commit f48d6f6690
13 changed files with 116 additions and 84 deletions

View File

@ -10,7 +10,10 @@ use crate::{
use rayon::prelude::*;
use byteorder::{ByteOrder, LittleEndian};
use cranelift_codegen::{ir, isa, Context};
use cranelift_codegen::{
binemit::{Stackmap, StackmapSink},
ir, isa, Context,
};
use std::{
mem,
ptr::{write_unaligned, NonNull},
@ -58,6 +61,11 @@ pub struct FuncResolverBuilder {
import_len: usize,
}
pub struct NoopStackmapSink {}
impl StackmapSink for NoopStackmapSink {
fn add_stackmap(&mut self, _: u32, _: Stackmap) {}
}
impl FuncResolverBuilder {
pub fn new_from_backend_cache(
backend_cache: BackendCache,
@ -109,12 +117,13 @@ impl FuncResolverBuilder {
ctx.func = func.to_owned();
let mut reloc_sink = RelocSink::new();
let mut local_trap_sink = LocalTrapSink::new();
let mut stackmap_sink = NoopStackmapSink {};
ctx.compile_and_emit(
isa,
&mut code_buf,
&mut reloc_sink,
&mut local_trap_sink,
&mut stackmap_sink,
)
.map_err(|e| CompileError::InternalError { msg: e.to_string() })?;
ctx.clear();