diff options
author | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-21 06:25:09 +0000 |
---|---|---|
committer | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-21 06:25:09 +0000 |
commit | 52bd8f6f68a45cb990a827e4a1c276251cdf471c (patch) | |
tree | 2947a7afacab980caf8b325c9ab8d17422040f97 /vm_insnhelper.h | |
parent | a8695d5022d7afbf004765bfb86457fbb9d56457 (diff) |
Share vm_call_iseq_optimizable_p to reduce copy-paste
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.h')
-rw-r--r-- | vm_insnhelper.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/vm_insnhelper.h b/vm_insnhelper.h index c004e5ecd6..98aee9d46c 100644 --- a/vm_insnhelper.h +++ b/vm_insnhelper.h @@ -239,4 +239,13 @@ THROW_DATA_CONSUMED_SET(struct vm_throw_data *obj) #define IS_ARGS_SPLAT(ci) ((ci)->flag & VM_CALL_ARGS_SPLAT) #define IS_ARGS_KEYWORD(ci) ((ci)->flag & VM_CALL_KWARG) +/* If this returns true, an optimized function returned by `vm_call_iseq_setup_func` + can be used as a fastpath. */ +static bool +vm_call_iseq_optimizable_p(const struct rb_call_info *ci, const struct rb_call_cache *cc) +{ + return !IS_ARGS_SPLAT(ci) && !IS_ARGS_KEYWORD(ci) && + !(METHOD_ENTRY_VISI(cc->me) == METHOD_VISI_PROTECTED); +} + #endif /* RUBY_INSNHELPER_H */ |