Merge remote-tracking branch 'origin/feature/clif-cgapi' into feature/metering

This commit is contained in:
losfair
2019-05-31 15:40:05 +08:00
28 changed files with 1122 additions and 949 deletions

View File

@ -9,7 +9,7 @@ edition = "2018"
[dependencies]
wasmer-runtime-core = { path = "../runtime-core", version = "0.4.2" }
wasmparser = "0.30.0"
wasmparser = "0.29.2"
dynasm = "0.3.2"
dynasmrt = "0.3.1"
lazy_static = "1.2.0"

View File

@ -8,7 +8,11 @@ use dynasmrt::{
};
use smallvec::SmallVec;
use std::ptr::NonNull;
use std::{any::Any, collections::HashMap, sync::Arc};
use std::{
any::Any,
collections::HashMap,
sync::{Arc, RwLock},
};
use wasmer_runtime_core::{
backend::{
sys::Memory, Backend, CacheGen, CompilerConfig, MemoryBoundCheckMode, RunnableModule, Token,
@ -319,7 +323,10 @@ impl ModuleCodeGenerator<X64FunctionCode, X64ExecutionContext, CodegenError>
Ok(())
}
fn next_function(&mut self) -> Result<&mut X64FunctionCode, CodegenError> {
fn next_function(
&mut self,
_module_info: Arc<RwLock<ModuleInfo>>,
) -> Result<&mut X64FunctionCode, CodegenError> {
let (mut assembler, mut function_labels, breakpoints) = match self.functions.last_mut() {
Some(x) => (
x.assembler.take().unwrap(),
@ -332,6 +339,7 @@ impl ModuleCodeGenerator<X64FunctionCode, X64ExecutionContext, CodegenError>
HashMap::new(),
),
};
let begin_offset = assembler.offset();
let begin_label_info = function_labels
.entry(self.functions.len() + self.func_import_count)