feat(interface-types) Rename write-utf8 to string-to-memory.

This commit is contained in:
Ivan Enderlin
2020-03-10 10:25:58 +01:00
parent 2d6b987791
commit a93421f6c2
9 changed files with 213 additions and 215 deletions

View File

@ -267,9 +267,9 @@ where
Instruction::MemoryToString => 0x03_u8.to_bytes(writer)?,
Instruction::WriteUtf8 { allocator_name } => {
Instruction::StringToMemory { allocator_index } => {
0x04_u8.to_bytes(writer)?;
allocator_name.to_bytes(writer)?;
(*allocator_index as u64).to_bytes(writer)?;
}
Instruction::I32ToS8 => 0x07_u8.to_bytes(writer)?,
@ -557,9 +557,7 @@ mod tests {
Instruction::Call { function_index: 1 },
Instruction::CallExport { export_name: "abc" },
Instruction::MemoryToString,
Instruction::WriteUtf8 {
allocator_name: "abc",
},
Instruction::StringToMemory { allocator_index: 1 },
Instruction::I32ToS8,
Instruction::I32ToS8X,
Instruction::I32ToU8,
@ -606,7 +604,7 @@ mod tests {
0x01, 0x01, // Call { function_index: 1 }
0x02, 0x03, 0x61, 0x62, 0x63, // CallExport { export_name: "abc" }
0x03, // MemoryToString
0x04, 0x03, 0x61, 0x62, 0x63, // WriteUtf8 { allocator_name: "abc" }
0x04, 0x01, // StringToMemory { allocator_index: 1 }
0x07, // I32ToS8
0x08, // I32ToS8X
0x09, // I32ToU8