Struct aptos_vm::move_vm_ext::MoveVmExt
source · [−]pub struct MoveVmExt { /* private fields */ }
Implementations
sourceimpl MoveVmExt
impl MoveVmExt
pub fn new(native_gas_params: NativeGasParameters) -> VMResult<Self>
pub fn new_session<'r, S: MoveResolverExt>(
&self,
remote: &'r S,
session_id: SessionId
) -> SessionExt<'r, '_, S>
Methods from Deref<Target = MoveVM>
pub fn new_session<S>(&self, remote: &'r S) -> Session<'r, '_, S> where
S: MoveResolver,
pub fn new_session<S>(&self, remote: &'r S) -> Session<'r, '_, S> where
S: MoveResolver,
Create a new Session backed by the given storage.
Right now it is the caller’s responsibility to ensure cache coherence of the Move VM Loader
- When a module gets published in a Move VM Session, and then gets used by another transaction, it will be loaded into the code cache and stay there even if the resulted effects do not get commited back to the storage when the Session ends.
- As a result, if one wants to have multiple sessions at a time, one needs to make sure none of them will try to publish a module. In other words, if there is a module publishing Session it must be the only Session existing.
- In general, a new Move VM needs to be created whenever the storage gets modified by an outer envrionment, or otherwise the states may be out of sync. There are a few exceptional cases where this may not be necessary, with the most notable one being the common module publishing flow: you can keep using the same Move VM if you publish some modules in a Session and apply the effects to the storage when the Session ends.
pub fn new_session_with_extensions<S>(
&self,
remote: &'r S,
extensions: NativeContextExtensions<'r>
) -> Session<'r, '_, S> where
S: MoveResolver,
pub fn new_session_with_extensions<S>(
&self,
remote: &'r S,
extensions: NativeContextExtensions<'r>
) -> Session<'r, '_, S> where
S: MoveResolver,
Create a new session, as in new_session
, but provide native context extensions.
pub fn load_module<S>(
&self,
module_id: &ModuleId,
remote: &'r S
) -> Result<Arc<CompiledModule>, VMError> where
S: MoveResolver,
pub fn load_module<S>(
&self,
module_id: &ModuleId,
remote: &'r S
) -> Result<Arc<CompiledModule>, VMError> where
S: MoveResolver,
Load a module into VM’s code cache
pub fn mark_loader_cache_as_invalid(&self)
pub fn mark_loader_cache_as_invalid(&self)
Allows the adapter to announce to the VM that the code loading cache should be considered outdated. This can happen if the adapter executed a particular code publishing transaction but decided to not commit the result to the data store. Because the code cache currently does not support deletion, the cache will, incorrectly, still contain this module. TODO: new loader architecture
pub fn flush_loader_cache_if_invalidated(&self)
pub fn flush_loader_cache_if_invalidated(&self)
If the loader cache has been invalidated (either by the above call or by internal logic) flush it so it is valid again. Notice that should only be called if there are no outstanding sessions created from this VM. TODO: new loader architecture
pub fn get_and_clear_module_cache_hits(&self) -> BTreeSet<ModuleId, Global>
pub fn get_and_clear_module_cache_hits(&self) -> BTreeSet<ModuleId, Global>
Gets and clears module cache hits. This is hack which allows the adapter to see module reads if executing multiple transactions in a VM. Without this, the adapter only sees the first load of a module. TODO: new loader architecture
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for MoveVmExt
impl Send for MoveVmExt
impl Sync for MoveVmExt
impl Unpin for MoveVmExt
impl !UnwindSafe for MoveVmExt
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more