vm/kite_stack.c File Reference

#include <stdlib.h>
#include <assert.h>
#include "objs/kite_object.h"
#include "kite_vm.h"

Functions

void kite_push_stack (kite_stack_t **st, int ref, void *obj)
void * kite_pop_stack (kite_stack_t **st)
void * kite_top_stack (kite_stack_t *st)
void kite_destroy_stack (kite_stack_t **st)

Function Documentation

void kite_destroy_stack ( kite_stack_t **  stack  ) 

Destroy stack.

Parameters:
[in,out] stack The stack to destroy.

Referenced by kite_vm_compile_from_fp().

void* kite_pop_stack ( kite_stack_t **  stack  ) 

Pop item off of the stack.

Parameters:
[in,out] stack The stack to operate on.
Returns:
The item at the top of the stack.

References kite_top_stack(), and kite_stack_t::length.

Referenced by kite_vm_call_object(), kite_vm_compile_from_fp(), and kite_vm_compile_from_string().

void kite_push_stack ( kite_stack_t **  stack,
int  ref,
void *  obj 
)

Push item onto the stack.

Parameters:
[in,out] stack The stack to push onto.
ref If 1, the object is not a kite_object_t.
obj The object to push.

References kite_stack_t::allocated, kite_stack_t::length, kite_stack_entry_t::obj, kite_stack_entry_t::reference, and kite_stack_t::stack.

Referenced by kite_vm_call_object(), kite_vm_compile_from_fp(), and kite_vm_compile_from_string().

void* kite_top_stack ( kite_stack_t stack  ) 

Return the item at the top of the stack without popping it.

Parameters:
stack The stack to operate on.
Returns:
The item at the top of the stack.

References kite_stack_t::length, kite_stack_entry_t::obj, kite_stack_entry_t::reference, and kite_stack_t::stack.

Referenced by kite_pop_stack(), kite_vm_call_object(), and kite_vm_execute_user_method().


Generated on Sun Feb 8 19:42:48 2009 for Kite by  doxygen 1.5.6