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

@@ -8,7 +8,7 @@ repository = "https://github.com/stoklund/cretonne"
license = "Apache-2.0"
[dependencies]
cretonne = { path = "../cretonne" }
cretonne-frontend = { path = "../frontend" }
wasm2cretonne = { path = "../wasm2cretonne" }
cretonne = { git = "https://github.com/stoklund/cretonne.git" }
cretonne-frontend = { git = "https://github.com/stoklund/cretonne.git" }
cretonne-wasm = { git = "https://github.com/stoklund/cretonne.git" }
region = "0.0.8"

View File

@@ -8,7 +8,7 @@ use cretonne::result::CtonError;
use cretonne::ir::entities::AnyEntity;
use cretonne::ir::{self, Ebb, FuncRef, JumpTable, Function};
use cretonne::binemit::{RelocSink, Reloc, CodeOffset};
use wasm2cretonne::{TranslationResult, FunctionTranslation, ImportMappings, FunctionIndex};
use cton_wasm::{TranslationResult, FunctionTranslation, ImportMappings, FunctionIndex};
use std::mem::transmute;
use region::Protection;
use region::protect;

View File

@@ -4,8 +4,8 @@
//! linear memories.
extern crate cretonne;
extern crate wasm2cretonne;
extern crate cton_frontend;
extern crate cton_wasm;
extern crate region;
mod execution;

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 {