Rename engine's Universal type to Backend

The Universal type was essentially a builder of engines that's given a
compiler backend and creates an Engine with .engine() method. The name
was not clear.
This commit is contained in:
Manos Pitsidianakis
2022-07-25 11:48:04 +03:00
parent b9ab9515c1
commit 4a06b1d3f6
45 changed files with 109 additions and 109 deletions

View File

@@ -77,9 +77,9 @@ compile_error!(
If you wish to use more than one compiler, you can simply create the own store. Eg.:
```
use wasmer::{Store, Universal, Singlepass};
use wasmer::{Store, Backend, Singlepass};
let engine = Universal::new(Singlepass::default()).engine();
let engine = Backend::new(Singlepass::default()).engine();
let mut store = Store::new_with_engine(&engine);
```"#
);
@@ -94,7 +94,7 @@ pub use wasmer_compiler_cranelift::{Cranelift, CraneliftOptLevel};
pub use wasmer_compiler_llvm::{LLVMOptLevel, LLVM};
#[cfg(feature = "universal")]
pub use wasmer_compiler::{Artifact, Engine, Universal};
pub use wasmer_compiler::{Artifact, Backend, Engine};
/// Version number of this crate.
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
@@ -102,7 +102,7 @@ pub const VERSION: &str = env!("CARGO_PKG_VERSION");
/// The Deprecated JIT Engine (please use `Universal` instead)
#[cfg(feature = "jit")]
#[deprecated(since = "2.0.0", note = "Please use the `universal` feature instead")]
pub type JIT = Universal;
pub type JIT = Backend;
/// This type is deprecated, it has been replaced by TypedFunction.
#[deprecated(

View File

@@ -4,7 +4,7 @@ use std::sync::{Arc, RwLock};
#[cfg(feature = "compiler")]
use wasmer_compiler::CompilerConfig;
#[cfg(feature = "compiler")]
use wasmer_compiler::{Engine, Tunables, Universal};
use wasmer_compiler::{Backend, Engine, Tunables};
use wasmer_vm::{init_traps, TrapHandler, TrapHandlerFn};
use wasmer_vm::StoreObjects;
@@ -39,7 +39,7 @@ impl Store {
#[cfg(feature = "compiler")]
/// Creates a new `Store` with a specific [`CompilerConfig`].
pub fn new(compiler_config: Box<dyn CompilerConfig>) -> Self {
let engine = Universal::new(compiler_config).engine();
let engine = Backend::new(compiler_config).engine();
Self::new_with_tunables(&engine, BaseTunables::for_target(engine.target()))
}
@@ -145,7 +145,7 @@ impl Default for Store {
fn get_engine(mut config: impl CompilerConfig + 'static) -> Engine {
cfg_if::cfg_if! {
if #[cfg(feature = "default-universal")] {
wasmer_compiler::Universal::new(config)
wasmer_compiler::Backend::new(config)
.engine()
} else {
compile_error!("No default engine chosen")