# $Id: /mirror/trunk/src/vtable.tbl 35819 2009-01-20T05:19:27.074079Z chromatic  $
# [MAIN] #default section name

# MMD_EQ ... MMD_STRCMP must be in one block
# see src/multidispatch.c

# INPLACE MMD variant must always be normal op + 1

void init()
# init must be first for JITed vtable meths
void init_pmc(PMC* initializer)
PMC* instantiate(PMC* sig)
PMC* instantiate_str(STRING* rep, INTVAL flags)
void morph(INTVAL type) :write
void mark()
void destroy()
PMC* get_namespace()

# XXX FIXME should this be marked as writing?
PMC* getprop(STRING* key)
void setprop(STRING* key, PMC* value)
void delprop(STRING* key)
PMC* getprops()

INTVAL type()
INTVAL type_keyed(PMC* key)

STRING* name()

PMC* clone()
PMC* clone_pmc(PMC* args)

PMC* find_method(STRING* method_name)

[FETCH]
INTVAL get_integer()
INTVAL get_integer_keyed(PMC* key)
INTVAL get_integer_keyed_int(INTVAL key)
INTVAL get_integer_keyed_str(STRING* key)

FLOATVAL get_number()
FLOATVAL get_number_keyed(PMC* key)
FLOATVAL get_number_keyed_int(INTVAL key)
FLOATVAL get_number_keyed_str(STRING* key)

PMC* get_bignum()

STRING* get_string()
STRING* get_repr()
STRING* get_string_keyed(PMC* key)
STRING* get_string_keyed_int(INTVAL key)
STRING* get_string_keyed_str(STRING* key)

INTVAL get_bool()

PMC* get_pmc()
PMC* get_pmc_keyed(PMC* key)
PMC* get_pmc_keyed_int(INTVAL key)
PMC* get_pmc_keyed_str(STRING* key)
PMC* slice(PMC* key, INTVAL flag)

void* get_pointer()
void* get_pointer_keyed(PMC* key)
void* get_pointer_keyed_int(INTVAL key)
void* get_pointer_keyed_str(STRING* key)

[STORE] :write
void set_integer_native(INTVAL value)
void set_integer_same(PMC* value)
void set_integer_keyed(PMC* key, INTVAL value)
void set_integer_keyed_int(INTVAL key, INTVAL value)
void set_integer_keyed_str(STRING* key, INTVAL value)

void set_number_native(FLOATVAL value)
void set_number_same(PMC* value)
void set_number_keyed(PMC* key, FLOATVAL value)
void set_number_keyed_int(INTVAL key, FLOATVAL value)
void set_number_keyed_str(STRING* key, FLOATVAL value)

void set_bignum_int(INTVAL value)
void set_bignum_num(FLOATVAL value)
void set_bignum_str(STRING* value)

void set_string_native(STRING* value)
void assign_string_native(STRING* value)
void set_string_same(PMC* value)
void set_string_keyed(PMC* key, STRING* value)
void set_string_keyed_int(INTVAL key, STRING* value)
void set_string_keyed_str(STRING* key, STRING* value)

void set_bool(INTVAL value)

void set_pmc(PMC* value)
void assign_pmc(PMC* value)
void set_pmc_keyed(PMC* key, PMC* value)
void set_pmc_keyed_int(INTVAL key, PMC* value)
void set_pmc_keyed_str(STRING* key, PMC* value)

void set_pointer(void* value)
void set_pointer_keyed(PMC* key, void* value)
void set_pointer_keyed_int(INTVAL key, void* value)
void set_pointer_keyed_str(STRING* key, void* value)

[FETCHSIZE]
INTVAL elements()

[POP] :write
INTVAL pop_integer()
FLOATVAL pop_float()
STRING* pop_string()
PMC* pop_pmc()

[PUSH] :write
void push_integer(INTVAL value)
void push_float(FLOATVAL value)
void push_string(STRING* value)
void push_pmc(PMC* value)

[SHIFT] :write
INTVAL shift_integer()
FLOATVAL shift_float()
STRING* shift_string()
PMC* shift_pmc()

