Update emscripten to latest changes

This commit is contained in:
Steve Akinyemi
2019-01-17 19:55:25 +01:00
parent 16a67c996a
commit 0bf6ce49f6
9 changed files with 445 additions and 457 deletions

View File

@@ -32,7 +32,7 @@ impl FuncResolver for PlaceholderFuncResolver {
/// This contains all of the items in a `ModuleInner` except the `func_resolver`.
pub struct Module {
module: ModuleInner,
pub module: ModuleInner,
}
impl Module {

File diff suppressed because it is too large Load Diff

View File

@@ -6,14 +6,16 @@ use std::ffi::CStr;
use std::mem::size_of;
use std::os::raw::c_char;
use std::slice;
use std::sync::Arc;
/// We check if a provided module is an Emscripten generated one
pub fn is_emscripten_module(module: &Module) -> bool {
for (_, import_name) in &module.imported_functions {
if import_name.name == "_emscripten_memcpy_big" && import_name.namespace == "env" {
return true;
}
}
false
pub fn is_emscripten_module(module: &Arc<Module>) -> bool {
// for (_, import_name) in &module.imported_functions {
// if import_name.name == "_emscripten_memcpy_big" && import_name.namespace == "env" {
// return true;
// }
// }
// false
true
}
pub unsafe fn write_to_buf(string: *const c_char, buf: u32, max: u32, instance: &Instance) -> u32 {

View File

@@ -24,7 +24,7 @@ pub(crate) struct InstanceInner {
}
pub struct Instance {
pub(crate) module: Rc<ModuleInner>,
pub module: Rc<ModuleInner>,
inner: Box<InstanceInner>,
#[allow(dead_code)]
imports: Box<Imports>,

View File

@@ -3,7 +3,7 @@
extern crate field_offset;
#[macro_use]
mod macros;
pub mod macros;
#[doc(hidden)]
pub mod backend;
mod backing;

View File

@@ -1,3 +1,4 @@
#[macro_export]
macro_rules! debug {
($fmt:expr) => (if cfg!(any(debug_assertions, feature="debug")) { println!(concat!("wasmer-runtime(:{})::", $fmt), line!()) });
($fmt:expr, $($arg:tt)*) => (if cfg!(any(debug_assertions, feature="debug")) { println!(concat!("wasmer-runtime(:{})::", $fmt, "\n"), line!(), $($arg)*) });

View File

@@ -39,7 +39,7 @@ pub struct ModuleInner {
pub sig_registry: SigRegistry,
}
pub struct Module(Rc<ModuleInner>);
pub struct Module(pub Rc<ModuleInner>);
impl Module {
pub(crate) fn new(inner: Rc<ModuleInner>) -> Self {