remove excess logging

This commit is contained in:
vms 2020-06-02 00:34:49 +03:00
parent ddb5c9881a
commit 541a19ff29
3 changed files with 9 additions and 12 deletions

View File

@ -71,7 +71,6 @@ impl WITFunction {
let func_type = wit_module.as_ref().get_func_signature(&func_name)?; let func_type = wit_module.as_ref().get_func_signature(&func_name)?;
let inputs = func_type.0.clone(); let inputs = func_type.0.clone();
let outputs = func_type.1.clone(); let outputs = func_type.1.clone();
println!("from_import: {:?}", inputs);
let inner = WITFunctionInner::Import { let inner = WITFunctionInner::Import {
wit_module, wit_module,

View File

@ -46,9 +46,7 @@ impl WITInstance {
modules: &HashMap<String, Arc<WITModule>>, modules: &HashMap<String, Arc<WITModule>>,
) -> Result<Self, WITFCEError> { ) -> Result<Self, WITFCEError> {
let mut exports = Self::extract_exports(&wasmer_instance, interfaces)?; let mut exports = Self::extract_exports(&wasmer_instance, interfaces)?;
println!("exports count {}", exports.len());
let imports = Self::extract_imports(modules, interfaces, exports.len())?; let imports = Self::extract_imports(modules, interfaces, exports.len())?;
println!("imports count {}", imports.len());
let memories = Self::extract_memories(&wasmer_instance); let memories = Self::extract_memories(&wasmer_instance);
exports.extend(imports); exports.extend(imports);

View File

@ -170,8 +170,6 @@ impl WITModule {
&interfaces.types[i.adapter_function_type as usize] &interfaces.types[i.adapter_function_type as usize]
{ {
for export_function_name in export_function_names.iter() { for export_function_name in export_function_names.iter() {
println!("export func name {}", export_function_name);
// TODO: handle errors // TODO: handle errors
let interpreter: WITInterpreter = adapter_instructions.try_into().unwrap(); let interpreter: WITInterpreter = adapter_instructions.try_into().unwrap();
wit_callable_exports.insert( wit_callable_exports.insert(
@ -257,17 +255,19 @@ impl WITModule {
let wit_instance = wit_instance.clone(); let wit_instance = wit_instance.clone();
let inner_import = Box::new(move |_: &mut Ctx, inputs: &[Value]| -> Vec<Value> { let inner_import = Box::new(move |_: &mut Ctx, inputs: &[Value]| -> Vec<Value> {
println!("calling from import with {:?}", inputs); // copy here to because otherwise wit_instance will be consumed by the closure
let wit_instance_callable = wit_instance.clone();
let tt = wit_instance.clone();
let converted_inputs = inputs.iter().map(wval_to_ival).collect::<Vec<_>>(); let converted_inputs = inputs.iter().map(wval_to_ival).collect::<Vec<_>>();
//let mut wit_instance_copy = Arc::make_mut(tt).unwrap();
unsafe { unsafe {
let r = interpreter // error here will be propagated by the special error instruction
.run(&converted_inputs, Arc::make_mut(&mut tt.assume_init())); let _ = interpreter.run(
println!("import interpreter result is {:?}", r); &converted_inputs,
Arc::make_mut(&mut wit_instance_callable.assume_init()),
);
} }
// wit import functions should only change the stack state -
// the result will be returned by an export function
vec![] vec![]
}); });