mirror of
https://github.com/fluencelabs/parity-wasm
synced 2025-05-29 07:31:54 +00:00
Get rid of elements stuff in GlobalInstance API
This commit is contained in:
parent
721b24442a
commit
dbab8f5673
@ -1,6 +1,6 @@
|
||||
use std::rc::Rc;
|
||||
use std::cell::Cell;
|
||||
use elements::{ValueType, GlobalType};
|
||||
use elements::ValueType;
|
||||
use interpreter::value::RuntimeValue;
|
||||
use interpreter::Error;
|
||||
|
||||
@ -22,8 +22,8 @@ pub struct GlobalInstance {
|
||||
|
||||
impl GlobalInstance {
|
||||
|
||||
pub fn alloc(global_type: &GlobalType, val: RuntimeValue) -> GlobalRef {
|
||||
let global = GlobalInstance::new(val, global_type.is_mutable());
|
||||
pub fn alloc(val: RuntimeValue, mutable: bool) -> GlobalRef {
|
||||
let global = GlobalInstance::new(val, mutable);
|
||||
GlobalRef(Rc::new(global))
|
||||
}
|
||||
|
||||
|
@ -259,7 +259,10 @@ impl ModuleInstance {
|
||||
)
|
||||
{
|
||||
let init_val = eval_init_expr(global_entry.init_expr(), &*instance);
|
||||
let global = GlobalInstance::alloc(global_entry.global_type(), init_val);
|
||||
let global = GlobalInstance::alloc(
|
||||
init_val,
|
||||
global_entry.global_type().is_mutable(),
|
||||
);
|
||||
instance.push_global(global);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user