Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
substrate
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Radu Popa
substrate
Commits
997bb60d
Commit
997bb60d
authored
5 years ago
by
Cecile Tonglet
Browse files
Options
Downloads
Patches
Plain Diff
Revert "wasmtime"
This reverts commit
79f4a2a1
.
parent
79f4a2a1
Branches
Branches containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
client/executor/src/wasm_runtime.rs
+1
-1
1 addition, 1 deletion
client/executor/src/wasm_runtime.rs
client/executor/wasmtime/src/runtime.rs
+1
-14
1 addition, 14 deletions
client/executor/wasmtime/src/runtime.rs
with
2 additions
and
15 deletions
client/executor/src/wasm_runtime.rs
+
1
−
1
View file @
997bb60d
...
@@ -199,7 +199,7 @@ pub fn create_wasm_runtime_with_code(
...
@@ -199,7 +199,7 @@ pub fn create_wasm_runtime_with_code(
.map
(|
runtime
|
->
Box
<
dyn
WasmRuntime
>
{
Box
::
new
(
runtime
)
}),
.map
(|
runtime
|
->
Box
<
dyn
WasmRuntime
>
{
Box
::
new
(
runtime
)
}),
#[cfg(feature
=
"wasmtime"
)]
#[cfg(feature
=
"wasmtime"
)]
WasmExecutionMethod
::
Compiled
=>
WasmExecutionMethod
::
Compiled
=>
sc_executor_wasmtime
::
create_instance
(
code
,
heap_pages
,
host_functions
,
enable_stub
)
sc_executor_wasmtime
::
create_instance
(
code
,
heap_pages
,
host_functions
)
.map
(|
runtime
|
->
Box
<
dyn
WasmRuntime
>
{
Box
::
new
(
runtime
)
}),
.map
(|
runtime
|
->
Box
<
dyn
WasmRuntime
>
{
Box
::
new
(
runtime
)
}),
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
client/executor/wasmtime/src/runtime.rs
+
1
−
14
View file @
997bb60d
...
@@ -56,10 +56,6 @@ pub struct WasmtimeRuntime {
...
@@ -56,10 +56,6 @@ pub struct WasmtimeRuntime {
heap_pages
:
u32
,
heap_pages
:
u32
,
/// The host functions registered for this instance.
/// The host functions registered for this instance.
host_functions
:
Vec
<&
'static
dyn
Function
>
,
host_functions
:
Vec
<&
'static
dyn
Function
>
,
/// Enable STUB for function called that are missing
enable_stub
:
bool
,
/// List of missing functions detected during function resolution
missing_functions
:
HashMap
<
usize
,
String
>
,
}
}
impl
WasmRuntime
for
WasmtimeRuntime
{
impl
WasmRuntime
for
WasmtimeRuntime
{
...
@@ -87,8 +83,6 @@ impl WasmRuntime for WasmtimeRuntime {
...
@@ -87,8 +83,6 @@ impl WasmRuntime for WasmtimeRuntime {
method
,
method
,
data
,
data
,
self
.heap_pages
,
self
.heap_pages
,
self
.enable_stub
,
&
self
.missing_functions
,
)
)
}
}
}
}
...
@@ -112,7 +106,6 @@ pub fn create_instance(
...
@@ -112,7 +106,6 @@ pub fn create_instance(
code
:
&
[
u8
],
code
:
&
[
u8
],
heap_pages
:
u64
,
heap_pages
:
u64
,
host_functions
:
Vec
<&
'static
dyn
Function
>
,
host_functions
:
Vec
<&
'static
dyn
Function
>
,
enable_stub
:
bool
,
)
->
std
::
result
::
Result
<
WasmtimeRuntime
,
WasmError
>
{
)
->
std
::
result
::
Result
<
WasmtimeRuntime
,
WasmError
>
{
let
global_exports
=
Rc
::
new
(
RefCell
::
new
(
HashMap
::
new
()));
let
global_exports
=
Rc
::
new
(
RefCell
::
new
(
HashMap
::
new
()));
...
@@ -121,7 +114,6 @@ pub fn create_instance(
...
@@ -121,7 +114,6 @@ pub fn create_instance(
instantiate_env_module
(
Rc
::
clone
(
&
global_exports
),
compiler
,
&
host_functions
)
?
;
instantiate_env_module
(
Rc
::
clone
(
&
global_exports
),
compiler
,
&
host_functions
)
?
;
let
mut
compiler
=
new_compiler
(
CompilationStrategy
::
Cranelift
)
?
;
let
mut
compiler
=
new_compiler
(
CompilationStrategy
::
Cranelift
)
?
;
// let (compiled_module, context, missing_functions) = create_compiled_unit(code, &host_functions, enable_stub)?;
let
compiled_module
=
create_compiled_unit
(
let
compiled_module
=
create_compiled_unit
(
&
mut
compiler
,
&
mut
compiler
,
code
,
code
,
...
@@ -159,8 +151,6 @@ pub fn create_instance(
...
@@ -159,8 +151,6 @@ pub fn create_instance(
host_functions
,
host_functions
,
global_exports
,
global_exports
,
env_instance
,
env_instance
,
enable_stub
,
missing_functions
,
})
})
}
}
...
@@ -170,8 +160,7 @@ fn create_compiled_unit(
...
@@ -170,8 +160,7 @@ fn create_compiled_unit(
resolver
:
&
mut
dyn
Resolver
,
resolver
:
&
mut
dyn
Resolver
,
global_exports
:
Rc
<
RefCell
<
HashMap
<
String
,
Option
<
Export
>>>>
,
global_exports
:
Rc
<
RefCell
<
HashMap
<
String
,
Option
<
Export
>>>>
,
host_functions
:
&
[
&
'static
dyn
Function
],
host_functions
:
&
[
&
'static
dyn
Function
],
enable_stub
:
bool
,
)
->
std
::
result
::
Result
<
CompiledModule
,
WasmError
>
{
)
->
std
::
result
::
Result
<
(
CompiledModule
,
HashMap
<
usize
,
String
>
),
WasmError
>
{
let
debug_info
=
false
;
let
debug_info
=
false
;
let
module
=
CompiledModule
::
new
(
compiler
,
code
,
resolver
,
global_exports
,
debug_info
)
let
module
=
CompiledModule
::
new
(
compiler
,
code
,
resolver
,
global_exports
,
debug_info
)
.map_err
(|
e
|
WasmError
::
Other
(
format!
(
"module compile error: {}"
,
e
)))
?
;
.map_err
(|
e
|
WasmError
::
Other
(
format!
(
"module compile error: {}"
,
e
)))
?
;
...
@@ -188,8 +177,6 @@ fn call_method(
...
@@ -188,8 +177,6 @@ fn call_method(
method
:
&
str
,
method
:
&
str
,
data
:
&
[
u8
],
data
:
&
[
u8
],
heap_pages
:
u32
,
heap_pages
:
u32
,
enable_stub
:
bool
,
missing_functions
:
&
HashMap
<
usize
,
String
>
,
)
->
Result
<
Vec
<
u8
>>
{
)
->
Result
<
Vec
<
u8
>>
{
// Old exports get clobbered in `InstanceHandle::new` if we don't explicitly remove them first.
// Old exports get clobbered in `InstanceHandle::new` if we don't explicitly remove them first.
//
//
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment