mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Introduce usage_analysis_clear
This commit is contained in:
parent
7bdb999d0f
commit
78748a5de2
Notes:
git
2022-08-29 14:42:42 +09:00
Merged: https://github.com/ruby/ruby/pull/6274 Merged-By: nobu <nobu@ruby-lang.org>
1 changed files with 23 additions and 26 deletions
33
vm.c
33
vm.c
|
@ -4296,23 +4296,28 @@ usage_analysis_register_running(VALUE self)
|
||||||
return RBOOL(ruby_vm_collect_usage_func_register != 0);
|
return RBOOL(ruby_vm_collect_usage_func_register != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static VALUE
|
||||||
|
usage_analysis_clear(VALUE self, ID usage_hash)
|
||||||
|
{
|
||||||
|
VALUE uh;
|
||||||
|
uh = rb_const_get(self, usage_hash);
|
||||||
|
rb_hash_clear(uh);
|
||||||
|
|
||||||
|
return Qtrue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* :nodoc: */
|
/* :nodoc: */
|
||||||
static VALUE
|
static VALUE
|
||||||
usage_analysis_insn_clear(VALUE self)
|
usage_analysis_insn_clear(VALUE self)
|
||||||
{
|
{
|
||||||
ID usage_hash;
|
ID usage_hash;
|
||||||
ID bigram_hash;
|
ID bigram_hash;
|
||||||
VALUE uh;
|
|
||||||
VALUE bh;
|
|
||||||
|
|
||||||
CONST_ID(usage_hash, "USAGE_ANALYSIS_INSN");
|
CONST_ID(usage_hash, "USAGE_ANALYSIS_INSN");
|
||||||
CONST_ID(bigram_hash, "USAGE_ANALYSIS_INSN_BIGRAM");
|
CONST_ID(bigram_hash, "USAGE_ANALYSIS_INSN_BIGRAM");
|
||||||
uh = rb_const_get(rb_cRubyVM, usage_hash);
|
usage_analysis_clear(rb_cRubyVM, usage_hash);
|
||||||
bh = rb_const_get(rb_cRubyVM, bigram_hash);
|
return usage_analysis_clear(rb_cRubyVM, bigram_hash);
|
||||||
rb_hash_clear(uh);
|
|
||||||
rb_hash_clear(bh);
|
|
||||||
|
|
||||||
return Qtrue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* :nodoc: */
|
/* :nodoc: */
|
||||||
|
@ -4320,13 +4325,9 @@ static VALUE
|
||||||
usage_analysis_operand_clear(VALUE self)
|
usage_analysis_operand_clear(VALUE self)
|
||||||
{
|
{
|
||||||
ID usage_hash;
|
ID usage_hash;
|
||||||
VALUE uh;
|
|
||||||
|
|
||||||
CONST_ID(usage_hash, "USAGE_ANALYSIS_INSN");
|
CONST_ID(usage_hash, "USAGE_ANALYSIS_INSN");
|
||||||
uh = rb_const_get(rb_cRubyVM, usage_hash);
|
return usage_analysis_clear(self, usage_hash);
|
||||||
rb_hash_clear(uh);
|
|
||||||
|
|
||||||
return Qtrue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* :nodoc: */
|
/* :nodoc: */
|
||||||
|
@ -4334,13 +4335,9 @@ static VALUE
|
||||||
usage_analysis_register_clear(VALUE self)
|
usage_analysis_register_clear(VALUE self)
|
||||||
{
|
{
|
||||||
ID usage_hash;
|
ID usage_hash;
|
||||||
VALUE uh;
|
|
||||||
|
|
||||||
CONST_ID(usage_hash, "USAGE_ANALYSIS_REGS");
|
CONST_ID(usage_hash, "USAGE_ANALYSIS_REGS");
|
||||||
uh = rb_const_get(rb_cRubyVM, usage_hash);
|
return usage_analysis_clear(self, usage_hash);
|
||||||
rb_hash_clear(uh);
|
|
||||||
|
|
||||||
return Qtrue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in a new issue