From 716e8b561395abb850242dd1dc476c17a382bd38 Mon Sep 17 00:00:00 2001 From: Sergey Pepyakin Date: Fri, 29 Mar 2019 18:13:36 +0100 Subject: [PATCH] Add some docs. --- src/validation/func.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/validation/func.rs b/src/validation/func.rs index 78dfd5e..8d7dd75 100644 --- a/src/validation/func.rs +++ b/src/validation/func.rs @@ -21,15 +21,17 @@ const DEFAULT_FRAME_STACK_LIMIT: usize = 16384; struct BlockFrame { /// Frame type. frame_type: BlockFrameType, - /// A signature, which is a block signature type indicating the number and types of result values of the region. + /// A signature, which is a block signature type indicating the number and types of result + /// values of the region. block_type: BlockType, /// A label for reference to block instruction. begin_position: usize, - /// A limit integer value, which is an index into the value stack indicating where to reset it to on a branch to that label. + /// A limit integer value, which is an index into the value stack indicating where to reset it + /// to on a branch to that label. value_stack_len: usize, - /// Boolean which signals whether value stack became polymorphic. Value stack starts in non-polymorphic state and - /// becomes polymorphic only after an instruction that never passes control further is executed, - /// i.e. `unreachable`, `br` (but not `br_if`!), etc. + /// Boolean which signals whether value stack became polymorphic. Value stack starts in + /// a non-polymorphic state and becomes polymorphic only after an instruction that never passes + /// control further is executed, i.e. `unreachable`, `br` (but not `br_if`!), etc. polymorphic_stack: bool, } @@ -1783,6 +1785,9 @@ fn require_local(locals: &Locals, idx: u32) -> Result { Ok(locals.type_of_local(idx)?) } +/// Returns a relative depth on the stack of a local variable specified +/// by `idx`. +/// /// See stack layout definition in mod isa. fn relative_local_depth( idx: u32,