From 3f2299904555dcf17775989f680faeae6d966a39 Mon Sep 17 00:00:00 2001 From: vms Date: Fri, 12 Mar 2021 22:08:17 +0300 Subject: [PATCH] remove deallocating while lifting record and arrays --- .../src/interpreter/instructions/arrays.rs | 2 -- .../src/interpreter/instructions/records.rs | 14 ----------- .../src/interpreter/instructions/utils.rs | 23 ------------------- 3 files changed, 39 deletions(-) diff --git a/wasmer-it/src/interpreter/instructions/arrays.rs b/wasmer-it/src/interpreter/instructions/arrays.rs index 32482e0..af61643 100644 --- a/wasmer-it/src/interpreter/instructions/arrays.rs +++ b/wasmer-it/src/interpreter/instructions/arrays.rs @@ -181,8 +181,6 @@ where } }; - deallocate(instance, instruction, offset as _, size as _)?; - Ok(result_array) } diff --git a/wasmer-it/src/interpreter/instructions/records.rs b/wasmer-it/src/interpreter/instructions/records.rs index f5635e2..abd1c95 100644 --- a/wasmer-it/src/interpreter/instructions/records.rs +++ b/wasmer-it/src/interpreter/instructions/records.rs @@ -12,18 +12,6 @@ use crate::{ }; use std::convert::TryInto; -/* - -struct Record1 { -field1: String, -field2: i32, -} - -// export -fn foo(t: Record1) { - -// import - */ /* /// Build an `IValue::Record` based on values on the stack. @@ -249,8 +237,6 @@ where field_id += 1; } - super::deallocate(instance, instruction, offset as _, size as _)?; - Ok(IValue::Record( NEVec::new(values.into_iter().collect()) .expect("Record must have at least one field, zero given"), diff --git a/wasmer-it/src/interpreter/instructions/utils.rs b/wasmer-it/src/interpreter/instructions/utils.rs index 0e7fd18..5c696a3 100644 --- a/wasmer-it/src/interpreter/instructions/utils.rs +++ b/wasmer-it/src/interpreter/instructions/utils.rs @@ -130,29 +130,6 @@ where to_native::(&values[0], instruction).map(|v| v as usize) } -pub(super) fn deallocate<'instance, Instance, Export, LocalImport, Memory, MemoryView>( - instance: &'instance Instance, - instruction: Instruction, - mem_ptr: i32, - size: i32, -) -> Result<(), InstructionError> -where - Export: wasm::structures::Export + 'instance, - LocalImport: wasm::structures::LocalImport + 'instance, - Memory: wasm::structures::Memory + 'instance, - MemoryView: wasm::structures::MemoryView, - Instance: wasm::structures::Instance, -{ - let _ = call_core( - instance, - DEALLOCATE_FUNC_INDEX, - instruction, - vec![IValue::I32(mem_ptr), IValue::I32(size)], - )?; - - Ok(()) -} - fn call_core<'instance, Instance, Export, LocalImport, Memory, MemoryView>( instance: &'instance Instance, function_index: u32,