Rename VMCallerCheckedAnyfunc to VMCallerCheckedFuncRef (#5738)
At some point what is now `funcref` was called `anyfunc` and the spec changed, but we didn't update our internal names. This does that. Co-authored-by: Jamey Sharp <jsharp@fastly.com>
This commit is contained in:
@@ -184,7 +184,7 @@ pub enum GlobalInitializer {
|
||||
/// A core wasm function was "generated" via `canon lower` of a function
|
||||
/// that was `canon lift`'d in the same component, meaning that the function
|
||||
/// always traps. This is recorded within the `VMComponentContext` as a new
|
||||
/// `VMCallerCheckedAnyfunc` that's available for use.
|
||||
/// `VMCallerCheckedFuncRef` that's available for use.
|
||||
AlwaysTrap(AlwaysTrap),
|
||||
|
||||
/// A core wasm linear memory is going to be saved into the
|
||||
@@ -213,7 +213,7 @@ pub enum GlobalInitializer {
|
||||
SaveModuleImport(RuntimeImportIndex),
|
||||
|
||||
/// Similar to `ExtractMemory` and friends and indicates that a
|
||||
/// `VMCallerCheckedAnyfunc` needs to be initialized for a transcoder
|
||||
/// `VMCallerCheckedFuncRef` needs to be initialized for a transcoder
|
||||
/// function and this will later be used to instantiate an adapter module.
|
||||
Transcoder(Transcoder),
|
||||
}
|
||||
@@ -469,7 +469,7 @@ pub enum StringEncoding {
|
||||
pub struct Transcoder {
|
||||
/// The index of the transcoder being defined and initialized.
|
||||
///
|
||||
/// This indicates which `VMCallerCheckedAnyfunc` slot is written to in a
|
||||
/// This indicates which `VMCallerCheckedFuncRef` slot is written to in a
|
||||
/// `VMComponentContext`.
|
||||
pub index: RuntimeTranscoderIndex,
|
||||
/// The transcoding operation being performed.
|
||||
|
||||
@@ -181,7 +181,7 @@ indices! {
|
||||
|
||||
/// Index into the list of transcoders identified during compilation.
|
||||
///
|
||||
/// This is used to index the `VMCallerCheckedAnyfunc` slots reserved for
|
||||
/// This is used to index the `VMCallerCheckedFuncRef` slots reserved for
|
||||
/// string encoders which reference linear memories defined within a
|
||||
/// component.
|
||||
pub struct RuntimeTranscoderIndex(u32);
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
// store: *mut dyn Store,
|
||||
// limits: *const VMRuntimeLimits,
|
||||
// flags: [VMGlobalDefinition; component.num_runtime_component_instances],
|
||||
// lowering_anyfuncs: [VMCallerCheckedAnyfunc; component.num_lowerings],
|
||||
// always_trap_anyfuncs: [VMCallerCheckedAnyfunc; component.num_always_trap],
|
||||
// transcoder_anyfuncs: [VMCallerCheckedAnyfunc; component.num_transcoders],
|
||||
// lowering_anyfuncs: [VMCallerCheckedFuncRef; component.num_lowerings],
|
||||
// always_trap_anyfuncs: [VMCallerCheckedFuncRef; component.num_always_trap],
|
||||
// transcoder_anyfuncs: [VMCallerCheckedFuncRef; component.num_transcoders],
|
||||
// lowerings: [VMLowering; component.num_lowerings],
|
||||
// memories: [*mut VMMemoryDefinition; component.num_memories],
|
||||
// reallocs: [*mut VMCallerCheckedAnyfunc; component.num_reallocs],
|
||||
// post_returns: [*mut VMCallerCheckedAnyfunc; component.num_post_returns],
|
||||
// reallocs: [*mut VMCallerCheckedFuncRef; component.num_reallocs],
|
||||
// post_returns: [*mut VMCallerCheckedFuncRef; component.num_post_returns],
|
||||
// }
|
||||
|
||||
use crate::component::{
|
||||
@@ -57,7 +57,7 @@ pub struct VMComponentOffsets<P> {
|
||||
/// least 1).
|
||||
pub num_runtime_component_instances: u32,
|
||||
/// Number of "always trap" functions which have their
|
||||
/// `VMCallerCheckedAnyfunc` stored inline in the `VMComponentContext`.
|
||||
/// `VMCallerCheckedFuncRef` stored inline in the `VMComponentContext`.
|
||||
pub num_always_trap: u32,
|
||||
/// Number of transcoders needed for string conversion.
|
||||
pub num_transcoders: u32,
|
||||
@@ -148,9 +148,9 @@ impl<P: PtrSize> VMComponentOffsets<P> {
|
||||
align(16),
|
||||
size(flags) = cmul(ret.num_runtime_component_instances, ret.ptr.size_of_vmglobal_definition()),
|
||||
align(u32::from(ret.ptr.size())),
|
||||
size(lowering_anyfuncs) = cmul(ret.num_lowerings, ret.ptr.size_of_vmcaller_checked_anyfunc()),
|
||||
size(always_trap_anyfuncs) = cmul(ret.num_always_trap, ret.ptr.size_of_vmcaller_checked_anyfunc()),
|
||||
size(transcoder_anyfuncs) = cmul(ret.num_transcoders, ret.ptr.size_of_vmcaller_checked_anyfunc()),
|
||||
size(lowering_anyfuncs) = cmul(ret.num_lowerings, ret.ptr.size_of_vmcaller_checked_func_ref()),
|
||||
size(always_trap_anyfuncs) = cmul(ret.num_always_trap, ret.ptr.size_of_vmcaller_checked_func_ref()),
|
||||
size(transcoder_anyfuncs) = cmul(ret.num_transcoders, ret.ptr.size_of_vmcaller_checked_func_ref()),
|
||||
size(lowerings) = cmul(ret.num_lowerings, ret.ptr.size() * 2),
|
||||
size(memories) = cmul(ret.num_runtime_memories, ret.ptr.size()),
|
||||
size(reallocs) = cmul(ret.num_runtime_reallocs, ret.ptr.size()),
|
||||
@@ -210,12 +210,12 @@ impl<P: PtrSize> VMComponentOffsets<P> {
|
||||
self.lowering_anyfuncs
|
||||
}
|
||||
|
||||
/// The offset of `VMCallerCheckedAnyfunc` for the `index` specified.
|
||||
/// The offset of `VMCallerCheckedFuncRef` for the `index` specified.
|
||||
#[inline]
|
||||
pub fn lowering_anyfunc(&self, index: LoweredIndex) -> u32 {
|
||||
assert!(index.as_u32() < self.num_lowerings);
|
||||
self.lowering_anyfuncs()
|
||||
+ index.as_u32() * u32::from(self.ptr.size_of_vmcaller_checked_anyfunc())
|
||||
+ index.as_u32() * u32::from(self.ptr.size_of_vmcaller_checked_func_ref())
|
||||
}
|
||||
|
||||
/// The offset of the `always_trap_anyfuncs` field.
|
||||
@@ -224,12 +224,12 @@ impl<P: PtrSize> VMComponentOffsets<P> {
|
||||
self.always_trap_anyfuncs
|
||||
}
|
||||
|
||||
/// The offset of `VMCallerCheckedAnyfunc` for the `index` specified.
|
||||
/// The offset of `VMCallerCheckedFuncRef` for the `index` specified.
|
||||
#[inline]
|
||||
pub fn always_trap_anyfunc(&self, index: RuntimeAlwaysTrapIndex) -> u32 {
|
||||
assert!(index.as_u32() < self.num_always_trap);
|
||||
self.always_trap_anyfuncs()
|
||||
+ index.as_u32() * u32::from(self.ptr.size_of_vmcaller_checked_anyfunc())
|
||||
+ index.as_u32() * u32::from(self.ptr.size_of_vmcaller_checked_func_ref())
|
||||
}
|
||||
|
||||
/// The offset of the `transcoder_anyfuncs` field.
|
||||
@@ -238,12 +238,12 @@ impl<P: PtrSize> VMComponentOffsets<P> {
|
||||
self.transcoder_anyfuncs
|
||||
}
|
||||
|
||||
/// The offset of `VMCallerCheckedAnyfunc` for the `index` specified.
|
||||
/// The offset of `VMCallerCheckedFuncRef` for the `index` specified.
|
||||
#[inline]
|
||||
pub fn transcoder_anyfunc(&self, index: RuntimeTranscoderIndex) -> u32 {
|
||||
assert!(index.as_u32() < self.num_transcoders);
|
||||
self.transcoder_anyfuncs()
|
||||
+ index.as_u32() * u32::from(self.ptr.size_of_vmcaller_checked_anyfunc())
|
||||
+ index.as_u32() * u32::from(self.ptr.size_of_vmcaller_checked_func_ref())
|
||||
}
|
||||
|
||||
/// The offset of the `lowerings` field.
|
||||
@@ -309,7 +309,7 @@ impl<P: PtrSize> VMComponentOffsets<P> {
|
||||
self.reallocs
|
||||
}
|
||||
|
||||
/// The offset of the `*mut VMCallerCheckedAnyfunc` for the runtime index
|
||||
/// The offset of the `*mut VMCallerCheckedFuncRef` for the runtime index
|
||||
/// provided.
|
||||
#[inline]
|
||||
pub fn runtime_realloc(&self, index: RuntimeReallocIndex) -> u32 {
|
||||
@@ -323,7 +323,7 @@ impl<P: PtrSize> VMComponentOffsets<P> {
|
||||
self.post_returns
|
||||
}
|
||||
|
||||
/// The offset of the `*mut VMCallerCheckedAnyfunc` for the runtime index
|
||||
/// The offset of the `*mut VMCallerCheckedFuncRef` for the runtime index
|
||||
/// provided.
|
||||
#[inline]
|
||||
pub fn runtime_post_return(&self, index: RuntimePostReturnIndex) -> u32 {
|
||||
|
||||
Reference in New Issue
Block a user