Add updates from feedback

Co-authored-by: Nick Lewycky <nick@wasmer.io>
This commit is contained in:
Mark McCaskey
2020-02-20 11:20:40 -08:00
parent 3bca20d3d3
commit 65a9e04f3c
4 changed files with 18 additions and 26 deletions

View File

@@ -257,7 +257,11 @@ pub struct CraneliftFunctionCodeGenerator {
next_local: usize,
position: Position,
func_env: FunctionEnvironment,
/// Start location of the function as an offset in bytes in the Wasm module
/// from the beginning of the code section.
start: u32,
/// End location of the function as an offset in bytes in the Wasm module
/// from the beginning of the code section.
end: u32,
}
@@ -1255,11 +1259,9 @@ fn declare_wasm_parameters(builder: &mut FunctionBuilder, entry_block: Ebb) -> u
// This is a normal WebAssembly signature parameter, so create a local for it.
let local = Variable::new(next_local);
builder.declare_var(local, param_type.value_type);
//let value_label = ValueLabel::from_u32(next_local as u32);
next_local += 1;
let param_value = builder.ebb_params(entry_block)[i];
//builder.set_val_label(param_value, value_label);
builder.def_var(local, param_value);
}
if param_type.purpose == ir::ArgumentPurpose::VMContext {

View File

@@ -112,18 +112,18 @@ impl FuncResolverBuilder {
let generate_debug_info = info.generate_debug_info;
let fb = function_bodies.iter().collect::<Vec<(_, _)>>();
let compiled_functions: Result<
Vec<(
Vec<u8>,
(
LocalFuncIndex,
Option<(CompiledFunctionData, ValueLabelsRanges, Vec<Option<i32>>)>,
RelocSink,
LocalTrapSink,
),
)>,
CompileError,
> = fb
/// Data about the the compiled machine code.
type CompileMetadata = (
LocalFuncIndex,
Option<(CompiledFunctionData, ValueLabelsRanges, Vec<Option<i32>>)>,
RelocSink,
LocalTrapSink,
);
/// Compiled machine code and information about it
type CompileData = (Vec<u8>, CompileMetadata);
let compiled_functions: Result<Vec<CompileData>, CompileError> = fb
.par_iter()
.map_init(
|| Context::new(),