Merge branch 'master' of github.com:wasmerio/wasmer into simd

This commit is contained in:
Nick Lewycky
2019-07-16 19:16:45 -07:00
56 changed files with 627 additions and 398 deletions

View File

@ -33,9 +33,9 @@ impl Backend {
pub fn variants() -> &'static [&'static str] {
&[
"cranelift",
#[cfg(feature = "backend:singlepass")]
#[cfg(feature = "backend-singlepass")]
"singlepass",
#[cfg(feature = "backend:llvm")]
#[cfg(feature = "backend-llvm")]
"llvm",
]
}
@ -117,6 +117,7 @@ pub struct CompilerConfig {
pub symbol_map: Option<HashMap<u32, String>>,
pub memory_bound_check_mode: MemoryBoundCheckMode,
pub enforce_stack_check: bool,
pub track_state: bool,
}
pub trait Compiler {

View File

@ -111,7 +111,13 @@ impl ModuleStateMap {
.unwrap();
match fsm.call_offsets.get(&(ip - base)) {
Some(x) => Some((fsm, fsm.diffs[x.diff_id].build_state(fsm))),
Some(x) => {
if x.diff_id < fsm.diffs.len() {
Some((fsm, fsm.diffs[x.diff_id].build_state(fsm)))
} else {
None
}
}
None => None,
}
}
@ -132,7 +138,13 @@ impl ModuleStateMap {
.unwrap();
match fsm.trappable_offsets.get(&(ip - base)) {
Some(x) => Some((fsm, fsm.diffs[x.diff_id].build_state(fsm))),
Some(x) => {
if x.diff_id < fsm.diffs.len() {
Some((fsm, fsm.diffs[x.diff_id].build_state(fsm)))
} else {
None
}
}
None => None,
}
}
@ -149,7 +161,13 @@ impl ModuleStateMap {
.unwrap();
match fsm.loop_offsets.get(&(ip - base)) {
Some(x) => Some((fsm, fsm.diffs[x.diff_id].build_state(fsm))),
Some(x) => {
if x.diff_id < fsm.diffs.len() {
Some((fsm, fsm.diffs[x.diff_id].build_state(fsm)))
} else {
None
}
}
None => None,
}
}

View File

@ -74,7 +74,7 @@ pub struct InternalCtx {
/// A pointer to an array of locally-defined globals, indexed by `GlobalIndex`.
pub globals: *mut *mut LocalGlobal,
/// A pointer to an array of imported memories, indexed by `MemoryIndex,
/// A pointer to an array of imported memories, indexed by `MemoryIndex`,
pub imported_memories: *mut *mut LocalMemory,
/// A pointer to an array of imported tables, indexed by `TableIndex`.