[UNSHIFT] :write
void unshift_integer(INTVAL value)
void unshift_float(FLOATVAL value)
void unshift_string(STRING* value)
void unshift_pmc(PMC* value)

## void splice ???

[SPLICE] :write
void splice(PMC* value, INTVAL offset, INTVAL count)

# XXX marking writing here?
[MATH]
PMC* add(PMC* value, PMC* dest)
PMC* add_int(INTVAL value, PMC* dest)
PMC* add_float(FLOATVAL value, PMC* dest)

void i_add(PMC* value) :write
void i_add_int(INTVAL value) :write
void i_add_float(FLOATVAL value) :write

PMC* subtract(PMC* value, PMC* dest)
PMC* subtract_int(INTVAL value, PMC* dest)
PMC* subtract_float(FLOATVAL value, PMC* dest)

void i_subtract(PMC* value) :write
void i_subtract_int(INTVAL value) :write
void i_subtract_float(FLOATVAL value) :write

PMC* multiply(PMC* value, PMC* dest)
PMC* multiply_int(INTVAL value, PMC* dest)
PMC* multiply_float(FLOATVAL value, PMC* dest)

void i_multiply(PMC* value) :write
void i_multiply_int(INTVAL value) :write
void i_multiply_float(FLOATVAL value) :write

PMC* divide(PMC* value, PMC* dest)
PMC* divide_int(INTVAL value, PMC* dest)
PMC* divide_float(FLOATVAL value, PMC* dest)

void i_divide(PMC* value) :write
void i_divide_int(INTVAL value) :write
void i_divide_float(FLOATVAL value) :write

PMC* floor_divide(PMC* value, PMC* dest)
PMC* floor_divide_int(INTVAL value, PMC* dest)
PMC* floor_divide_float(FLOATVAL value, PMC* dest)

void i_floor_divide(PMC* value) :write
void i_floor_divide_int(INTVAL value) :write
void i_floor_divide_float(FLOATVAL value) :write

PMC* modulus(PMC* value, PMC* dest)
PMC* modulus_int(INTVAL value, PMC* dest)
PMC* modulus_float(FLOATVAL value, PMC* dest)

void i_modulus(PMC* value) :write
void i_modulus_int(INTVAL value) :write
void i_modulus_float(FLOATVAL value) :write

PMC* pow(PMC* value, PMC* dest)
PMC* pow_int(INTVAL value, PMC* dest)
PMC* pow_float(FLOATVAL value, PMC* dest)

void i_pow(PMC* value) :write
void i_pow_int(INTVAL value) :write
void i_pow_float(FLOATVAL value) :write

void increment() :write
void decrement() :write

PMC* absolute(PMC* dest)
void i_absolute() :write

PMC* neg(PMC* dest)
void i_neg() :write

[BITWISE]
PMC* bitwise_or(PMC* value, PMC* dest)
PMC* bitwise_or_int(INTVAL value, PMC* dest)

void i_bitwise_or(PMC* value) :write
void i_bitwise_or_int(INTVAL value) :write

PMC* bitwise_and(PMC* value, PMC* dest)
PMC* bitwise_and_int(INTVAL value, PMC* dest)

void i_bitwise_and(PMC* value) :write
void i_bitwise_and_int(INTVAL value) :write

PMC* bitwise_xor(PMC* value, PMC* dest)
PMC* bitwise_xor_int(INTVAL value, PMC* dest)

void i_bitwise_xor(PMC* value) :write
void i_bitwise_xor_int(INTVAL value) :write

PMC* bitwise_ors(PMC* value, PMC* dest)
PMC* bitwise_ors_str(STRING* value, PMC* dest)

void i_bitwise_ors(PMC* value) :write
void i_bitwise_ors_str(STRING* value) :write

PMC* bitwise_ands(PMC* value, PMC* dest)
PMC* bitwise_ands_str(STRING* value, PMC* dest)

void i_bitwise_ands(PMC* value) :write
void i_bitwise_ands_str(STRING* value) :write

PMC* bitwise_xors(PMC* value, PMC* dest)
PMC* bitwise_xors_str(STRING* value, PMC* dest)

void i_bitwise_xors(PMC* value) :write
void i_bitwise_xors_str(STRING* value) :write

