diff options
author | Aaron Patterson <tenderlove@ruby-lang.org> | 2021-03-16 15:12:37 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2021-03-17 10:55:37 -0700 |
commit | 17bf478de14d0dd9098df65282f7f419cd792599 (patch) | |
tree | 3198984fbd2d003fdf4d6b80837d97619561c903 /insns.def | |
parent | 366e88e508de7c59d69906ad948cccd7979e932b (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.def | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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'. |