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

ruby-changes:31180

From: ko1 <ko1@a...>
Date: Sat, 12 Oct 2013 02:33:51 +0900 (JST)
Subject: [ruby-changes:31180] ko1:r43259 (trunk): * class.c, variable.c, gc.c (rb_class_tbl): removed.

ko1	2013-10-12 02:33:44 +0900 (Sat, 12 Oct 2013)

  New Revision: 43259

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43259

  Log:
    * class.c, variable.c, gc.c (rb_class_tbl): removed.
      rb_class_tbl is no longer used.

  Modified files:
    trunk/ChangeLog
    trunk/class.c
    trunk/gc.c
    trunk/variable.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43258)
+++ ChangeLog	(revision 43259)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Oct 12 02:32:42 2013  Koichi Sasada  <ko1@a...>
+
+	* class.c, variable.c, gc.c (rb_class_tbl): removed.
+	  rb_class_tbl is no longer used.
+
 Fri Oct 11 21:05:19 2013  Koichi Sasada  <ko1@a...>
 
 	* internal.h, parse.y: use `full_mark' instead of `full_marking'.
Index: variable.c
===================================================================
--- variable.c	(revision 43258)
+++ variable.c	(revision 43259)
@@ -21,14 +21,12 @@ https://github.com/ruby/ruby/blob/trunk/variable.c#L21
 #include "id.h"
 
 st_table *rb_global_tbl;
-st_table *rb_class_tbl;
 static ID autoload, classpath, tmp_classpath, classid;
 
 void
 Init_var_tables(void)
 {
     rb_global_tbl = st_init_numtable();
-    rb_class_tbl = st_init_numtable();
     CONST_ID(autoload, "__autoload__");
     /* __classpath__: fully qualified class path */
     CONST_ID(classpath, "__classpath__");
@@ -135,9 +133,6 @@ find_class_path(VALUE klass, ID preferre https://github.com/ruby/ruby/blob/trunk/variable.c#L133
     if (RCLASS_CONST_TBL(rb_cObject)) {
 	st_foreach_safe(RCLASS_CONST_TBL(rb_cObject), fc_i, (st_data_t)&arg);
     }
-    if (arg.path == 0) {
-	st_foreach_safe(rb_class_tbl, fc_i, (st_data_t)&arg);
-    }
     if (arg.path) {
 	st_data_t tmp = tmp_classpath;
 	if (!RCLASS_IV_TBL(klass)) {
Index: gc.c
===================================================================
--- gc.c	(revision 43258)
+++ gc.c	(revision 43259)
@@ -535,7 +535,6 @@ VALUE *ruby_initial_gc_stress_ptr = &rb_ https://github.com/ruby/ruby/blob/trunk/gc.c#L535
 
 int ruby_gc_debug_indent = 0;
 VALUE rb_mGC;
-extern st_table *rb_class_tbl;
 int ruby_disable_gc_stress = 0;
 
 void rb_gcdebug_print_obj_condition(VALUE obj);
@@ -3574,13 +3573,18 @@ gc_marks_body(rb_objspace_t *objspace, i https://github.com/ruby/ruby/blob/trunk/gc.c#L3573
     th->vm->self ? rb_gc_mark(th->vm->self) : rb_vm_mark(th->vm);
 
     MARK_CHECKPOINT;
-    mark_tbl(objspace, finalizer_table);
+    rb_gc_mark(rb_cObject);
 
     MARK_CHECKPOINT;
     mark_current_machine_context(objspace, th);
 
     MARK_CHECKPOINT;
+    mark_tbl(objspace, finalizer_table);
+
+    MARK_CHECKPOINT;
+    objspace->rgengc.parent_object_is_promoted = TRUE;
     rb_gc_mark_symbols(full_mark);
+    objspace->rgengc.parent_object_is_promoted = FALSE;
 
     MARK_CHECKPOINT;
     rb_gc_mark_encodings();
@@ -3597,9 +3601,6 @@ gc_marks_body(rb_objspace_t *objspace, i https://github.com/ruby/ruby/blob/trunk/gc.c#L3601
     MARK_CHECKPOINT;
     rb_gc_mark_global_tbl();
 
-    MARK_CHECKPOINT;
-    mark_tbl(objspace, rb_class_tbl);
-
     /* mark generic instance variables for special constants */
     MARK_CHECKPOINT;
     rb_mark_generic_ivar_tbl();
Index: class.c
===================================================================
--- class.c	(revision 43258)
+++ class.c	(revision 43259)
@@ -31,7 +31,6 @@ https://github.com/ruby/ruby/blob/trunk/class.c#L31
 #include "internal.h"
 #include <ctype.h>
 
-extern st_table *rb_class_tbl;
 #define id_attached id__attached__
 
 void
@@ -517,12 +516,10 @@ make_singleton_class(VALUE obj) https://github.com/ruby/ruby/blob/trunk/class.c#L516
 static VALUE
 boot_defclass(const char *name, VALUE super)
 {
-    extern st_table *rb_class_tbl;
     VALUE obj = rb_class_boot(super);
     ID id = rb_intern(name);
 
     rb_name_class(obj, id);
-    st_add_direct(rb_class_tbl, id, obj);
     rb_const_set((rb_cObject ? rb_cObject : obj), id, obj);
     return obj;
 }
@@ -643,7 +640,6 @@ rb_define_class(const char *name, VALUE https://github.com/ruby/ruby/blob/trunk/class.c#L640
 	rb_warn("no super class for `%s', Object assumed", name);
     }
     klass = rb_define_class_id(id, super);
-    st_add_direct(rb_class_tbl, id, klass);
     rb_name_class(klass, id);
     rb_const_set(rb_cObject, id, klass);
     rb_class_inherited(super, klass);
@@ -754,7 +750,6 @@ rb_define_module(const char *name) https://github.com/ruby/ruby/blob/trunk/class.c#L750
 	rb_raise(rb_eTypeError, "%s is not a module", rb_obj_classname(module));
     }
     module = rb_define_module_id(id);
-    st_add_direct(rb_class_tbl, id, module);
     rb_const_set(rb_cObject, id, module);
 
     return module;

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

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