Update Cranelift

This commit is contained in:
bjorn3 2020-03-28 14:01:48 +01:00
parent 33fd4c47aa
commit f6d12440aa
5 changed files with 38 additions and 24 deletions

40
Cargo.lock generated
View File

@ -44,16 +44,16 @@ checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
[[package]]
name = "cranelift-bforest"
version = "0.60.0"
source = "git+https://github.com/bytecodealliance/wasmtime/#0d4bde4ab30f202c888888db7a8eb2d905c0119f"
version = "0.61.0"
source = "git+https://github.com/bytecodealliance/wasmtime/#08e5484cdb158b7795587ff7ad0cb04beef6dcd3"
dependencies = [
"cranelift-entity",
]
[[package]]
name = "cranelift-codegen"
version = "0.60.0"
source = "git+https://github.com/bytecodealliance/wasmtime/#0d4bde4ab30f202c888888db7a8eb2d905c0119f"
version = "0.61.0"
source = "git+https://github.com/bytecodealliance/wasmtime/#08e5484cdb158b7795587ff7ad0cb04beef6dcd3"
dependencies = [
"byteorder",
"cranelift-bforest",
@ -69,8 +69,8 @@ dependencies = [
[[package]]
name = "cranelift-codegen-meta"
version = "0.60.0"
source = "git+https://github.com/bytecodealliance/wasmtime/#0d4bde4ab30f202c888888db7a8eb2d905c0119f"
version = "0.61.0"
source = "git+https://github.com/bytecodealliance/wasmtime/#08e5484cdb158b7795587ff7ad0cb04beef6dcd3"
dependencies = [
"cranelift-codegen-shared",
"cranelift-entity",
@ -78,18 +78,18 @@ dependencies = [
[[package]]
name = "cranelift-codegen-shared"
version = "0.60.0"
source = "git+https://github.com/bytecodealliance/wasmtime/#0d4bde4ab30f202c888888db7a8eb2d905c0119f"
version = "0.61.0"
source = "git+https://github.com/bytecodealliance/wasmtime/#08e5484cdb158b7795587ff7ad0cb04beef6dcd3"
[[package]]
name = "cranelift-entity"
version = "0.60.0"
source = "git+https://github.com/bytecodealliance/wasmtime/#0d4bde4ab30f202c888888db7a8eb2d905c0119f"
version = "0.61.0"
source = "git+https://github.com/bytecodealliance/wasmtime/#08e5484cdb158b7795587ff7ad0cb04beef6dcd3"
[[package]]
name = "cranelift-frontend"
version = "0.60.0"
source = "git+https://github.com/bytecodealliance/wasmtime/#0d4bde4ab30f202c888888db7a8eb2d905c0119f"
version = "0.61.0"
source = "git+https://github.com/bytecodealliance/wasmtime/#08e5484cdb158b7795587ff7ad0cb04beef6dcd3"
dependencies = [
"cranelift-codegen",
"log",
@ -99,8 +99,8 @@ dependencies = [
[[package]]
name = "cranelift-module"
version = "0.60.0"
source = "git+https://github.com/bytecodealliance/wasmtime/#0d4bde4ab30f202c888888db7a8eb2d905c0119f"
version = "0.61.0"
source = "git+https://github.com/bytecodealliance/wasmtime/#08e5484cdb158b7795587ff7ad0cb04beef6dcd3"
dependencies = [
"anyhow",
"cranelift-codegen",
@ -111,8 +111,8 @@ dependencies = [
[[package]]
name = "cranelift-native"
version = "0.60.0"
source = "git+https://github.com/bytecodealliance/wasmtime/#0d4bde4ab30f202c888888db7a8eb2d905c0119f"
version = "0.61.0"
source = "git+https://github.com/bytecodealliance/wasmtime/#08e5484cdb158b7795587ff7ad0cb04beef6dcd3"
dependencies = [
"cranelift-codegen",
"raw-cpuid",
@ -121,8 +121,8 @@ dependencies = [
[[package]]
name = "cranelift-object"
version = "0.60.0"
source = "git+https://github.com/bytecodealliance/wasmtime/#0d4bde4ab30f202c888888db7a8eb2d905c0119f"
version = "0.61.0"
source = "git+https://github.com/bytecodealliance/wasmtime/#08e5484cdb158b7795587ff7ad0cb04beef6dcd3"
dependencies = [
"cranelift-codegen",
"cranelift-module",
@ -132,8 +132,8 @@ dependencies = [
[[package]]
name = "cranelift-simplejit"
version = "0.60.0"
source = "git+https://github.com/bytecodealliance/wasmtime/#0d4bde4ab30f202c888888db7a8eb2d905c0119f"
version = "0.61.0"
source = "git+https://github.com/bytecodealliance/wasmtime/#08e5484cdb158b7795587ff7ad0cb04beef6dcd3"
dependencies = [
"cranelift-codegen",
"cranelift-module",

View File

@ -94,6 +94,10 @@ fn codegen_inner(module: &mut Module<impl Backend + 'static>, kind: AllocatorKin
bcx.seal_all_blocks();
bcx.finalize();
}
module.define_function(func_id, &mut ctx).unwrap();
module.define_function(
func_id,
&mut ctx,
&mut cranelift_codegen::binemit::NullTrapSink {},
).unwrap();
}
}

View File

@ -125,7 +125,6 @@ pub(crate) fn make_module(sess: &Session, name: String) -> Module<Backend> {
ObjectBuilder::new(
crate::build_isa(sess, true),
name + ".o",
ObjectTrapCollection::Disabled,
cranelift_module::default_libcall_names(),
),
);

View File

@ -171,7 +171,14 @@ pub(crate) fn trans_fn<'clif, 'tcx, B: Backend + 'static>(
// Define function
let module = &mut cx.module;
tcx.sess.time("define function", || module.define_function(func_id, context).unwrap());
tcx.sess.time(
"define function",
|| module.define_function(
func_id,
context,
&mut cranelift_codegen::binemit::NullTrapSink {},
).unwrap(),
);
// Write optimized function to file for debugging
#[cfg(debug_assertions)]

View File

@ -103,6 +103,10 @@ pub(crate) fn maybe_create_entry_wrapper(tcx: TyCtxt<'_>, module: &mut Module<im
bcx.seal_all_blocks();
bcx.finalize();
}
m.define_function(cmain_func_id, &mut ctx).unwrap();
m.define_function(
cmain_func_id,
&mut ctx,
&mut cranelift_codegen::binemit::NullTrapSink {},
).unwrap();
}
}