PMC* bitwise_not(PMC* dest)
void i_bitwise_not() :write

PMC* bitwise_nots(PMC* dest)
void i_bitwise_nots() :write

PMC* bitwise_shl(PMC* value, PMC* dest)
PMC* bitwise_shl_int(INTVAL value, PMC* dest)

void i_bitwise_shl(PMC* value) :write
void i_bitwise_shl_int(INTVAL value) :write

PMC* bitwise_shr(PMC* value, PMC* dest)
PMC* bitwise_shr_int(INTVAL value, PMC* dest)

void i_bitwise_shr(PMC* value) :write
void i_bitwise_shr_int(INTVAL value) :write

PMC* bitwise_lsr(PMC* value, PMC* dest)
PMC* bitwise_lsr_int(INTVAL value, PMC* dest)

void i_bitwise_lsr(PMC* value) :write
void i_bitwise_lsr_int(INTVAL value) :write

[CMP]
INTVAL is_equal(PMC* value)
INTVAL is_equal_num(PMC* value)
INTVAL is_equal_string(PMC* value)

INTVAL is_same(PMC* value)

INTVAL cmp(PMC* value)
INTVAL cmp_num(PMC* value)
INTVAL cmp_string(PMC* value)
PMC* cmp_pmc(PMC* value)

PMC* logical_or(PMC* value, PMC* dest)

PMC* logical_and(PMC* value, PMC* dest)

PMC* logical_xor(PMC* value, PMC* dest)

PMC* logical_not(PMC* dest)
void i_logical_not() :write


[STRING]
PMC* concatenate(PMC* value, PMC* dest)
PMC* concatenate_str(STRING* value, PMC* dest)

void i_concatenate(PMC* value) :write
void i_concatenate_str(STRING* value) :write

PMC* repeat(PMC* value, PMC* dest)
PMC* repeat_int(INTVAL value, PMC* dest)

void i_repeat(PMC* value) :write
void i_repeat_int(INTVAL value) :write

void substr(INTVAL offset, INTVAL length, PMC* dest)
STRING* substr_str(INTVAL offset, INTVAL length)

[EXISTS]
INTVAL exists_keyed(PMC* key)
INTVAL exists_keyed_int(INTVAL key)
INTVAL exists_keyed_str(STRING* key)

[MAIN]
INTVAL defined()
INTVAL defined_keyed(PMC* key)
INTVAL defined_keyed_int(INTVAL key)
INTVAL defined_keyed_str(STRING* key)

[DELETE] :write
void delete_keyed(PMC* key)
void delete_keyed_int(INTVAL key)
void delete_keyed_str(STRING* key)

[MAIN]
PMC* nextkey_keyed(PMC* key, INTVAL what)
PMC* nextkey_keyed_int(INTVAL key, INTVAL what)
PMC* nextkey_keyed_str(STRING* key, INTVAL what)
PMC* get_iter()

opcode_t* invoke(void* next)

INTVAL can(STRING* method)

INTVAL does_pmc(PMC* role)
INTVAL does(STRING* role)

INTVAL isa_pmc(PMC* _class)
INTVAL isa(STRING* _class)

PMC* get_attr_str(STRING* idx)
PMC* get_attr_keyed(PMC* key, STRING* idx)
void set_attr_str(STRING* idx, PMC* value) :write
void set_attr_keyed(PMC* key, STRING* idx, PMC* value) :write

PMC* get_class()

void add_parent(PMC* parent) :write
void remove_parent(PMC* parent) :write

void add_role(PMC* role) :write
void remove_role(PMC* role) :write

void add_attribute(STRING* name, PMC* type) :write
void remove_attribute(STRING* name) :write

void add_method(STRING* method_name, PMC* sub_pmc) :write
void remove_method(STRING* method_name) :write

void add_vtable_override(STRING* vtable_name, PMC* sub_pmc) :write
void remove_vtable_override(STRING* vtable_name) :write

PMC* inspect()
PMC* inspect_str(STRING* what)

void freeze(visit_info* info)
void thaw  (visit_info* info) :write
void thawfinish (visit_info* info) :write
void visit (visit_info* info)

void share()

PMC* share_ro()
