mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-12 04:21:21 +00:00
Avoid invoking a function pointer with JsStatic
The previous codegen wasn't enough to convince LLVM that the function pointer was a constant value and could be aggressively inlined, so this updates the `JsStatic` internals slightly to guarantee to LLVM that the function pointer is constant and no dynamic dispatch is needed after all
This commit is contained in:
@ -779,8 +779,10 @@ impl ToTokens for ast::ImportStatic {
|
||||
|
||||
}
|
||||
}
|
||||
static mut _VAL: ::wasm_bindgen::__rt::core::cell::UnsafeCell<Option<#ty>> =
|
||||
::wasm_bindgen::__rt::core::cell::UnsafeCell::new(None);
|
||||
::wasm_bindgen::JsStatic {
|
||||
__inner: ::wasm_bindgen::__rt::core::cell::UnsafeCell::new(None),
|
||||
__inner: unsafe { &_VAL },
|
||||
__init: init,
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user