Groonga 3.0.9 Source Code Document
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros | Enumerations
opcode.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MAXARG_Bx   (0xffff)
#define MAXARG_sBx   (MAXARG_Bx>>1) /* `sBx' is signed */
#define GET_OPCODE(i)   ((int)(((mrb_code)(i)) & 0x7f))
#define GETARG_A(i)   ((int)((((mrb_code)(i)) >> 23) & 0x1ff))
#define GETARG_B(i)   ((int)((((mrb_code)(i)) >> 14) & 0x1ff))
#define GETARG_C(i)   ((int)((((mrb_code)(i)) >> 7) & 0x7f))
#define GETARG_Bx(i)   ((int)((((mrb_code)(i)) >> 7) & 0xffff))
#define GETARG_sBx(i)   ((int)(GETARG_Bx(i)-MAXARG_sBx))
#define GETARG_Ax(i)   ((int32_t)((((mrb_code)(i)) >> 7) & 0x1ffffff))
#define GETARG_UNPACK_b(i, n1, n2)   ((int)((((mrb_code)(i)) >> (7+(n2))) & (((1<<(n1))-1))))
#define GETARG_UNPACK_c(i, n1, n2)   ((int)((((mrb_code)(i)) >> 7) & (((1<<(n2))-1))))
#define GETARG_b(i)   GETARG_UNPACK_b(i,14,2)
#define GETARG_c(i)   GETARG_UNPACK_c(i,14,2)
#define MKOPCODE(op)   ((op) & 0x7f)
#define MKARG_A(c)   ((mrb_code)((c) & 0x1ff) << 23)
#define MKARG_B(c)   ((mrb_code)((c) & 0x1ff) << 14)
#define MKARG_C(c)   (((c) & 0x7f) << 7)
#define MKARG_Bx(v)   ((mrb_code)((v) & 0xffff) << 7)
#define MKARG_sBx(v)   MKARG_Bx((v)+MAXARG_sBx)
#define MKARG_Ax(v)   ((mrb_code)((v) & 0x1ffffff) << 7)
#define MKARG_PACK(b, n1, c, n2)   ((((b) & ((1<<n1)-1)) << (7+n2))|(((c) & ((1<<n2)-1)) << 7))
#define MKARG_bc(b, c)   MKARG_PACK(b,14,c,2)
#define MKOP_A(op, a)   (MKOPCODE(op)|MKARG_A(a))
#define MKOP_AB(op, a, b)   (MKOP_A(op,a)|MKARG_B(b))
#define MKOP_ABC(op, a, b, c)   (MKOP_AB(op,a,b)|MKARG_C(c))
#define MKOP_ABx(op, a, bx)   (MKOP_A(op,a)|MKARG_Bx(bx))
#define MKOP_Bx(op, bx)   (MKOPCODE(op)|MKARG_Bx(bx))
#define MKOP_sBx(op, sbx)   (MKOPCODE(op)|MKARG_sBx(sbx))
#define MKOP_AsBx(op, a, sbx)   (MKOP_A(op,a)|MKARG_sBx(sbx))
#define MKOP_Ax(op, ax)   (MKOPCODE(op)|MKARG_Ax(ax))
#define MKOP_Abc(op, a, b, c)   (MKOP_A(op,a)|MKARG_bc(b,c))
#define OP_L_STRICT   1
#define OP_L_CAPTURE   2
#define OP_L_METHOD   OP_L_STRICT
#define OP_L_LAMBDA   (OP_L_STRICT|OP_L_CAPTURE)
#define OP_L_BLOCK   OP_L_CAPTURE
#define OP_R_NORMAL   0
#define OP_R_BREAK   1
#define OP_R_RETURN   2

Enumerations

