Stop calling rb_iseq_defined_string
in vm_defined
We already have access to the string from the iseqs, so we can stop calling this function.
This commit is contained in:
parent
17bf478de1
commit
c3971bea33
Notes:
git
2021-03-18 02:56:05 +09:00
@ -667,7 +667,7 @@ defined
|
|||||||
(VALUE val)
|
(VALUE val)
|
||||||
// attr bool leaf = leafness_of_defined(op_type);
|
// attr bool leaf = leafness_of_defined(op_type);
|
||||||
{
|
{
|
||||||
if (vm_defined(ec, GET_CFP(), op_type, obj, Qfalse, v)) {
|
if (vm_defined(ec, GET_CFP(), op_type, obj, v)) {
|
||||||
val = needstr;
|
val = needstr;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -3986,7 +3986,7 @@ check_respond_to_missing(VALUE obj, VALUE v)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
vm_defined(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, rb_num_t op_type, VALUE obj, VALUE needstr, VALUE v)
|
vm_defined(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, rb_num_t op_type, VALUE obj, VALUE v)
|
||||||
{
|
{
|
||||||
VALUE klass;
|
VALUE klass;
|
||||||
enum defined_type expr_type = DEFINED_NOT_DEFINED;
|
enum defined_type expr_type = DEFINED_NOT_DEFINED;
|
||||||
@ -4081,15 +4081,10 @@ vm_defined(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, rb_num_t op_
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (expr_type != 0) {
|
if (expr_type != 0) {
|
||||||
if (needstr != Qfalse) {
|
return Qtrue;
|
||||||
return rb_iseq_defined_string(expr_type);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return Qtrue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return Qnil;
|
return Qfalse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user