summaryrefslogtreecommitdiff
path: root/vm_callinfo.h
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-05-29 15:20:57 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2020-06-09 09:52:46 +0900
commit77293cef91a9aa424c086ae05f03211d9a8a87d3 (patch)
tree2aa46363231bbd9ec07a086d07695e1a44b63b8e /vm_callinfo.h
parent3928c151a63b273ff10feb43906d6590c6592d1a (diff)
downloadruby-77293cef91a9aa424c086ae05f03211d9a8a87d3.tar.gz
vm_ci_markable: added
CIs are created on-the-fly, which increases GC pressure. However they include no references to other objects, and those on-the-fly CIs tend to be short lived. Why not skip allocation of them. In doing so we need to add a flag denotes the CI object does not reside inside of objspace.
Diffstat (limited to 'vm_callinfo.h')
-rw-r--r--vm_callinfo.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/vm_callinfo.h b/vm_callinfo.h
index e938092926..14027fc112 100644
--- a/vm_callinfo.h
+++ b/vm_callinfo.h
@@ -229,6 +229,23 @@ vm_ci_new_runtime_(ID mid, unsigned int flag, unsigned int argc, const struct rb
return vm_ci_new_(mid, flag, argc, kwarg, file, line);
}
+#define VM_CALLINFO_NOT_UNDER_GC IMEMO_FL_USER0
+
+static inline bool
+vm_ci_markable(const struct rb_callinfo *ci)
+{
+ if (! ci) {
+ return false; /* or true? This is Qfalse... */
+ }
+ else if (vm_ci_packed_p(ci)) {
+ return true;
+ }
+ else {
+ VM_ASSERT(IMEMO_TYPE_P(ci, imemo_callinfo));
+ return ! FL_ANY_RAW((VALUE)ci, VM_CALLINFO_NOT_UNDER_GC);
+ }
+}
+
typedef VALUE (*vm_call_handler)(
struct rb_execution_context_struct *ec,
struct rb_control_frame_struct *cfp,