Update cranelift (v0.32) and wasmparser deps

This commit is contained in:
Yury Delendik
2019-07-02 15:58:41 -05:00
parent 762cd3fb32
commit 8b9c170a91
2 changed files with 14 additions and 7 deletions

View File

@@ -13,13 +13,13 @@ edition = "2018"
smallvec = "0.6" smallvec = "0.6"
dynasm = "0.3" dynasm = "0.3"
dynasmrt = "0.3" dynasmrt = "0.3"
wasmparser = "0.29" wasmparser = "0.32"
memoffset = "0.2" memoffset = "0.2"
itertools = "0.8" itertools = "0.8"
capstone = "0.5.0" capstone = "0.5.0"
failure = "0.1.3" failure = "0.1.3"
failure_derive = "0.1.3" failure_derive = "0.1.3"
cranelift-codegen = "0.30" cranelift-codegen = "0.32"
multi_mut = "0.1" multi_mut = "0.1"
either = "1.5" either = "1.5"
wabt = "0.7" wabt = "0.7"

View File

@@ -290,6 +290,13 @@ impl SignlessType {
} }
} }
fn create_returns_from_wasm_type(ty: wasmparser::TypeOrFuncType) -> Vec<SignlessType> {
match ty {
wasmparser::TypeOrFuncType::Type(ty) => Vec::from_iter(Type::from_wasm(ty)),
wasmparser::TypeOrFuncType::FuncType(_) => panic!("unsupported func type"),
}
}
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct BrTable<L> { pub struct BrTable<L> {
pub targets: Vec<BrTargetDrop<L>>, pub targets: Vec<BrTargetDrop<L>>,
@@ -1415,9 +1422,9 @@ where
self.stack.clone() self.stack.clone()
} }
fn block_params_with_wasm_type(&self, ty: wasmparser::Type) -> Vec<SignlessType> { fn block_params_with_wasm_type(&self, ty: wasmparser::TypeOrFuncType) -> Vec<SignlessType> {
let mut out = self.block_params(); let mut out = self.block_params();
out.extend(Type::from_wasm(ty)); out.extend(create_returns_from_wasm_type(ty));
out out
} }
} }
@@ -1546,7 +1553,7 @@ where
self.control_frames.push(ControlFrame { self.control_frames.push(ControlFrame {
id, id,
arguments: self.stack.len() as u32, arguments: self.stack.len() as u32,
returns: Vec::from_iter(Type::from_wasm(ty)), returns: create_returns_from_wasm_type(ty),
kind: ControlFrameKind::Block { kind: ControlFrameKind::Block {
needs_end_label: false, needs_end_label: false,
}, },
@@ -1561,7 +1568,7 @@ where
self.control_frames.push(ControlFrame { self.control_frames.push(ControlFrame {
id, id,
arguments: self.stack.len() as u32, arguments: self.stack.len() as u32,
returns: Vec::from_iter(Type::from_wasm(ty)), returns: create_returns_from_wasm_type(ty),
kind: ControlFrameKind::Loop, kind: ControlFrameKind::Loop,
}); });
let label = (id, NameTag::Header); let label = (id, NameTag::Header);
@@ -1579,7 +1586,7 @@ where
self.control_frames.push(ControlFrame { self.control_frames.push(ControlFrame {
id, id,
arguments: self.stack.len() as u32, arguments: self.stack.len() as u32,
returns: Vec::from_iter(Type::from_wasm(ty)), returns: create_returns_from_wasm_type(ty),
kind: ControlFrameKind::If { has_else: false }, kind: ControlFrameKind::If { has_else: false },
}); });
let (then, else_, end) = ( let (then, else_, end) = (