Check in the wasmstandalone code.

This is based on the code in https://github.com/denismerigoux/cretonne/commits/wasm2cretonne
before wasmstandalone was removed, with minor updates for the new library structure.
It is not yet updated for the latest cretonne API changes.
This commit is contained in:
Dan Gohman
2017-09-05 17:06:51 -07:00
parent 8f6957296e
commit d0fe50a2a8
679 changed files with 31 additions and 57859 deletions

View File

@@ -1,4 +1,4 @@
use wasm2cretonne::{Local, FunctionIndex, GlobalIndex, TableIndex, MemoryIndex, RawByte,
use cton_wasm::{Local, FunctionIndex, GlobalIndex, TableIndex, MemoryIndex, RawByte,
MemoryAddress, Global, GlobalInit, Table, Memory, WasmRuntime};
use cton_frontend::FunctionBuilder;
use cretonne::ir::{MemFlags, Value, InstBuilder, SigRef, FuncRef, ExtFuncData, FunctionName,
@@ -40,7 +40,7 @@ struct MemoryData {
const PAGE_SIZE: usize = 65536;
/// Object containing the standalone runtime information. To be passed after creation as argument
/// to [`wasm2cretonne::translatemodule`](../wasm2cretonne/fn.translate_module.html).
/// to `cton_wasm::translatemodule`.
pub struct StandaloneRuntime {
globals: GlobalsData,
tables: Vec<TableData>,
@@ -68,7 +68,7 @@ impl StandaloneRuntime {
}
/// This trait is useful for
/// [`wasm2cretonne::translatemodule`](../wasm2cretonne/fn.translate_module.html) because it
/// `cton_wasm::translatemodule` because it
/// tells how to translate runtime-dependent wasm instructions. These functions should not be
/// called by the user.
impl WasmRuntime for StandaloneRuntime {