summaryrefslogtreecommitdiff
path: root/insns.def
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2021-03-16 15:12:37 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2021-03-17 10:55:37 -0700
commit17bf478de14d0dd9098df65282f7f419cd792599 (patch)
tree3198984fbd2d003fdf4d6b80837d97619561c903 /insns.def
parent366e88e508de7c59d69906ad948cccd7979e932b (diff)
Store strings for `defined` in the iseqs
We can know the string used for "defined" calls at compile time, then store the string in the instruction sequences
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4279
Diffstat (limited to 'insns.def')
-rw-r--r--insns.def7
1 files changed, 6 insertions, 1 deletions
diff --git a/insns.def b/insns.def
index e3c7ad5e7b..55564c4792 100644
--- a/insns.def
+++ b/insns.def
@@ -667,7 +667,12 @@ defined
(VALUE val)
// attr bool leaf = leafness_of_defined(op_type);
{
- val = vm_defined(ec, GET_CFP(), op_type, obj, needstr, v);
+ if (vm_defined(ec, GET_CFP(), op_type, obj, Qfalse, v)) {
+ val = needstr;
+ }
+ else {
+ val = Qnil;
+ }
}
/* check `target' matches `pattern'.