43#if defined(MRBC_DEBUG)
48#if defined(MRBC_DEBUG)
55#if defined(MRBC_DEBUG)
74#define mrbc_irep_tbl_syms(irep) ((mrbc_sym *)(irep)->data)
77#define mrbc_irep_symbol_id(irep, n) mrbc_irep_tbl_syms(irep)[(n)]
80#define mrbc_irep_symbol_cstr(irep, n) mrbc_symid_to_str( mrbc_irep_symbol_id(irep, n) )
84#define mrbc_irep_tbl_pools(irep) \
85 ( (uint16_t *)((irep)->data + (irep)->ofs_pools) )
88#define mrbc_irep_pool_ptr(irep, n) \
89 ( (irep)->pool + mrbc_irep_tbl_pools(irep)[(n)] )
93#define mrbc_irep_tbl_ireps(irep) \
94 ( (mrbc_irep **)((irep)->data + (irep)->ofs_ireps) )
97#define mrbc_irep_child_irep(irep, n) \
98 ( mrbc_irep_tbl_ireps(irep)[(n)] )
141#if defined(MRBC_DEBUG)
142 uint8_t obj_mark_[2];
struct RProc mrbc_proc
Proc object.
struct RClass mrbc_class
Class object.
uint8_t is_called_super
this is called by op_super.
const mrbc_irep * cur_irep
copy from mrbc_vm.
mrbc_sym method_id
called method ID.
struct RHash * karg_keep
keyword argument backup for OP_ARGARY.
uint8_t n_args
num of arguments.
mrbc_class * target_class
copy from mrbc_vm.
struct CALLINFO * prev
previous linked list.
mrbc_class * own_class
class that owns method.
const uint8_t * inst
copy from mrbc_vm.
mrbc_value * cur_regs
copy from mrbc_vm.
uint8_t reg_offset
register offset after call.
uint8_t target[4]
The address to jump to if a match is made.
uint8_t begin[4]
The starting address to match the handler. Includes this.
uint8_t type
enum mrb_catch_type, 1 byte. 0=rescue, 1=ensure
uint8_t end[4]
The endpoint address that matches the handler. Not Includes this.
IREP Internal REPresentation.
uint16_t ofs_pools
offset of data->tbl_pools.
const uint8_t * inst
pointer to instruction in RITE binary
const uint8_t * pool
pointer to pool in RITE binary
uint16_t ilen
num of bytes in OpCode
uint16_t ref_count
reference counter
uint16_t ofs_ireps
offset of data->tbl_ireps. (32bit aligned)
uint16_t rlen
num of child IREP blocks
uint16_t clen
num of catch handlers
uint16_t nregs
num of register variables
mrbc_class * target_class
Target class.
unsigned int flag_need_memfree
uint16_t regs_size
size of regs[]
const mrbc_irep * cur_irep
IREP currently running.
mrbc_callinfo * callinfo_tail
Last point of CALLINFO link.
uint8_t vm_id
vm_id : 1..MAX_VM_COUNT
volatile int8_t flag_preemption
mrbc_value exception
Raised exception or nil.
unsigned int flag_permanence
const uint8_t * inst
Instruction pointer.
mrbc_value * cur_regs
Current register top.
mrbc_proc * ret_blk
Return block.
mrbc_irep * top_irep
IREP tree top.
mruby/c value definitions
int16_t mrbc_sym
mruby/c symbol ID
struct RObject mrbc_value
mrbc_callinfo * mrbc_push_callinfo(struct VM *vm, mrbc_sym method_id, int reg_offset, int n_args)
mrbc_vm * mrbc_vm_new(int regs_size)
void mrbc_vm_end(struct VM *vm)
void mrbc_pop_callinfo(struct VM *vm)
mrbc_vm * mrbc_vm_open(struct VM *vm)
mrbc_sym mrbc_get_callee_symid(struct VM *vm)
void mrbc_vm_begin(struct VM *vm)
void mrbc_cleanup_vm(void)
int mrbc_vm_run(struct VM *vm)
const char * mrbc_get_callee_name(struct VM *vm)
void mrbc_vm_close(struct VM *vm)
static mrbc_value * mrbc_get_self(struct VM *vm, mrbc_value *regs)
struct CALLINFO mrbc_callinfo
Call information.
struct IREP_CATCH_HANDLER mrbc_irep_catch_handler
IREP Catch Handler.
static int mrbc_c_block_given(struct VM *vm, mrbc_value v[], int argc)
struct CALLINFO mrb_callinfo
struct IREP mrbc_irep
IREP Internal REPresentation.
struct VM mrbc_vm
Virtual Machine.
Global configuration of mruby/c VM's.