feat(interface-types) Rename call to call-core, and remove call-export.

This commit is contained in:
Ivan Enderlin
2020-03-09 14:33:17 +01:00
parent f38c45e373
commit f342670532
10 changed files with 52 additions and 288 deletions

View File

@ -255,16 +255,11 @@ where
(*index as u64).to_bytes(writer)?;
}
Instruction::Call { function_index } => {
Instruction::CallCore { function_index } => {
0x01_u8.to_bytes(writer)?;
(*function_index as u64).to_bytes(writer)?;
}
Instruction::CallExport { export_name } => {
0x02_u8.to_bytes(writer)?;
export_name.to_bytes(writer)?;
}
Instruction::ReadUtf8 => 0x03_u8.to_bytes(writer)?,
Instruction::WriteUtf8 { allocator_name } => {
@ -554,8 +549,7 @@ mod tests {
assert_to_bytes!(
vec![
Instruction::ArgumentGet { index: 1 },
Instruction::Call { function_index: 1 },
Instruction::CallExport { export_name: "abc" },
Instruction::CallCore { function_index: 1 },
Instruction::ReadUtf8,
Instruction::WriteUtf8 {
allocator_name: "abc",
@ -601,10 +595,9 @@ mod tests {
Instruction::U64ToI64,
],
&[
0x2c, // list of 44 items
0x2b, // list of 43 items
0x00, 0x01, // ArgumentGet { index: 1 }
0x01, 0x01, // Call { function_index: 1 }
0x02, 0x03, 0x61, 0x62, 0x63, // CallExport { export_name: "abc" }
0x01, 0x01, // CallCore { function_index: 1 }
0x03, // ReadUtf8
0x04, 0x03, 0x61, 0x62, 0x63, // WriteUtf8 { allocator_name: "abc" }
0x07, // I32ToS8