From e75a108998ff408df48fdc60651758f7c8eb7655 Mon Sep 17 00:00:00 2001 From: vms Date: Sat, 24 Apr 2021 23:04:34 +0300 Subject: [PATCH] rename it-lilo-utils to it-lilo --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- crates/{it-lilo-utils => it-lilo}/Cargo.toml | 4 ++-- crates/{it-lilo-utils => it-lilo}/src/lib.rs | 0 .../src/lifter/error.rs | 0 .../src/lifter/lift_array.rs | 0 .../src/lifter/lift_record.rs | 0 .../src/lifter/macros.rs | 0 .../src/lifter/memory_reader.rs | 0 .../src/lifter/mod.rs | 0 .../src/lowerer/error.rs | 0 .../src/lowerer/lower_array.rs | 0 .../src/lowerer/lower_record.rs | 0 .../src/lowerer/memory_writer.rs | 0 .../src/lowerer/mod.rs | 0 .../src/traits/heapable.rs | 0 .../src/traits/mod.rs | 0 .../src/traits/record_resolvable.rs | 0 crates/{it-lilo-utils => it-lilo}/src/utils.rs | 0 crates/it-types/src/values.rs | 2 +- wasmer-it/Cargo.toml | 2 +- wasmer-it/src/errors.rs | 4 ++-- .../src/interpreter/instructions/arrays.rs | 18 +++++++----------- .../interpreter/instructions/lilo/li_helper.rs | 4 ++-- .../interpreter/instructions/lilo/lo_helper.rs | 6 +++--- .../src/interpreter/instructions/records.rs | 8 ++++---- 26 files changed, 25 insertions(+), 29 deletions(-) rename crates/{it-lilo-utils => it-lilo}/Cargo.toml (87%) rename crates/{it-lilo-utils => it-lilo}/src/lib.rs (100%) rename crates/{it-lilo-utils => it-lilo}/src/lifter/error.rs (100%) rename crates/{it-lilo-utils => it-lilo}/src/lifter/lift_array.rs (100%) rename crates/{it-lilo-utils => it-lilo}/src/lifter/lift_record.rs (100%) rename crates/{it-lilo-utils => it-lilo}/src/lifter/macros.rs (100%) rename crates/{it-lilo-utils => it-lilo}/src/lifter/memory_reader.rs (100%) rename crates/{it-lilo-utils => it-lilo}/src/lifter/mod.rs (100%) rename crates/{it-lilo-utils => it-lilo}/src/lowerer/error.rs (100%) rename crates/{it-lilo-utils => it-lilo}/src/lowerer/lower_array.rs (100%) rename crates/{it-lilo-utils => it-lilo}/src/lowerer/lower_record.rs (100%) rename crates/{it-lilo-utils => it-lilo}/src/lowerer/memory_writer.rs (100%) rename crates/{it-lilo-utils => it-lilo}/src/lowerer/mod.rs (100%) rename crates/{it-lilo-utils => it-lilo}/src/traits/heapable.rs (100%) rename crates/{it-lilo-utils => it-lilo}/src/traits/mod.rs (100%) rename crates/{it-lilo-utils => it-lilo}/src/traits/record_resolvable.rs (100%) rename crates/{it-lilo-utils => it-lilo}/src/utils.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 4032009..fdce1a0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -37,7 +37,7 @@ dependencies = [ ] [[package]] -name = "it-lilo-utils" +name = "it-lilo" version = "0.1.0" dependencies = [ "fluence-it-types", @@ -264,7 +264,7 @@ name = "wasmer-interface-types-fl" version = "0.20.0" dependencies = [ "fluence-it-types", - "it-lilo-utils", + "it-lilo", "it-to-bytes", "itertools", "log", diff --git a/Cargo.toml b/Cargo.toml index 726f79a..cc38e80 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace] members = [ - "crates/it-lilo-utils", + "crates/it-lilo", "crates/to-bytes", "crates/it-types", "wasmer-it", diff --git a/crates/it-lilo-utils/Cargo.toml b/crates/it-lilo/Cargo.toml similarity index 87% rename from crates/it-lilo-utils/Cargo.toml rename to crates/it-lilo/Cargo.toml index 05fe25e..6792fbf 100644 --- a/crates/it-lilo-utils/Cargo.toml +++ b/crates/it-lilo/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "it-lilo-utils" +name = "it-lilo" version = "0.1.0" authors = ["Fluence Labs"] description = "Defines some helper utils for lifting/lowering IT" @@ -7,7 +7,7 @@ edition = "2018" license = "Apache-2.0" [lib] -name = "it_lilo_utils" +name = "it_lilo" path = "src/lib.rs" [dependencies] diff --git a/crates/it-lilo-utils/src/lib.rs b/crates/it-lilo/src/lib.rs similarity index 100% rename from crates/it-lilo-utils/src/lib.rs rename to crates/it-lilo/src/lib.rs diff --git a/crates/it-lilo-utils/src/lifter/error.rs b/crates/it-lilo/src/lifter/error.rs similarity index 100% rename from crates/it-lilo-utils/src/lifter/error.rs rename to crates/it-lilo/src/lifter/error.rs diff --git a/crates/it-lilo-utils/src/lifter/lift_array.rs b/crates/it-lilo/src/lifter/lift_array.rs similarity index 100% rename from crates/it-lilo-utils/src/lifter/lift_array.rs rename to crates/it-lilo/src/lifter/lift_array.rs diff --git a/crates/it-lilo-utils/src/lifter/lift_record.rs b/crates/it-lilo/src/lifter/lift_record.rs similarity index 100% rename from crates/it-lilo-utils/src/lifter/lift_record.rs rename to crates/it-lilo/src/lifter/lift_record.rs diff --git a/crates/it-lilo-utils/src/lifter/macros.rs b/crates/it-lilo/src/lifter/macros.rs similarity index 100% rename from crates/it-lilo-utils/src/lifter/macros.rs rename to crates/it-lilo/src/lifter/macros.rs diff --git a/crates/it-lilo-utils/src/lifter/memory_reader.rs b/crates/it-lilo/src/lifter/memory_reader.rs similarity index 100% rename from crates/it-lilo-utils/src/lifter/memory_reader.rs rename to crates/it-lilo/src/lifter/memory_reader.rs diff --git a/crates/it-lilo-utils/src/lifter/mod.rs b/crates/it-lilo/src/lifter/mod.rs similarity index 100% rename from crates/it-lilo-utils/src/lifter/mod.rs rename to crates/it-lilo/src/lifter/mod.rs diff --git a/crates/it-lilo-utils/src/lowerer/error.rs b/crates/it-lilo/src/lowerer/error.rs similarity index 100% rename from crates/it-lilo-utils/src/lowerer/error.rs rename to crates/it-lilo/src/lowerer/error.rs diff --git a/crates/it-lilo-utils/src/lowerer/lower_array.rs b/crates/it-lilo/src/lowerer/lower_array.rs similarity index 100% rename from crates/it-lilo-utils/src/lowerer/lower_array.rs rename to crates/it-lilo/src/lowerer/lower_array.rs diff --git a/crates/it-lilo-utils/src/lowerer/lower_record.rs b/crates/it-lilo/src/lowerer/lower_record.rs similarity index 100% rename from crates/it-lilo-utils/src/lowerer/lower_record.rs rename to crates/it-lilo/src/lowerer/lower_record.rs diff --git a/crates/it-lilo-utils/src/lowerer/memory_writer.rs b/crates/it-lilo/src/lowerer/memory_writer.rs similarity index 100% rename from crates/it-lilo-utils/src/lowerer/memory_writer.rs rename to crates/it-lilo/src/lowerer/memory_writer.rs diff --git a/crates/it-lilo-utils/src/lowerer/mod.rs b/crates/it-lilo/src/lowerer/mod.rs similarity index 100% rename from crates/it-lilo-utils/src/lowerer/mod.rs rename to crates/it-lilo/src/lowerer/mod.rs diff --git a/crates/it-lilo-utils/src/traits/heapable.rs b/crates/it-lilo/src/traits/heapable.rs similarity index 100% rename from crates/it-lilo-utils/src/traits/heapable.rs rename to crates/it-lilo/src/traits/heapable.rs diff --git a/crates/it-lilo-utils/src/traits/mod.rs b/crates/it-lilo/src/traits/mod.rs similarity index 100% rename from crates/it-lilo-utils/src/traits/mod.rs rename to crates/it-lilo/src/traits/mod.rs diff --git a/crates/it-lilo-utils/src/traits/record_resolvable.rs b/crates/it-lilo/src/traits/record_resolvable.rs similarity index 100% rename from crates/it-lilo-utils/src/traits/record_resolvable.rs rename to crates/it-lilo/src/traits/record_resolvable.rs diff --git a/crates/it-lilo-utils/src/utils.rs b/crates/it-lilo/src/utils.rs similarity index 100% rename from crates/it-lilo-utils/src/utils.rs rename to crates/it-lilo/src/utils.rs diff --git a/crates/it-types/src/values.rs b/crates/it-types/src/values.rs index b3a8f3a..2e0a237 100644 --- a/crates/it-types/src/values.rs +++ b/crates/it-types/src/values.rs @@ -37,7 +37,7 @@ pub enum IValue { /// A 64-bits float. F64(f64), - + /// A string. String(String), diff --git a/wasmer-it/Cargo.toml b/wasmer-it/Cargo.toml index ef8b07d..a16f5d6 100644 --- a/wasmer-it/Cargo.toml +++ b/wasmer-it/Cargo.toml @@ -10,7 +10,7 @@ edition = "2018" [dependencies] fluence-it-types = { path = "../crates/it-types", version = "0.2.0", features = ["impls"] } it-to-bytes = { path = "../crates/to-bytes", version = "0.1.0" } -it-lilo-utils = { path = "../crates/it-lilo-utils", version = "0.1.0" } +it-lilo = { path = "../crates/it-lilo", version = "0.1.0" } nom = "5.1" wast = "8.0" diff --git a/wasmer-it/src/errors.rs b/wasmer-it/src/errors.rs index 3d29d3c..9aa428c 100644 --- a/wasmer-it/src/errors.rs +++ b/wasmer-it/src/errors.rs @@ -12,8 +12,8 @@ use std::{ string::{self, ToString}, }; -use it_lilo_utils::lifter::LiError; -use it_lilo_utils::lowerer::LoError; +use it_lilo::lifter::LiError; +use it_lilo::lowerer::LoError; use thiserror::Error as ThisError; pub use fluence_it_types::WasmValueNativeCastError; diff --git a/wasmer-it/src/interpreter/instructions/arrays.rs b/wasmer-it/src/interpreter/instructions/arrays.rs index a3592e6..30867e9 100644 --- a/wasmer-it/src/interpreter/instructions/arrays.rs +++ b/wasmer-it/src/interpreter/instructions/arrays.rs @@ -7,9 +7,9 @@ use crate::{ interpreter::Instruction, IType, IValue, }; -use it_lilo_utils::lifter::ILifter; -use it_lilo_utils::lowerer::ILowerer; -use it_lilo_utils::lowerer::LoweredArray; +use it_lilo::lifter::ILifter; +use it_lilo::lowerer::ILowerer; +use it_lilo::lowerer::LoweredArray; use std::convert::TryInto; @@ -69,13 +69,9 @@ where let li_helper = lilo::LiHelper::new(&**instance); let lifter = ILifter::new(memory, &li_helper); - let array = it_lilo_utils::lifter::array_lift_memory( - &lifter, - &value_type, - offset as _, - size as _, - ) - .map_err(|e| InstructionError::from_li(instruction.clone(), e))?; + let array = + it_lilo::lifter::array_lift_memory(&lifter, &value_type, offset as _, size as _) + .map_err(|e| InstructionError::from_li(instruction.clone(), e))?; log::trace!("array.lift_memory: pushing {:?} on the stack", array); runtime.stack.push(array); @@ -125,7 +121,7 @@ where .map_err(|e| InstructionError::from_lo(instruction.clone(), e))?; let LoweredArray { offset, size } = - it_lilo_utils::lowerer::array_lower_memory(&lowerer, values) + it_lilo::lowerer::array_lower_memory(&lowerer, values) .map_err(|e| InstructionError::from_lo(instruction.clone(), e))?; log::trace!( diff --git a/wasmer-it/src/interpreter/instructions/lilo/li_helper.rs b/wasmer-it/src/interpreter/instructions/lilo/li_helper.rs index 69a3aff..a761a79 100644 --- a/wasmer-it/src/interpreter/instructions/lilo/li_helper.rs +++ b/wasmer-it/src/interpreter/instructions/lilo/li_helper.rs @@ -1,8 +1,8 @@ use crate::interpreter::wasm; use crate::IRecordType; -use it_lilo_utils::traits::RecordResolvable; -use it_lilo_utils::traits::RecordResolvableError; +use it_lilo::traits::RecordResolvable; +use it_lilo::traits::RecordResolvableError; use std::marker::PhantomData; diff --git a/wasmer-it/src/interpreter/instructions/lilo/lo_helper.rs b/wasmer-it/src/interpreter/instructions/lilo/lo_helper.rs index 9501177..72e2b66 100644 --- a/wasmer-it/src/interpreter/instructions/lilo/lo_helper.rs +++ b/wasmer-it/src/interpreter/instructions/lilo/lo_helper.rs @@ -2,9 +2,9 @@ use crate::interpreter::wasm; use crate::interpreter::wasm::structures::FunctionIndex; use crate::IValue; -use it_lilo_utils::traits::Allocatable; -use it_lilo_utils::traits::AllocatableError; -use it_lilo_utils::traits::MemSlice; +use it_lilo::traits::Allocatable; +use it_lilo::traits::AllocatableError; +use it_lilo::traits::MemSlice; use std::marker::PhantomData; diff --git a/wasmer-it/src/interpreter/instructions/records.rs b/wasmer-it/src/interpreter/instructions/records.rs index 4581274..0920b1f 100644 --- a/wasmer-it/src/interpreter/instructions/records.rs +++ b/wasmer-it/src/interpreter/instructions/records.rs @@ -5,8 +5,8 @@ use crate::IType; use crate::IValue; use crate::{errors::InstructionError, errors::InstructionErrorKind, interpreter::Instruction}; -use it_lilo_utils::lifter::ILifter; -use it_lilo_utils::lowerer::ILowerer; +use it_lilo::lifter::ILifter; +use it_lilo::lowerer::ILowerer; use std::convert::TryInto; @@ -67,7 +67,7 @@ where let li_helper = lilo::LiHelper::new(&**instance); let lifter = ILifter::new(memory, &li_helper); - let record = it_lilo_utils::lifter::record_lift_memory(&lifter, record_type, offset) + let record = it_lilo::lifter::record_lift_memory(&lifter, record_type, offset) .map_err(|e| InstructionError::from_li(instruction.clone(), e))?; log::debug!("record.lift_memory: pushing {:?} on the stack", record); @@ -111,7 +111,7 @@ where let memory_writer = ILowerer::new(&lo_helper) .map_err(|e| InstructionError::from_lo(instruction.clone(), e))?; let offset = - it_lilo_utils::lowerer::record_lower_memory(&memory_writer, record_fields) + it_lilo::lowerer::record_lower_memory(&memory_writer, record_fields) .map_err(|e| InstructionError::from_lo(instruction.clone(), e))?; log::debug!("record.lower_memory: pushing {} on the stack", offset);