1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* vm_insnhelper.h: rename REG_(CFP|PC|SP|EP) to VM_REG_....

[Bug #12527]

* vm_exec.c: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2016-11-05 16:31:25 +00:00
parent a44c3bb26f
commit b0569e3dde
3 changed files with 28 additions and 21 deletions

View file

@ -1,3 +1,10 @@
Sun Nov 6 01:28:41 2016 Koichi Sasada <ko1@atdot.net>
* vm_insnhelper.h: rename REG_(CFP|PC|SP|EP) to VM_REG_....
[Bug #12527]
* vm_exec.c: ditto.
Sun Nov 6 00:25:11 2016 Sho Hashimoto <sho.hsmt@gmail.com> Sun Nov 6 00:25:11 2016 Sho Hashimoto <sho.hsmt@gmail.com>
* enumerator.c (InitVM_Enumerator): Enumerator::Lazy#chunk_while * enumerator.c (InitVM_Enumerator): Enumerator::Lazy#chunk_while

View file

@ -88,16 +88,16 @@ vm_exec_core(rb_thread_t *th, VALUE initial)
#undef RESTORE_REGS #undef RESTORE_REGS
#define RESTORE_REGS() \ #define RESTORE_REGS() \
{ \ { \
REG_CFP = th->cfp; \ VM_REG_CFP = th->cfp; \
reg_pc = reg_cfp->pc; \ reg_pc = reg_cfp->pc; \
} }
#undef REG_PC #undef VM_REG_PC
#define REG_PC reg_pc #define VM_REG_PC reg_pc
#undef GET_PC #undef GET_PC
#define GET_PC() (reg_pc) #define GET_PC() (reg_pc)
#undef SET_PC #undef SET_PC
#define SET_PC(x) (reg_cfp->pc = REG_PC = (x)) #define SET_PC(x) (reg_cfp->pc = VM_REG_PC = (x))
#endif #endif
#if OPT_TOKEN_THREADED_CODE || OPT_DIRECT_THREADED_CODE #if OPT_TOKEN_THREADED_CODE || OPT_DIRECT_THREADED_CODE

View file

@ -41,13 +41,13 @@ extern VALUE ruby_vm_const_missing_count;
/* deal with registers */ /* deal with registers */
/**********************************************************/ /**********************************************************/
#define REG_CFP (reg_cfp) #define VM_REG_CFP (reg_cfp)
#define REG_PC (REG_CFP->pc) #define VM_REG_PC (VM_REG_CFP->pc)
#define REG_SP (REG_CFP->sp) #define VM_REG_SP (VM_REG_CFP->sp)
#define REG_EP (REG_CFP->ep) #define VM_REG_EP (VM_REG_CFP->ep)
#define RESTORE_REGS() do { \ #define RESTORE_REGS() do { \
REG_CFP = th->cfp; \ VM_REG_CFP = th->cfp; \
} while (0) } while (0)
#define REG_A reg_a #define REG_A reg_a
@ -74,28 +74,28 @@ enum vm_regan_acttype {
#endif #endif
/* PC */ /* PC */
#define GET_PC() (COLLECT_USAGE_REGISTER_HELPER(PC, GET, REG_PC)) #define GET_PC() (COLLECT_USAGE_REGISTER_HELPER(PC, GET, VM_REG_PC))
#define SET_PC(x) (REG_PC = (COLLECT_USAGE_REGISTER_HELPER(PC, SET, (x)))) #define SET_PC(x) (VM_REG_PC = (COLLECT_USAGE_REGISTER_HELPER(PC, SET, (x))))
#define GET_CURRENT_INSN() (*GET_PC()) #define GET_CURRENT_INSN() (*GET_PC())
#define GET_OPERAND(n) (GET_PC()[(n)]) #define GET_OPERAND(n) (GET_PC()[(n)])
#define ADD_PC(n) (SET_PC(REG_PC + (n))) #define ADD_PC(n) (SET_PC(VM_REG_PC + (n)))
#define JUMP(dst) (REG_PC += (dst)) #define JUMP(dst) (VM_REG_PC += (dst))
/* frame pointer, environment pointer */ /* frame pointer, environment pointer */
#define GET_CFP() (COLLECT_USAGE_REGISTER_HELPER(CFP, GET, REG_CFP)) #define GET_CFP() (COLLECT_USAGE_REGISTER_HELPER(CFP, GET, VM_REG_CFP))
#define GET_EP() (COLLECT_USAGE_REGISTER_HELPER(EP, GET, REG_EP)) #define GET_EP() (COLLECT_USAGE_REGISTER_HELPER(EP, GET, VM_REG_EP))
#define SET_EP(x) (REG_EP = (COLLECT_USAGE_REGISTER_HELPER(EP, SET, (x)))) #define SET_EP(x) (VM_REG_EP = (COLLECT_USAGE_REGISTER_HELPER(EP, SET, (x))))
#define GET_LEP() (VM_EP_LEP(GET_EP())) #define GET_LEP() (VM_EP_LEP(GET_EP()))
/* SP */ /* SP */
#define GET_SP() (COLLECT_USAGE_REGISTER_HELPER(SP, GET, REG_SP)) #define GET_SP() (COLLECT_USAGE_REGISTER_HELPER(SP, GET, VM_REG_SP))
#define SET_SP(x) (REG_SP = (COLLECT_USAGE_REGISTER_HELPER(SP, SET, (x)))) #define SET_SP(x) (VM_REG_SP = (COLLECT_USAGE_REGISTER_HELPER(SP, SET, (x))))
#define INC_SP(x) (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) (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 SET_SV(x) (*GET_SP() = (x))
/* set current stack value as x */ /* set current stack value as x */
#define GET_SP_COUNT() (REG_SP - th->stack) #define GET_SP_COUNT() (VM_REG_SP - th->stack)
/* instruction sequence C struct */ /* instruction sequence C struct */
#define GET_ISEQ() (GET_CFP()->iseq) #define GET_ISEQ() (GET_CFP()->iseq)