Skip to content

Commit 6ae1183

Browse files
authored
stack-switching: update vmoffsets naming for VMHostArray (#10964)
VMArray from the original stack switching impl was renamed to VMHostArray, but the prefixes used in vmoffsets didn't get updated. Original Discussion: #10388 (comment) Original (incomplete) Change: 22bf039
1 parent 4233014 commit 6ae1183

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

crates/environ/src/vmoffsets.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -276,25 +276,25 @@ pub trait PtrSize {
276276
self.size()
277277
}
278278

279-
// Offsets within `VMArray`
279+
// Offsets within `VMHostArray`
280280

281-
/// Return the offset of `VMArray::length`.
282-
fn vmarray_length(&self) -> u8 {
281+
/// Return the offset of `VMHostArray::length`.
282+
fn vmhostarray_length(&self) -> u8 {
283283
0
284284
}
285285

286-
/// Return the offset of `VMArray::capacity`.
287-
fn vmarray_capacity(&self) -> u8 {
286+
/// Return the offset of `VMHostArray::capacity`.
287+
fn vmhostarray_capacity(&self) -> u8 {
288288
4
289289
}
290290

291-
/// Return the offset of `VMArray::data`.
292-
fn vmarray_data(&self) -> u8 {
291+
/// Return the offset of `VMHostArray::data`.
292+
fn vmhostarray_data(&self) -> u8 {
293293
8
294294
}
295295

296-
/// Return the size of `VMArray`.
297-
fn size_of_vmarray(&self) -> u8 {
296+
/// Return the size of `VMHostArray`.
297+
fn size_of_vmhostarray(&self) -> u8 {
298298
8 + self.size()
299299
}
300300

@@ -321,7 +321,7 @@ pub trait PtrSize {
321321

322322
/// Return the offset of `VMCommonStackInformation::first_switch_handler_index`.
323323
fn vmcommon_stack_information_first_switch_handler_index(&self) -> u8 {
324-
self.vmcommon_stack_information_handlers() + self.size_of_vmarray()
324+
self.vmcommon_stack_information_handlers() + self.size_of_vmhostarray()
325325
}
326326

327327
/// Return the size of `VMCommonStackInformation`.
@@ -372,7 +372,7 @@ pub trait PtrSize {
372372

373373
/// Return the offset of `VMContRef::values`.
374374
fn vmcontref_values(&self) -> u8 {
375-
self.vmcontref_args() + self.size_of_vmarray()
375+
self.vmcontref_args() + self.size_of_vmhostarray()
376376
}
377377

378378
/// Return the offset to the `magic` value in this `VMContext`.

crates/wasmtime/src/runtime/vm/stack_switching.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -633,19 +633,19 @@ mod tests {
633633
let offsets = VMOffsets::new(HostPtr, &module);
634634
assert_eq!(
635635
size_of::<VMHostArray<()>>(),
636-
usize::from(offsets.ptr.size_of_vmarray())
636+
usize::from(offsets.ptr.size_of_vmhostarray())
637637
);
638638
assert_eq!(
639639
offset_of!(VMHostArray<()>, length),
640-
usize::from(offsets.ptr.vmarray_length())
640+
usize::from(offsets.ptr.vmhostarray_length())
641641
);
642642
assert_eq!(
643643
offset_of!(VMHostArray<()>, capacity),
644-
usize::from(offsets.ptr.vmarray_capacity())
644+
usize::from(offsets.ptr.vmhostarray_capacity())
645645
);
646646
assert_eq!(
647647
offset_of!(VMHostArray<()>, data),
648-
usize::from(offsets.ptr.vmarray_data())
648+
usize::from(offsets.ptr.vmhostarray_data())
649649
);
650650
}
651651

0 commit comments

Comments
 (0)