Merge branch 'optimizations' of github.com:fluencelabs/interface-types into optimizations

This commit is contained in:
vms
2021-04-23 23:57:46 +03:00
11 changed files with 1 additions and 26 deletions

View File

@@ -38,7 +38,6 @@ pub fn ser_type_size(ty: &IType) -> usize {
// Vec-like types are passed by pointer and size
IType::String | IType::ByteArray | IType::Array(_) => 2 * WASM_POINTER_SIZE,
IType::S64 | IType::U64 | IType::I64 | IType::F64 => 8,
IType::U128 => 16,
}
}
@@ -49,7 +48,6 @@ pub fn ser_value_size(value: &IValue) -> u32 {
IValue::S16(_) | IValue::U16(_) => 2,
IValue::S32(_) | IValue::U32(_) | IValue::F32(_) | IValue::I32(_) => 4,
IValue::S64(_) | IValue::U64(_) | IValue::F64(_) | IValue::I64(_) => 8,
IValue::U128(_) => 16,
IValue::String(_) | IValue::ByteArray(_) | IValue::Array(_) => 2 * 4,
IValue::Record(_) => 4,
}
@@ -73,7 +71,6 @@ pub fn type_tag_form_itype(itype: &IType) -> u32 {
IType::U16 => 2, // u16
IType::U32 => 3, // u32
IType::U64 => 4, // u64
IType::U128 => 5, // u128
IType::S8 => 6, // i8
IType::S16 => 7, // i16
IType::S32 | IType::I32 => 8, // i32
@@ -93,7 +90,6 @@ pub fn type_tag_form_ivalue(itype: &IValue) -> u32 {
IValue::U16(_) => 2, // u16
IValue::U32(_) => 3, // u32
IValue::U64(_) => 4, // u64
IValue::U128(_) => 5, // u128
IValue::S8(_) => 6, // i8
IValue::S16(_) => 7, // i16
IValue::S32(_) | IValue::I32(_) => 8, // i32

View File

@@ -103,7 +103,6 @@ impl<'m> MemoryReader<'m> {
read_array_ty!(read_s64_array, i64, S64);
read_array_ty!(read_i64_array, i64, I64);
read_array_ty!(read_f64_array, f64, F64);
read_array_ty!(read_u128_array, u128, U128);
}
impl<'r, 'm> SequentialReader<'r, 'm> {
@@ -130,5 +129,4 @@ impl<'r, 'm> SequentialReader<'r, 'm> {
read_ty!(read_u64, u64, 8);
read_ty!(read_i64, i64, 8);
read_ty!(read_f64, f64, 8);
read_ty!(read_u128, u128, 16);
}