44#if defined(MRBC_DEBUG)
49#if defined(MRBC_DEBUG)
56#if defined(MRBC_DEBUG)
72typedef struct IREP mrb_irep;
77#define mrbc_irep_tbl_syms(irep) ((mrbc_sym *)(irep)->data)
80#define mrbc_irep_symbol_id(irep, n) mrbc_irep_tbl_syms(irep)[(n)]
83#define mrbc_irep_symbol_cstr(irep, n) mrbc_symid_to_str( mrbc_irep_symbol_id(irep, n) )
87#define mrbc_irep_tbl_pools(irep) \
88 ( (uint16_t *)((irep)->data + (irep)->ofs_pools) )
91#define mrbc_irep_pool_ptr(irep, n) \
92 ( (irep)->pool + mrbc_irep_tbl_pools(irep)[(n)] )
96#define mrbc_irep_tbl_ireps(irep) \
97 ( (mrbc_irep **)((irep)->data + (irep)->ofs_ireps) )
100#define mrbc_irep_child_irep(irep, n) \
101 ( mrbc_irep_tbl_ireps(irep)[(n)] )
122#if defined(MRBC_DEBUG)
123 uint8_t obj_mark_[2];
142typedef struct CALLINFO mrb_callinfo;
151#if defined(MRBC_DEBUG)
152 uint8_t obj_mark_[2];
176typedef struct VM mrb_vm;
struct RObject mrbc_value
Value object. Default version.
uint8_t is_called_super
flags when called by OP_SUPER.
const mrbc_irep * cur_irep
copy from mrbc_vm.
struct RClass * target_class
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.
struct CALLINFO * prev
previous linked list.
const uint8_t * inst
copy from mrbc_vm.
mrbc_value * cur_regs
copy from mrbc_vm.
struct RClass * own_class
class that owns method.
uint8_t reg_offset
register offset after call.
uint8_t is_called_block
flags when block calls.
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. (pointer aligned)
uint16_t rlen
num of child IREP blocks
uint16_t clen
num of catch handlers
uint16_t nregs
num of register variables
mrbc_value self
Copy of self object. Valid when 'B'.
unsigned int flag_need_memfree
mrbc_sym callee_sym_id
Current called method.
uint16_t regs_size
size of regs[]
const mrbc_irep * cur_irep
IREP currently running.
struct RProc * ret_blk
Return block.
struct RClass * target_class
Target class.
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_irep * top_irep
IREP tree top.
const char * mrbc_symid_to_str(mrbc_sym sym_id)
mruby/c value definitions
int16_t mrbc_sym
mruby/c symbol ID
void mrbc_vm_close(mrbc_vm *vm)
void mrbc_pop_callinfo(mrbc_vm *vm)
mrbc_vm * mrbc_vm_new(int regs_size)
mrbc_vm * mrbc_vm_open(mrbc_vm *vm)
int mrbc_vm_run(mrbc_vm *vm)
void mrbc_vm_end(mrbc_vm *vm)
void mrbc_cleanup_vm(void)
void mrbc_vm_begin(mrbc_vm *vm)
mrbc_callinfo * mrbc_push_callinfo(mrbc_vm *vm, mrbc_sym method_id, int reg_offset, int n_args)
static mrbc_value * mrbc_get_self(mrbc_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(mrbc_vm *vm, mrbc_value v[], int argc)
static const char * mrbc_get_callee_name(const mrbc_vm *vm)
struct IREP mrbc_irep
IREP Internal REPresentation.
struct VM mrbc_vm
Virtual Machine.
static mrbc_sym mrbc_get_callee_symid(const mrbc_vm *vm)
Global configuration of mruby/c VM's.