Update Lightbeam for various API changes.
This commit is contained in:
@@ -22,7 +22,7 @@ failure_derive = "0.1.3"
|
|||||||
cranelift-codegen = "0.44"
|
cranelift-codegen = "0.44"
|
||||||
multi_mut = "0.1"
|
multi_mut = "0.1"
|
||||||
either = "1.5"
|
either = "1.5"
|
||||||
wabt = "0.7"
|
wabt = "0.9.2"
|
||||||
lazy_static = "1.2"
|
lazy_static = "1.2"
|
||||||
quickcheck = "0.7"
|
quickcheck = "0.7"
|
||||||
typemap = "0.3"
|
typemap = "0.3"
|
||||||
|
|||||||
@@ -153,6 +153,10 @@ pub enum CompileError {
|
|||||||
/// A compilation error occured.
|
/// A compilation error occured.
|
||||||
#[fail(display = "Compilation error: {}", _0)]
|
#[fail(display = "Compilation error: {}", _0)]
|
||||||
Codegen(CodegenError),
|
Codegen(CodegenError),
|
||||||
|
|
||||||
|
/// A compilation error occured.
|
||||||
|
#[fail(display = "Debug info is not supported with this configuration")]
|
||||||
|
DebugInfoNotSupported,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An implementation of a compiler from parsed WebAssembly module to native code.
|
/// An implementation of a compiler from parsed WebAssembly module to native code.
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
//! Support for compiling with Lightbeam.
|
//! Support for compiling with Lightbeam.
|
||||||
|
|
||||||
use crate::compilation::{AddressTransforms, Compilation, CompileError, Relocations};
|
use crate::compilation::{Compilation, CompileError, Relocations, Traps};
|
||||||
use crate::func_environ::FuncEnvironment;
|
use crate::func_environ::FuncEnvironment;
|
||||||
use crate::module::Module;
|
use crate::module::Module;
|
||||||
use crate::module_environ::FunctionBodyData;
|
use crate::module_environ::FunctionBodyData;
|
||||||
// TODO: Put this in `compilation`
|
// TODO: Put this in `compilation`
|
||||||
|
use crate::address_map::{ModuleAddressMap, ValueLabelsRanges};
|
||||||
use crate::cranelift::RelocSink;
|
use crate::cranelift::RelocSink;
|
||||||
use cranelift_codegen::isa;
|
use cranelift_codegen::{ir, isa};
|
||||||
use cranelift_entity::{PrimaryMap, SecondaryMap};
|
use cranelift_entity::{PrimaryMap, SecondaryMap};
|
||||||
use cranelift_wasm::DefinedFuncIndex;
|
use cranelift_wasm::DefinedFuncIndex;
|
||||||
use lightbeam;
|
use lightbeam;
|
||||||
@@ -22,8 +23,22 @@ impl crate::compilation::Compiler for Lightbeam {
|
|||||||
function_body_inputs: PrimaryMap<DefinedFuncIndex, FunctionBodyData<'data>>,
|
function_body_inputs: PrimaryMap<DefinedFuncIndex, FunctionBodyData<'data>>,
|
||||||
isa: &dyn isa::TargetIsa,
|
isa: &dyn isa::TargetIsa,
|
||||||
// TODO
|
// TODO
|
||||||
_generate_debug_info: bool,
|
generate_debug_info: bool,
|
||||||
) -> Result<(Compilation, Relocations, AddressTransforms), CompileError> {
|
) -> Result<
|
||||||
|
(
|
||||||
|
Compilation,
|
||||||
|
Relocations,
|
||||||
|
ModuleAddressMap,
|
||||||
|
ValueLabelsRanges,
|
||||||
|
PrimaryMap<DefinedFuncIndex, ir::StackSlots>,
|
||||||
|
Traps,
|
||||||
|
),
|
||||||
|
CompileError,
|
||||||
|
> {
|
||||||
|
if generate_debug_info {
|
||||||
|
return Err(CompileError::DebugInfoNotSupported);
|
||||||
|
}
|
||||||
|
|
||||||
let env = FuncEnvironment::new(isa.frontend_config(), module);
|
let env = FuncEnvironment::new(isa.frontend_config(), module);
|
||||||
let mut relocations = PrimaryMap::new();
|
let mut relocations = PrimaryMap::new();
|
||||||
let mut codegen_session: lightbeam::CodeGenSession<_> =
|
let mut codegen_session: lightbeam::CodeGenSession<_> =
|
||||||
@@ -57,7 +72,10 @@ impl crate::compilation::Compiler for Lightbeam {
|
|||||||
Ok((
|
Ok((
|
||||||
Compilation::from_buffer(code_section.buffer().to_vec(), code_section_ranges_and_jt),
|
Compilation::from_buffer(code_section.buffer().to_vec(), code_section_ranges_and_jt),
|
||||||
relocations,
|
relocations,
|
||||||
AddressTransforms::new(),
|
ModuleAddressMap::new(),
|
||||||
|
ValueLabelsRanges::new(),
|
||||||
|
PrimaryMap::new(),
|
||||||
|
Traps::new(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user