Permalink
Browse files

* gc.c: add longlife garbage collection. [ruby-dev:38423]

  (NORMAL_HEAPS_USED): new macro.
  (LONGLIFE_ALLOCATE_HEAPS_MIN): ditto.
  (add_longlife_heaps_slot): new function.
  (rb_newobj_from_longlife_heap): ditto.
  (rb_newobj_longlife): ditto.
  (rb_node_newnode_longlife): ditto.
  (rb_gc_write_barrier): ditto.
  (remembered_set_recycle): ditto.
  (rb_gc_mark_remembered_set): ditto.
  (clear_mark_longlife_heaps): ditto.
  (gc_sweep_for_longlife): ditto.
  (assign_heap_slot): new argumnent to longlife heaps slot.
  (add_freelist): ditto.
  (gc_sweep): avoid lonlife heap slot. set longlife_collection
   flag at add heap.
  (rb_gc_force_recycle): avoid mark object and remembered_set
   object.
  (garbage_collect): add longlife collection.
  (rb_gc_start): invoke longlife collection.
  (gc_profile_record_get): for longlife collction profile.
  (gc_profile_result): ditto.

* include/ruby/intern.h (rb_gc_write_barrier): declared.

* include/ruby/ruby.h (FL_REMEMBERED_SET): renamed from FL_RESERVED.

* debug.c (FL_REMEMBERED_SET): ditto.

* insns.def (setinlinecache): insert write barrier.

* vm_insnhelper.c (vm_method_search): ditto.

* set_relation (set_relation): use longlife object.

* vm.c (vm_define_method): ditto.

* vm_core.h (NEW_INLINE_CACHE_ENTRY): ditto.

* vm_method.c (rb_add_method): ditto.

* class.c (rb_add_method): ditto.

* node.h (NEW_NODE_LONGLIFE): new macro.
  (rb_node_newnode_longlife): declared.
					    


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent e7ba393 commit 57b83a5191be20c49d5d4cff77582170a507cf88 @authorNari authorNari committed May 13, 2009
Showing with 333 additions and 48 deletions.
  1. +48 −0 ChangeLog
  2. +10 −8 class.c
  3. +1 −1 debug.c
  4. +248 −24 gc.c
  5. +1 −0 include/ruby/intern.h
  6. +1 −1 include/ruby/ruby.h
  7. +1 −1 insns.def
  8. +2 −2 iseq.c
  9. +2 −0 node.h
  10. +1 −1 vm.c
  11. +1 −1 vm_core.h
  12. +2 −2 vm_insnhelper.c
  13. +15 −7 vm_method.c
