revert r43259 because it is possible to mark miss classes defined in C-exts. Thanks charliesome.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3b0abede8e
commit
9d70a17541
@ -1,8 +1,3 @@
|
|||||||
Sat Oct 12 02:32:42 2013 Koichi Sasada <ko1@atdot.net>
|
|
||||||
|
|
||||||
* 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@atdot.net>
|
Fri Oct 11 21:05:19 2013 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* internal.h, parse.y: use `full_mark' instead of `full_marking'.
|
* internal.h, parse.y: use `full_mark' instead of `full_marking'.
|
||||||
|
5
class.c
5
class.c
@ -31,6 +31,7 @@
|
|||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
extern st_table *rb_class_tbl;
|
||||||
#define id_attached id__attached__
|
#define id_attached id__attached__
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -516,10 +517,12 @@ make_singleton_class(VALUE obj)
|
|||||||
static VALUE
|
static VALUE
|
||||||
boot_defclass(const char *name, VALUE super)
|
boot_defclass(const char *name, VALUE super)
|
||||||
{
|
{
|
||||||
|
extern st_table *rb_class_tbl;
|
||||||
VALUE obj = rb_class_boot(super);
|
VALUE obj = rb_class_boot(super);
|
||||||
ID id = rb_intern(name);
|
ID id = rb_intern(name);
|
||||||
|
|
||||||
rb_name_class(obj, id);
|
rb_name_class(obj, id);
|
||||||
|
st_add_direct(rb_class_tbl, id, obj);
|
||||||
rb_const_set((rb_cObject ? rb_cObject : obj), id, obj);
|
rb_const_set((rb_cObject ? rb_cObject : obj), id, obj);
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
@ -640,6 +643,7 @@ rb_define_class(const char *name, VALUE super)
|
|||||||
rb_warn("no super class for `%s', Object assumed", name);
|
rb_warn("no super class for `%s', Object assumed", name);
|
||||||
}
|
}
|
||||||
klass = rb_define_class_id(id, super);
|
klass = rb_define_class_id(id, super);
|
||||||
|
st_add_direct(rb_class_tbl, id, klass);
|
||||||
rb_name_class(klass, id);
|
rb_name_class(klass, id);
|
||||||
rb_const_set(rb_cObject, id, klass);
|
rb_const_set(rb_cObject, id, klass);
|
||||||
rb_class_inherited(super, klass);
|
rb_class_inherited(super, klass);
|
||||||
@ -750,6 +754,7 @@ rb_define_module(const char *name)
|
|||||||
rb_raise(rb_eTypeError, "%s is not a module", rb_obj_classname(module));
|
rb_raise(rb_eTypeError, "%s is not a module", rb_obj_classname(module));
|
||||||
}
|
}
|
||||||
module = rb_define_module_id(id);
|
module = rb_define_module_id(id);
|
||||||
|
st_add_direct(rb_class_tbl, id, module);
|
||||||
rb_const_set(rb_cObject, id, module);
|
rb_const_set(rb_cObject, id, module);
|
||||||
|
|
||||||
return module;
|
return module;
|
||||||
|
13
gc.c
13
gc.c
@ -535,6 +535,7 @@ VALUE *ruby_initial_gc_stress_ptr = &rb_objspace.gc_stress;
|
|||||||
|
|
||||||
int ruby_gc_debug_indent = 0;
|
int ruby_gc_debug_indent = 0;
|
||||||
VALUE rb_mGC;
|
VALUE rb_mGC;
|
||||||
|
extern st_table *rb_class_tbl;
|
||||||
int ruby_disable_gc_stress = 0;
|
int ruby_disable_gc_stress = 0;
|
||||||
|
|
||||||
void rb_gcdebug_print_obj_condition(VALUE obj);
|
void rb_gcdebug_print_obj_condition(VALUE obj);
|
||||||
@ -3452,7 +3453,7 @@ gc_mark_stacked_objects(rb_objspace_t *objspace)
|
|||||||
shrink_stack_chunk_cache(mstack);
|
shrink_stack_chunk_cache(mstack);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define RGENGC_PRINT_TICK 0
|
#define RGENGC_PRINT_TICK 1
|
||||||
/* the following code is only for internal tuning. */
|
/* the following code is only for internal tuning. */
|
||||||
|
|
||||||
/* Source code to use RDTSC is quoted and modified from
|
/* Source code to use RDTSC is quoted and modified from
|
||||||
@ -3573,18 +3574,13 @@ gc_marks_body(rb_objspace_t *objspace, int full_mark)
|
|||||||
th->vm->self ? rb_gc_mark(th->vm->self) : rb_vm_mark(th->vm);
|
th->vm->self ? rb_gc_mark(th->vm->self) : rb_vm_mark(th->vm);
|
||||||
|
|
||||||
MARK_CHECKPOINT;
|
MARK_CHECKPOINT;
|
||||||
rb_gc_mark(rb_cObject);
|
mark_tbl(objspace, finalizer_table);
|
||||||
|
|
||||||
MARK_CHECKPOINT;
|
MARK_CHECKPOINT;
|
||||||
mark_current_machine_context(objspace, th);
|
mark_current_machine_context(objspace, th);
|
||||||
|
|
||||||
MARK_CHECKPOINT;
|
MARK_CHECKPOINT;
|
||||||
mark_tbl(objspace, finalizer_table);
|
|
||||||
|
|
||||||
MARK_CHECKPOINT;
|
|
||||||
objspace->rgengc.parent_object_is_promoted = TRUE;
|
|
||||||
rb_gc_mark_symbols(full_mark);
|
rb_gc_mark_symbols(full_mark);
|
||||||
objspace->rgengc.parent_object_is_promoted = FALSE;
|
|
||||||
|
|
||||||
MARK_CHECKPOINT;
|
MARK_CHECKPOINT;
|
||||||
rb_gc_mark_encodings();
|
rb_gc_mark_encodings();
|
||||||
@ -3601,6 +3597,9 @@ gc_marks_body(rb_objspace_t *objspace, int full_mark)
|
|||||||
MARK_CHECKPOINT;
|
MARK_CHECKPOINT;
|
||||||
rb_gc_mark_global_tbl();
|
rb_gc_mark_global_tbl();
|
||||||
|
|
||||||
|
MARK_CHECKPOINT;
|
||||||
|
mark_tbl(objspace, rb_class_tbl);
|
||||||
|
|
||||||
/* mark generic instance variables for special constants */
|
/* mark generic instance variables for special constants */
|
||||||
MARK_CHECKPOINT;
|
MARK_CHECKPOINT;
|
||||||
rb_mark_generic_ivar_tbl();
|
rb_mark_generic_ivar_tbl();
|
||||||
|
@ -21,12 +21,14 @@
|
|||||||
#include "id.h"
|
#include "id.h"
|
||||||
|
|
||||||
st_table *rb_global_tbl;
|
st_table *rb_global_tbl;
|
||||||
|
st_table *rb_class_tbl;
|
||||||
static ID autoload, classpath, tmp_classpath, classid;
|
static ID autoload, classpath, tmp_classpath, classid;
|
||||||
|
|
||||||
void
|
void
|
||||||
Init_var_tables(void)
|
Init_var_tables(void)
|
||||||
{
|
{
|
||||||
rb_global_tbl = st_init_numtable();
|
rb_global_tbl = st_init_numtable();
|
||||||
|
rb_class_tbl = st_init_numtable();
|
||||||
CONST_ID(autoload, "__autoload__");
|
CONST_ID(autoload, "__autoload__");
|
||||||
/* __classpath__: fully qualified class path */
|
/* __classpath__: fully qualified class path */
|
||||||
CONST_ID(classpath, "__classpath__");
|
CONST_ID(classpath, "__classpath__");
|
||||||
@ -133,6 +135,9 @@ find_class_path(VALUE klass, ID preferred)
|
|||||||
if (RCLASS_CONST_TBL(rb_cObject)) {
|
if (RCLASS_CONST_TBL(rb_cObject)) {
|
||||||
st_foreach_safe(RCLASS_CONST_TBL(rb_cObject), fc_i, (st_data_t)&arg);
|
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) {
|
if (arg.path) {
|
||||||
st_data_t tmp = tmp_classpath;
|
st_data_t tmp = tmp_classpath;
|
||||||
if (!RCLASS_IV_TBL(klass)) {
|
if (!RCLASS_IV_TBL(klass)) {
|
||||||
|
@ -105,13 +105,15 @@ rb_gc_mark_unlinked_live_method_entries(void *pvm)
|
|||||||
{
|
{
|
||||||
rb_vm_t *vm = pvm;
|
rb_vm_t *vm = pvm;
|
||||||
struct unlinked_method_entry_list_entry *ume = vm->unlinked_method_entry_list;
|
struct unlinked_method_entry_list_entry *ume = vm->unlinked_method_entry_list;
|
||||||
|
int i=0;
|
||||||
|
|
||||||
while (ume) {
|
while (ume) {
|
||||||
if (ume->me->mark) {
|
if (ume->me->mark) {
|
||||||
rb_mark_method_entry(ume->me);
|
rb_mark_method_entry(ume->me);
|
||||||
}
|
}
|
||||||
ume = ume->next;
|
ume = ume->next; i++;
|
||||||
}
|
}
|
||||||
|
fprintf(stderr, "rb_gc_mark_unlinked_live_method_entries: %d entries\n", i);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user