update to latest parity-wasm

This commit is contained in:
NikVolf
2017-06-06 16:54:22 +03:00
parent 050c0b76a8
commit 4882bace69
4 changed files with 10 additions and 9 deletions
+2 -1
View File
@@ -1,3 +1,4 @@
Cargo.lock
target
.cargo
.cargo
.DS_Store
+1 -1
View File
@@ -46,7 +46,7 @@ pub fn externalize(
if let &elements::Internal::Function(func_idx) = export.1.internal() {
let type_ref = module
.functions_section().expect("Functions section to exist")
.function_section().expect("Functions section to exist")
.entries()[func_idx as usize - import_funcs_total]
.type_ref();
+6 -6
View File
@@ -140,16 +140,16 @@ pub fn optimize(
}
// Forth, delete orphaned functions
if functions_section(module).is_some() && code_section(module).is_some() {
if function_section(module).is_some() && code_section(module).is_some() {
index = 0;
old_index = 0;
loop {
if functions_section(module).expect("Functons section to exist").entries_mut().len() == index { break; }
if function_section(module).expect("Functons section to exist").entries_mut().len() == index { break; }
if stay.contains(&Symbol::Function(old_index)) {
index += 1;
} else {
functions_section(module).expect("Functons section to exist").entries_mut().remove(index);
function_section(module).expect("Functons section to exist").entries_mut().remove(index);
code_section(module).expect("Code section to exist").bodies_mut().remove(index);
eliminated_funcs.push(top_funcs + old_index);
@@ -314,7 +314,7 @@ pub fn global_section<'a>(module: &'a mut elements::Module) -> Option<&'a mut el
None
}
pub fn functions_section<'a>(module: &'a mut elements::Module) -> Option<&'a mut elements::FunctionsSection> {
pub fn function_section<'a>(module: &'a mut elements::Module) -> Option<&'a mut elements::FunctionSection> {
for section in module.sections_mut() {
match section {
&mut elements::Section::Function(ref mut sect) => {
@@ -417,7 +417,7 @@ mod tests {
assert_eq!(
1,
module.functions_section().expect("functions section to be generated").entries().len(),
module.function_section().expect("functions section to be generated").entries().len(),
"There should 2 (two) functions in the optimized module"
);
}
@@ -543,7 +543,7 @@ mod tests {
assert_eq!(
2,
module.functions_section().expect("functions section to be generated").entries().len(),
module.function_section().expect("functions section to be generated").entries().len(),
"There should 2 (two) functions in the optimized module"
);
}
+1 -1
View File
@@ -126,7 +126,7 @@ pub fn expand_symbols(module: &elements::Module, set: &mut HashSet<Symbol>) {
set.insert(symbol);
}
let signature = &module.functions_section().expect("Functions section to exist").entries()[idx];
let signature = &module.function_section().expect("Functions section to exist").entries()[idx];
let type_symbol = Symbol::Type(signature.type_ref() as usize);
if !stop.contains(&type_symbol) {
fringe.push(type_symbol);