Groonga 3.0.9 Source Code Document
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Enumerations | Functions
vm.c File Reference
#include <string.h>
#include <setjmp.h>
#include <stddef.h>
#include <stdarg.h>
#include "mruby.h"
#include "mruby/array.h"
#include "mruby/class.h"
#include "mruby/hash.h"
#include "mruby/irep.h"
#include "mruby/numeric.h"
#include "mruby/proc.h"
#include "mruby/range.h"
#include "mruby/variable.h"
#include "error.h"
#include "opcode.h"
#include "value_array.h"
Include dependency graph for vm.c:

Go to the source code of this file.

Macros

#define SET_TRUE_VALUE(r)   MRB_SET_VALUE(r, MRB_TT_TRUE, value.i, 1)
#define SET_FALSE_VALUE(r)   MRB_SET_VALUE(r, MRB_TT_FALSE, value.i, 1)
#define SET_NIL_VALUE(r)   MRB_SET_VALUE(r, MRB_TT_FALSE, value.i, 0)
#define SET_INT_VALUE(r, n)   MRB_SET_VALUE(r, MRB_TT_FIXNUM, value.i, (n))
#define SET_SYM_VALUE(r, v)   MRB_SET_VALUE(r, MRB_TT_SYMBOL, value.sym, (v))
#define SET_OBJ_VALUE(r, v)   MRB_SET_VALUE(r, (((struct RObject*)(v))->tt), value.p, (v))
#define SET_FLT_VALUE(mrb, r, v)   MRB_SET_VALUE(r, MRB_TT_FLOAT, value.f, (v))
#define STACK_INIT_SIZE   128
#define CALLINFO_INIT_SIZE   32
#define MRB_STACK_GROWTH   128
#define MRB_STACK_MAX   (0x40000 - MRB_STACK_GROWTH)
#define DEBUG(x)
#define TO_STR(x)   TO_STR_(x)
#define TO_STR_(x)   #x
#define CI_ACC_SKIP   -1
#define CI_ACC_DIRECT   -2
#define MRB_FUNCALL_ARGC_MAX   16
#define CODE_FETCH_HOOK(mrb, irep, pc, regs)
#define INIT_DISPATCH   for (;;) { i = *pc; CODE_FETCH_HOOK(mrb, irep, pc, regs); switch (GET_OPCODE(i)) {
#define CASE(op)   case op:
#define NEXT   pc++; break
#define JUMP   break
#define END_DISPATCH   }}
#define CALL_MAXARGS   127
#define attr_i   value.i
#define attr_f   value.f
#define TYPES2(a, b)   ((((uint16_t)(a))<<8)|(((uint16_t)(b))&0xff))
#define OP_MATH_BODY(op, v1, v2)
#define OP_CMP_BODY(op, v1, v2)
#define OP_CMP(op)

Enumerations

enum  localjump_error_kind { LOCALJUMP_ERROR_RETURN = 0, LOCALJUMP_ERROR_BREAK = 1, LOCALJUMP_ERROR_YIELD = 2 }

Functions

void abort (void)
mrb_value mrb_funcall (mrb_state *mrb, mrb_value self, const char *name, int argc,...)
mrb_value mrb_funcall_with_block (mrb_state *mrb, mrb_value self, mrb_sym mid, int argc, mrb_value *argv, mrb_value blk)
mrb_value mrb_funcall_argv (mrb_state *mrb, mrb_value self, mrb_sym mid, int argc, mrb_value *argv)
mrb_value mrb_yield_internal (mrb_state *mrb, mrb_value b, int argc, mrb_value *argv, mrb_value self, struct RClass *c)
mrb_value mrb_yield_argv (mrb_state *mrb, mrb_value b, int argc, mrb_value *argv)
mrb_value mrb_yield (mrb_state *mrb, mrb_value b, mrb_value arg)
mrb_value mrb_gv_val_get (mrb_state *mrb, mrb_sym sym)
void mrb_gv_val_set (mrb_state *mrb, mrb_sym sym, mrb_value val)
mrb_value mrb_run (mrb_state *mrb, struct RProc *proc, mrb_value self)
void mrb_longjmp (mrb_state *mrb)

Macro Definition Documentation

#define attr_f   value.f
#define attr_i   value.i
#define CALL_MAXARGS   127

Definition at line 547 of file vm.c.

#define CALLINFO_INIT_SIZE   32

Definition at line 50 of file vm.c.

#define CASE (   op)    case op:

Definition at line 528 of file vm.c.

#define CI_ACC_DIRECT   -2

Definition at line 209 of file vm.c.

#define CI_ACC_SKIP   -1

Definition at line 208 of file vm.c.

#define CODE_FETCH_HOOK (   mrb,
  irep,
  pc,
  regs 
)

Definition at line 518 of file vm.c.

#define DEBUG (   x)

Definition at line 66 of file vm.c.

#define END_DISPATCH   }}

Definition at line 531 of file vm.c.

#define INIT_DISPATCH   for (;;) { i = *pc; CODE_FETCH_HOOK(mrb, irep, pc, regs); switch (GET_OPCODE(i)) {

Definition at line 527 of file vm.c.

#define JUMP   break

Definition at line 530 of file vm.c.

