Struct rust_jvm::vm::frame::Frame [] [src]

pub struct Frame<'a> {
    current_class: &'a Class,
    code: &'a [u8],
    pc: u16,
    local_variables: Vec<Option<Value>>,
    operand_stack: Vec<Value>,
}

A frame is used to store data and partial results, as well as to perform dynamic linking, return values for methods, and dispatch exceptions.

Fields

current_class

A reference to the class containing the currently executing method.

code

The bytecode currently executing in this frame.

pc

The current program counter.

local_variables

The local variables of the current method. Values that occupy two indices (long and double) are stored in one slot followed by a None value in the subsequent index.

operand_stack

The operand stack manipulated by the instructions of the current method.

Methods

impl<'a> Frame<'a>

fn new(current_class: &'a Class, code: &'a [u8], local_variables: Vec<Option<Value>>) -> Self

fn read_next_byte(&mut self) -> u8

Read a byte (u8) value and advance the program counter.

fn read_next_short(&mut self) -> u16

Read a short (u16) value and advance the program counter by 2.

fn pop_multi(&mut self, count: usize) -> Vec<Value>

Remove count items from the operand stack.

fn run(self, class_loader: &mut ClassLoader) -> Option<Value>

Execute the method associated with this stack frame in the context of the currrent class loader, and return a result if there is one. This method may create new stack frames as a result of evaluating invoke* instructions.

Trait Implementations

Derived Implementations

impl<'a> Debug for Frame<'a>

fn fmt(&self, __arg_0: &mut Formatter) -> Result