From d9d69299bbf507acf9d58e142b2751c2fc63d134 Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Wed, 29 Apr 2020 02:18:05 +0200 Subject: [PATCH] A few typofixes (#1623) * a few typofixes * more tyops --- cranelift/codegen/src/isa/aarch64/lower.rs | 2 +- .../debug/src/transform/address_transform.rs | 18 +++++++++--------- crates/lightbeam/src/module.rs | 8 ++++---- crates/obj/src/context.rs | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/cranelift/codegen/src/isa/aarch64/lower.rs b/cranelift/codegen/src/isa/aarch64/lower.rs index 505a742607..50707a5f01 100644 --- a/cranelift/codegen/src/isa/aarch64/lower.rs +++ b/cranelift/codegen/src/isa/aarch64/lower.rs @@ -3,7 +3,7 @@ //! TODO: opportunities for better code generation: //! //! - Smarter use of addressing modes. Recognize a+SCALE*b patterns; recognize -//! and incorporate sign/zero extension on indicies. Recognize pre/post-index +//! and incorporate sign/zero extension on indices. Recognize pre/post-index //! opportunities. //! //! - Floating-point immediates (FIMM instruction). diff --git a/crates/debug/src/transform/address_transform.rs b/crates/debug/src/transform/address_transform.rs index c134266675..3c2efe2863 100644 --- a/crates/debug/src/transform/address_transform.rs +++ b/crates/debug/src/transform/address_transform.rs @@ -39,7 +39,7 @@ struct Position { } /// Mapping of continuous range of source location to its generated -/// code. The positions are always in accending order for search. +/// code. The positions are always in ascending order for search. #[derive(Debug)] struct Range { wasm_start: WasmAddress, @@ -226,7 +226,7 @@ fn build_function_addr_map( // The iterator returns generated addresses sorted by RangeIndex. struct TransformRangeStartIter<'a> { addr: WasmAddress, - indicies: &'a [RangeIndex], + indices: &'a [RangeIndex], ranges: &'a [Range], } @@ -249,7 +249,7 @@ impl<'a> TransformRangeStartIter<'a> { if let Some(range_indices) = found { TransformRangeStartIter { addr, - indicies: range_indices, + indices: range_indices, ranges: &func.lookup.ranges, } } else { @@ -261,10 +261,10 @@ impl<'a> TransformRangeStartIter<'a> { impl<'a> Iterator for TransformRangeStartIter<'a> { type Item = (GeneratedAddress, RangeIndex); fn next(&mut self) -> Option { - if let Some((first, tail)) = self.indicies.split_first() { + if let Some((first, tail)) = self.indices.split_first() { let range_index = *first; let range = &self.ranges[range_index]; - self.indicies = tail; + self.indices = tail; let address = match range .positions .binary_search_by(|a| a.wasm_pos.cmp(&self.addr)) @@ -289,7 +289,7 @@ impl<'a> Iterator for TransformRangeStartIter<'a> { // The iterator returns generated addresses sorted by RangeIndex. struct TransformRangeEndIter<'a> { addr: WasmAddress, - indicies: &'a [RangeIndex], + indices: &'a [RangeIndex], ranges: &'a [Range], } @@ -312,7 +312,7 @@ impl<'a> TransformRangeEndIter<'a> { if let Some(range_indices) = found { TransformRangeEndIter { addr, - indicies: range_indices, + indices: range_indices, ranges: &func.lookup.ranges, } } else { @@ -324,10 +324,10 @@ impl<'a> TransformRangeEndIter<'a> { impl<'a> Iterator for TransformRangeEndIter<'a> { type Item = (GeneratedAddress, RangeIndex); fn next(&mut self) -> Option { - while let Some((first, tail)) = self.indicies.split_first() { + while let Some((first, tail)) = self.indices.split_first() { let range_index = *first; let range = &self.ranges[range_index]; - self.indicies = tail; + self.indices = tail; if range.wasm_start >= self.addr { continue; } diff --git a/crates/lightbeam/src/module.rs b/crates/lightbeam/src/module.rs index 02cb9c09ec..27d6af4f27 100644 --- a/crates/lightbeam/src/module.rs +++ b/crates/lightbeam/src/module.rs @@ -182,7 +182,7 @@ impl ExecutableModule { ) -> Result { let module = &self.module; - if func_idx as usize >= module.ctx.func_ty_indicies.len() { + if func_idx as usize >= module.ctx.func_ty_indices.len() { return Err(ExecutionError::FuncIndexOutOfBounds); } @@ -249,7 +249,7 @@ impl VmCtx { #[derive(Default, Debug)] pub struct SimpleContext { types: Vec, - func_ty_indicies: Vec, + func_ty_indices: Vec, } pub const WASM_PAGE_SIZE: usize = 65_536; @@ -393,7 +393,7 @@ impl ModuleContext for SimpleContext { } fn func_type_index(&self, func_idx: u32) -> u32 { - self.func_ty_indicies[func_idx as usize] + self.func_ty_indices[func_idx as usize] } fn defined_global_index(&self, _index: u32) -> Option { @@ -539,7 +539,7 @@ pub fn translate_only(data: &[u8]) -> Result { if let SectionCode::Function = section.code { let functions = section.get_function_section_reader()?; - output.ctx.func_ty_indicies = translate_sections::function(functions)?; + output.ctx.func_ty_indices = translate_sections::function(functions)?; reader.skip_custom_sections()?; if reader.eof() { diff --git a/crates/obj/src/context.rs b/crates/obj/src/context.rs index 70a99d7b78..d46ecf253e 100644 --- a/crates/obj/src/context.rs +++ b/crates/obj/src/context.rs @@ -22,7 +22,7 @@ pub fn layout_vmcontext( let out_len = ofs.size_of_vmctx() as usize; let mut out = vec![0; out_len]; - // Assign unique indicies to unique signatures. + // Assign unique indices to unique signatures. let mut signature_registry = HashMap::new(); let mut signature_registry_len = signature_registry.len(); for (index, sig) in module.local.signatures.iter() {