From b00f280d4b9569e7153365d7e1c522b3d6b3c6cf Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Thu, 11 Apr 2019 23:46:28 -0400 Subject: Eagerly name modules and classes * variable.c: make the hidden ivars `classpath` and `tmp_classpath` the source of truth for module and constant names. Assign to them when modules are bind to constants. * variable.c: remove references to module name cache, as what used to be the cache is now the source of truth. Remove rb_class_path_no_cache(). * variable.c: remove the hidden ivar `classid`. This existed for the purposes of module name search, which is now replaced. Also, remove the associated rb_name_class(). * class.c: use rb_set_class_path_string to set the name of Object during boot. Must use a fstring as this runs before rb_cString is initialized and creating a normal string leads to a VALUE without a class. * spec/ruby/core/module/name_spec.rb: add a few specs to specify what happens to Module#name across multiple operations. These specs pass without other code changes in this commit. [Feature #15765] --- include/ruby/intern.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/ruby') diff --git a/include/ruby/intern.h b/include/ruby/intern.h index d629d08830..bcbf8424e4 100644 --- a/include/ruby/intern.h +++ b/include/ruby/intern.h @@ -949,7 +949,6 @@ void rb_set_class_path(VALUE, VALUE, const char*); void rb_set_class_path_string(VALUE, VALUE, VALUE); VALUE rb_path_to_class(VALUE); VALUE rb_path2class(const char*); -void rb_name_class(VALUE, ID); VALUE rb_class_name(VALUE); VALUE rb_autoload_load(VALUE, ID); VALUE rb_autoload_p(VALUE, ID); -- cgit v1.2.3