mirror of
https://github.com/fluencelabs/wasmer
synced 2025-07-31 15:22:03 +00:00
Merge remote-tracking branch 'origin/master' into feature/optional-full-preemption
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
FROM circleci/rust:1.39.0-stretch as wasmer-build-env
|
||||
FROM circleci/rust:1.40.0-stretch as wasmer-build-env
|
||||
RUN sudo apt-get update && \
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
cmake \
|
||||
|
@@ -174,7 +174,7 @@ nginx and Lua do not work on Windows - you can track the progress on [this issue
|
||||
|
||||
## Building
|
||||
|
||||
[](https://blog.rust-lang.org/2019/11/07/Rust-1.39.0.html)
|
||||
[](https://blog.rust-lang.org/2019/12/19/Rust-1.40.0.html)
|
||||
|
||||
Wasmer is built with [Cargo](https://crates.io/), the Rust package manager.
|
||||
|
||||
|
@@ -21,7 +21,7 @@ jobs:
|
||||
- script: cargo fmt --all -- --check
|
||||
displayName: Lint
|
||||
variables:
|
||||
rust_toolchain: '1.39.0'
|
||||
rust_toolchain: '1.40.0'
|
||||
|
||||
- job: clippy_lint
|
||||
pool:
|
||||
@@ -57,7 +57,7 @@ jobs:
|
||||
CARGO_HTTP_CHECK_REVOKE: false
|
||||
windows:
|
||||
imageName: "vs2017-win2016"
|
||||
rust_toolchain: '1.39.0'
|
||||
rust_toolchain: '1.40.0'
|
||||
pool:
|
||||
vmImage: $(imageName)
|
||||
condition: in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/staging', 'refs/heads/trying')
|
||||
@@ -118,7 +118,7 @@ jobs:
|
||||
MACOSX_DEPLOYMENT_TARGET: 10.10
|
||||
windows:
|
||||
imageName: "vs2017-win2016"
|
||||
rust_toolchain: '1.39.0'
|
||||
rust_toolchain: '1.40.0'
|
||||
# RUSTFLAGS: -Ctarget-feature=+crt-static
|
||||
pool:
|
||||
vmImage: $(imageName)
|
||||
@@ -188,7 +188,7 @@ jobs:
|
||||
MACOSX_DEPLOYMENT_TARGET: 10.10
|
||||
windows:
|
||||
imageName: "vs2017-win2016"
|
||||
rust_toolchain: '1.39.0'
|
||||
rust_toolchain: '1.40.0'
|
||||
# RUSTFLAGS: -Ctarget-feature=+crt-static
|
||||
pool:
|
||||
vmImage: $(imageName)
|
||||
|
@@ -1,3 +1,9 @@
|
||||
//! Code for dealing with [LLVM][llvm-intrinsics] and VM intrinsics.
|
||||
//!
|
||||
//! VM intrinsics are used to interact with the host VM.
|
||||
//!
|
||||
//! [llvm-intrinsics]: https://llvm.org/docs/LangRef.html#intrinsic-functions
|
||||
|
||||
use inkwell::{
|
||||
attributes::{Attribute, AttributeLoc},
|
||||
builder::Builder,
|
||||
@@ -34,6 +40,7 @@ fn type_to_llvm_ptr<'ctx>(intrinsics: &Intrinsics<'ctx>, ty: Type) -> PointerTyp
|
||||
}
|
||||
}
|
||||
|
||||
/// Struct containing LLVM and VM intrinsics.
|
||||
pub struct Intrinsics<'ctx> {
|
||||
pub ctlz_i32: FunctionValue<'ctx>,
|
||||
pub ctlz_i64: FunctionValue<'ctx>,
|
||||
@@ -151,6 +158,7 @@ pub struct Intrinsics<'ctx> {
|
||||
}
|
||||
|
||||
impl<'ctx> Intrinsics<'ctx> {
|
||||
/// Create an [`Intrinsics`] for the given [`Context`].
|
||||
pub fn declare(module: &Module<'ctx>, context: &'ctx Context) -> Self {
|
||||
let void_ty = context.void_type();
|
||||
let i1_ty = context.bool_type();
|
||||
|
@@ -1,5 +1,5 @@
|
||||
//! The global module contains the implementation data structures and helper functions used to
|
||||
//! manipulate and access a wasm globals.
|
||||
//! The global module contains data structures and helper functions used to
|
||||
//! manipulate and access Wasm globals.
|
||||
use crate::{
|
||||
export::Export,
|
||||
import::IsExport,
|
||||
@@ -11,7 +11,7 @@ use std::{
|
||||
sync::{Arc, Mutex},
|
||||
};
|
||||
|
||||
/// Container with a descriptor and a reference to a global value.
|
||||
/// A handle to a Wasm Global
|
||||
pub struct Global {
|
||||
desc: GlobalDescriptor,
|
||||
storage: Arc<Mutex<vm::LocalGlobal>>,
|
||||
|
@@ -1,15 +1,15 @@
|
||||
//! Wasmer Runtime Core Library
|
||||
//!
|
||||
//! The runtime core library provides common data structures which are shared by compiler backends
|
||||
//! to implement a Web Assembly runtime.
|
||||
//! This crate provides common data structures which are shared by compiler backends
|
||||
//! to implement a WebAssembly runtime.
|
||||
//!
|
||||
//! The runtime core also provides an API for users who use wasmer as an embedded wasm runtime which
|
||||
//! This crate also provides an API for users who use wasmer as an embedded wasm runtime which
|
||||
//! allows operations like compiling, instantiating, providing imports, access exports, memories,
|
||||
//! and tables for example.
|
||||
//!
|
||||
//! The runtime core library is recommended to be used by only power users who wish to customize the
|
||||
//! wasmer runtime. Most wasmer users should prefer the API which is re-exported by the wasmer
|
||||
//! runtime library which provides common defaults and a friendly API.
|
||||
//! Most wasmer users should prefer the API which is re-exported by the `wasmer-runtime`
|
||||
//! library by default. This crate provides additional APIs which may be useful to users
|
||||
//! that wish to customize the wasmer runtime.
|
||||
//!
|
||||
|
||||
#![deny(
|
||||
|
@@ -88,7 +88,7 @@ impl Instance for LocalInstance {
|
||||
}
|
||||
}
|
||||
let offset = self.offsets[id];
|
||||
let addr: *const u8 = unsafe { self.code.as_ptr().offset(offset as isize) };
|
||||
let addr: *const u8 = unsafe { self.code.as_ptr().add(offset) };
|
||||
use std::mem::transmute;
|
||||
Ok(unsafe {
|
||||
match args_u64.len() {
|
||||
|
@@ -658,7 +658,7 @@ macro_rules! impl_traits {
|
||||
Rets: WasmTypeList,
|
||||
{
|
||||
/// Call the typed func and return results.
|
||||
#[allow(non_snake_case)]
|
||||
#[allow(non_snake_case, clippy::too_many_arguments)]
|
||||
pub fn call(&self, $( $x: $x, )* ) -> Result<Rets, RuntimeError> {
|
||||
#[allow(unused_parens)]
|
||||
unsafe {
|
||||
|
@@ -78,7 +78,7 @@
|
||||
//!
|
||||
//! # Additional Notes:
|
||||
//!
|
||||
//! The `wasmer-runtime` is build to support compiler multiple backends.
|
||||
//! `wasmer-runtime` is built to support multiple compiler backends.
|
||||
//! Currently, we support the Singlepass, [Cranelift], and LLVM compilers
|
||||
//! with the [`wasmer-singlepass-backend`], [`wasmer-clif-backend`], and
|
||||
//! wasmer-llvm-backend crates, respectively.
|
||||
@@ -145,7 +145,7 @@ pub mod units {
|
||||
}
|
||||
|
||||
pub mod types {
|
||||
//! Various types.
|
||||
//! Types used in the Wasm runtime and conversion functions.
|
||||
pub use wasmer_runtime_core::types::*;
|
||||
}
|
||||
|
||||
|
@@ -1,3 +1,7 @@
|
||||
//! Macros to simplify some common WASI-specific tasks.
|
||||
|
||||
/// Like the `try!` macro or `?` syntax: returns the value if the computation
|
||||
/// succeeded or returns the error value.
|
||||
macro_rules! wasi_try {
|
||||
($expr:expr) => {{
|
||||
let res: Result<_, crate::syscalls::types::__wasi_errno_t> = $expr;
|
||||
@@ -18,6 +22,8 @@ macro_rules! wasi_try {
|
||||
}};
|
||||
}
|
||||
|
||||
/// Reads a string from Wasm memory and returns the invalid argument error
|
||||
/// code if it fails.
|
||||
macro_rules! get_input_str {
|
||||
($memory:expr, $data:expr, $len:expr) => {{
|
||||
wasi_try!($data.get_utf8_string($memory, $len), __WASI_EINVAL)
|
||||
|
Reference in New Issue
Block a user