Sha256: a407e774553044775033e4ef3dd59236ea04c8df373bf2b53146f4769bb2d8ad

Contents?: true

Size: 1.14 KB

Versions: 14

Compression:

Stored size: 1.14 KB

Contents

//! Tables.

use crate::ir::immediates::Uimm64;
use crate::ir::{GlobalValue, Type};
use core::fmt;

#[cfg(feature = "enable-serde")]
use serde::{Deserialize, Serialize};

/// Information about a table declaration.
#[derive(Clone, PartialEq, Hash)]
#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]
pub struct TableData {
    /// Global value giving the address of the start of the table.
    pub base_gv: GlobalValue,

    /// Guaranteed minimum table size in elements. Table accesses before `min_size` don't need
    /// bounds checking.
    pub min_size: Uimm64,

    /// Global value giving the current bound of the table, in elements.
    pub bound_gv: GlobalValue,

    /// The size of a table element, in bytes.
    pub element_size: Uimm64,

    /// The index type for the table.
    pub index_type: Type,
}

impl fmt::Display for TableData {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.write_str("dynamic")?;
        write!(
            f,
            " {}, min {}, bound {}, element_size {}, index_type {}",
            self.base_gv, self.min_size, self.bound_gv, self.element_size, self.index_type
        )
    }
}

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
wasmtime-12.0.1 ./ext/cargo-vendor/cranelift-codegen-0.99.1/src/ir/table.rs
wasmtime-12.0.0 ./ext/cargo-vendor/cranelift-codegen-0.99.1/src/ir/table.rs
wasmtime-11.0.0 ./ext/cargo-vendor/cranelift-codegen-0.98.1/src/ir/table.rs
wasmtime-10.0.1 ./ext/cargo-vendor/cranelift-codegen-0.97.1/src/ir/table.rs
wasmtime-10.0.0 ./ext/cargo-vendor/cranelift-codegen-0.97.1/src/ir/table.rs
wasmtime-9.0.4 ./ext/cargo-vendor/cranelift-codegen-0.96.4/src/ir/table.rs
wasmtime-9.0.1 ./ext/cargo-vendor/cranelift-codegen-0.96.1/src/ir/table.rs
wasmtime-8.0.0 ./ext/cargo-vendor/cranelift-codegen-0.95.0/src/ir/table.rs
wasmtime-7.0.0 ./ext/cargo-vendor/cranelift-codegen-0.94.0/src/ir/table.rs
wasmtime-6.0.1 ./ext/cargo-vendor/cranelift-codegen-0.93.1/src/ir/table.rs
wasmtime-6.0.0 ./ext/cargo-vendor/cranelift-codegen-0.93.0/src/ir/table.rs
wasmtime-5.0.0 ./ext/cargo-vendor/cranelift-codegen-0.92.0/src/ir/table.rs
wasmtime-0.4.1 ./ext/cargo-vendor/cranelift-codegen-0.91.0/src/ir/table.rs
wasmtime-0.4.0 ./ext/cargo-vendor/cranelift-codegen-0.91.0/src/ir/table.rs