summaryrefslogtreecommitdiff
path: root/vm_insnhelper.h
diff options
context:
space:
mode:
Diffstat (limited to 'vm_insnhelper.h')
-rw-r--r--vm_insnhelper.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/vm_insnhelper.h b/vm_insnhelper.h
index 286bc1f671..3b0958d2e1 100644
--- a/vm_insnhelper.h
+++ b/vm_insnhelper.h
@@ -58,6 +58,19 @@ RUBY_EXTERN rb_serial_t ruby_vm_global_cvar_state;
VM_REG_CFP = ec->cfp; \
} while (0)
+typedef enum call_type {
+ CALL_PUBLIC,
+ CALL_FCALL,
+ CALL_VCALL,
+ CALL_PUBLIC_KW,
+ CALL_FCALL_KW
+} call_type;
+
+struct rb_forwarding_call_data {
+ struct rb_call_data cd;
+ CALL_INFO caller_ci;
+};
+
#if VM_COLLECT_USAGE_DETAILS
enum vm_regan_regtype {
VM_REGAN_PC = 0,
@@ -250,8 +263,8 @@ THROW_DATA_CONSUMED_SET(struct vm_throw_data *obj)
static inline bool
vm_call_cacheable(const struct rb_callinfo *ci, const struct rb_callcache *cc)
{
- return (vm_ci_flag(ci) & VM_CALL_FCALL) ||
- METHOD_ENTRY_VISI(vm_cc_cme(cc)) != METHOD_VISI_PROTECTED;
+ return !(vm_ci_flag(ci) & VM_CALL_FORWARDING) && ((vm_ci_flag(ci) & VM_CALL_FCALL) ||
+ METHOD_ENTRY_VISI(vm_cc_cme(cc)) != METHOD_VISI_PROTECTED);
}
/* If this returns true, an optimized function returned by `vm_call_iseq_setup_func`
can be used as a fastpath. */