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:
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user