mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-12 21:38:39 +00:00
feat(deprecated) Remove debugging statements.
This commit is contained in:
@@ -21,19 +21,20 @@ impl PreInstance {
|
|||||||
|
|
||||||
// #[derive(Clone)]
|
// #[derive(Clone)]
|
||||||
pub struct Instance {
|
pub struct Instance {
|
||||||
pub exports: Exports,
|
|
||||||
pre_instance: Box<PreInstance>,
|
pre_instance: Box<PreInstance>,
|
||||||
|
pub exports: Exports,
|
||||||
pub(crate) new_instance: new::wasmer::Instance,
|
pub(crate) new_instance: new::wasmer::Instance,
|
||||||
// vmctx: vm::Ctx,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Instance {
|
impl Instance {
|
||||||
pub(crate) fn new(mut pre_instance: Box<PreInstance>, new_instance: new::wasmer::Instance) -> Self {
|
pub(crate) fn new(
|
||||||
pre_instance.vmctx.x = 42;
|
mut pre_instance: Box<PreInstance>,
|
||||||
|
new_instance: new::wasmer::Instance,
|
||||||
|
) -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
pre_instance,
|
||||||
exports: new_instance.exports.clone(),
|
exports: new_instance.exports.clone(),
|
||||||
new_instance,
|
new_instance,
|
||||||
pre_instance,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ impl Module {
|
|||||||
import_object: &crate::import::ImportObject,
|
import_object: &crate::import::ImportObject,
|
||||||
) -> Result<Instance, InstantiationError> {
|
) -> Result<Instance, InstantiationError> {
|
||||||
let pre_instance = Box::new(PreInstance::new());
|
let pre_instance = Box::new(PreInstance::new());
|
||||||
dbg!(pre_instance.vmctx_ptr());
|
|
||||||
|
|
||||||
let import_object = {
|
let import_object = {
|
||||||
// Replace the fake `vm::Ctx` of host functions.
|
// Replace the fake `vm::Ctx` of host functions.
|
||||||
@@ -51,9 +50,9 @@ impl Module {
|
|||||||
.map(|((namespace, name), export)| match export {
|
.map(|((namespace, name), export)| match export {
|
||||||
Export::Function(mut function) => {
|
Export::Function(mut function) => {
|
||||||
if function.vmctx.is_null() {
|
if function.vmctx.is_null() {
|
||||||
|
// That's an ugly hack. Go your way :-].
|
||||||
function.vmctx = pre_instance.vmctx_ptr() as _;
|
function.vmctx = pre_instance.vmctx_ptr() as _;
|
||||||
}
|
}
|
||||||
dbg!(function.vmctx);
|
|
||||||
|
|
||||||
(
|
(
|
||||||
(namespace, name),
|
(namespace, name),
|
||||||
@@ -82,7 +81,6 @@ impl Module {
|
|||||||
|
|
||||||
new_import_object
|
new_import_object
|
||||||
};
|
};
|
||||||
dbg!(pre_instance.vmctx_ptr());
|
|
||||||
|
|
||||||
Ok(Instance::new(
|
Ok(Instance::new(
|
||||||
pre_instance,
|
pre_instance,
|
||||||
|
|||||||
Reference in New Issue
Block a user