diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-03-17 10:26:39 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-03-17 10:26:39 +0000 |
commit | 0db407836bf7871fdee9e32357bd90c3ddaa1e11 (patch) | |
tree | 87c71dde9cbf1b7c459188aea837c0d6e89f4676 /include | |
parent | 40c9281107d6239eb63b6903bd445f5aad709357 (diff) | |
download | ruby-0db407836bf7871fdee9e32357bd90c3ddaa1e11.tar.gz |
* include/ruby/ruby.h: use rb_gc_writebrrier() simply.
For incremental GC, we need to get a pointer to the objspace.
We can share this pointer for the following WB process.
And considering icache hit ratio, prcess in the GC.
* gc.c (rb_gc_writebarrier): added.
* gc.c (gc_writebarrier_generational, gc_writebarrier_incremental):
make them NOINLINE because inlining them into rb_gc_writebarrier()
makes a prologue code of rb_gc_writebarrier() longer (storing callee
save registers).
This patch improve the performance of WB on micro-benchmarks.
name ruby 2.1 trunk modified
vm1_gc_wb_ary* 0.511 0.632 0.532
vm1_gc_wb_ary_promoted* 0.578 0.701 0.674
vm1_gc_wb_obj* 0.419 0.575 0.492
vm1_gc_wb_obj_promoted* 0.537 0.664 0.618
(sec)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r-- | include/ruby/ruby.h | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 351766a111..6a370bd118 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -1214,12 +1214,7 @@ rb_data_object_get_warning(VALUE obj) #define OBJ_PROMOTED(x) (SPECIAL_CONST_P(x) ? 0 : OBJ_PROMOTED_RAW(x)) #define OBJ_WB_UNPROTECT(x) rb_obj_wb_unprotect(x, __FILE__, __LINE__) -#if USE_RINCGC -int rb_gc_writebarrier_incremental(VALUE a, VALUE b); -#else -#define rb_gc_writebarrier_incremental(a, b) 0 -#endif -void rb_gc_writebarrier_generational(VALUE a, VALUE b); +void rb_gc_writebarrier(VALUE a, VALUE b); void rb_gc_writebarrier_unprotect(VALUE obj); #else /* USE_RGENGC */ @@ -1271,11 +1266,7 @@ rb_obj_written(VALUE a, RB_UNUSED_VAR(VALUE oldv), VALUE b, RB_UNUSED_VAR(const #if USE_RGENGC if (!SPECIAL_CONST_P(b)) { - if (rb_gc_writebarrier_incremental(a, b) == 0) { - if (OBJ_PROMOTED_RAW(a) && !OBJ_PROMOTED_RAW(b)) { - rb_gc_writebarrier_generational(a, b); - } - } + rb_gc_writebarrier(a, b); } #endif |