vm/kite_execute.c File Reference

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

Defines

#define KITE_EXECUTE_C

Typedefs

typedef kite_opcode_t *(* kite_opcode_func_t )(kite_thread_t *, kite_opcode_t *)

Functions

void kite_vm_call_method (kite_thread_t *thd, kite_object_t *obj, char *name, struct kite_object_t *args, int err)
void kite_vm_call_object (kite_thread_t *thd, struct kite_object_t *this, struct kite_object_t *method, struct kite_object_t *args)
void kite_vm_call_constructor (kite_thread_t *thd, struct kite_object_t *this, struct kite_object_t *args)
int kite_vm_call_operator (kite_thread_t *thd, struct kite_object_t *this, int op, struct kite_object_t *arg, int err)
void kite_vm_execute_exception (kite_thread_t *thd, int exit_now)
void * kite_vm_execute (void *ptr)
void kite_vm_execute_user_method (kite_thread_t *thd, void *pc)

Variables

char * OPERATOR_STRINGS []
char * OPERATOR_NAME_STRINGS []
char * OPERATOR_METHODS []

Define Documentation

#define KITE_EXECUTE_C


Typedef Documentation


Function Documentation

void kite_vm_call_constructor ( kite_thread_t thd,
struct kite_object_t this,
struct kite_object_t args 
)

Call constructor on given object.

Parameters:
thd The current thread.
this The object to operate on.
args A list containing the method arguments to pass in.

References KITE_FIND_ANY_IN_SYMTAB, kite_list_count(), kite_vm_call_method(), kite_object_t::object_data, kite_object_t::properties, and TRUE.

Referenced by kite_new_instance_with_constructor().

void kite_vm_call_method ( kite_thread_t thd,
struct kite_object_t this,
char *  name,
struct kite_object_t args,
int  err 
)

Call method on given object.

Parameters:
thd The current thread.
this The object to operate on.
name The name of the method to call.
args A list containing the method arguments to pass in.
err If 1, throw an exception if the method does not exist.
Note:
Method will push its return value to the top of the running stack.

References kite_object_t::builtin_data, kite_object_t::inherit_from, kite_dereference_object(), KITE_FIND_METHOD, kite_list_count(), kite_new_exception(), kite_new_list(), kite_new_string(), kite_reference_object(), kite_vm_call_method(), kite_vm_call_object(), kite_vm_call_operator(), kite_object_t::listvalue, kite_object_t::object_data, OP_METHOD_CALL, TRUE, kite_object_t::type, and kite_symtab_t::value.

Referenced by kite_boolean_object(), kite_dereference_and_load(), kite_float_object(), kite_gc_destroy_all(), kite_gc_incremental(), kite_int_object(), kite_string_object(), kite_vm_call_constructor(), kite_vm_call_method(), and kite_vm_call_operator().

void kite_vm_call_object ( kite_thread_t thd,
struct kite_object_t this,
struct kite_object_t method,
struct kite_object_t args 
)

int kite_vm_call_operator ( kite_thread_t thd,
struct kite_object_t this,
int  op,
struct kite_object_t args,
int  err 
)

Call operator on given object.

Parameters:
thd The current thread.
this The object to operate on.
op The operator to call (see enum kite_operators).
args A list containing the method arguments to pass in.
err If 1, throw an exception if the operator does not exist.
Note:
Method will push its return value to the top of the running stack.

References kite_object_t::inherit_from, KITE_FIND_ANY_IN_SYMTAB, kite_new_exception(), kite_new_list(), kite_vm_call_method(), kite_vm_call_object(), kite_object_t::object_data, OP_TO_METHOD, OP_TO_STRING, kite_object_t::properties, TRUE, and kite_symtab_t::value.

Referenced by kite_vm_call_method().

void* kite_vm_execute ( void *  ptr  ) 

void kite_vm_execute_exception ( kite_thread_t thd,
int  exit_now 
)

void kite_vm_execute_user_method ( kite_thread_t thd,
void *  pc 
)


Variable Documentation

Initial value:

 {
    "__op_plus__",
    "__op_minus__",
    "__op_multiply__",
    "__op_divide__",
    "__op_mod__",
    "__op_unplus__",
    "__op_unminus__",
    "__op_assign__",
    "__op_equals__",
    "__op_nequals__",
    "__op_lt__",
    "__op_gt__",
    "__op_leq__",
    "__op_geq__",
    "__op_and__",
    "__op_or__",
    "__op_not__",
    "__op_xor__",
    "__op_lshift__",
    "__op_rshift__",
    "__op_map__",
    "__op_reduce__",
    "__op_array__",
    "__op_array_set__",
    "__op_call__",
    "__op_property__",
    "__op_number_of_operators__"
}

Initial value:

 {
    "plus",
    "minus",
    "multiply",
    "divide",
    "mod",
    "unplus",
    "unminus",
    "assign",
    "equals",
    "nequals",
    "lt",
    "gt",
    "leq",
    "geq",
    "and",
    "or",
    "not",
    "xor",
    "lshift",
    "rshift",
    "map",
    "reduce",
    "array",
    "array_set",
    "call",
    "property",
    "number_of_operators"
}

Initial value:

 {
    "+",
    "-",
    "*",
    "/",
    "%",
    "unary +",
    "unary -",
    "=",
    "==",
    "!=",
    "<",
    ">",
    "<=",
    ">=",
    "and",
    "or",
    "not",
    "xor",
    "<<",
    ">>",
    "map",
    "reduce",
    "[]",
    "[]=",
    "|",
    ".",
    NULL,
}


Generated on Mon Apr 13 23:02:00 2009 for Kite by  doxygen 1.5.6