feat(interface-types) Draft instruction interpreter.

This commit is contained in:
Ivan Enderlin
2019-09-19 00:18:36 +02:00
parent dcf8a12cdb
commit 23d5e7b7b3
7 changed files with 185 additions and 29 deletions

View File

@ -1,3 +1,4 @@
use crate::instructions::Instruction;
use std::str;
#[derive(PartialEq, Debug)]
@ -21,30 +22,6 @@ pub(crate) enum AdapterKind {
HelperFunction,
}
#[derive(PartialEq, Debug)]
pub enum Instruction<'input> {
ArgumentGet(u64),
Call(u64),
CallExport(&'input str),
ReadUtf8,
WriteUtf8(&'input str),
AsWasm(InterfaceType),
AsInterface(InterfaceType),
TableRefAdd,
TableRefGet,
CallMethod(u64),
MakeRecord(InterfaceType),
GetField(InterfaceType, u64),
Const(InterfaceType, u64),
FoldSeq(u64),
Add(InterfaceType),
MemToSeq(InterfaceType, &'input str),
Load(InterfaceType, &'input str),
SeqNew(InterfaceType),
ListPush,
RepeatWhile(u64, u64),
}
#[derive(PartialEq, Debug)]
pub struct Export<'input> {
pub name: &'input str,