Ruby 2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)

Macros | Variables
vm_insnhelper.h File Reference

Go to the source code of this file.

## Macros
#define | COLLECT_USAGE_INSN(insn) /* none */
#define | COLLECT_USAGE_OPERAND(insn, n, op) /* none */
#define | COLLECT_USAGE_REGISTER(reg, s) /* none */
#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 | VM_REG_CFP (reg_cfp)
#define | VM_REG_PC (VM_REG_CFP->pc)
#define | VM_REG_SP (VM_REG_CFP->sp)
#define | VM_REG_EP (VM_REG_CFP->ep)
#define | RESTORE_REGS()
#define | COLLECT_USAGE_REGISTER_HELPER(a, b, v) (v)
#define | GET_PC() (COLLECT_USAGE_REGISTER_HELPER(PC, GET, VM_REG_PC))
#define | SET_PC(x) (VM_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(VM_REG_PC + (n)))
#define | JUMP(dst) (SET_PC(VM_REG_PC + (dst)))
#define | GET_CFP() (COLLECT_USAGE_REGISTER_HELPER(CFP, GET, VM_REG_CFP))
#define | GET_EP() (COLLECT_USAGE_REGISTER_HELPER(EP, GET, VM_REG_EP))
#define | SET_EP(x) (VM_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, VM_REG_SP))
#define | SET_SP(x) (VM_REG_SP = (COLLECT_USAGE_REGISTER_HELPER(SP, SET, (x))))
#define | INC_SP(x) (VM_REG_SP += (COLLECT_USAGE_REGISTER_HELPER(SP, SET, (x))))
#define | DEC_SP(x) (VM_REG_SP -= (COLLECT_USAGE_REGISTER_HELPER(SP, SET, (x))))
#define | SET_SV(x) (*GET_SP() = (x))
#define | GET_ISEQ() (GET_CFP()->iseq)
#define | GET_PREV_EP(ep) ((VALUE *)((ep)[VM_ENV_DATA_INDEX_SPECVAL] & ~0x03))
#define | GET_SELF() (COLLECT_USAGE_REGISTER_HELPER(SELF, GET, GET_CFP()->self))
#define | GET_BLOCK_HANDLER() (GET_LEP()[VM_ENV_DATA_INDEX_SPECVAL])
#define | SETUP_CANARY() /* void */
#define | CHECK_CANARY() /* void */
#define | CALL_SIMPLE_METHOD()
#define | PREV_CLASS_SERIAL() (ruby_vm_class_serial)
#define | NEXT_CLASS_SERIAL() (++ruby_vm_class_serial)
#define | GET_GLOBAL_METHOD_STATE() (ruby_vm_global_method_state)
#define | INC_GLOBAL_METHOD_STATE() (++ruby_vm_global_method_state)
#define | GET_GLOBAL_CONSTANT_STATE() (ruby_vm_global_constant_state)
#define | INC_GLOBAL_CONSTANT_STATE() (++ruby_vm_global_constant_state)
#define | IS_ARGS_SPLAT(ci) ((ci)->flag & VM_CALL_ARGS_SPLAT)
#define | IS_ARGS_KEYWORD(ci) ((ci)->flag & VM_CALL_KWARG)
#define | IS_ARGS_KW_SPLAT(ci) ((ci)->flag & VM_CALL_KW_SPLAT)
#define | IS_ARGS_KW_OR_KW_SPLAT(ci) ((ci)->flag & (VM_CALL_KWARG | VM_CALL_KW_SPLAT))

## Variables
RUBY_SYMBOL_EXPORT_BEGIN RUBY_EXTERN VALUE | ruby_vm_const_missing_count
RUBY_EXTERN rb_serial_t | ruby_vm_global_method_state
RUBY_EXTERN rb_serial_t | ruby_vm_global_constant_state
RUBY_EXTERN rb_serial_t | ruby_vm_class_serial

## Macro Definition Documentation

## ◆ ADD_PC

#define ADD_PC | ( |  | n | ) | (SET_PC(VM_REG_PC + (n)))

Definition at line 83 of file vm_insnhelper.h.

## ◆ CALL_SIMPLE_METHOD

#define CALL_SIMPLE_METHOD | ( |  | ) |

Value:
do { \
rb_snum_t x = leaf ? INSN_ATTR(width) : 0; \
rb_snum_t y = attr_width_opt_send_without_block(0); \
rb_snum_t z = x - y; \
ADD_PC(z); \
DISPATCH_ORIGINAL_INSN(opt_send_without_block); \
} while (0)

Definition at line 178 of file vm_insnhelper.h.

## ◆ CHECK_CANARY

#define CHECK_CANARY | ( |  | ) | /* void */

Definition at line 170 of file vm_insnhelper.h.

## ◆ COLLECT_USAGE_INSN

#define COLLECT_USAGE_INSN | ( |  | insn | ) | /* none */

