cranelift-module: Add support for passing a StackMapSink when defining functions

Fixes #2738

This follows the convention set by the existing method of passing a
TrapSink by adding another argument for a StackMapSink.
This commit is contained in:
Will Robson
2021-03-18 16:49:17 +00:00
parent 59dfe4b9f4
commit 38926fb1fc
6 changed files with 26 additions and 24 deletions

View File

@@ -469,6 +469,7 @@ pub trait Module {
func: FuncId,
ctx: &mut Context,
trap_sink: &mut dyn binemit::TrapSink,
stack_map_sink: &mut dyn binemit::StackMapSink,
) -> ModuleResult<ModuleCompiledFunction>;
/// Define a function, taking the function body from the given `bytes`.
@@ -562,8 +563,9 @@ impl<M: Module> Module for &mut M {
func: FuncId,
ctx: &mut Context,
trap_sink: &mut dyn binemit::TrapSink,
stack_map_sink: &mut dyn binemit::StackMapSink,
) -> ModuleResult<ModuleCompiledFunction> {
(**self).define_function(func, ctx, trap_sink)
(**self).define_function(func, ctx, trap_sink, stack_map_sink)
}
fn define_function_bytes(