mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-08 13:48:26 +00:00
Add an extra layer of indirection for shared globals
This commit is contained in:
@@ -1898,7 +1898,13 @@ impl<'a> FuncGen<'a> {
|
||||
self.module.local_global_index(global_index)
|
||||
{
|
||||
let offset = self.vmoffsets.vmctx_vmglobal_definition(local_global_index);
|
||||
Location::Memory(Machine::get_vmctx_reg(), offset as i32)
|
||||
self.emit_relaxed_binop(
|
||||
Assembler::emit_mov,
|
||||
Size::S64,
|
||||
Location::Memory(Machine::get_vmctx_reg(), offset as i32),
|
||||
Location::GPR(tmp),
|
||||
);
|
||||
Location::Memory(tmp, 0)
|
||||
} else {
|
||||
// Imported globals require one level of indirection.
|
||||
let offset = self
|
||||
@@ -1924,7 +1930,13 @@ impl<'a> FuncGen<'a> {
|
||||
self.module.local_global_index(global_index)
|
||||
{
|
||||
let offset = self.vmoffsets.vmctx_vmglobal_definition(local_global_index);
|
||||
Location::Memory(Machine::get_vmctx_reg(), offset as i32)
|
||||
self.emit_relaxed_binop(
|
||||
Assembler::emit_mov,
|
||||
Size::S64,
|
||||
Location::Memory(Machine::get_vmctx_reg(), offset as i32),
|
||||
Location::GPR(tmp),
|
||||
);
|
||||
Location::Memory(tmp, 0)
|
||||
} else {
|
||||
// Imported globals require one level of indirection.
|
||||
let offset = self
|
||||
|
||||
Reference in New Issue
Block a user