|
27 | 27 | // memories: [*mut VMMemoryDefinition; module.num_defined_memories],
|
28 | 28 | // owned_memories: [VMMemoryDefinition; module.num_owned_memories],
|
29 | 29 | // imported_functions: [VMFunctionImport; module.num_imported_functions],
|
30 |
| -// imported_tables: [VMTableImport; module.num_imported_tables], |
| 30 | +// imported_tables: [VMTable; module.num_imported_tables], |
31 | 31 | // imported_globals: [VMGlobalImport; module.num_imported_globals],
|
32 | 32 | // imported_tags: [VMTagImport; module.num_imported_tags],
|
33 | 33 | // tables: [VMTableDefinition; module.num_defined_tables],
|
@@ -520,7 +520,7 @@ impl<P: PtrSize> From<VMOffsetsFields<P>> for VMOffsets<P> {
|
520 | 520 | size(imported_functions)
|
521 | 521 | = cmul(ret.num_imported_functions, ret.size_of_vmfunction_import()),
|
522 | 522 | size(imported_tables)
|
523 |
| - = cmul(ret.num_imported_tables, ret.size_of_vmtable_import()), |
| 523 | + = cmul(ret.num_imported_tables, ret.size_of_vmtable()), |
524 | 524 | size(imported_globals)
|
525 | 525 | = cmul(ret.num_imported_globals, ret.size_of_vmglobal_import()),
|
526 | 526 | size(imported_tags)
|
@@ -578,23 +578,23 @@ impl<P: PtrSize> VMOffsets<P> {
|
578 | 578 | }
|
579 | 579 | }
|
580 | 580 |
|
581 |
| -/// Offsets for `VMTableImport`. |
| 581 | +/// Offsets for `VMTable`. |
582 | 582 | impl<P: PtrSize> VMOffsets<P> {
|
583 | 583 | /// The offset of the `from` field.
|
584 | 584 | #[inline]
|
585 |
| - pub fn vmtable_import_from(&self) -> u8 { |
| 585 | + pub fn vmtable_from(&self) -> u8 { |
586 | 586 | 0 * self.pointer_size()
|
587 | 587 | }
|
588 | 588 |
|
589 | 589 | /// The offset of the `vmctx` field.
|
590 | 590 | #[inline]
|
591 |
| - pub fn vmtable_import_vmctx(&self) -> u8 { |
| 591 | + pub fn vmtable_vmctx(&self) -> u8 { |
592 | 592 | 1 * self.pointer_size()
|
593 | 593 | }
|
594 | 594 |
|
595 |
| - /// Return the size of `VMTableImport`. |
| 595 | + /// Return the size of `VMTable`. |
596 | 596 | #[inline]
|
597 |
| - pub fn size_of_vmtable_import(&self) -> u8 { |
| 597 | + pub fn size_of_vmtable(&self) -> u8 { |
598 | 598 | 2 * self.pointer_size()
|
599 | 599 | }
|
600 | 600 | }
|
@@ -767,12 +767,11 @@ impl<P: PtrSize> VMOffsets<P> {
|
767 | 767 | + index.as_u32() * u32::from(self.size_of_vmfunction_import())
|
768 | 768 | }
|
769 | 769 |
|
770 |
| - /// Return the offset to `VMTableImport` index `index`. |
| 770 | + /// Return the offset to `VMTable` index `index`. |
771 | 771 | #[inline]
|
772 | 772 | pub fn vmctx_vmtable_import(&self, index: TableIndex) -> u32 {
|
773 | 773 | assert!(index.as_u32() < self.num_imported_tables);
|
774 |
| - self.vmctx_imported_tables_begin() |
775 |
| - + index.as_u32() * u32::from(self.size_of_vmtable_import()) |
| 774 | + self.vmctx_imported_tables_begin() + index.as_u32() * u32::from(self.size_of_vmtable()) |
776 | 775 | }
|
777 | 776 |
|
778 | 777 | /// Return the offset to `VMMemoryImport` index `index`.
|
@@ -863,10 +862,11 @@ impl<P: PtrSize> VMOffsets<P> {
|
863 | 862 | self.vmctx_vmfunction_import(index) + u32::from(self.vmfunction_import_vmctx())
|
864 | 863 | }
|
865 | 864 |
|
866 |
| - /// Return the offset to the `from` field in `VMTableImport` index `index`. |
| 865 | + /// Return the offset to the `from` field in the imported `VMTable` at index |
| 866 | + /// `index`. |
867 | 867 | #[inline]
|
868 |
| - pub fn vmctx_vmtable_import_from(&self, index: TableIndex) -> u32 { |
869 |
| - self.vmctx_vmtable_import(index) + u32::from(self.vmtable_import_from()) |
| 868 | + pub fn vmctx_vmtable_from(&self, index: TableIndex) -> u32 { |
| 869 | + self.vmctx_vmtable_import(index) + u32::from(self.vmtable_from()) |
870 | 870 | }
|
871 | 871 |
|
872 | 872 | /// Return the offset to the `base` field in `VMTableDefinition` index `index`.
|
|
0 commit comments