Connect trampoline code to trampoline module. Still unimplemented.

This commit is contained in:
Nick Lewycky
2020-04-24 16:31:31 -07:00
parent 474b3eb2f2
commit a6bde15ce5
5 changed files with 49 additions and 13 deletions

View File

@@ -1,4 +1,3 @@
use crate::intrinsics::Intrinsics;
use inkwell::{
context::Context,
module::{Linkage, Module},
@@ -6,12 +5,29 @@ use inkwell::{
values::FunctionValue,
AddressSpace,
};
use wasmer_runtime_core::{
module::ModuleInfo,
structures::{SliceMap, TypedIndex},
types::{FuncSig, SigIndex, Type},
};
use wasm_common::FuncType;
use wasmer_compiler::{Compilation, CompileError, CompiledFunction, Compiler};
pub struct FuncTrampoline {
ctx: Context,
}
impl FuncTrampoline {
pub fn new() -> Self {
Self {
ctx: Context::create(),
}
}
pub fn trampoline(&mut self, ty: &FuncType) -> Result<CompiledFunction, CompileError> {
// TODO: implement this
Err(CompileError::Codegen(
"Trampoline compilation not yet implemented.".to_string(),
))
}
}
/*
pub fn generate_trampolines<'ctx>(
info: &ModuleInfo,
signatures: &SliceMap<SigIndex, FunctionType<'ctx>>,
@@ -117,3 +133,4 @@ fn generate_trampoline<'ctx>(
builder.build_return(None);
Ok(())
}
*/