2018-12-27 01:12:09 -05:00
|
|
|
%# -*- C -*-
|
2018-09-11 05:48:58 -04:00
|
|
|
%# Copyright (c) 2018 Urabe, Shyouhei. All rights reserved.
|
|
|
|
%#
|
|
|
|
%# This file is a part of the programming language Ruby. Permission is hereby
|
|
|
|
%# granted, to either redistribute and/or modify this file, provided that the
|
|
|
|
%# conditions mentioned in the file COPYING are met. Consult the file for
|
|
|
|
%# details.
|
|
|
|
%;
|
2018-12-26 02:23:35 -05:00
|
|
|
#line <%= __LINE__ + 1 %> <%=cstr __FILE__ %>
|
2018-09-11 05:48:58 -04:00
|
|
|
|
|
|
|
#include "iseq.h"
|
|
|
|
|
2020-12-17 01:08:04 -05:00
|
|
|
// This is used to tell MJIT that this insn would be leaf if CHECK_INTS didn't exist.
|
|
|
|
// It should be used only when RUBY_VM_CHECK_INTS is directly written in insns.def.
|
|
|
|
static bool leafness_of_check_ints = false;
|
|
|
|
|
2018-09-11 05:48:58 -04:00
|
|
|
static bool
|
|
|
|
leafness_of_defined(rb_num_t op_type)
|
|
|
|
{
|
|
|
|
/* see also: vm_insnhelper.c:vm_defined() */
|
|
|
|
switch (op_type) {
|
|
|
|
case DEFINED_IVAR:
|
|
|
|
case DEFINED_GVAR:
|
|
|
|
case DEFINED_CVAR:
|
|
|
|
case DEFINED_YIELD:
|
|
|
|
case DEFINED_REF:
|
|
|
|
case DEFINED_ZSUPER:
|
|
|
|
return false;
|
|
|
|
case DEFINED_CONST:
|
2019-11-06 01:47:32 -05:00
|
|
|
case DEFINED_CONST_FROM:
|
2018-09-11 05:48:58 -04:00
|
|
|
/* has rb_autoload_load(); */
|
|
|
|
return false;
|
|
|
|
case DEFINED_FUNC:
|
|
|
|
case DEFINED_METHOD:
|
|
|
|
/* calls #respond_to_missing? */
|
|
|
|
return false;
|
|
|
|
default:
|
|
|
|
rb_bug("unknown operand %ld: blame @shyouhei.", op_type);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool
|
|
|
|
leafness_of_checkmatch(rb_num_t flag)
|
|
|
|
{
|
|
|
|
/* see also: vm_insnhelper.c:check_match() */
|
|
|
|
if (flag == VM_CHECKMATCH_TYPE_WHEN) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* has rb_funcallv() */
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2018-12-26 02:23:35 -05:00
|
|
|
#pragma RubyVM reset source
|