View
@@ -1,3 +1,51 @@
+Wed May 13 22:34:31 2009 Narihiro Nakamura <authorNari@gmail.com>
+
+ * gc.c: add longlife garbage collection. [ruby-dev:38423]
+ (NORMAL_HEAPS_USED): new macro.
+ (LONGLIFE_ALLOCATE_HEAPS_MIN): ditto.
+ (add_longlife_heaps_slot): new function.
+ (rb_newobj_from_longlife_heap): ditto.
+ (rb_newobj_longlife): ditto.
+ (rb_node_newnode_longlife): ditto.
+ (rb_gc_write_barrier): ditto.
+ (remembered_set_recycle): ditto.
+ (rb_gc_mark_remembered_set): ditto.
+ (clear_mark_longlife_heaps): ditto.
+ (gc_sweep_for_longlife): ditto.
+ (assign_heap_slot): new argumnent to longlife heaps slot.
+ (add_freelist): ditto.
+ (gc_sweep): avoid lonlife heap slot. set longlife_collection
+ flag at add heap.
+ (rb_gc_force_recycle): avoid mark object and remembered_set
+ object.
+ (garbage_collect): add longlife collection.
+ (rb_gc_start): invoke longlife collection.
+ (gc_profile_record_get): for longlife collction profile.
+ (gc_profile_result): ditto.
+
+ * include/ruby/intern.h (rb_gc_write_barrier): declared.
+
+ * include/ruby/ruby.h (FL_REMEMBERED_SET): renamed from FL_RESERVED.
+
+ * debug.c (FL_REMEMBERED_SET): ditto.
+
+ * insns.def (setinlinecache): insert write barrier.
+
+ * vm_insnhelper.c (vm_method_search): ditto.
+
+ * set_relation (set_relation): use longlife object.
+
+ * vm.c (vm_define_method): ditto.
+
+ * vm_core.h (NEW_INLINE_CACHE_ENTRY): ditto.
+
+ * vm_method.c (rb_add_method): ditto.
+
+ * class.c (rb_add_method): ditto.
+
+ * node.h (NEW_NODE_LONGLIFE): new macro.
+ (rb_node_newnode_longlife): declared.
+
Wed May 13 15:23:18 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* include/ruby/version.h: extracted the extensions interface and
View
18 class.c
@@ -88,11 +88,13 @@ clone_method(ID mid, NODE *body, struct clone_method_data *data)
}
st_insert(data->tbl, mid,
(st_data_t)
- NEW_FBODY(
- NEW_METHOD(fbody,
- data->klass, /* TODO */
- body->nd_body->nd_noex),
- 0));
+ NEW_NODE_LONGLIFE(
+ NODE_FBODY,
+ 0,
+ NEW_NODE_LONGLIFE(NODE_METHOD,
+ rb_gc_write_barrier(data->klass), /* TODO */
+ rb_gc_write_barrier(fbody),
+ body->nd_body->nd_noex), 0));
}
return ST_CONTINUE;
}
@@ -810,7 +812,7 @@ rb_define_method_id(VALUE klass, ID name, VALUE (*func)(ANYARGS), int argc)
if (func == rb_f_notimplement)
rb_define_notimplement_method_id(klass, name, NOEX_PUBLIC);
else
- rb_add_method(klass, name, NEW_CFUNC(func,argc), NOEX_PUBLIC);
+ rb_add_method(klass, name, NEW_NODE_LONGLIFE(NODE_CFUNC, func, argc, 0), NOEX_PUBLIC);
}
void
@@ -826,7 +828,7 @@ rb_define_protected_method(VALUE klass, const char *name, VALUE (*func)(ANYARGS)
if (func == rb_f_notimplement)
rb_define_notimplement_method_id(klass, id, NOEX_PROTECTED);
else
- rb_add_method(klass, id, NEW_CFUNC(func, argc), NOEX_PROTECTED);
+ rb_add_method(klass, id, NEW_NODE_LONGLIFE(NODE_CFUNC, func, argc, 0), NOEX_PROTECTED);
}
void
@@ -836,7 +838,7 @@ rb_define_private_method(VALUE klass, const char *name, VALUE (*func)(ANYARGS),
if (func == rb_f_notimplement)
rb_define_notimplement_method_id(klass, id, NOEX_PRIVATE);
else
- rb_add_method(klass, id, NEW_CFUNC(func, argc), NOEX_PRIVATE);
+ rb_add_method(klass, id, NEW_NODE_LONGLIFE(NODE_CFUNC, func, argc, 0), NOEX_PRIVATE);
}
void
View
@@ -32,7 +32,7 @@ static const union {
RUBY_ENC_CODERANGE_VALID = ENC_CODERANGE_VALID,
RUBY_ENC_CODERANGE_BROKEN = ENC_CODERANGE_BROKEN,
RUBY_FL_MARK = FL_MARK,
- RUBY_FL_RESERVED = FL_RESERVED,
+ RUBY_FL_REMENBERED_SET = FL_REMEMBERED_SET,
RUBY_FL_FINALIZE = FL_FINALIZE,
RUBY_FL_TAINT = FL_TAINT,
RUBY_FL_UNTRUSTED = FL_UNTRUSTED,
Oops, something went wrong.

0 comments on commit 57b83a5

Please sign in to comment.