Sha256: 5284de52d4efe3ba65b7c1b6d4b107a62f0be588788208408a8cfaef188a2398

Contents?: true

Size: 1.15 KB

Versions: 11

Compression:

Stored size: 1.15 KB

Contents

//! Tables.

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

#[cfg(feature = "enable-serde")]
use serde_derive::{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

11 entries across 11 versions & 1 rubygems

Version Path
wasmtime-18.0.3 ./ext/cargo-vendor/cranelift-codegen-0.105.3/src/ir/table.rs
wasmtime-17.0.1 ./ext/cargo-vendor/cranelift-codegen-0.104.1/src/ir/table.rs
wasmtime-17.0.0 ./ext/cargo-vendor/cranelift-codegen-0.104.0/src/ir/table.rs
wasmtime-16.0.0 ./ext/cargo-vendor/cranelift-codegen-0.103.0/src/ir/table.rs
wasmtime-15.0.1 ./ext/cargo-vendor/cranelift-codegen-0.102.1/src/ir/table.rs
wasmtime-15.0.0 ./ext/cargo-vendor/cranelift-codegen-0.102.1/src/ir/table.rs
wasmtime-14.0.4 ./ext/cargo-vendor/cranelift-codegen-0.101.4/src/ir/table.rs
wasmtime-14.0.3 ./ext/cargo-vendor/cranelift-codegen-0.101.4/src/ir/table.rs
wasmtime-14.0.1 ./ext/cargo-vendor/cranelift-codegen-0.101.1/src/ir/table.rs
wasmtime-14.0.0 ./ext/cargo-vendor/cranelift-codegen-0.101.1/src/ir/table.rs
wasmtime-13.0.0 ./ext/cargo-vendor/cranelift-codegen-0.100.0/src/ir/table.rs