Definition at line 30 of file vm_insnhelper.h.

## ◆ COLLECT_USAGE_OPERAND

#define COLLECT_USAGE_OPERAND | ( |  | insn,
|  |  | n,
|  |  | op
| ) |  | /* none */

Definition at line 31 of file vm_insnhelper.h.

## ◆ COLLECT_USAGE_REGISTER

#define COLLECT_USAGE_REGISTER | ( |  | reg,
|  |  | s
| ) |  | /* none */

Definition at line 32 of file vm_insnhelper.h.

## ◆ COLLECT_USAGE_REGISTER_HELPER

#define COLLECT_USAGE_REGISTER_HELPER | ( |  | a,
|  |  | b,
|  |  | v
| ) |  | (v)

Definition at line 75 of file vm_insnhelper.h.

## ◆ DEC_SP

#define DEC_SP | ( |  | x | ) | (VM_REG_SP -= (COLLECT_USAGE_REGISTER_HELPER(SP, SET, (x))))

Definition at line 96 of file vm_insnhelper.h.

## ◆ GET_BLOCK_HANDLER

#define GET_BLOCK_HANDLER | ( |  | ) | (GET_LEP()[VM_ENV_DATA_INDEX_SPECVAL])

Definition at line 138 of file vm_insnhelper.h.

## ◆ GET_CFP

#define GET_CFP | ( |  | ) | (COLLECT_USAGE_REGISTER_HELPER(CFP, GET, VM_REG_CFP))

Definition at line 87 of file vm_insnhelper.h.

## ◆ GET_CURRENT_INSN

#define GET_CURRENT_INSN | ( |  | ) | (*GET_PC())

Definition at line 81 of file vm_insnhelper.h.

## ◆ GET_EP

#define GET_EP | ( |  | ) | (COLLECT_USAGE_REGISTER_HELPER(EP, GET, VM_REG_EP))

Definition at line 88 of file vm_insnhelper.h.

## ◆ GET_GLOBAL_CONSTANT_STATE

#define GET_GLOBAL_CONSTANT_STATE | ( |  | ) | (ruby_vm_global_constant_state)

Definition at line 191 of file vm_insnhelper.h.

## ◆ GET_GLOBAL_METHOD_STATE

#define GET_GLOBAL_METHOD_STATE | ( |  | ) | (ruby_vm_global_method_state)

Definition at line 189 of file vm_insnhelper.h.

## ◆ GET_ISEQ

#define GET_ISEQ | ( |  | ) | (GET_CFP()->iseq)

Definition at line 101 of file vm_insnhelper.h.

## ◆ GET_LEP

#define GET_LEP | ( |  | ) | (VM_EP_LEP(GET_EP()))

Definition at line 90 of file vm_insnhelper.h.

## ◆ GET_OPERAND

#define GET_OPERAND | ( |  | n | ) | (GET_PC()[(n)])

Definition at line 82 of file vm_insnhelper.h.

## ◆ GET_PC

#define GET_PC | ( |  | ) | (COLLECT_USAGE_REGISTER_HELPER(PC, GET, VM_REG_PC))

Definition at line 79 of file vm_insnhelper.h.

## ◆ GET_PREV_EP

#define GET_PREV_EP | ( |  | ep | ) | ((VALUE *)((ep)[VM_ENV_DATA_INDEX_SPECVAL] & ~0x03))

Definition at line 107 of file vm_insnhelper.h.

## ◆ GET_SELF

#define GET_SELF | ( |  | ) | (COLLECT_USAGE_REGISTER_HELPER(SELF, GET, GET_CFP()->self))

Definition at line 113 of file vm_insnhelper.h.

## ◆ GET_SP

#define GET_SP | ( |  | ) | (COLLECT_USAGE_REGISTER_HELPER(SP, GET, VM_REG_SP))

Definition at line 93 of file vm_insnhelper.h.

## ◆ INC_GLOBAL_CONSTANT_STATE

#define INC_GLOBAL_CONSTANT_STATE | ( |  | ) | (++ruby_vm_global_constant_state)

Definition at line 192 of file vm_insnhelper.h.

## ◆ INC_GLOBAL_METHOD_STATE

#define INC_GLOBAL_METHOD_STATE | ( |  | ) | (++ruby_vm_global_method_state)

Definition at line 190 of file vm_insnhelper.h.

## ◆ INC_SP

#define INC_SP | ( |  | x | ) | (VM_REG_SP += (COLLECT_USAGE_REGISTER_HELPER(SP, SET, (x))))

Definition at line 95 of file vm_insnhelper.h.

## ◆ IS_ARGS_KEYWORD

#define IS_ARGS_KEYWORD | ( |  | ci | ) | ((ci)->flag & VM_CALL_KWARG)

Definition at line 254 of file vm_insnhelper.h.

