Stack Class Reference

#include <interp_defs.h>

List of all members.


Detailed Description

The stack for executing the Java method.

This structure contains a set of operations specific for the Java stack.


Public Member Functions

 Stack ()
 The empty constructor.
 ~Stack ()
 The destructor.
void init (void *ptr, int size)
 Initializes the stack of a method.
Valuepick (int offset=0)
 Returns the reference to the value on the top of the stack.
uint8 & ref (int offset=0)
 Sets and resets the value to the object reference.
void push (int size=1)
 Only moves the stack pointer.
void pop (int size=1)
 Decreases the stack pointer.
void popClearRef (int size=1)
 Is similar to pop().
void setLong (int idx, Value2 val)
 Sets the value of an object of the Long or Double type contained in two adjacent stack elements.
Value2 getLong (int idx)
 Returns the Long value located at the depth specified by idx.
void clear ()
 Clears the stack.
int getIndex ()
 Returns the number of elements on the stack.

Static Public Member Functions

static int getStorageSize (int size)
 Returns the size of the allocated stack area by the elements' size.

Friends

void interp_enumerate_root_set_single_thread_on_stack (VM_thread *)
 Enumerates references associated with the thread.
void interp_ti_enumerate_root_set_single_thread_on_stack (jvmtiEnv *ti_env, VM_thread *thread)
 Enumerates references associated with the thread.


Constructor & Destructor Documentation

Stack.Stack (  ) 

The empty constructor.

Stack::~Stack (  ) 

The destructor.


Member Function Documentation

void Stack::init ( void *  ptr,
int  size 
)

Initializes the stack of a method.

Parameters:
[in] ptr - the pointer to the data
[in] size - the stack size

Value & Stack::pick ( int  offset = 0  ) 

Returns the reference to the value on the top of the stack.

Parameters:
[in] offset - the offset value
Returns:
The reference to the value on the top of the stack.

uint8 & Stack::ref ( int  offset = 0  ) 

Sets and resets the value to the object reference.

Parameters:
[in] offset - the offset value
Returns:
The value to the object reference.

void Stack::push ( int  size = 1  ) 

Only moves the stack pointer.

Parameters:
[in] size - the size value

void Stack::pop ( int  size = 1  ) 

Decreases the stack pointer.

By default, decreases the pointer by one step or as specified in size.

Parameters:
[in] size - the required size

void Stack::popClearRef ( int  size = 1  ) 

Is similar to pop().

Does the same as pop() and clears the type value associated with every cleared stack element via the ref() function.

Parameters:
[in] size - the required size

void Stack::setLong ( int  idx,
Value2  val 
)

Sets the value of an object of the Long or Double type contained in two adjacent stack elements.

Parameters:
[in] idx - the pointer to the stack depth of the Long value
[in] val - the Long value

Value2 Stack::getLong ( int  idx  ) 

Returns the Long value located at the depth specified by idx.

Parameters:
[in] idx - the value identifier
Returns:
The Long value.

void Stack::clear (  ) 

Clears the stack.

int Stack::getStorageSize ( int  size  )  [static]

Returns the size of the allocated stack area by the elements' size.

Parameters:
[in] size - the size in elements
Returns:
The size of the allocated area.

int Stack.getIndex (  ) 

Returns the number of elements on the stack.

Returns:
The number of elements on the stack.


Friends And Related Function Documentation

void interp_enumerate_root_set_single_thread_on_stack ( VM_thread *   )  [friend]

Enumerates references associated with the thread.

Parameters:
[in] VM_thread - the pointer to the thread

void interp_ti_enumerate_root_set_single_thread_on_stack ( jvmtiEnv *  ti_env,
VM_thread *  thread 
) [friend]

Enumerates references associated with the thread.

Parameters:
[in] ti_env - the pointer to the jvmti environment
[in] VM_thread - the pointer to the thread


The documentation for this class was generated from the following file:

Genereated on Tue Mar 11 19:25:37 2008 by Doxygen.

(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable.