Update Cranelift to 0.52.0 (#710)

* Add unimplemented stubs for Cranelift interfaces

Cranelift changes to FuncEnvironment, TargetEnvironment, and GlobalInit (see https://github.com/bytecodealliance/cranelift/pull/1073) require these changes to compile wasmtime.

* Upgrade Cranelift to 0.52.0
This commit is contained in:
Andrew Brown
2019-12-31 10:24:56 -08:00
committed by Yury Delendik
parent 681445b18b
commit 69683e8b67
9 changed files with 125 additions and 39 deletions

View File

@@ -7,7 +7,7 @@ use cranelift_codegen::isa::TargetFrontendConfig;
use cranelift_entity::PrimaryMap;
use cranelift_wasm::{
self, translate_module, DefinedFuncIndex, FuncIndex, Global, GlobalIndex, Memory, MemoryIndex,
ModuleTranslationState, SignatureIndex, Table, TableIndex, WasmResult,
ModuleTranslationState, SignatureIndex, Table, TableIndex, TargetEnvironment, WasmResult,
};
use std::convert::TryFrom;
@@ -86,13 +86,15 @@ impl<'data> ModuleEnvironment<'data> {
}
}
/// This trait is useful for `translate_module` because it tells how to translate
/// environment-dependent wasm instructions. These functions should not be called by the user.
impl<'data> cranelift_wasm::ModuleEnvironment<'data> for ModuleEnvironment<'data> {
impl<'data> TargetEnvironment for ModuleEnvironment<'data> {
fn target_config(&self) -> TargetFrontendConfig {
self.result.target_config
}
}
/// This trait is useful for `translate_module` because it tells how to translate
/// environment-dependent wasm instructions. These functions should not be called by the user.
impl<'data> cranelift_wasm::ModuleEnvironment<'data> for ModuleEnvironment<'data> {
fn reserve_signatures(&mut self, num: u32) -> WasmResult<()> {
self.result
.module