mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-23 05:31:32 +00:00
Fix unused imports on Windows.
This commit is contained in:
@ -10,7 +10,6 @@ use inkwell::{
|
|||||||
use libc::c_char;
|
use libc::c_char;
|
||||||
use std::{
|
use std::{
|
||||||
any::Any,
|
any::Any,
|
||||||
collections::BTreeMap,
|
|
||||||
ffi::{c_void, CString},
|
ffi::{c_void, CString},
|
||||||
fs::File,
|
fs::File,
|
||||||
io::Write,
|
io::Write,
|
||||||
@ -229,6 +228,8 @@ impl LLVMBackend {
|
|||||||
#[cfg(all(any(target_os = "linux", target_os = "macos"), target_arch = "x86_64"))]
|
#[cfg(all(any(target_os = "linux", target_os = "macos"), target_arch = "x86_64"))]
|
||||||
{
|
{
|
||||||
use super::stackmap::{self, StkMapRecord, StkSizeRecord};
|
use super::stackmap::{self, StkMapRecord, StkSizeRecord};
|
||||||
|
use std::collections::BTreeMap;
|
||||||
|
|
||||||
let raw_stackmap = unsafe {
|
let raw_stackmap = unsafe {
|
||||||
std::slice::from_raw_parts(
|
std::slice::from_raw_parts(
|
||||||
llvm_backend_get_stack_map_ptr(module),
|
llvm_backend_get_stack_map_ptr(module),
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// https://llvm.org/docs/StackMaps.html#stackmap-section
|
// https://llvm.org/docs/StackMaps.html#stackmap-section
|
||||||
|
|
||||||
use byteorder::{LittleEndian, ReadBytesExt};
|
use byteorder::{LittleEndian, ReadBytesExt};
|
||||||
use std::collections::{BTreeMap, HashMap};
|
|
||||||
use std::io::{self, Cursor};
|
use std::io::{self, Cursor};
|
||||||
use wasmer_runtime_core::vm::Ctx;
|
use wasmer_runtime_core::vm::Ctx;
|
||||||
use wasmer_runtime_core::{
|
use wasmer_runtime_core::{
|
||||||
@ -54,33 +53,6 @@ pub enum StackmapEntryKind {
|
|||||||
Trappable,
|
Trappable,
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
pub struct FunctionStateMap {
|
|
||||||
pub initial: MachineState,
|
|
||||||
pub local_function_id: usize,
|
|
||||||
pub locals: Vec<WasmAbstractValue>,
|
|
||||||
pub shadow_size: usize, // for single-pass backend, 32 bytes on x86-64
|
|
||||||
pub diffs: Vec<MachineStateDiff>,
|
|
||||||
pub wasm_function_header_target_offset: Option<SuspendOffset>,
|
|
||||||
pub wasm_offset_to_target_offset: BTreeMap<usize, SuspendOffset>,
|
|
||||||
pub loop_offsets: BTreeMap<usize, OffsetInfo>, /* suspend_offset -> info */
|
|
||||||
pub call_offsets: BTreeMap<usize, OffsetInfo>, /* suspend_offset -> info */
|
|
||||||
pub trappable_offsets: BTreeMap<usize, OffsetInfo>, /* suspend_offset -> info */
|
|
||||||
}
|
|
||||||
pub struct MachineStateDiff {
|
|
||||||
pub last: Option<usize>,
|
|
||||||
pub stack_push: Vec<MachineValue>,
|
|
||||||
pub stack_pop: usize,
|
|
||||||
pub reg_diff: Vec<(RegisterIndex, MachineValue)>,
|
|
||||||
|
|
||||||
pub wasm_stack_push: Vec<WasmAbstractValue>,
|
|
||||||
pub wasm_stack_pop: usize,
|
|
||||||
pub wasm_stack_private_depth: usize, // absolute value; not a diff.
|
|
||||||
|
|
||||||
pub wasm_inst_offset: usize, // absolute value; not a diff.
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
impl StackmapEntry {
|
impl StackmapEntry {
|
||||||
#[cfg(all(any(target_os = "linux", target_os = "macos"), target_arch = "x86_64"))]
|
#[cfg(all(any(target_os = "linux", target_os = "macos"), target_arch = "x86_64"))]
|
||||||
pub fn populate_msm(
|
pub fn populate_msm(
|
||||||
@ -93,11 +65,13 @@ impl StackmapEntry {
|
|||||||
end: Option<(&StackmapEntry, &StkMapRecord)>,
|
end: Option<(&StackmapEntry, &StkMapRecord)>,
|
||||||
msm: &mut wasmer_runtime_core::state::ModuleStateMap,
|
msm: &mut wasmer_runtime_core::state::ModuleStateMap,
|
||||||
) {
|
) {
|
||||||
|
use std::collections::{BTreeMap, HashMap};
|
||||||
use wasmer_runtime_core::state::{
|
use wasmer_runtime_core::state::{
|
||||||
x64::{new_machine_state, X64Register, GPR},
|
x64::{new_machine_state, X64Register, GPR},
|
||||||
FunctionStateMap, MachineStateDiff, MachineValue, OffsetInfo, RegisterIndex,
|
FunctionStateMap, MachineStateDiff, MachineValue, OffsetInfo, RegisterIndex,
|
||||||
SuspendOffset, WasmAbstractValue,
|
SuspendOffset, WasmAbstractValue,
|
||||||
};
|
};
|
||||||
|
|
||||||
let func_base_addr = (size_record.function_address as usize)
|
let func_base_addr = (size_record.function_address as usize)
|
||||||
.checked_sub(code_addr)
|
.checked_sub(code_addr)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
Reference in New Issue
Block a user