From 747487cda7b5a8c893ed8f6b0d7f7498aa434a02 Mon Sep 17 00:00:00 2001 From: ko1 Date: Mon, 15 Oct 2012 17:40:50 +0000 Subject: * vm_insnhelper.h (CI_SET_FASTPATH): add new parameter `enabled'. If `enable' is 0 then CI_SET_FASTPATH() doesn't work. And add new configuration option OPT_CALL_FASTPATH. If this macro was defined by 0, then CI_SET_FASTPATH() doesn't work any more. * vm_insnhelper.c (vm_call_method): Pass `0' for `enabled' parameter of CI_SET_FASTPATH if this method is protected. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_insnhelper.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'vm_insnhelper.h') diff --git a/vm_insnhelper.h b/vm_insnhelper.h index 7e111d1b1e..b87d8a68ae 100644 --- a/vm_insnhelper.h +++ b/vm_insnhelper.h @@ -203,9 +203,18 @@ enum vm_regan_acttype { /* set fastpath when cached method is *NOT* protected * because inline method cache does not care about receiver. */ -#define CI_SET_FASTPATH(ci, func) do { \ - if (!(((ci)->me->flag & NOEX_MASK) & NOEX_PROTECTED)) ((ci)->call = (func)); \ + +#ifndef OPT_CALL_FASTPATH +#define OPT_CALL_FASTPATH 1 +#endif + +#if OPT_CALL_FASTPATH +#define CI_SET_FASTPATH(ci, func, enabled) do { \ + if (LIKELY(enabled)) ((ci)->call = (func)); \ } while (0) +#else +#define CI_SET_FASTPATH(ci, func, enabled) /* do nothing */ +#endif #define GET_BLOCK_PTR() ((rb_block_t *)(GC_GUARDED_PTR_REF(GET_LEP()[0]))) -- cgit v1.2.3