enum  {
  OP_NOP = 0, OP_MOVE, OP_LOADL, OP_LOADI,
  OP_LOADSYM, OP_LOADNIL, OP_LOADSELF, OP_LOADT,
  OP_LOADF, OP_GETGLOBAL, OP_SETGLOBAL, OP_GETSPECIAL,
  OP_SETSPECIAL, OP_GETIV, OP_SETIV, OP_GETCV,
  OP_SETCV, OP_GETCONST, OP_SETCONST, OP_GETMCNST,
  OP_SETMCNST, OP_GETUPVAR, OP_SETUPVAR, OP_JMP,
  OP_JMPIF, OP_JMPNOT, OP_ONERR, OP_RESCUE,
  OP_POPERR, OP_RAISE, OP_EPUSH, OP_EPOP,
  OP_SEND, OP_SENDB, OP_FSEND, OP_CALL,
  OP_SUPER, OP_ARGARY, OP_ENTER, OP_KARG,
  OP_KDICT, OP_RETURN, OP_TAILCALL, OP_BLKPUSH,
  OP_ADD, OP_ADDI, OP_SUB, OP_SUBI,
  OP_MUL, OP_DIV, OP_EQ, OP_LT,
  OP_LE, OP_GT, OP_GE, OP_ARRAY,
  OP_ARYCAT, OP_ARYPUSH, OP_AREF, OP_ASET,
  OP_APOST, OP_STRING, OP_STRCAT, OP_HASH,
  OP_LAMBDA, OP_RANGE, OP_OCLASS, OP_CLASS,
  OP_MODULE, OP_EXEC, OP_METHOD, OP_SCLASS,
  OP_TCLASS, OP_DEBUG, OP_STOP, OP_ERR,
  OP_RSVD1, OP_RSVD2, OP_RSVD3, OP_RSVD4,
  OP_RSVD5
}

Macro Definition Documentation

#define GET_OPCODE (   i)    ((int)(((mrb_code)(i)) & 0x7f))

Definition at line 20 of file opcode.h.

#define GETARG_A (   i)    ((int)((((mrb_code)(i)) >> 23) & 0x1ff))

Definition at line 21 of file opcode.h.

#define GETARG_Ax (   i)    ((int32_t)((((mrb_code)(i)) >> 7) & 0x1ffffff))

Definition at line 26 of file opcode.h.

#define GETARG_B (   i)    ((int)((((mrb_code)(i)) >> 14) & 0x1ff))

Definition at line 22 of file opcode.h.

#define GETARG_b (   i)    GETARG_UNPACK_b(i,14,2)

Definition at line 29 of file opcode.h.

#define GETARG_Bx (   i)    ((int)((((mrb_code)(i)) >> 7) & 0xffff))

Definition at line 24 of file opcode.h.

#define GETARG_C (   i)    ((int)((((mrb_code)(i)) >> 7) & 0x7f))

Definition at line 23 of file opcode.h.

#define GETARG_c (   i)    GETARG_UNPACK_c(i,14,2)

Definition at line 30 of file opcode.h.

#define GETARG_sBx (   i)    ((int)(GETARG_Bx(i)-MAXARG_sBx))

Definition at line 25 of file opcode.h.

#define GETARG_UNPACK_b (   i,
  n1,
  n2 
)    ((int)((((mrb_code)(i)) >> (7+(n2))) & (((1<<(n1))-1))))

Definition at line 27 of file opcode.h.

#define GETARG_UNPACK_c (   i,
  n1,
  n2 
)    ((int)((((mrb_code)(i)) >> 7) & (((1<<(n2))-1))))

Definition at line 28 of file opcode.h.

#define MAXARG_Bx   (0xffff)

Definition at line 10 of file opcode.h.

#define MAXARG_sBx   (MAXARG_Bx>>1) /* `sBx' is signed */

Definition at line 11 of file opcode.h.

#define MKARG_A (   c)    ((mrb_code)((c) & 0x1ff) << 23)

Definition at line 33 of file opcode.h.

#define MKARG_Ax (   v)    ((mrb_code)((v) & 0x1ffffff) << 7)

Definition at line 38 of file opcode.h.

#define MKARG_B (   c)    ((mrb_code)((c) & 0x1ff) << 14)

Definition at line 34 of file opcode.h.

#define MKARG_bc (   b,
 
)    MKARG_PACK(b,14,c,2)

Definition at line 40 of file opcode.h.

#define MKARG_Bx (   v)    ((mrb_code)((v) & 0xffff) << 7)

Definition at line 36 of file opcode.h.

#define MKARG_C (   c)    (((c) & 0x7f) << 7)

Definition at line 35 of file opcode.h.

#define MKARG_PACK (   b,
  n1,
  c,
  n2 
)    ((((b) & ((1<<n1)-1)) << (7+n2))|(((c) & ((1<<n2)-1)) << 7))

Definition at line 39 of file opcode.h.

#define MKARG_sBx (   v)    MKARG_Bx((v)+MAXARG_sBx)

