Fix typos caused by find-and-replace
This commit is contained in:
committed by
Dan Gohman
parent
5c320a0d30
commit
3686fc2fc7
@@ -16,7 +16,7 @@ ebb = EntityRefKind(
|
||||
#: A reference to a stack slot declared in the function preamble.
|
||||
stack_slot = EntityRefKind('stack_slot', 'A stack slot.')
|
||||
|
||||
#: A reference to a global valueiable.
|
||||
#: A reference to a global value.
|
||||
global_value = EntityRefKind('global_value', 'A global value.')
|
||||
|
||||
#: A reference to a function sugnature declared in the function preamble.
|
||||
|
||||
@@ -79,5 +79,5 @@ CondTrap = InstructionFormat(VALUE, trapcode)
|
||||
IntCondTrap = InstructionFormat(intcc, VALUE, trapcode)
|
||||
FloatCondTrap = InstructionFormat(floatcc, VALUE, trapcode)
|
||||
|
||||
# Finally extract the names of global valueiables in this module.
|
||||
# Finally extract the names of global values in this module.
|
||||
InstructionFormat.extract_names(globals())
|
||||
|
||||
@@ -53,7 +53,7 @@ call_conv = EnumSetting(
|
||||
|
||||
# Note that Cretonne doesn't currently need an is_pie flag, because PIE is just
|
||||
# PIC where symbols can't be pre-empted, which can be expressed with the
|
||||
# `colocated` flag on external functions and global valueiables.
|
||||
# `colocated` flag on external functions and global values.
|
||||
is_pic = BoolSetting("Enable Position-Independent Code generation")
|
||||
|
||||
colocated_libcalls = BoolSetting(
|
||||
|
||||
@@ -208,7 +208,7 @@ class InstructionFormat(object):
|
||||
"""
|
||||
Given a dict mapping name -> object as returned by `globals()`, find
|
||||
all the InstructionFormat objects and set their name from the dict key.
|
||||
This is used to name a bunch of global valueiables in a module.
|
||||
This is used to name a bunch of global values in a module.
|
||||
"""
|
||||
for name, obj in globs.items():
|
||||
if isinstance(obj, InstructionFormat):
|
||||
|
||||
@@ -365,7 +365,7 @@ class RegClass(object):
|
||||
"""
|
||||
Given a dict mapping name -> object as returned by `globals()`, find
|
||||
all the RegClass objects and set their name from the dict key.
|
||||
This is used to name a bunch of global valueiables in a module.
|
||||
This is used to name a bunch of global values in a module.
|
||||
"""
|
||||
for name, obj in globs.items():
|
||||
if isinstance(obj, RegClass):
|
||||
|
||||
@@ -82,13 +82,13 @@ impl StackSlot {
|
||||
}
|
||||
}
|
||||
|
||||
/// An opaque reference to a global valueiable.
|
||||
/// An opaque reference to a global value.
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct GlobalValue(u32);
|
||||
entity_impl!(GlobalValue, "gv");
|
||||
|
||||
impl GlobalValue {
|
||||
/// Create a new global valueiable reference from its number.
|
||||
/// Create a new global value reference from its number.
|
||||
///
|
||||
/// This method is for use by the parser.
|
||||
pub fn with_number(n: u32) -> Option<Self> {
|
||||
|
||||
@@ -284,7 +284,7 @@ pub enum ArgumentPurpose {
|
||||
/// A VM context pointer.
|
||||
///
|
||||
/// This is a pointer to a context struct containing details about the current sandbox. It is
|
||||
/// used as a base pointer for `vmctx` global valueiables.
|
||||
/// used as a base pointer for `vmctx` global values.
|
||||
VMContext,
|
||||
|
||||
/// A signature identifier.
|
||||
|
||||
@@ -145,7 +145,7 @@ impl Function {
|
||||
self.dfg.ext_funcs.push(data)
|
||||
}
|
||||
|
||||
/// Declares a global valueiable accessible to the function.
|
||||
/// Declares a global value accessible to the function.
|
||||
pub fn create_global_value(&mut self, data: GlobalValueData) -> GlobalValue {
|
||||
self.global_values.push(data)
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ use ir::immediates::Offset32;
|
||||
use ir::{ExternalName, GlobalValue};
|
||||
use std::fmt;
|
||||
|
||||
/// Information about a global valueiable declaration.
|
||||
/// Information about a global value declaration.
|
||||
#[derive(Clone)]
|
||||
pub enum GlobalValueData {
|
||||
/// Variable is part of the VM context struct, it's address is a constant offset from the VM
|
||||
@@ -14,13 +14,13 @@ pub enum GlobalValueData {
|
||||
offset: Offset32,
|
||||
},
|
||||
|
||||
/// Variable is part of a struct pointed to by another global valueiable.
|
||||
/// Variable is part of a struct pointed to by another global value.
|
||||
///
|
||||
/// The `base` global valueiable is assumed to contain a pointer to a struct. This global
|
||||
/// The `base` global value is assumed to contain a pointer to a struct. This global
|
||||
/// variable lives at an offset into the struct. The memory must be accessible, and
|
||||
/// naturally aligned to hold a pointer value.
|
||||
Deref {
|
||||
/// The base pointer global valueiable.
|
||||
/// The base pointer global value.
|
||||
base: GlobalValue,
|
||||
|
||||
/// Byte offset to be added to the pointer loaded from `base`.
|
||||
|
||||
@@ -4,7 +4,7 @@ use ir::immediates::Offset32;
|
||||
use ir::{ExternalName, GlobalValue};
|
||||
use std::fmt;
|
||||
|
||||
/// Information about a global valueiable declaration.
|
||||
/// Information about a global value declaration.
|
||||
#[derive(Clone)]
|
||||
pub enum GlobalValueData {
|
||||
/// Variable is part of the VM context struct, it's address is a constant offset from the VM
|
||||
@@ -14,13 +14,13 @@ pub enum GlobalValueData {
|
||||
offset: Offset32,
|
||||
},
|
||||
|
||||
/// Variable is part of a struct pointed to by another global valueiable.
|
||||
/// Variable is part of a struct pointed to by another global value.
|
||||
///
|
||||
/// The `base` global valueiable is assumed to contain a pointer to a struct. This global
|
||||
/// The `base` global value is assumed to contain a pointer to a struct. This global
|
||||
/// variable lives at an offset into the struct. The memory must be accessible, and
|
||||
/// naturally aligned to hold a pointer value.
|
||||
Deref {
|
||||
/// The base pointer global valueiable.
|
||||
/// The base pointer global value.
|
||||
base: GlobalValue,
|
||||
|
||||
/// Byte offset to be added to the pointer loaded from `base`.
|
||||
|
||||
@@ -29,7 +29,7 @@ pub enum HeapBase {
|
||||
/// This feature is not yet implemented.
|
||||
ReservedReg,
|
||||
|
||||
/// The heap base is in a global valueiable. The variable must be accessible and naturally
|
||||
/// The heap base is in a global value. The variable must be accessible and naturally
|
||||
/// aligned for a pointer.
|
||||
GlobalValue(GlobalValue),
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
//! Legalization of global valueiables.
|
||||
//! Legalization of global values.
|
||||
//!
|
||||
//! This module exports the `expand_global_value` function which transforms a `global_value`
|
||||
//! instruction into code that depends on the kind of global valueiable referenced.
|
||||
//! instruction into code that depends on the kind of global value referenced.
|
||||
|
||||
use cursor::{Cursor, FuncCursor};
|
||||
use flowgraph::ControlFlowGraph;
|
||||
use ir::{self, InstBuilder};
|
||||
use isa::TargetIsa;
|
||||
|
||||
/// Expand a `global_value` instruction according to the definition of the global valueiable.
|
||||
/// Expand a `global_value` instruction according to the definition of the global value.
|
||||
pub fn expand_global_value(
|
||||
inst: ir::Inst,
|
||||
func: &mut ir::Function,
|
||||
@@ -46,7 +46,7 @@ fn vmctx_addr(inst: ir::Inst, func: &mut ir::Function, offset: i64) {
|
||||
|
||||
/// Expand a `global_value` instruction for a deref global.
|
||||
fn deref_addr(inst: ir::Inst, func: &mut ir::Function, base: ir::GlobalValue, offset: i64) {
|
||||
// We need to load a pointer from the `base` global valueiable, so insert a new `global_value`
|
||||
// We need to load a pointer from the `base` global value, so insert a new `global_value`
|
||||
// instruction. This depends on the iterative legalization loop. Note that the IR verifier
|
||||
// detects any cycles in the `deref` globals.
|
||||
let ptr_ty = func.dfg.value_type(func.dfg.first_result(inst));
|
||||
|
||||
@@ -920,7 +920,7 @@ impl Solver {
|
||||
Some(reg) => reg,
|
||||
None => {
|
||||
// If `v` must avoid global interference, there is not point in requesting
|
||||
// live registers be diverted. We need to make it a non-global valueiable.
|
||||
// live registers be diverted. We need to make it a non-global value.
|
||||
if v.is_global && gregs.iter(rc).next().is_none() {
|
||||
return Err(SolverError::Global(v.value));
|
||||
} else {
|
||||
|
||||
@@ -168,7 +168,7 @@ impl<'a> Verifier<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
// Check for cycles in the global valueiable declarations.
|
||||
// Check for cycles in the global value declarations.
|
||||
fn verify_global_values(&self) -> VerifierResult<()> {
|
||||
let mut seen = SparseSet::new();
|
||||
|
||||
@@ -415,7 +415,7 @@ impl<'a> Verifier<'a> {
|
||||
|
||||
fn verify_global_value(&self, inst: Inst, gv: GlobalValue) -> VerifierResult<()> {
|
||||
if !self.func.global_values.is_valid(gv) {
|
||||
err!(inst, "invalid global valueiable {}", gv)
|
||||
err!(inst, "invalid global value {}", gv)
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -377,7 +377,7 @@ where
|
||||
self.func.import_function(data)
|
||||
}
|
||||
|
||||
/// Declares a global valueiable accessible to the function.
|
||||
/// Declares a global value accessible to the function.
|
||||
pub fn create_global_value(&mut self, data: GlobalValueData) -> GlobalValue {
|
||||
self.func.create_global_value(data)
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ impl DataContext {
|
||||
self.description.function_decls.push(name)
|
||||
}
|
||||
|
||||
/// Declares a global valueiable import.
|
||||
/// Declares a global value import.
|
||||
///
|
||||
/// TODO: Rename to import_data?
|
||||
///
|
||||
|
||||
@@ -139,7 +139,7 @@ impl<'a> Context<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
// Allocate a global valueiable slot.
|
||||
// Allocate a global value slot.
|
||||
fn add_gv(
|
||||
&mut self,
|
||||
gv: GlobalValue,
|
||||
@@ -156,10 +156,10 @@ impl<'a> Context<'a> {
|
||||
self.map.def_gv(gv, loc)
|
||||
}
|
||||
|
||||
// Resolve a reference to a global valueiable.
|
||||
// Resolve a reference to a global value.
|
||||
fn check_gv(&self, gv: GlobalValue, loc: &Location) -> ParseResult<()> {
|
||||
if !self.map.contains_gv(gv) {
|
||||
err!(loc, "undefined global valueiable {}", gv)
|
||||
err!(loc, "undefined global value {}", gv)
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
@@ -401,7 +401,7 @@ impl<'a> Parser<'a> {
|
||||
err!(self.loc, err_msg)
|
||||
}
|
||||
|
||||
// Match and consume a global valueiable reference.
|
||||
// Match and consume a global value reference.
|
||||
fn match_gv(&mut self, err_msg: &str) -> ParseResult<GlobalValue> {
|
||||
if let Some(Token::GlobalValue(gv)) = self.token() {
|
||||
self.consume();
|
||||
@@ -1077,7 +1077,7 @@ impl<'a> Parser<'a> {
|
||||
Ok((ss, data))
|
||||
}
|
||||
|
||||
// Parse a global valueiable decl.
|
||||
// Parse a global value decl.
|
||||
//
|
||||
// global-var-decl ::= * GlobalValue(gv) "=" global-var-desc
|
||||
// global-var-desc ::= "vmctx" offset32
|
||||
@@ -1085,28 +1085,19 @@ impl<'a> Parser<'a> {
|
||||
// | globalsym ["colocated"] name
|
||||
//
|
||||
fn parse_global_value_decl(&mut self) -> ParseResult<(GlobalValue, GlobalValueData)> {
|
||||
let gv = self.match_gv("expected global valueiable number: gv«n»")?;
|
||||
let gv = self.match_gv("expected global value number: gv«n»")?;
|
||||
|
||||
self.match_token(
|
||||
Token::Equal,
|
||||
"expected '=' in global valueiable declaration",
|
||||
)?;
|
||||
self.match_token(Token::Equal, "expected '=' in global value declaration")?;
|
||||
|
||||
let data = match self.match_any_identifier("expected global valueiable kind")? {
|
||||
let data = match self.match_any_identifier("expected global value kind")? {
|
||||
"vmctx" => {
|
||||
let offset = self.optional_offset32()?;
|
||||
GlobalValueData::VMContext { offset }
|
||||
}
|
||||
"deref" => {
|
||||
self.match_token(
|
||||
Token::LPar,
|
||||
"expected '(' in 'deref' global valueiable decl",
|
||||
)?;
|
||||
let base = self.match_gv("expected global valueiable: gv«n»")?;
|
||||
self.match_token(
|
||||
Token::RPar,
|
||||
"expected ')' in 'deref' global valueiable decl",
|
||||
)?;
|
||||
self.match_token(Token::LPar, "expected '(' in 'deref' global value decl")?;
|
||||
let base = self.match_gv("expected global value: gv«n»")?;
|
||||
self.match_token(Token::RPar, "expected ')' in 'deref' global value decl")?;
|
||||
let offset = self.optional_offset32()?;
|
||||
GlobalValueData::Deref { base, offset }
|
||||
}
|
||||
@@ -1115,7 +1106,7 @@ impl<'a> Parser<'a> {
|
||||
let name = self.parse_external_name()?;
|
||||
GlobalValueData::Sym { name, colocated }
|
||||
}
|
||||
other => return err!(self.loc, "Unknown global valueiable kind '{}'", other),
|
||||
other => return err!(self.loc, "Unknown global value kind '{}'", other),
|
||||
};
|
||||
|
||||
// Collect any trailing comments.
|
||||
@@ -1150,7 +1141,7 @@ impl<'a> Parser<'a> {
|
||||
Some(Token::GlobalValue(base_num)) => {
|
||||
let base_gv = match GlobalValue::with_number(base_num) {
|
||||
Some(gv) => gv,
|
||||
None => return err!(self.loc, "invalid global valueiable number for heap base"),
|
||||
None => return err!(self.loc, "invalid global value number for heap base"),
|
||||
};
|
||||
HeapBase::GlobalValue(base_gv)
|
||||
}
|
||||
@@ -1327,7 +1318,7 @@ impl<'a> Parser<'a> {
|
||||
fn parse_stack_limit_decl(&mut self) -> ParseResult<GlobalValue> {
|
||||
self.consume();
|
||||
self.match_token(Token::Equal, "expected '=' in stack limit declaration")?;
|
||||
let gv = self.match_gv("expected global valueiable")?;
|
||||
let gv = self.match_gv("expected global value")?;
|
||||
|
||||
Ok(gv)
|
||||
}
|
||||
@@ -1904,7 +1895,7 @@ impl<'a> Parser<'a> {
|
||||
imm: self.match_bool("expected immediate boolean operand")?,
|
||||
},
|
||||
InstructionFormat::UnaryGlobalValue => {
|
||||
let gv = self.match_gv("expected global valueiable")?;
|
||||
let gv = self.match_gv("expected global value")?;
|
||||
ctx.check_gv(gv, &self.loc)?;
|
||||
InstructionData::UnaryGlobalValue {
|
||||
opcode,
|
||||
|
||||
@@ -36,7 +36,7 @@ impl SourceMap {
|
||||
self.locations.contains_key(&ss.into())
|
||||
}
|
||||
|
||||
/// Look up a global valueiable entity.
|
||||
/// Look up a global value entity.
|
||||
pub fn contains_gv(&self, gv: GlobalValue) -> bool {
|
||||
self.locations.contains_key(&gv.into())
|
||||
}
|
||||
@@ -154,7 +154,7 @@ impl SourceMap {
|
||||
self.def_entity(entity.into(), loc)
|
||||
}
|
||||
|
||||
/// Define the global valueiable `entity`.
|
||||
/// Define the global value `entity`.
|
||||
pub fn def_gv(&mut self, entity: GlobalValue, loc: &Location) -> ParseResult<()> {
|
||||
self.def_entity(entity.into(), loc)
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ use translation_utils::{FunctionIndex, Global, GlobalIndex, Memory, MemoryIndex,
|
||||
Table, TableIndex};
|
||||
use wasmparser::BinaryReaderError;
|
||||
|
||||
/// The value of a WebAssembly global valueiable.
|
||||
/// The value of a WebAssembly global value.
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum GlobalValue {
|
||||
/// This is a constant global with a value known at compile time.
|
||||
@@ -17,9 +17,9 @@ pub enum GlobalValue {
|
||||
|
||||
/// This is a variable in memory that should be referenced as a `GlobalValue`.
|
||||
Memory {
|
||||
/// Which global valueiable should be referenced.
|
||||
/// Which global value should be referenced.
|
||||
gv: ir::GlobalValue,
|
||||
/// The global valueiable's type.
|
||||
/// The global value's type.
|
||||
ty: ir::Type,
|
||||
},
|
||||
}
|
||||
@@ -88,12 +88,12 @@ pub trait FuncEnvironment {
|
||||
ir::Type::int(u16::from(self.triple().pointer_width().unwrap().bits())).unwrap()
|
||||
}
|
||||
|
||||
/// Set up the necessary preamble definitions in `func` to access the global valueiable
|
||||
/// Set up the necessary preamble definitions in `func` to access the global value
|
||||
/// identified by `index`.
|
||||
///
|
||||
/// The index space covers both imported globals and globals defined by the module.
|
||||
///
|
||||
/// Return the global valueiable reference that should be used to access the global and the
|
||||
/// Return the global value reference that should be used to access the global and the
|
||||
/// WebAssembly type of the global.
|
||||
fn make_global(&mut self, func: &mut ir::Function, index: GlobalIndex) -> GlobalValue;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
//! The code of theses helper function is straightforward since it is only about reading metadata
|
||||
//! about linear memories, tables, globals, etc. and storing them for later use.
|
||||
//!
|
||||
//! The special case of the initialize expressions for table elements offsets or global valueiables
|
||||
//! The special case of the initialize expressions for table elements offsets or global values
|
||||
//! is handled, according to the semantics of WebAssembly, to only specific expressions that are
|
||||
//! interpreted on the fly.
|
||||
use cretonne_codegen::ir::{self, AbiParam, Signature};
|
||||
|
||||
@@ -134,7 +134,7 @@ pub struct TranslationState {
|
||||
pub control_stack: Vec<ControlStackFrame>,
|
||||
pub reachable: bool,
|
||||
|
||||
// Map of global valueiables that have already been created by `FuncEnvironment::make_global`.
|
||||
// Map of global values that have already been created by `FuncEnvironment::make_global`.
|
||||
globals: HashMap<GlobalIndex, GlobalValue>,
|
||||
|
||||
// Map of heaps that have been created by `FuncEnvironment::make_heap`.
|
||||
@@ -272,7 +272,7 @@ impl TranslationState {
|
||||
|
||||
/// Methods for handling entity references.
|
||||
impl TranslationState {
|
||||
/// Get the `GlobalValue` reference that should be used to access the global valueiable `index`.
|
||||
/// Get the `GlobalValue` reference that should be used to access the global value `index`.
|
||||
/// Create the reference if necessary.
|
||||
/// Also return the WebAssembly type of the global.
|
||||
pub fn get_global<FE: FuncEnvironment + ?Sized>(
|
||||
|
||||
@@ -7,7 +7,7 @@ use wasmparser;
|
||||
pub type FunctionIndex = usize;
|
||||
/// Index of a table (imported or defined) inside the WebAssembly module.
|
||||
pub type TableIndex = usize;
|
||||
/// Index of a global valueiable (imported or defined) inside the WebAssembly module.
|
||||
/// Index of a global value (imported or defined) inside the WebAssembly module.
|
||||
pub type GlobalIndex = usize;
|
||||
/// Index of a linear memory (imported or defined) inside the WebAssembly module.
|
||||
pub type MemoryIndex = usize;
|
||||
|
||||
Reference in New Issue
Block a user