ruby-changes:57651
From: Takashi <ko1@a...>
Date: Sat, 7 Sep 2019 23:14:44 +0900 (JST)
Subject: [ruby-changes:57651] ae8b977742 (master): Avoid defining DISPATCH_ARCH_DEPEND_WAY macro
https://git.ruby-lang.org/ruby.git/commit/?id=ae8b977742 From ae8b9777424f11cbcb962db94958f1e8a3c11acd Mon Sep 17 00:00:00 2001 From: Takashi Kokubun <takashikkbn@g...> Date: Sat, 7 Sep 2019 23:13:46 +0900 Subject: Avoid defining DISPATCH_ARCH_DEPEND_WAY macro when it's not used. This macro is not used when it's direct threaded code. This patch is purely for readability and has no impact for any behavior. diff --git a/vm_exec.h b/vm_exec.h index 26cd762..c0ce84e 100644 --- a/vm_exec.h +++ b/vm_exec.h @@ -90,16 +90,6 @@ error ! https://github.com/ruby/ruby/blob/trunk/vm_exec.h#L90 LABEL(insn): \ INSN_ENTRY_SIG(insn); \ -/* dispatcher */ -#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && __GNUC__ == 3 -#define DISPATCH_ARCH_DEPEND_WAY(addr) \ - __asm__ __volatile__("jmp *%0;\t# -- inserted by vm.h\t[length = 2]" : : "r" (addr)) - -#else -#define DISPATCH_ARCH_DEPEND_WAY(addr) \ - /* do nothing */ -#endif - /**********************************/ #if OPT_DIRECT_THREADED_CODE @@ -112,14 +102,22 @@ error ! https://github.com/ruby/ruby/blob/trunk/vm_exec.h#L102 #else /* token threaded code */ +/* dispatcher */ +#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && __GNUC__ == 3 +#define DISPATCH_ARCH_DEPEND_WAY(addr) \ + __asm__ __volatile__("jmp *%0;\t# -- inserted by vm.h\t[length = 2]" : : "r" (addr)) + +#else +#define DISPATCH_ARCH_DEPEND_WAY(addr) \ + /* do nothing */ +#endif #define TC_DISPATCH(insn) \ DISPATCH_ARCH_DEPEND_WAY(insns_address_table[GET_CURRENT_INSN()]); \ INSN_DISPATCH_SIG(insn); \ RB_GNUC_EXTENSION_BLOCK(goto *insns_address_table[GET_CURRENT_INSN()]); \ rb_bug("tc error"); - -#endif /* DISPATCH_DIRECT_THREADED_CODE */ +#endif /* OPT_DIRECT_THREADED_CODE */ #define END_INSN(insn) \ DEBUG_END_INSN(); \ -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/