diff --git a/ChangeLog b/ChangeLog index 90f81752a6..8a9cabdb04 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun Sep 28 12:36:09 2008 Koichi Sasada + + * vm_exec.c (vm_exec_core): add an UNLIKELY() hint. + + * vm_insnhelper.h (BASIC_OP_UNREDEFINED_P): add a LIKELY() hint. + Sun Sep 28 12:04:18 2008 Nobuyoshi Nakada * string.c (str_new): sets empty string to coderange 7bit. diff --git a/vm_exec.c b/vm_exec.c index 392fde0cf7..fc04fc6a1d 100644 --- a/vm_exec.c +++ b/vm_exec.c @@ -83,7 +83,7 @@ vm_exec_core(rb_thread_t *th, VALUE initial) #if OPT_TOKEN_THREADED_CODE || OPT_DIRECT_THREADED_CODE #include "vmtc.inc" - if (th == 0) { + if (UNLIKELY(th == 0)) { #if OPT_STACK_CACHING finish_insn_seq[0] = (VALUE)&&LABEL (finish_SC_ax_ax); #else diff --git a/vm_insnhelper.h b/vm_insnhelper.h index 6e931e1622..1d2bdafdad 100644 --- a/vm_insnhelper.h +++ b/vm_insnhelper.h @@ -180,7 +180,7 @@ extern VALUE ruby_vm_redefined_flag; /* optimize insn */ #define FIXNUM_2_P(a, b) ((a) & (b) & 1) -#define BASIC_OP_UNREDEFINED_P(op) ((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 #define CALL_SIMPLE_METHOD(num, id, recv) do { \