Skip to content

Commit b4ded07

Browse files
authored
Merge branch 'master' into feature/preopen-fd-and-more
2 parents eef2bc6 + ed65105 commit b4ded07

28 files changed

+874
-1069
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Blocks of changes will separated by version increments.
66

77
## **[Unreleased]**
88
- [#343](https://github.com/wasmerio/wasmer/pull/343) Implement preopened files for WASI and fix aligment issue when accessing WASI memory
9+
- [#366](https://github.com/wasmerio/wasmer/pull/366) Remove `UserTrapper` trait to fix [#365](https://github.com/wasmerio/wasmer/issues/365).
10+
- [#348](https://github.com/wasmerio/wasmer/pull/348) Refactor internal runtime ↔️ backend abstraction.
911
- [#355](https://github.com/wasmerio/wasmer/pull/355) Misc changes to `Cargo.toml`s for publishing
1012
- [#352](https://github.com/wasmerio/wasmer/pull/352) Bump version numbers to 0.3.0
1113
- [#351](https://github.com/wasmerio/wasmer/pull/351) Add hidden option to specify wasm program name (can be used to improve error messages)

Cargo.lock

+2-87
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LICENSE

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
Copyright (c) 2019 Syrus Akbary
1+
MIT License
2+
3+
Copyright (c) 2019 Wasmer, Inc. and its affiliates.
24

35
Permission is hereby granted, free of charge, to any person obtaining a copy
46
of this software and associated documentation files (the "Software"), to deal

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ test-emscripten-singlepass:
6363
cargo test --manifest-path lib/emscripten/Cargo.toml --features singlepass -- --test-threads=1 $(runargs)
6464

6565
singlepass-debug-release:
66-
cargo +nightly build --features "singlepass debug" --release
66+
cargo +nightly build --features "backend:singlepass debug" --release
6767

6868
singlepass-release:
69-
cargo +nightly build --features "singlepass" --release
69+
cargo +nightly build --features "backend:singlepass" --release
7070

7171
singlepass-build:
72-
cargo +nightly build --features "singlepass debug"
72+
cargo +nightly build --features "backend:singlepass debug"
7373

7474
release:
7575
# If you are in OS-X, you will need mingw-w64 for cross compiling to windows

bors.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ status = [
22
"ci/circleci: lint",
33
"ci/circleci: test",
44
"ci/circleci: test-macos",
5+
"ci/circleci: test-rust-nightly",
56
"continuous-integration/appveyor/branch"
67
]
78
required_approvals = 1
89
timeout_sec = 900
9-
delete_merged_branches = true
10+
delete_merged_branches = true

lib/clif-backend/src/module.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,15 @@ impl Module {
7373
handler_data.clone(),
7474
)?;
7575

76-
let protected_caller = Caller::new(&self.info, handler_data, trampolines);
77-
7876
let cache_gen = Box::new(CacheGenerator::new(
7977
backend_cache,
8078
Arc::clone(&func_resolver.memory),
8179
));
8280

81+
let runnable_module = Caller::new(handler_data, trampolines, func_resolver);
82+
8383
Ok(ModuleInner {
84-
func_resolver: Box::new(func_resolver),
85-
protected_caller: Box::new(protected_caller),
84+
runnable_module: Box::new(runnable_module),
8685
cache_gen,
8786

8887
info: self.info,
@@ -103,16 +102,15 @@ impl Module {
103102
)
104103
.map_err(|e| CacheError::Unknown(format!("{:?}", e)))?;
105104

106-
let protected_caller = Caller::new(&info, handler_data, trampolines);
107-
108105
let cache_gen = Box::new(CacheGenerator::new(
109106
backend_cache,
110107
Arc::clone(&func_resolver.memory),
111108
));
112109

110+
let runnable_module = Caller::new(handler_data, trampolines, func_resolver);
111+
113112
Ok(ModuleInner {
114-
func_resolver: Box::new(func_resolver),
115-
protected_caller: Box::new(protected_caller),
113+
runnable_module: Box::new(runnable_module),
116114
cache_gen,
117115

118116
info,

lib/clif-backend/src/resolver.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ use wasmer_runtime_core::cache::Error as CacheError;
2121
use wasmer_runtime_core::{
2222
self,
2323
backend::{
24-
self,
2524
sys::{Memory, Protect},
2625
SigRegistry,
2726
},
@@ -357,13 +356,8 @@ pub struct FuncResolver {
357356
pub(crate) memory: Arc<Memory>,
358357
}
359358

360-
// Implements FuncResolver trait.
361-
impl backend::FuncResolver for FuncResolver {
362-
fn get(
363-
&self,
364-
_module: &wasmer_runtime_core::module::ModuleInner,
365-
index: LocalFuncIndex,
366-
) -> Option<NonNull<vm::Func>> {
359+
impl FuncResolver {
360+
pub fn lookup(&self, index: LocalFuncIndex) -> Option<NonNull<vm::Func>> {
367361
lookup_func(&self.map, &self.memory, index)
368362
}
369363
}

0 commit comments

Comments
 (0)