mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* vm_insnhelper.h: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2ec31553ea
commit
c11a4d8f3f
2 changed files with 15 additions and 11 deletions
|
@ -1,3 +1,7 @@
|
|||
Mon Jan 24 21:50:48 2011 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* vm_insnhelper.h: parenthesize macro arguments.
|
||||
|
||||
Mon Jan 24 21:28:34 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||
|
||||
* object.c (rb_str_to_dbl): use ALLOC_N instead ALLOCA_N because
|
||||
|
|
|
@ -93,14 +93,14 @@ extern VALUE ruby_vm_const_missing_count;
|
|||
|
||||
#ifdef COLLECT_USAGE_ANALYSIS
|
||||
#define USAGE_ANALYSIS_REGISTER_HELPER(a, b, v) \
|
||||
(USAGE_ANALYSIS_REGISTER(a, b), (v))
|
||||
(USAGE_ANALYSIS_REGISTER((a), (b)), (v))
|
||||
#else
|
||||
#define USAGE_ANALYSIS_REGISTER_HELPER(a, b, v) (v)
|
||||
#endif
|
||||
|
||||
/* PC */
|
||||
#define GET_PC() (USAGE_ANALYSIS_REGISTER_HELPER(0, 0, REG_PC))
|
||||
#define SET_PC(x) (REG_PC = (USAGE_ANALYSIS_REGISTER_HELPER(0, 1, x)))
|
||||
#define SET_PC(x) (REG_PC = (USAGE_ANALYSIS_REGISTER_HELPER(0, 1, (x))))
|
||||
#define GET_CURRENT_INSN() (*GET_PC())
|
||||
#define GET_OPERAND(n) (GET_PC()[(n)])
|
||||
#define ADD_PC(n) (SET_PC(REG_PC + (n)))
|
||||
|
@ -134,8 +134,8 @@ extern VALUE ruby_vm_const_missing_count;
|
|||
|
||||
#define GET_PREV_DFP(dfp) ((VALUE *)((dfp)[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_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))
|
||||
|
||||
|
@ -151,13 +151,13 @@ extern VALUE ruby_vm_const_missing_count;
|
|||
|
||||
#define COPY_CREF(c1, c2) do { \
|
||||
NODE *__tmp_c2 = (c2); \
|
||||
c1->nd_clss = __tmp_c2->nd_clss; \
|
||||
c1->nd_visi = __tmp_c2->nd_visi;\
|
||||
c1->nd_next = __tmp_c2->nd_next; \
|
||||
(c1)->nd_clss = __tmp_c2->nd_clss; \
|
||||
(c1)->nd_visi = __tmp_c2->nd_visi;\
|
||||
(c1)->nd_next = __tmp_c2->nd_next; \
|
||||
} while (0)
|
||||
|
||||
#define CALL_METHOD(num, blockptr, flag, id, me, recv) do { \
|
||||
VALUE v = vm_call_method(th, GET_CFP(), num, blockptr, flag, id, me, recv); \
|
||||
VALUE v = vm_call_method(th, GET_CFP(), (num), (blockptr), (flag), (id), (me), (recv)); \
|
||||
if (v == Qundef) { \
|
||||
RESTORE_REGS(); \
|
||||
NEXT_INSN(); \
|
||||
|
@ -182,7 +182,7 @@ extern VALUE ruby_vm_const_missing_count;
|
|||
|
||||
/* optimize insn */
|
||||
#define FIXNUM_2_P(a, b) ((a) & (b) & 1)
|
||||
#define BASIC_OP_UNREDEFINED_P(op) (LIKELY(ruby_vm_redefined_flag[op] == 0))
|
||||
#define BASIC_OP_UNREDEFINED_P(op) (LIKELY(ruby_vm_redefined_flag[(op)] == 0))
|
||||
#define HEAP_CLASS_OF(obj) RBASIC(obj)->klass
|
||||
|
||||
#ifndef USE_IC_FOR_SPECIALIZED_METHOD
|
||||
|
@ -193,14 +193,14 @@ extern VALUE ruby_vm_const_missing_count;
|
|||
|
||||
#define CALL_SIMPLE_METHOD(num, id, recv) do { \
|
||||
VALUE klass = CLASS_OF(recv); \
|
||||
CALL_METHOD(num, 0, 0, id, vm_method_search(id, klass, ic), recv); \
|
||||
CALL_METHOD((num), 0, 0, (id), vm_method_search((id), klass, ic), (recv)); \
|
||||
} while (0)
|
||||
|
||||
#else
|
||||
|
||||
#define CALL_SIMPLE_METHOD(num, id, recv) do { \
|
||||
VALUE klass = CLASS_OF(recv); \
|
||||
CALL_METHOD(num, 0, 0, id, rb_method_entry(klass, id), recv); \
|
||||
CALL_METHOD((num), 0, 0, (id), rb_method_entry(klass, (id)), (recv)); \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue