ruby-changes:44536
From: ko1 <ko1@a...>
Date: Sun, 6 Nov 2016 01:31:29 +0900 (JST)
Subject: [ruby-changes:44536] ko1:r56609 (trunk): * vm_insnhelper.h: rename REG_(CFP|PC|SP|EP) to VM_REG_....
ko1 2016-11-06 01:31:25 +0900 (Sun, 06 Nov 2016) New Revision: 56609 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56609 Log: * vm_insnhelper.h: rename REG_(CFP|PC|SP|EP) to VM_REG_.... [Bug #12527] * vm_exec.c: ditto. Modified files: trunk/ChangeLog trunk/vm_exec.c trunk/vm_insnhelper.h Index: ChangeLog =================================================================== --- ChangeLog (revision 56608) +++ ChangeLog (revision 56609) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sun Nov 6 01:28:41 2016 Koichi Sasada <ko1@a...> + + * 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@g...> * enumerator.c (InitVM_Enumerator): Enumerator::Lazy#chunk_while Index: vm_insnhelper.h =================================================================== --- vm_insnhelper.h (revision 56608) +++ vm_insnhelper.h (revision 56609) @@ -41,13 +41,13 @@ extern VALUE ruby_vm_const_missing_count https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.h#L41 /* deal with registers */ /**********************************************************/ -#define REG_CFP (reg_cfp) -#define REG_PC (REG_CFP->pc) -#define REG_SP (REG_CFP->sp) -#define REG_EP (REG_CFP->ep) +#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() do { \ - REG_CFP = th->cfp; \ + VM_REG_CFP = th->cfp; \ } while (0) #define REG_A reg_a @@ -74,28 +74,28 @@ enum vm_regan_acttype { https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.h#L74 #endif /* PC */ -#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_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(REG_PC + (n))) -#define JUMP(dst) (REG_PC += (dst)) +#define ADD_PC(n) (SET_PC(VM_REG_PC + (n))) +#define JUMP(dst) (VM_REG_PC += (dst)) /* frame pointer, environment pointer */ -#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_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())) /* SP */ -#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 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)) /* 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 */ #define GET_ISEQ() (GET_CFP()->iseq) Index: vm_exec.c =================================================================== --- vm_exec.c (revision 56608) +++ vm_exec.c (revision 56609) @@ -88,16 +88,16 @@ vm_exec_core(rb_thread_t *th, VALUE init https://github.com/ruby/ruby/blob/trunk/vm_exec.c#L88 #undef RESTORE_REGS #define RESTORE_REGS() \ { \ - REG_CFP = th->cfp; \ + VM_REG_CFP = th->cfp; \ reg_pc = reg_cfp->pc; \ } -#undef REG_PC -#define REG_PC reg_pc +#undef VM_REG_PC +#define VM_REG_PC reg_pc #undef GET_PC #define GET_PC() (reg_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 #if OPT_TOKEN_THREADED_CODE || OPT_DIRECT_THREADED_CODE -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/