Rename wasmtime-runtime to wasmtime-environ.

This mirrors changes in cranelift.
This commit is contained in:
Dan Gohman
2018-08-03 15:20:19 -07:00
parent b8daa27884
commit 548c45c604
18 changed files with 38 additions and 37 deletions

View File

@@ -1,9 +1,9 @@
[package]
name = "wasmtime-runtime"
name = "wasmtime-environ"
version = "0.0.0"
authors = ["The Cranelift Project Developers"]
publish = false
description = "Standalone runtime support for WebAsssembly code in Cranelift"
description = "Standalone environment support for WebAsssembly code in Cranelift"
repository = "https://github.com/sunfishcode/wasmtime"
license = "Apache-2.0 WITH LLVM-exception"

View File

@@ -17,7 +17,7 @@ pub struct Compilation {
}
impl Compilation {
/// Allocates the runtime data structures with the given flags.
/// Allocates the compilation result with the given function bodies.
pub fn new(functions: Vec<Vec<u8>>) -> Self {
Self { functions }
}

View File

@@ -21,8 +21,8 @@ pub fn get_func_name(func_index: FunctionIndex) -> ir::ExternalName {
ir::ExternalName::user(0, func_index as u32)
}
/// Object containing the standalone runtime information. To be passed after creation as argument
/// to `compile_module`.
/// Object containing the standalone environment information. To be passed after creation as
/// argument to `compile_module`.
pub struct ModuleEnvironment<'data, 'module> {
/// Compilation setting flags.
pub isa: &'module isa::TargetIsa,
@@ -35,7 +35,7 @@ pub struct ModuleEnvironment<'data, 'module> {
}
impl<'data, 'module> ModuleEnvironment<'data, 'module> {
/// Allocates the runtime data structures with the given isa.
/// Allocates the enironment data structures with the given isa.
pub fn new(isa: &'module isa::TargetIsa, module: &'module mut Module) -> Self {
Self {
isa,
@@ -119,7 +119,7 @@ impl<'module_environment> FuncEnvironment<'module_environment> {
/// This trait is useful for
/// `cranelift_wasm::translate_module` because it
/// tells how to translate runtime-dependent wasm instructions. These functions should not be
/// tells how to translate enironment-dependent wasm instructions. These functions should not be
/// called by the user.
impl<'data, 'module> cranelift_wasm::ModuleEnvironment<'data>
for ModuleEnvironment<'data, 'module>

View File

@@ -1,4 +1,4 @@
//! Standalone runtime for WebAssembly using Cranelift. Provides functions to translate
//! Standalone environment for WebAssembly using Cranelift. Provides functions to translate
//! `get_global`, `set_global`, `current_memory`, `grow_memory`, `call_indirect` that hardcode in
//! the translation the base addresses of regions of memory that will hold the globals, tables and
//! linear memories.

View File

@@ -3,7 +3,7 @@ name = "wasmtime-execute"
version = "0.0.0"
authors = ["The Cranelift Project Developers"]
publish = false
description = "JIT-style runtime support for WebAsssembly code in Cranelift"
description = "JIT-style execution for WebAsssembly code in Cranelift"
repository = "https://github.com/sunfishcode/wasmtime"
license = "Apache-2.0 WITH LLVM-exception"
@@ -11,4 +11,4 @@ license = "Apache-2.0 WITH LLVM-exception"
cranelift-codegen = "0.18.1"
cranelift-wasm = "0.18.1"
region = "0.3.0"
wasmtime-runtime = { path = "../runtime" }
wasmtime-environ = { path = "../environ" }

View File

@@ -5,9 +5,10 @@ use region::protect;
use region::Protection;
use std::mem::transmute;
use std::ptr::write_unaligned;
use wasmtime_runtime::{compile_module, Compilation, Module, ModuleTranslation, Relocation};
use wasmtime_environ::{compile_module, Compilation, Module, ModuleTranslation, Relocation};
/// Executes a module that has been translated with the `standalone::Runtime` runtime implementation.
/// Executes a module that has been translated with the `wasmtime-environ` environment
/// implementation.
pub fn compile_and_link_module<'data, 'module>(
isa: &TargetIsa,
translation: &ModuleTranslation<'data, 'module>,
@@ -56,7 +57,7 @@ fn relocate(compilation: &mut Compilation, relocations: &[Vec<Relocation>]) {
}
/// Create the VmCtx data structure for the JIT'd code to use. This must
/// match the VmCtx layout in the runtime.
/// match the VmCtx layout in the environment.
fn make_vmctx(instance: &mut Instance) -> Vec<*mut u8> {
let mut memories = Vec::new();
let mut vmctx = Vec::new();

View File

@@ -3,7 +3,7 @@
use cranelift_codegen::ir;
use cranelift_wasm::GlobalIndex;
use wasmtime_runtime::{DataInitializer, Module, TableElements};
use wasmtime_environ::{DataInitializer, Module, TableElements};
const PAGE_SIZE: usize = 65536;

View File

@@ -15,7 +15,7 @@
extern crate cranelift_codegen;
extern crate cranelift_wasm;
extern crate region;
extern crate wasmtime_runtime;
extern crate wasmtime_environ;
mod execute;
mod instance;

View File

@@ -7,5 +7,5 @@ license = "Apache-2.0 WITH LLVM-exception"
[dependencies]
cranelift-codegen = "0.18.1"
wasmtime-runtime = { path = "../runtime" }
wasmtime-environ = { path = "../environ" }
faerie = "0.4.4"

View File

@@ -1,15 +1,15 @@
use cranelift_codegen::settings;
use cranelift_codegen::settings::Configurable;
use faerie::Artifact;
use wasmtime_runtime;
use wasmtime_environ::{Module, Compilation, Relocations};
/// Emits a module that has been emitted with the `WasmRuntime` runtime
/// Emits a module that has been emitted with the `wasmtime-environ` environment
/// implementation to a native object file.
pub fn emit_module(
obj: &mut Artifact,
module: &wasmtime_runtime::Module,
compilation: &wasmtime_runtime::Compilation,
relocations: &wasmtime_runtime::Relocations,
module: &Module,
compilation: &Compilation,
relocations: &Relocations,
) -> Result<(), String> {
debug_assert!(
module.start_func.is_none() || module.start_func.unwrap() >= module.imported_funcs.len(),

View File

@@ -1,4 +1,4 @@
//! Object-file writing library using the wasmtime runtime.
//! Object-file writing library using the wasmtime environment.
#![deny(missing_docs, trivial_numeric_casts, unused_extern_crates, unstable_features)]
#![warn(unused_import_braces)]
@@ -14,7 +14,7 @@
extern crate cranelift_codegen;
extern crate faerie;
extern crate wasmtime_runtime;
extern crate wasmtime_environ;
mod emit_module;