Definition at line 37 of file opcode.h.

#define MKOP_A (   op,
 
)    (MKOPCODE(op)|MKARG_A(a))

Definition at line 42 of file opcode.h.

#define MKOP_AB (   op,
  a,
 
)    (MKOP_A(op,a)|MKARG_B(b))

Definition at line 43 of file opcode.h.

#define MKOP_ABC (   op,
  a,
  b,
 
)    (MKOP_AB(op,a,b)|MKARG_C(c))

Definition at line 44 of file opcode.h.

#define MKOP_Abc (   op,
  a,
  b,
 
)    (MKOP_A(op,a)|MKARG_bc(b,c))

Definition at line 50 of file opcode.h.

#define MKOP_ABx (   op,
  a,
  bx 
)    (MKOP_A(op,a)|MKARG_Bx(bx))

Definition at line 45 of file opcode.h.

#define MKOP_AsBx (   op,
  a,
  sbx 
)    (MKOP_A(op,a)|MKARG_sBx(sbx))

Definition at line 48 of file opcode.h.

#define MKOP_Ax (   op,
  ax 
)    (MKOPCODE(op)|MKARG_Ax(ax))

Definition at line 49 of file opcode.h.

#define MKOP_Bx (   op,
  bx 
)    (MKOPCODE(op)|MKARG_Bx(bx))

Definition at line 46 of file opcode.h.

#define MKOP_sBx (   op,
  sbx 
)    (MKOPCODE(op)|MKARG_sBx(sbx))

Definition at line 47 of file opcode.h.

#define MKOPCODE (   op)    ((op) & 0x7f)

Definition at line 32 of file opcode.h.

#define OP_L_BLOCK   OP_L_CAPTURE

Definition at line 154 of file opcode.h.

#define OP_L_CAPTURE   2

Definition at line 151 of file opcode.h.

#define OP_L_LAMBDA   (OP_L_STRICT|OP_L_CAPTURE)

Definition at line 153 of file opcode.h.

#define OP_L_METHOD   OP_L_STRICT

Definition at line 152 of file opcode.h.

#define OP_L_STRICT   1

Definition at line 150 of file opcode.h.

#define OP_R_BREAK   1

Definition at line 157 of file opcode.h.

#define OP_R_NORMAL   0

Definition at line 156 of file opcode.h.

#define OP_R_RETURN   2

Definition at line 158 of file opcode.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
OP_NOP 
OP_MOVE 
OP_LOADL 
OP_LOADI 
OP_LOADSYM 
OP_LOADNIL 
OP_LOADSELF 
OP_LOADT 
OP_LOADF 
OP_GETGLOBAL 
OP_SETGLOBAL 
OP_GETSPECIAL 
OP_SETSPECIAL 
OP_GETIV 
OP_SETIV 
OP_GETCV 
OP_SETCV 
OP_GETCONST 
OP_SETCONST 
OP_GETMCNST 
OP_SETMCNST 
OP_GETUPVAR 
OP_SETUPVAR 
OP_JMP 
OP_JMPIF 
OP_JMPNOT 
OP_ONERR 
OP_RESCUE 
OP_POPERR 
OP_RAISE 
OP_EPUSH 
OP_EPOP 
OP_SEND 
OP_SENDB 
OP_FSEND 
OP_CALL 
OP_SUPER 
OP_ARGARY 
OP_ENTER 
OP_KARG 
OP_KDICT 
OP_RETURN 
OP_TAILCALL 
OP_BLKPUSH 
OP_ADD 
OP_ADDI 
OP_SUB 
OP_SUBI 
OP_MUL 
OP_DIV 
OP_EQ 
OP_LT 
OP_LE 
OP_GT 
OP_GE 
OP_ARRAY 
OP_ARYCAT 
OP_ARYPUSH 
OP_AREF 
OP_ASET 
OP_APOST 
OP_STRING 
OP_STRCAT 
OP_HASH 
OP_LAMBDA 
OP_RANGE 
OP_OCLASS 
OP_CLASS 
OP_MODULE 
OP_EXEC 
OP_METHOD 
OP_SCLASS 
OP_TCLASS 
OP_DEBUG 
OP_STOP 
OP_ERR 
OP_RSVD1 
OP_RSVD2 
OP_RSVD3 
OP_RSVD4 
OP_RSVD5 

Definition at line 52 of file opcode.h.