#define MRB_FUNCALL_ARGC_MAX   16

Definition at line 279 of file vm.c.

#define MRB_STACK_GROWTH   128

Definition at line 54 of file vm.c.

#define MRB_STACK_MAX   (0x40000 - MRB_STACK_GROWTH)

Definition at line 60 of file vm.c.

#define NEXT   pc++; break

Definition at line 529 of file vm.c.

#define OP_CMP (   op)
Value:
do {\
int a = GETARG_A(i);\
/* need to check if - is overridden */\
switch (TYPES2(mrb_type(regs[a]),mrb_type(regs[a+1]))) {\
break;\
case TYPES2(MRB_TT_FIXNUM,MRB_TT_FLOAT):\
break;\
case TYPES2(MRB_TT_FLOAT,MRB_TT_FIXNUM):\
break;\
case TYPES2(MRB_TT_FLOAT,MRB_TT_FLOAT):\
break;\
default:\
goto L_SEND;\
}\
} while(0)
#define OP_CMP_BODY (   op,
  v1,
  v2 
)
Value:
do {\
if (regs[a].v1 op regs[a+1].v2) {\
SET_TRUE_VALUE(regs[a]);\
}\
else {\
SET_FALSE_VALUE(regs[a]);\
}\
} while(0)
#define OP_MATH_BODY (   op,
  v1,
  v2 
)
Value:
do {\
regs[a].v1 = regs[a].v1 op regs[a+1].v2;\
} while(0)
#define SET_FALSE_VALUE (   r)    MRB_SET_VALUE(r, MRB_TT_FALSE, value.i, 1)

Definition at line 36 of file vm.c.

#define SET_FLT_VALUE (   mrb,
  r,
 
)    MRB_SET_VALUE(r, MRB_TT_FLOAT, value.f, (v))

Definition at line 46 of file vm.c.

#define SET_INT_VALUE (   r,
 
)    MRB_SET_VALUE(r, MRB_TT_FIXNUM, value.i, (n))

Definition at line 38 of file vm.c.

#define SET_NIL_VALUE (   r)    MRB_SET_VALUE(r, MRB_TT_FALSE, value.i, 0)

Definition at line 37 of file vm.c.

#define SET_OBJ_VALUE (   r,
 
)    MRB_SET_VALUE(r, (((struct RObject*)(v))->tt), value.p, (v))

Definition at line 40 of file vm.c.

#define SET_SYM_VALUE (   r,
 
)    MRB_SET_VALUE(r, MRB_TT_SYMBOL, value.sym, (v))

Definition at line 39 of file vm.c.

#define SET_TRUE_VALUE (   r)    MRB_SET_VALUE(r, MRB_TT_TRUE, value.i, 1)

Definition at line 35 of file vm.c.

#define STACK_INIT_SIZE   128

Definition at line 49 of file vm.c.

#define TO_STR (   x)    TO_STR_(x)

Definition at line 69 of file vm.c.

#define TO_STR_ (   x)    #x

Definition at line 70 of file vm.c.

#define TYPES2 (   a,
 
)    ((((uint16_t)(a))<<8)|(((uint16_t)(b))&0xff))

Enumeration Type Documentation

Enumerator:
LOCALJUMP_ERROR_RETURN 
LOCALJUMP_ERROR_BREAK 
LOCALJUMP_ERROR_YIELD 

Definition at line 474 of file vm.c.

Function Documentation

void abort ( void  )

Here is the caller graph for this function:

mrb_value mrb_funcall ( mrb_state mrb,
mrb_value  self,
const char *  name,
int  argc,
  ... 
)

Definition at line 283 of file vm.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_funcall_argv ( mrb_state mrb,
mrb_value  self,
mrb_sym  mid,
int  argc,
mrb_value argv 
)

Definition at line 407 of file vm.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_funcall_with_block ( mrb_state mrb,
mrb_value  self,
mrb_sym  mid,
int  argc,
mrb_value argv,
mrb_value  blk 
)

Definition at line 318 of file vm.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_gv_val_get ( mrb_state mrb,
mrb_sym  sym 
)
void mrb_gv_val_set ( mrb_state mrb,
mrb_sym  sym,
mrb_value  val 
)
void mrb_longjmp ( mrb_state mrb)

Definition at line 2137 of file vm.c.

Here is the caller graph for this function:

mrb_value mrb_run ( mrb_state mrb,
struct RProc proc,
mrb_value  self 
)

Definition at line 550 of file vm.c.

Here is the call graph for this function:

Here is the caller graph for this function:

mrb_value mrb_yield ( mrb_state mrb,
mrb_value  b,
mrb_value  arg 
)

Definition at line 467 of file vm.c.

Here is the call graph for this function:

mrb_value mrb_yield_argv ( mrb_state mrb,
mrb_value  b,
int  argc,
mrb_value argv 
)

Definition at line 459 of file vm.c.

Here is the call graph for this function:

mrb_value mrb_yield_internal ( mrb_state mrb,
mrb_value  b,
int  argc,
mrb_value argv,
mrb_value  self,
struct RClass c 
)

Definition at line 413 of file vm.c.

Here is the call graph for this function:

Here is the caller graph for this function: