mruby/c VM Source Code release 3.4
Loading...
Searching...
No Matches
vm.h File Reference

mruby bytecode executor. More...

#include "value.h"
#include "class.h"
#include "c_proc.h"
Include dependency graph for vm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  IREP
 IREP Internal REPresentation. More...
struct  IREP_CATCH_HANDLER
 IREP Catch Handler. More...
struct  CALLINFO
 Call information. More...
struct  VM
 Virtual Machine. More...

Macros

#define mrbc_irep_tbl_syms(irep)
 get a symbol id table pointer.
#define mrbc_irep_symbol_id(irep, n)
 get a n'th symbol id in irep
#define mrbc_irep_symbol_cstr(irep, n)
 get a n'th symbol string in irep
#define mrbc_irep_tbl_pools(irep)
 get a pool data offset table pointer.
#define mrbc_irep_pool_ptr(irep, n)
 get a pointer to n'th pool data.
#define mrbc_irep_tbl_ireps(irep)
 get a child irep table pointer.
#define mrbc_irep_child_irep(irep, n)
 get a n'th child irep

Typedefs

typedef struct IREP mrbc_irep
 IREP Internal REPresentation.
typedef struct IREP mrb_irep
typedef struct IREP_CATCH_HANDLER mrbc_irep_catch_handler
 IREP Catch Handler.
typedef struct CALLINFO mrbc_callinfo
 Call information.
typedef struct CALLINFO mrb_callinfo
typedef struct VM mrbc_vm
 Virtual Machine.
typedef struct VM mrb_vm

Functions

static mrbc_valuemrbc_get_self (struct VM *vm, mrbc_value *regs)
static int mrbc_c_block_given (struct VM *vm, mrbc_value v[], int argc)

Detailed Description

mruby bytecode executor.

Copyright (C) 2015- Kyushu Institute of Technology.
Copyright (C) 2015- Shimane IT Open-Innovation Center.

This file is distributed under BSD 3-Clause License.

Fetch mruby VM bytecodes, decode and execute.

Definition in file vm.h.

Macro Definition Documentation

◆ mrbc_irep_child_irep

#define mrbc_irep_child_irep ( irep,
n )
Value:
( mrbc_irep_tbl_ireps(irep)[(n)] )
#define mrbc_irep_tbl_ireps(irep)
get a child irep table pointer.
Definition vm.h:93

get a n'th child irep

Definition at line 97 of file vm.h.

◆ mrbc_irep_pool_ptr

#define mrbc_irep_pool_ptr ( irep,
n )
Value:
( (irep)->pool + mrbc_irep_tbl_pools(irep)[(n)] )
#define mrbc_irep_tbl_pools(irep)
get a pool data offset table pointer.
Definition vm.h:84

get a pointer to n'th pool data.

Definition at line 88 of file vm.h.

◆ mrbc_irep_symbol_cstr

#define mrbc_irep_symbol_cstr ( irep,
n )
Value:
const char * mrbc_symid_to_str(mrbc_sym sym_id)
Definition symbol.c:238
#define mrbc_irep_symbol_id(irep, n)
get a n'th symbol id in irep
Definition vm.h:77

get a n'th symbol string in irep

Definition at line 80 of file vm.h.

◆ mrbc_irep_symbol_id

#define mrbc_irep_symbol_id ( irep,
n )
Value:
#define mrbc_irep_tbl_syms(irep)
get a symbol id table pointer.
Definition vm.h:74

get a n'th symbol id in irep

Definition at line 77 of file vm.h.

◆ mrbc_irep_tbl_ireps

#define mrbc_irep_tbl_ireps ( irep)
Value:
( (mrbc_irep **)((irep)->data + (irep)->ofs_ireps) )
struct IREP mrbc_irep
IREP Internal REPresentation.

get a child irep table pointer.

Definition at line 93 of file vm.h.

◆ mrbc_irep_tbl_pools

#define mrbc_irep_tbl_pools ( irep)
Value:
( (uint16_t *)((irep)->data + (irep)->ofs_pools) )

get a pool data offset table pointer.

Definition at line 84 of file vm.h.

◆ mrbc_irep_tbl_syms

#define mrbc_irep_tbl_syms ( irep)
Value:
((mrbc_sym *)(irep)->data)
int16_t mrbc_sym
mruby/c symbol ID
Definition value.h:59

get a symbol id table pointer.

Definition at line 74 of file vm.h.

Typedef Documentation

◆ mrb_callinfo

typedef struct CALLINFO mrb_callinfo

Definition at line 133 of file vm.h.

◆ mrb_irep

typedef struct IREP mrb_irep

Definition at line 70 of file vm.h.

◆ mrb_vm

typedef struct VM mrb_vm

Definition at line 163 of file vm.h.

◆ mrbc_callinfo

typedef struct CALLINFO mrbc_callinfo

Call information.

◆ mrbc_irep

typedef struct IREP mrbc_irep

IREP Internal REPresentation.

◆ mrbc_irep_catch_handler

IREP Catch Handler.

◆ mrbc_vm

typedef struct VM mrbc_vm

Virtual Machine.

Function Documentation

◆ mrbc_c_block_given()

int mrbc_c_block_given ( struct VM * vm,
mrbc_value v[],
int argc )
inlinestatic

(BETA) check if a block is passed to a method.

Parameters
vmA pointer to VM.
vregister top.
argcn of arguments.
Returns
0 or 1

Definition at line 205 of file vm.h.

◆ mrbc_get_self()

mrbc_value * mrbc_get_self ( struct VM * vm,
mrbc_value * regs )
inlinestatic

get the self object

Parameters
vmA pointer to VM.
regsregistor
Returns
pointer to self object

Definition at line 191 of file vm.h.

Here is the caller graph for this function: