mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-13 06:15:33 +00:00
Improved instance & module data pointers location
# Conflicts: # src/webassembly/instance.rs # src/webassembly/module.rs
This commit is contained in:
parent
ac2d605472
commit
e4ed4cc532
@ -67,6 +67,7 @@ fn get_function_addr(
|
|||||||
/// first field
|
/// first field
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
#[repr(C)]
|
||||||
pub struct Instance {
|
pub struct Instance {
|
||||||
// C-like pointers to data (heaps, globals, tables)
|
// C-like pointers to data (heaps, globals, tables)
|
||||||
pub data_pointers: DataPointers,
|
pub data_pointers: DataPointers,
|
||||||
@ -99,6 +100,7 @@ pub struct Instance {
|
|||||||
/// NOTE: Rearranging the fields will break the memory arrangement model
|
/// NOTE: Rearranging the fields will break the memory arrangement model
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
#[repr(C)]
|
||||||
pub struct DataPointers {
|
pub struct DataPointers {
|
||||||
// Pointer to tables
|
// Pointer to tables
|
||||||
pub tables: TablesSlice,
|
pub tables: TablesSlice,
|
||||||
|
@ -489,6 +489,7 @@ impl<'environment> FuncEnvironmentTrait for FuncEnvironment<'environment> {
|
|||||||
.special_param(ir::ArgumentPurpose::VMContext)
|
.special_param(ir::ArgumentPurpose::VMContext)
|
||||||
.expect("Missing vmctx parameter");
|
.expect("Missing vmctx parameter");
|
||||||
|
|
||||||
|
|
||||||
// The `callee` value is an index into a table of function pointers.
|
// The `callee` value is an index into a table of function pointers.
|
||||||
// Apparently, that table is stored at absolute address 0 in this dummy environment.
|
// Apparently, that table is stored at absolute address 0 in this dummy environment.
|
||||||
// TODO: Generate bounds checking code.
|
// TODO: Generate bounds checking code.
|
||||||
@ -537,6 +538,9 @@ impl<'environment> FuncEnvironmentTrait for FuncEnvironment<'environment> {
|
|||||||
.special_param(ir::ArgumentPurpose::VMContext)
|
.special_param(ir::ArgumentPurpose::VMContext)
|
||||||
.expect("Missing vmctx parameter");
|
.expect("Missing vmctx parameter");
|
||||||
|
|
||||||
|
// println!("POINTER BYTES {}", self.pointer_bytes());
|
||||||
|
// println!("POINTER SIZE {}", self.ptr_size());
|
||||||
|
|
||||||
// Build a value list for the call instruction containing the call_args and the vmctx
|
// Build a value list for the call instruction containing the call_args and the vmctx
|
||||||
// parameter.
|
// parameter.
|
||||||
let mut args = ir::ValueList::default();
|
let mut args = ir::ValueList::default();
|
||||||
|
Loading…
Reference in New Issue
Block a user