Go to the source code of this file.
Defines | |
| #define | COLLECT_USAGE_INSN(insn) |
| #define | COLLECT_USAGE_OPERAND(insn, n, op) |
| #define | COLLECT_USAGE_REGISTER(reg, s) |
| #define | PUSH(x) (SET_SV(x), INC_SP(1)) |
| #define | TOPN(n) (*(GET_SP()-(n)-1)) |
| #define | POPN(n) (DEC_SP(n)) |
| #define | POP() (DEC_SP(1)) |
| #define | STACK_ADDR_FROM_TOP(n) (GET_SP()-(n)) |
| #define | GET_TOS() (tos) |
| #define | REG_CFP (reg_cfp) |
| #define | REG_PC (REG_CFP->pc) |
| #define | REG_SP (REG_CFP->sp) |
| #define | REG_EP (REG_CFP->ep) |
| #define | RESTORE_REGS() |
| #define | REG_A reg_a |
| #define | REG_B reg_b |
| #define | COLLECT_USAGE_REGISTER_HELPER(a, b, v) (v) |
| #define | GET_PC() (COLLECT_USAGE_REGISTER_HELPER(PC, GET, REG_PC)) |
| #define | SET_PC(x) (REG_PC = (COLLECT_USAGE_REGISTER_HELPER(PC, SET, (x)))) |
| #define | GET_CURRENT_INSN() (*GET_PC()) |
| #define | GET_OPERAND(n) (GET_PC()[(n)]) |
| #define | ADD_PC(n) (SET_PC(REG_PC + (n))) |
| #define | GET_PC_COUNT() (REG_PC - GET_ISEQ()->iseq_encoded) |
| #define | JUMP(dst) (REG_PC += (dst)) |
| #define | GET_CFP() (COLLECT_USAGE_REGISTER_HELPER(CFP, GET, REG_CFP)) |
| #define | GET_EP() (COLLECT_USAGE_REGISTER_HELPER(EP, GET, REG_EP)) |
| #define | SET_EP(x) (REG_EP = (COLLECT_USAGE_REGISTER_HELPER(EP, SET, (x)))) |
| #define | GET_LEP() (VM_EP_LEP(GET_EP())) |
| #define | GET_SP() (COLLECT_USAGE_REGISTER_HELPER(SP, GET, REG_SP)) |
| #define | SET_SP(x) (REG_SP = (COLLECT_USAGE_REGISTER_HELPER(SP, SET, (x)))) |
| #define | INC_SP(x) (REG_SP += (COLLECT_USAGE_REGISTER_HELPER(SP, SET, (x)))) |
| #define | DEC_SP(x) (REG_SP -= (COLLECT_USAGE_REGISTER_HELPER(SP, SET, (x)))) |
| #define | SET_SV(x) (*GET_SP() = (x)) |
| #define | GET_SP_COUNT() (REG_SP - th->stack) |
| #define | GET_ISEQ() (GET_CFP()->iseq) |
| #define | GET_PREV_EP(ep) ((VALUE *)((ep)[0] & ~0x03)) |
| #define | GET_GLOBAL(entry) rb_gvar_get((struct rb_global_entry*)(entry)) |
| #define | SET_GLOBAL(entry, val) rb_gvar_set((struct rb_global_entry*)(entry), (val)) |
| #define | GET_CONST_INLINE_CACHE(dst) ((IC) * (GET_PC() + (dst) + 2)) |
| #define | GET_SELF() (COLLECT_USAGE_REGISTER_HELPER(SELF, GET, GET_CFP()->self)) |
| #define | COPY_CREF_OMOD(c1, c2) |
| #define | COPY_CREF(c1, c2) |
| #define | CALL_METHOD(ci) |
| #define | OPT_CALL_FASTPATH 1 |
| #define | CI_SET_FASTPATH(ci, func, enabled) |
| #define | GET_BLOCK_PTR() ((rb_block_t *)(GC_GUARDED_PTR_REF(GET_LEP()[0]))) |
| #define | FIXNUM_REDEFINED_OP_FLAG (1 << 0) |
| #define | FLOAT_REDEFINED_OP_FLAG (1 << 1) |
| #define | STRING_REDEFINED_OP_FLAG (1 << 2) |
| #define | ARRAY_REDEFINED_OP_FLAG (1 << 3) |
| #define | HASH_REDEFINED_OP_FLAG (1 << 4) |
| #define | BIGNUM_REDEFINED_OP_FLAG (1 << 5) |
| #define | SYMBOL_REDEFINED_OP_FLAG (1 << 6) |
| #define | TIME_REDEFINED_OP_FLAG (1 << 7) |
| #define | BASIC_OP_UNREDEFINED_P(op, klass) (LIKELY((ruby_vm_redefined_flag[(op)]&(klass)) == 0)) |
| #define | FIXNUM_2_P(a, b) ((a) & (b) & 1) |
| #define | FLONUM_2_P(a, b) (((((a)^2) | ((b)^2)) & 3) == 0) |
| #define | HEAP_CLASS_OF(obj) (RBASIC(obj)->klass) |
| #define | USE_IC_FOR_SPECIALIZED_METHOD 1 |
| #define | CALL_SIMPLE_METHOD(recv) |
| #define | GET_VM_STATE_VERSION() (ruby_vm_global_state_version) |
| #define | INC_VM_STATE_VERSION() |
Enumerations | |
| enum | { BOP_PLUS, BOP_MINUS, BOP_MULT, BOP_DIV, BOP_MOD, BOP_EQ, BOP_EQQ, BOP_LT, BOP_LE, BOP_LTLT, BOP_AREF, BOP_ASET, BOP_LENGTH, BOP_SIZE, BOP_EMPTY_P, BOP_SUCC, BOP_GT, BOP_GE, BOP_NOT, BOP_NEQ, BOP_LAST_ } |
VM Debug Level. More... | |
| enum | vm_regan_regtype { VM_REGAN_PC = 0, VM_REGAN_SP = 1, VM_REGAN_EP = 2, VM_REGAN_CFP = 3, VM_REGAN_SELF = 4, VM_REGAN_ISEQ = 5 } |
| enum | vm_regan_acttype { VM_REGAN_ACT_GET = 0, VM_REGAN_ACT_SET = 1 } |
Functions | |
| static void | vm_clear_all_cache (void) |
| static VALUE | make_no_method_exception (VALUE exc, const char *format, VALUE obj, int argc, const VALUE *argv) |
Variables | |
| char | ruby_vm_redefined_flag [BOP_LAST_] |
| VALUE | ruby_vm_const_missing_count |
| static VALUE | ruby_vm_global_state_version = 1 |
| #define ADD_PC | ( | n | ) | (SET_PC(REG_PC + (n))) |
Definition at line 129 of file vm_insnhelper.h.
| #define ARRAY_REDEFINED_OP_FLAG (1 << 3) |
Definition at line 235 of file vm_insnhelper.h.
Referenced by vm_redefinition_check_flag().
| #define BASIC_OP_UNREDEFINED_P | ( | op, | |||
| klass | ) | (LIKELY((ruby_vm_redefined_flag[(op)]&(klass)) == 0)) |
Definition at line 241 of file vm_insnhelper.h.
Referenced by opt_eq_func().
| #define BIGNUM_REDEFINED_OP_FLAG (1 << 5) |
Definition at line 237 of file vm_insnhelper.h.
Referenced by vm_redefinition_check_flag().
| #define CALL_METHOD | ( | ci | ) |
do { \ VALUE v = (*(ci)->call)(th, GET_CFP(), (ci)); \ if (v == Qundef) { \ RESTORE_REGS(); \ NEXT_INSN(); \ } \ else { \ val = v; \ } \ } while (0)
Definition at line 193 of file vm_insnhelper.h.
| #define CALL_SIMPLE_METHOD | ( | recv | ) |
do { \ ci->blockptr = 0; ci->argc = ci->orig_argc; \ vm_search_method(ci, ci->recv = (recv)); \ CALL_METHOD(ci); \ } while (0)
Definition at line 255 of file vm_insnhelper.h.
| #define CI_SET_FASTPATH | ( | ci, | |||
| func, | |||||
| enabled | ) |
Definition at line 213 of file vm_insnhelper.h.
Referenced by vm_call_method(), vm_callee_setup_arg(), and vm_search_super_method().
| #define COLLECT_USAGE_INSN | ( | insn | ) |
Definition at line 71 of file vm_insnhelper.h.
| #define COLLECT_USAGE_OPERAND | ( | insn, | |||
| n, | |||||
| op | ) |
Definition at line 72 of file vm_insnhelper.h.
| #define COLLECT_USAGE_REGISTER | ( | reg, | |||
| s | ) |
Definition at line 73 of file vm_insnhelper.h.
| #define COLLECT_USAGE_REGISTER_HELPER | ( | a, | |||
| b, | |||||
| v | ) | (v) |
Definition at line 121 of file vm_insnhelper.h.
| #define COPY_CREF | ( | c1, | |||
| c2 | ) |
do { \ NODE *__tmp_c2 = (c2); \ COPY_CREF_OMOD(c1, __tmp_c2); \ (c1)->nd_clss = __tmp_c2->nd_clss; \ (c1)->nd_visi = __tmp_c2->nd_visi;\ (c1)->nd_next = __tmp_c2->nd_next; \ if (__tmp_c2->flags & NODE_FL_CREF_PUSHED_BY_EVAL) { \ (c1)->flags |= NODE_FL_CREF_PUSHED_BY_EVAL; \ } \ } while (0)
Definition at line 182 of file vm_insnhelper.h.
Referenced by vm_define_method().
| #define COPY_CREF_OMOD | ( | c1, | |||
| c2 | ) |
do { \ (c1)->nd_refinements = (c2)->nd_refinements; \ if (!NIL_P((c2)->nd_refinements)) { \ (c1)->flags |= NODE_FL_CREF_OMOD_SHARED; \ (c2)->flags |= NODE_FL_CREF_OMOD_SHARED; \ } \ } while (0)
Definition at line 174 of file vm_insnhelper.h.
Referenced by rb_vm_rewrite_cref_stack(), and vm_cref_push().
| #define DEC_SP | ( | x | ) | (REG_SP -= (COLLECT_USAGE_REGISTER_HELPER(SP, SET, (x)))) |
Definition at line 144 of file vm_insnhelper.h.
Referenced by vm_call_opt_send().
| #define FIXNUM_2_P | ( | a, | |||
| b | ) | ((a) & (b) & 1) |
Definition at line 243 of file vm_insnhelper.h.
Referenced by opt_eq_func().
| #define FIXNUM_REDEFINED_OP_FLAG (1 << 0) |
Definition at line 232 of file vm_insnhelper.h.
Referenced by opt_eq_func(), and vm_redefinition_check_flag().
| #define FLOAT_REDEFINED_OP_FLAG (1 << 1) |
Definition at line 233 of file vm_insnhelper.h.
Referenced by opt_eq_func(), and vm_redefinition_check_flag().
| #define FLONUM_2_P | ( | a, | |||
| b | ) | (((((a)^2) | ((b)^2)) & 3) == 0) |
Definition at line 245 of file vm_insnhelper.h.
Referenced by opt_eq_func().
| #define GET_BLOCK_PTR | ( | ) | ((rb_block_t *)(GC_GUARDED_PTR_REF(GET_LEP()[0]))) |
Definition at line 220 of file vm_insnhelper.h.
| #define GET_CFP | ( | ) | (COLLECT_USAGE_REGISTER_HELPER(CFP, GET, REG_CFP)) |
Definition at line 135 of file vm_insnhelper.h.
Referenced by vm_invoke_block(), vm_search_super_method(), vm_search_superclass(), and vm_throw().
| #define GET_CONST_INLINE_CACHE | ( | dst | ) | ((IC) * (GET_PC() + (dst) + 2)) |
Definition at line 162 of file vm_insnhelper.h.
| #define GET_CURRENT_INSN | ( | ) | (*GET_PC()) |
Definition at line 127 of file vm_insnhelper.h.
| #define GET_EP | ( | ) | (COLLECT_USAGE_REGISTER_HELPER(EP, GET, REG_EP)) |
Definition at line 136 of file vm_insnhelper.h.
Referenced by vm_throw().
| #define GET_GLOBAL | ( | entry | ) | rb_gvar_get((struct rb_global_entry*)(entry)) |
Definition at line 159 of file vm_insnhelper.h.
| #define GET_ISEQ | ( | ) | (GET_CFP()->iseq) |
Definition at line 151 of file vm_insnhelper.h.
Referenced by vm_invoke_block(), vm_search_super_method(), and vm_throw().
| #define GET_LEP | ( | ) | (VM_EP_LEP(GET_EP())) |
Definition at line 138 of file vm_insnhelper.h.
| #define GET_OPERAND | ( | n | ) | (GET_PC()[(n)]) |
Definition at line 128 of file vm_insnhelper.h.
| #define GET_PC | ( | ) | (COLLECT_USAGE_REGISTER_HELPER(PC, GET, REG_PC)) |
Definition at line 125 of file vm_insnhelper.h.
| #define GET_PC_COUNT | ( | ) | (REG_PC - GET_ISEQ()->iseq_encoded) |
Definition at line 131 of file vm_insnhelper.h.
| #define GET_PREV_EP | ( | ep | ) | ((VALUE *)((ep)[0] & ~0x03)) |
Definition at line 157 of file vm_insnhelper.h.
| #define GET_SELF | ( | ) | (COLLECT_USAGE_REGISTER_HELPER(SELF, GET, GET_CFP()->self)) |
Definition at line 168 of file vm_insnhelper.h.
| #define GET_SP | ( | ) | (COLLECT_USAGE_REGISTER_HELPER(SP, GET, REG_SP)) |
Definition at line 141 of file vm_insnhelper.h.
Referenced by vm_invoke_block().
| #define GET_SP_COUNT | ( | ) | (REG_SP - th->stack) |
Definition at line 148 of file vm_insnhelper.h.
| #define GET_TOS | ( | ) | (tos) |
Definition at line 86 of file vm_insnhelper.h.
| #define GET_VM_STATE_VERSION | ( | ) | (ruby_vm_global_state_version) |
Definition at line 263 of file vm_insnhelper.h.
Referenced by rb_method_entry(), rb_method_entry_get_without_cache(), vm_getivar(), vm_search_method(), and vm_setivar().
| #define HASH_REDEFINED_OP_FLAG (1 << 4) |
Definition at line 236 of file vm_insnhelper.h.
Referenced by vm_redefinition_check_flag().
| #define HEAP_CLASS_OF | ( | obj | ) | (RBASIC(obj)->klass) |
Definition at line 249 of file vm_insnhelper.h.
Referenced by opt_eq_func().
| #define INC_SP | ( | x | ) | (REG_SP += (COLLECT_USAGE_REGISTER_HELPER(SP, SET, (x)))) |
Definition at line 143 of file vm_insnhelper.h.
Referenced by vm_call_method_missing().
| #define INC_VM_STATE_VERSION | ( | ) |
do { \ ruby_vm_global_state_version = (ruby_vm_global_state_version + 1); \ if (ruby_vm_global_state_version == 0) vm_clear_all_cache(); \ } while (0)
Definition at line 264 of file vm_insnhelper.h.
Referenced by m_core_undef_method(), rb_vm_change_state(), and vm_define_method().
| #define JUMP | ( | dst | ) | (REG_PC += (dst)) |
Definition at line 132 of file vm_insnhelper.h.
| #define OPT_CALL_FASTPATH 1 |
Definition at line 209 of file vm_insnhelper.h.
| #define POP | ( | ) | (DEC_SP(1)) |
Definition at line 83 of file vm_insnhelper.h.
| #define POPN | ( | n | ) | (DEC_SP(n)) |
Definition at line 82 of file vm_insnhelper.h.
Referenced by vm_invoke_block().
| #define PUSH | ( | x | ) | (SET_SV(x), INC_SP(1)) |
Definition at line 80 of file vm_insnhelper.h.
| #define REG_A reg_a |
Definition at line 101 of file vm_insnhelper.h.
| #define REG_B reg_b |
Definition at line 102 of file vm_insnhelper.h.
| #define REG_CFP (reg_cfp) |
Definition at line 92 of file vm_insnhelper.h.
| #define REG_EP (REG_CFP->ep) |
Definition at line 95 of file vm_insnhelper.h.
| #define REG_PC (REG_CFP->pc) |
Definition at line 93 of file vm_insnhelper.h.
| #define REG_SP (REG_CFP->sp) |
Definition at line 94 of file vm_insnhelper.h.
| #define RESTORE_REGS | ( | ) |
Definition at line 97 of file vm_insnhelper.h.
| #define SET_EP | ( | x | ) | (REG_EP = (COLLECT_USAGE_REGISTER_HELPER(EP, SET, (x)))) |
Definition at line 137 of file vm_insnhelper.h.
| #define SET_GLOBAL | ( | entry, | |||
| val | ) | rb_gvar_set((struct rb_global_entry*)(entry), (val)) |
Definition at line 160 of file vm_insnhelper.h.
| #define SET_PC | ( | x | ) | (REG_PC = (COLLECT_USAGE_REGISTER_HELPER(PC, SET, (x)))) |
Definition at line 126 of file vm_insnhelper.h.
| #define SET_SP | ( | x | ) | (REG_SP = (COLLECT_USAGE_REGISTER_HELPER(SP, SET, (x)))) |
Definition at line 142 of file vm_insnhelper.h.
Referenced by vm_invoke_block().
| #define SET_SV | ( | x | ) | (*GET_SP() = (x)) |
Definition at line 145 of file vm_insnhelper.h.
| #define STACK_ADDR_FROM_TOP | ( | n | ) | (GET_SP()-(n)) |
Definition at line 84 of file vm_insnhelper.h.
Referenced by vm_call_method(), vm_call_method_missing(), and vm_invoke_block().
| #define STRING_REDEFINED_OP_FLAG (1 << 2) |
Definition at line 234 of file vm_insnhelper.h.
Referenced by opt_eq_func(), and vm_redefinition_check_flag().
| #define SYMBOL_REDEFINED_OP_FLAG (1 << 6) |
Definition at line 238 of file vm_insnhelper.h.
Referenced by vm_redefinition_check_flag().
| #define TIME_REDEFINED_OP_FLAG (1 << 7) |
Definition at line 239 of file vm_insnhelper.h.
Referenced by vm_redefinition_check_flag().
| #define TOPN | ( | n | ) | (*(GET_SP()-(n)-1)) |
Definition at line 81 of file vm_insnhelper.h.
Referenced by vm_call_opt_send(), and vm_search_super_method().
| #define USE_IC_FOR_SPECIALIZED_METHOD 1 |
Definition at line 252 of file vm_insnhelper.h.
| anonymous enum |
VM Debug Level.
debug level: 0: no debug output 1: show instruction name 2: show stack frame when control stack frame is changed 3: show stack status 4: show register 5: 10: gc check
| BOP_PLUS | |
| BOP_MINUS | |
| BOP_MULT | |
| BOP_DIV | |
| BOP_MOD | |
| BOP_EQ | |
| BOP_EQQ | |
| BOP_LT | |
| BOP_LE | |
| BOP_LTLT | |
| BOP_AREF | |
| BOP_ASET | |
| BOP_LENGTH | |
| BOP_SIZE | |
| BOP_EMPTY_P | |
| BOP_SUCC | |
| BOP_GT | |
| BOP_GE | |
| BOP_NOT | |
| BOP_NEQ | |
| BOP_LAST_ |
Definition at line 37 of file vm_insnhelper.h.
| enum vm_regan_acttype |
Definition at line 112 of file vm_insnhelper.h.
| enum vm_regan_regtype |
Definition at line 104 of file vm_insnhelper.h.
| static VALUE make_no_method_exception | ( | VALUE | exc, | |
| const char * | format, | |||
| VALUE | obj, | |||
| int | argc, | |||
| const VALUE * | argv | |||
| ) | [static] |
| static void vm_clear_all_cache | ( | void | ) | [static] |
Definition at line 94 of file vm.c.
Referenced by rb_vm_inc_const_missing_count().
VALUE ruby_vm_global_state_version = 1 [static] |
Definition at line 261 of file vm_insnhelper.h.
Referenced by vm_clear_all_cache().
| char ruby_vm_redefined_flag[BOP_LAST_] |
Definition at line 95 of file vm.c.
Referenced by rb_vm_check_redefinition_opt_method().
1.6.1