## ◆ IS_ARGS_KW_OR_KW_SPLAT

#define IS_ARGS_KW_OR_KW_SPLAT | ( |  | ci | ) | ((ci)->flag & (VM_CALL_KWARG | VM_CALL_KW_SPLAT))

Definition at line 256 of file vm_insnhelper.h.

## ◆ IS_ARGS_KW_SPLAT

#define IS_ARGS_KW_SPLAT | ( |  | ci | ) | ((ci)->flag & VM_CALL_KW_SPLAT)

Definition at line 255 of file vm_insnhelper.h.

## ◆ IS_ARGS_SPLAT

#define IS_ARGS_SPLAT | ( |  | ci | ) | ((ci)->flag & VM_CALL_ARGS_SPLAT)

Definition at line 253 of file vm_insnhelper.h.

## ◆ JUMP

#define JUMP | ( |  | dst | ) | (SET_PC(VM_REG_PC + (dst)))

Definition at line 84 of file vm_insnhelper.h.

## ◆ NEXT_CLASS_SERIAL

#define NEXT_CLASS_SERIAL | ( |  | ) | (++ruby_vm_class_serial)

Definition at line 188 of file vm_insnhelper.h.

## ◆ POP

#define POP | ( |  | ) | (DEC_SP(1))

Definition at line 42 of file vm_insnhelper.h.

## ◆ POPN

#define POPN | ( |  | n | ) | (DEC_SP(n))

Definition at line 41 of file vm_insnhelper.h.

## ◆ PREV_CLASS_SERIAL

#define PREV_CLASS_SERIAL | ( |  | ) | (ruby_vm_class_serial)

Definition at line 187 of file vm_insnhelper.h.

## ◆ PUSH

#define PUSH | ( |  | x | ) | (SET_SV(x), INC_SP(1))

Definition at line 39 of file vm_insnhelper.h.

## ◆ RESTORE_REGS

#define RESTORE_REGS | ( |  | ) |

Value:
do { \
VM_REG_CFP = ec->cfp; \
} while (0)

Definition at line 54 of file vm_insnhelper.h.

## ◆ SET_EP

#define SET_EP | ( |  | x | ) | (VM_REG_EP = (COLLECT_USAGE_REGISTER_HELPER(EP, SET, (x))))

Definition at line 89 of file vm_insnhelper.h.

## ◆ SET_PC

#define SET_PC | ( |  | x | ) | (VM_REG_PC = (COLLECT_USAGE_REGISTER_HELPER(PC, SET, (x))))

Definition at line 80 of file vm_insnhelper.h.

## ◆ SET_SP

#define SET_SP | ( |  | x | ) | (VM_REG_SP = (COLLECT_USAGE_REGISTER_HELPER(SP, SET, (x))))

Definition at line 94 of file vm_insnhelper.h.

## ◆ SET_SV

#define SET_SV | ( |  | x | ) | (*GET_SP() = (x))

Definition at line 97 of file vm_insnhelper.h.

## ◆ SETUP_CANARY

#define SETUP_CANARY | ( |  | ) | /* void */

Definition at line 169 of file vm_insnhelper.h.

## ◆ STACK_ADDR_FROM_TOP

#define STACK_ADDR_FROM_TOP | ( |  | n | ) | (GET_SP()-(n))

Definition at line 43 of file vm_insnhelper.h.

## ◆ TOPN

#define TOPN | ( |  | n | ) | (*(GET_SP()-(n)-1))

Definition at line 40 of file vm_insnhelper.h.

## ◆ VM_REG_CFP

#define VM_REG_CFP (reg_cfp)

Definition at line 49 of file vm_insnhelper.h.

## ◆ VM_REG_EP

#define VM_REG_EP (VM_REG_CFP->ep)

Definition at line 52 of file vm_insnhelper.h.

## ◆ VM_REG_PC

#define VM_REG_PC (VM_REG_CFP->pc)

Definition at line 50 of file vm_insnhelper.h.

## ◆ VM_REG_SP

#define VM_REG_SP (VM_REG_CFP->sp)

Definition at line 51 of file vm_insnhelper.h.

## Variable Documentation

## ◆ ruby_vm_class_serial

RUBY_EXTERN rb_serial_t ruby_vm_class_serial

Definition at line 20 of file vm_insnhelper.h.

## ◆ ruby_vm_const_missing_count

RUBY_SYMBOL_EXPORT_BEGIN RUBY_EXTERN VALUE ruby_vm_const_missing_count

Definition at line 17 of file vm_insnhelper.h.

## ◆ ruby_vm_global_constant_state

RUBY_EXTERN rb_serial_t ruby_vm_global_constant_state

Definition at line 19 of file vm_insnhelper.h.

## ◆ ruby_vm_global_method_state

RUBY_EXTERN rb_serial_t ruby_vm_global_method_state

Definition at line 18 of file vm_insnhelper.h.