mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-24 22:21:32 +00:00
Cranelift backend update to fork of clif version 0.43.1
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user