[前][次][番号順一覧][スレッド一覧]

ruby-changes:63349

From: Koichi <ko1@a...>
Date: Wed, 14 Oct 2020 23:15:47 +0900 (JST)
Subject: [ruby-changes:63349] 278450de80 (master): ruby_vm_global_method_state is no longer needed.

https://git.ruby-lang.org/ruby.git/commit/?id=278450de80

From 278450de803c59137fff69c4db03cd40c5b5d08a Mon Sep 17 00:00:00 2001
From: Koichi Sasada <ko1@a...>
Date: Wed, 14 Oct 2020 16:09:33 +0900
Subject: ruby_vm_global_method_state is no longer needed.

Now ruby_vm_global_method_state is not used so let's remove it.

diff --git a/test/ruby/test_rubyvm.rb b/test/ruby/test_rubyvm.rb
index 7673d8d..67d46e2 100644
--- a/test/ruby/test_rubyvm.rb
+++ b/test/ruby/test_rubyvm.rb
@@ -4,11 +4,11 @@ require 'test/unit' https://github.com/ruby/ruby/blob/trunk/test/ruby/test_rubyvm.rb#L4
 class TestRubyVM < Test::Unit::TestCase
   def test_stat
     assert_kind_of Hash, RubyVM.stat
-    assert_kind_of Integer, RubyVM.stat[:global_method_state]
+    assert_kind_of Integer, RubyVM.stat[:global_constant_state]
 
     RubyVM.stat(stat = {})
     assert_not_empty stat
-    assert_equal stat[:global_method_state], RubyVM.stat(:global_method_state)
+    assert_equal stat[:global_constant_state], RubyVM.stat(:global_constant_state)
   end
 
   def test_stat_unknown
diff --git a/vm.c b/vm.c
index 9535205..77a0659 100644
--- a/vm.c
+++ b/vm.c
@@ -385,7 +385,6 @@ rb_event_flag_t ruby_vm_event_flags; https://github.com/ruby/ruby/blob/trunk/vm.c#L385
 rb_event_flag_t ruby_vm_event_enabled_global_flags;
 unsigned int    ruby_vm_event_local_num;
 
-rb_serial_t ruby_vm_global_method_state = 1;
 rb_serial_t ruby_vm_global_constant_state = 1;
 rb_serial_t ruby_vm_class_serial = 1;
 
@@ -456,7 +455,6 @@ rb_dtrace_setup(rb_execution_context_t *ec, VALUE klass, ID id, https://github.com/ruby/ruby/blob/trunk/vm.c#L455
  *  This hash includes information about method/constant cache serials:
  *
  *    {
- *      :global_method_state=>251,
  *      :global_constant_state=>481,
  *      :class_serial=>9029
  *    }
@@ -470,7 +468,7 @@ rb_dtrace_setup(rb_execution_context_t *ec, VALUE klass, ID id, https://github.com/ruby/ruby/blob/trunk/vm.c#L468
 static VALUE
 vm_stat(int argc, VALUE *argv, VALUE self)
 {
-    static VALUE sym_global_method_state, sym_global_constant_state, sym_class_serial;
+    static VALUE sym_global_constant_state, sym_class_serial;
     VALUE arg = Qnil;
     VALUE hash = Qnil, key = Qnil;
 
@@ -487,9 +485,8 @@ vm_stat(int argc, VALUE *argv, VALUE self) https://github.com/ruby/ruby/blob/trunk/vm.c#L485
 	hash = rb_hash_new();
     }
 
-    if (sym_global_method_state == 0) {
+    if (sym_global_constant_state == 0) {
 #define S(s) sym_##s = ID2SYM(rb_intern_const(#s))
-	S(global_method_state);
 	S(global_constant_state);
 	S(class_serial);
 #undef S
@@ -501,7 +498,6 @@ vm_stat(int argc, VALUE *argv, VALUE self) https://github.com/ruby/ruby/blob/trunk/vm.c#L498
     else if (hash != Qnil) \
 	rb_hash_aset(hash, sym_##name, SERIALT2NUM(attr));
 
-    SET(global_method_state, ruby_vm_global_method_state);
     SET(global_constant_state, ruby_vm_global_constant_state);
     SET(class_serial, ruby_vm_class_serial);
 #undef SET
diff --git a/vm_insnhelper.h b/vm_insnhelper.h
index 40c3225..11785a5 100644
--- a/vm_insnhelper.h
+++ b/vm_insnhelper.h
@@ -14,7 +14,6 @@ https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.h#L14
 RUBY_SYMBOL_EXPORT_BEGIN
 
 RUBY_EXTERN VALUE ruby_vm_const_missing_count;
-RUBY_EXTERN rb_serial_t ruby_vm_global_method_state;
 RUBY_EXTERN rb_serial_t ruby_vm_global_constant_state;
 RUBY_EXTERN rb_serial_t ruby_vm_class_serial;
 
@@ -178,8 +177,6 @@ CC_SET_FASTPATH(const struct rb_callcache *cc, vm_call_handler func, bool enable https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.h#L177
 
 #define PREV_CLASS_SERIAL() (ruby_vm_class_serial)
 #define NEXT_CLASS_SERIAL() (++ruby_vm_class_serial)
-#define GET_GLOBAL_METHOD_STATE() (ruby_vm_global_method_state)
-#define INC_GLOBAL_METHOD_STATE() (++ruby_vm_global_method_state)
 #define GET_GLOBAL_CONSTANT_STATE() (ruby_vm_global_constant_state)
 #define INC_GLOBAL_CONSTANT_STATE() (++ruby_vm_global_constant_state)
 
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]