1
Fork 0

Update Cranelift

This commit is contained in:
bjorn3 2021-03-21 10:05:22 +01:00
parent 7bd3950831
commit 56fe51cb36
5 changed files with 31 additions and 30 deletions

40
Cargo.lock generated
View file

@ -39,16 +39,16 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]] [[package]]
name = "cranelift-bforest" name = "cranelift-bforest"
version = "0.71.0" version = "0.72.0"
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#df6812b8559c35230d44c6d6f94a83b2b97b5de3" source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
dependencies = [ dependencies = [
"cranelift-entity", "cranelift-entity",
] ]
[[package]] [[package]]
name = "cranelift-codegen" name = "cranelift-codegen"
version = "0.71.0" version = "0.72.0"
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#df6812b8559c35230d44c6d6f94a83b2b97b5de3" source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
dependencies = [ dependencies = [
"byteorder", "byteorder",
"cranelift-bforest", "cranelift-bforest",
@ -65,8 +65,8 @@ dependencies = [
[[package]] [[package]]
name = "cranelift-codegen-meta" name = "cranelift-codegen-meta"
version = "0.71.0" version = "0.72.0"
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#df6812b8559c35230d44c6d6f94a83b2b97b5de3" source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
dependencies = [ dependencies = [
"cranelift-codegen-shared", "cranelift-codegen-shared",
"cranelift-entity", "cranelift-entity",
@ -74,18 +74,18 @@ dependencies = [
[[package]] [[package]]
name = "cranelift-codegen-shared" name = "cranelift-codegen-shared"
version = "0.71.0" version = "0.72.0"
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#df6812b8559c35230d44c6d6f94a83b2b97b5de3" source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
[[package]] [[package]]
name = "cranelift-entity" name = "cranelift-entity"
version = "0.71.0" version = "0.72.0"
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#df6812b8559c35230d44c6d6f94a83b2b97b5de3" source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
[[package]] [[package]]
name = "cranelift-frontend" name = "cranelift-frontend"
version = "0.71.0" version = "0.72.0"
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#df6812b8559c35230d44c6d6f94a83b2b97b5de3" source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
dependencies = [ dependencies = [
"cranelift-codegen", "cranelift-codegen",
"log", "log",
@ -95,8 +95,8 @@ dependencies = [
[[package]] [[package]]
name = "cranelift-jit" name = "cranelift-jit"
version = "0.71.0" version = "0.72.0"
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#df6812b8559c35230d44c6d6f94a83b2b97b5de3" source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"cranelift-codegen", "cranelift-codegen",
@ -113,8 +113,8 @@ dependencies = [
[[package]] [[package]]
name = "cranelift-module" name = "cranelift-module"
version = "0.71.0" version = "0.72.0"
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#df6812b8559c35230d44c6d6f94a83b2b97b5de3" source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"cranelift-codegen", "cranelift-codegen",
@ -125,8 +125,8 @@ dependencies = [
[[package]] [[package]]
name = "cranelift-native" name = "cranelift-native"
version = "0.71.0" version = "0.72.0"
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#df6812b8559c35230d44c6d6f94a83b2b97b5de3" source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
dependencies = [ dependencies = [
"cranelift-codegen", "cranelift-codegen",
"target-lexicon", "target-lexicon",
@ -134,8 +134,8 @@ dependencies = [
[[package]] [[package]]
name = "cranelift-object" name = "cranelift-object"
version = "0.71.0" version = "0.72.0"
source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#df6812b8559c35230d44c6d6f94a83b2b97b5de3" source = "git+https://github.com/bytecodealliance/wasmtime/?branch=main#8e43e96410a14143d368273cf1e708f8094bb8e0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"cranelift-codegen", "cranelift-codegen",

View file

@ -3,6 +3,7 @@
use crate::prelude::*; use crate::prelude::*;
use cranelift_codegen::binemit::{NullStackMapSink, NullTrapSink};
use rustc_ast::expand::allocator::{AllocatorKind, AllocatorTy, ALLOCATOR_METHODS}; use rustc_ast::expand::allocator::{AllocatorKind, AllocatorTy, ALLOCATOR_METHODS};
use rustc_span::symbol::sym; use rustc_span::symbol::sym;
@ -92,7 +93,7 @@ fn codegen_inner(
bcx.finalize(); bcx.finalize();
} }
module module
.define_function(func_id, &mut ctx, &mut cranelift_codegen::binemit::NullTrapSink {}) .define_function(func_id, &mut ctx, &mut NullTrapSink {}, &mut NullStackMapSink {})
.unwrap(); .unwrap();
unwind_context.add_function(func_id, &ctx, module.isa()); unwind_context.add_function(func_id, &ctx, module.isa());
} }
@ -132,7 +133,7 @@ fn codegen_inner(
bcx.finalize(); bcx.finalize();
} }
module module
.define_function(func_id, &mut ctx, &mut cranelift_codegen::binemit::NullTrapSink {}) .define_function(func_id, &mut ctx, &mut NullTrapSink {}, &mut NullStackMapSink {})
.unwrap(); .unwrap();
unwind_context.add_function(func_id, &ctx, module.isa()); unwind_context.add_function(func_id, &ctx, module.isa());
} }

View file

@ -1,5 +1,6 @@
//! Codegen of a single function //! Codegen of a single function
use cranelift_codegen::binemit::{NullStackMapSink, NullTrapSink};
use rustc_index::vec::IndexVec; use rustc_index::vec::IndexVec;
use rustc_middle::ty::adjustment::PointerCast; use rustc_middle::ty::adjustment::PointerCast;
use rustc_middle::ty::layout::FnAbiExt; use rustc_middle::ty::layout::FnAbiExt;
@ -131,7 +132,7 @@ pub(crate) fn codegen_fn<'tcx>(
let module = &mut cx.module; let module = &mut cx.module;
tcx.sess.time("define function", || { tcx.sess.time("define function", || {
module module
.define_function(func_id, context, &mut cranelift_codegen::binemit::NullTrapSink {}) .define_function(func_id, context, &mut NullTrapSink {}, &mut NullStackMapSink {})
.unwrap() .unwrap()
}); });

View file

@ -5,6 +5,7 @@ use std::cell::RefCell;
use std::ffi::CString; use std::ffi::CString;
use std::os::raw::{c_char, c_int}; use std::os::raw::{c_char, c_int};
use cranelift_codegen::binemit::{NullStackMapSink, NullTrapSink};
use rustc_codegen_ssa::CrateInfo; use rustc_codegen_ssa::CrateInfo;
use rustc_middle::mir::mono::MonoItem; use rustc_middle::mir::mono::MonoItem;
use rustc_session::config::EntryFnType; use rustc_session::config::EntryFnType;
@ -297,7 +298,8 @@ fn codegen_shim<'tcx>(cx: &mut CodegenCx<'_, 'tcx>, inst: Instance<'tcx>) {
.define_function( .define_function(
func_id, func_id,
&mut Context::for_function(trampoline), &mut Context::for_function(trampoline),
&mut cranelift_codegen::binemit::NullTrapSink {}, &mut NullTrapSink {},
&mut NullStackMapSink {},
) )
.unwrap(); .unwrap();
} }

View file

@ -1,3 +1,4 @@
use cranelift_codegen::binemit::{NullStackMapSink, NullTrapSink};
use rustc_hir::LangItem; use rustc_hir::LangItem;
use rustc_session::config::EntryFnType; use rustc_session::config::EntryFnType;
@ -100,12 +101,8 @@ pub(crate) fn maybe_create_entry_wrapper(
bcx.seal_all_blocks(); bcx.seal_all_blocks();
bcx.finalize(); bcx.finalize();
} }
m.define_function( m.define_function(cmain_func_id, &mut ctx, &mut NullTrapSink {}, &mut NullStackMapSink {})
cmain_func_id, .unwrap();
&mut ctx,
&mut cranelift_codegen::binemit::NullTrapSink {},
)
.unwrap();
unwind_context.add_function(cmain_func_id, &ctx, m.isa()); unwind_context.add_function(cmain_func_id, &ctx, m.isa());
} }
} }