aboutsummaryrefslogtreecommitdiffstats
path: root/gc.c
Commit message (Collapse)AuthorAgeFilesLines
* gc.c: fix commit miss r54145nobu2016-03-181-1/+1
| | | | | | * gc.c (tick): fix missing close parenthesis. [Fix GH-1291] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: tick for POWER archnobu2016-03-171-0/+12
| | | | | | | | | | | | | * gc.c (tick): Use __builtin_ppc_get_timebase for POWER arch. [Fix GH-1291] This gives a little performance improvement user system total real Before: 20.870000 0.000000 20.870000 ( 20.893959) After: 20.720000 0.000000 20.720000 ( 20.733970) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: mark_stack_locationsnobu2016-03-151-11/+12
| | | | | | | * gc.c (mark_stack_locations): extract the common part from mark_current_machine_context and rb_gc_mark_machine_stack. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: rb_objspace_ofnobu2016-03-151-7/+9
| | | | | | * gc.c (rb_objspace_of): macro to get the objspace from a thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: expand a local macronobu2016-03-151-10/+14
| | | | | | | * gc.c (mark_current_machine_context, rb_gc_mark_machine_stack): expand rb_gc_mark_locations local macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: use 2 bits with unsigned int for rb_objspace::flags::modeko12016-03-041-3/+3
| | | | | | | because it always returns 0 to 2 (non-negative value). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: rename "enum gc_stat" to "enum gc_mode"ko12016-03-041-20/+51
| | | | | | | | | | | | | | | | | | | | because there is a same name (no related) function gc_stat(). Also gc_stat_* are renamed to gc_mode_*, gc_stat_transition() to gc_mode_transition(), rb_objspace::flags::stat is renamed to rb_objspace::flags::mode. Change rb_objspace::flags::mode from 2 bits to 3 bits because VC++ returns negative enum value with 2 bits. * gc.c (gc_mode): add a macro to access rb_objspace::flags::mode with verification code (verification is enabled only on RGENGC_CHECK_MODE > 0). * gc.c (gc_mode_set): same macro for setter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c: Introduce RREGEXP_PTR.naruse2016-02-021-2/+2
| | | | | | | | | | | | | | | | | patch by dbussink. partially merge https://github.com/ruby/ruby/pull/497 * include/ruby/ruby.h: ditto. * gc.c: ditto. * ext/strscan/strscan.c: ditto. * parse.y: ditto. * string.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Macro typonobu2016-01-251-1/+1
| | | | | | | * gc.c (RVALUE_PAGE_WB_UNPROTECTED): fix a typo of argument name. [Fix GH-1221] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* RUBY_ASSERTnobu2016-01-221-1/+1
| | | | | | | * error.c (rb_assert_failure): assertion with stack dump. * ruby_assert.h (RUBY_ASSERT): new header for the assertion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: rename PAGE_* to HEAP_PAGE_* because PAGE_SIZE is usedko12016-01-081-40/+40
| | | | | | | | | in Mac OS X. * test/ruby/test_gc.rb: catch up this fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: PAGE_BITMAP_PLANES (the number of bitmap) is 4, not 3.ko12016-01-081-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: rename constant names HEAP_* to PAGE_*.ko12016-01-081-40/+40
| | | | | | | | | Keys of GC::INTERNAL_CONSTANTS are also renamed. * test/ruby/test_gc.rb: catch up this fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: remove heap_page::body. Instead of this field,ko12016-01-081-19/+14
| | | | | | | heap_page::start field works well. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: rename rb_heap_t::page_length to rb_heap_t::total_pages.ko12016-01-081-19/+19
| | | | | | | | | `page_length' is not clear (we may understand with length of a page). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: remove heap_page::heap. This field is only used to recognizeko12016-01-081-7/+6
| | | | | | | | | | | | | whether a page is in a tomb or not. Instead of this field, heap_page::flags::in_tomb (1 bit field) is added. Also type of heap_page::(total|free|final)_slots are changed from int to short. 2B is enough for them. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use id_table for constant tablesnormal2015-12-291-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | valgrind 3.9.0 on x86-64 reports a minor reduction in memory usage when loading only RubyGems and RDoc by running: ruby -rrdoc -eexit before: HEAP SUMMARY: in use at exit: 2,913,448 bytes in 27,394 blocks total heap usage: 48,362 allocs, 20,968 frees, 9,034,621 bytes alloc after: HEAP SUMMARY: in use at exit: 2,880,056 bytes in 26,712 blocks total heap usage: 47,791 allocs, 21,079 frees, 9,046,507 bytes alloc * class.c (struct clone_const_arg): adjust for id_table (clone_const): ditto (clone_const_i): ditto (rb_mod_init_copy): ditto (rb_singleton_class_clone_and_attach): ditto (rb_include_class_new): ditto (include_modules_at): ditto * constant.h (rb_free_const_table): ditto * gc.c (free_const_entry_i): ditto (rb_free_const_table): ditto (obj_memsize_of): ditto (mark_const_entry_i): ditto (mark_const_tbl): ditto * internal.h (struct rb_classext_struct): ditto * object.c (rb_mod_const_set): resolve class name on assignment * variable.c (const_update): replace with const_tbl_update (const_tbl_update): new function (fc_i): adjust for id_table (find_class_path): ditto (autoload_const_set): st_update => const_tbl_update (rb_const_remove): adjust for id_table (sv_i): ditto (rb_local_constants_i): ditto (rb_local_constants): ditto (rb_mod_const_at): ditto (rb_mod_const_set): ditto (rb_const_lookup): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: do not expose internal singleton classnobu2015-12-221-0/+6
| | | | | | | | | * gc.c (internal_object_p): should not expose singleton classes without a metaclass. based on patches by ko1 and shugo. [Bug #11740] * class.c (rb_singleton_class_object_p): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* revert r53228 because this patch breaks rubyspecko12015-12-211-7/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (internal_object_p): should not expose singleton classesko12015-12-211-0/+7
| | | | | | | | | | | | | | without a metaclass. [Bug #11740] * class.c (rb_singleton_class_has_metaclass_p): added. * test/ruby/test_class.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: Delete excess semicolon after RUBY_ALIAS_FUNCTION().ngoto2015-12-151-2/+2
| | | | | | | | | | Suppress "syntax error: empty declaration" warnings by Oracle Solaris Studio 12.x on Solaris. [Bug #11821] * hash.c: ditto, after NOINSERT_UPDATE_CALLBACK(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c: fix typos.hsbt2015-12-141-2/+2
| | | | | | | | | | | | | [ci skip][fix GH-1140] Patch by @jutaz * dir.c: ditto. * gc.c: ditto. * io.c: ditto. * node.h: ditto. * thread_pthread.c: ditto. * vm_insnhelper.c: ditto. * vsnprintf.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_mark_stacked_objects): fix typo.ko12015-12-091-2/+2
| | | | | | | | | reported by XIE Zhibang. [Bug #11763] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * *.c (*_memsize): do not check ptr.ko12015-12-091-1/+0
| | | | | | | | | | NULL checking is finished Before call of memsize functions. See r52979. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: NULL check at memsizenobu2015-12-081-5/+7
| | | | | | | | * gc.c (rb_objspace_data_type_memsize): consider NULL data uses no memory without calling dsize function as well as other functions. fix SEGV in test/objspace with RUBY_ISEQ_DUMP_DEBUG=to_binary. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* make local symbols staticnobu2015-12-081-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_raw_obj_info): fix compile errors when USE_RGENGCodaira2015-11-221-3/+10
| | | | | | is 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_start): force to invoke GC by GC.startko12015-11-191-2/+2
| | | | | | | | | | | even if it is GC.disable'd. * test/ruby/test_gc.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: trivial performance improvements.ko12015-11-191-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | name modified vm1_gc_short_lived* 1.015 vm1_gc_short_with_complex_long* 1.014 vm1_gc_short_with_long* 1.000 vm1_gc_short_with_symbol* 1.016 vm1_gc_wb_ary* 1.002 vm1_gc_wb_ary_promoted* 0.996 vm1_gc_wb_obj* 1.045 vm1_gc_wb_obj_promoted* 1.014 vm3_gc 1.021 * gc.c (gc_writebarrier_generational): reorder parameters to optimize register passing function call. * gc.c (gc_writebarrier_incremental): ditto. * gc.c (rb_gc_writebarrier): remove LIKELY(). LIKELY() seems to move related functions not better places. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: use BUILTIN_TYPEnobu2015-11-181-1/+1
| | | | | | | * gc.c (rb_raw_obj_info): BUILTIN_TYPE works fro non-special_const objects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_raw_obj_info): fix trivial issues.ko12015-11-181-87/+95
| | | | | | | | | | * support SPECIAL_CONSTs. * fix IMEMO/ment outputs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* internal.h: RUBY_DTRACE_HOOKnobu2015-10-311-12/+6
| | | | | | | | | | | * internal.h (RUBY_DTRACE_HOOK): extract from RUBY_DTRACE_CREATE_HOOK for other type hooks. * gc.c (RUBY_DTRACE_GC_HOOK): ditto. * parse.y (RUBY_DTRACE_PARSE_HOOK): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use rb_source_loc and rb_source_locationnobu2015-10-311-2/+1
| | | | | | | | | * error.c, eval.c, eval_error.c, gc.c, variable.c, vm.c, vm_eval.c, vm_trace.c: use rb_source_loc/rb_source_location instead of combination of rb_sourcefile/rb_sourcefilename and rb_sourceline. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (newobj_slowpath): do not need to use flags hack (commit miss).ko12015-10-301-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (heap_get_freeobj_from_next_freepage): not so UNLIKELY.ko12015-10-301-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (newobj_slowpath): reduce 1 parameter to use only registersko12015-10-301-16/+33
| | | | | | | | | | | | for performance. On my laptop, 'N.times{x = []}' (where N = 29_000_000) is 1.86 sec -> 1.74 sec. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_mark_ptr): specify NOINLINE so that gc_mark() can returnko12015-10-291-0/+2
| | | | | | | | | immediately when obj is not a markable object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: separate event hook call from newobj_initnobu2015-10-291-6/+5
| | | | | | | | | | * gc.c (newobj_init): separate event hook call and remove the argument for it. * gc.c (newobj_slowpath): call event hook after initialized the new object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_imemo_new): should not pass FL_WB_PROTECTED flag.ko12015-10-291-1/+3
| | | | | | | | | | | * gc.c (rb_wb_protected_newobj_of): add more assertions. * gc.c (rb_wb_unprotected_newobj_of): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: introduce rb_wb_unprotected_newobj_of() andko12015-10-291-18/+32
| | | | | | | | | | | | | | | | rb_wb_protected_newobj_of(), pass the WB_PROTECTED information explicitly. * internal.h: use introduced functions by NEWOBJ_OF(). `flag' is immediate value, so that C compilers can solve them at compile time. * include/ruby/ruby.h: add a commnent about that. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: fix UNLIKELY usagenobu2015-10-291-3/+3
| | | | | | | | | * gc.c (gc_event_hook_needed_p): UNLIKELY makes no sense for boolean flag value. * gc.c (gc_event_hook, newobj_init): use in conditions instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: add rb_objspace::flags::has_hook to represent hook availability.ko12015-10-291-7/+11
| | | | | | | | | | | | | | | | | * gc.c: add gc_event_hook_available_p(objspace) to check that flag. * gc.c (newobj_of): use gc_event_hook_available_p() instead of checking gc_event_hook_needed_p(objspace, RUBY_INTERNAL_EVENT_NEWOBJ). for performance. * gc.c (newobj_init): add UNLIKELY() for FL_WB_PROTECTED flag. * gc.c (newobj_init): change parameters order (trivial change). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_mark_ptr): remove debug code for #11244.ko12015-10-291-11/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* revert r52336 (commit miss)ko12015-10-291-0/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (gc_mark_ptr): remove debug code for #11244.ko12015-10-291-11/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c: Good-by Borland-C.kosaki2015-10-181-2/+2
| | | | | | | | | | | | | | | | * include/ruby/backward/rubyio.h: ditto. * include/ruby/backward/st.h: ditto. * include/ruby/backward/util.h: ditto. * include/ruby/backward/rubysig.h: ditto. * include/ruby/backward/classext.h: ditto. * dln.c: ditto. * gc.c: ditto. * win32/resource.rb: ditto. * win32/dir.h: ditto. * ext/tk/tcltklib.c: ditto. * NEWS: announce that Borland-C is no longer supported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dln.c: simplify #ifdef. _WIN32 and __CYGWIN__ are exclusive.kosaki2015-10-181-2/+2
| | | | | | | | see include/ruby/defines.h * gc.c: ditto. * ext/sdbm/_sdbm.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (newobj_of_slowpass): fix typo (pass -> path).ko12015-10-101-6/+6
| | | | | | | | | Pointed out by Yukihiro Matsumoto <matz@ruby-lang.org>. * gc.c (newobj_of_...): `of' is unnecessary. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * import a github pull requestko12015-10-101-7/+6
| | | | | | | | | | | | | | | | | https://github.com/ruby/ruby/pull/1050 by Kazuho Oku <kazuho@natadeco.co>. This pull request has the following commits. * gc.c: reduce # of args to 6 (max. of register args on x86-64) so that the `newobj_of_slowpass` can be called via TCO. * gc.c (newobj_of), string.c (str_duplicate): for performance, the hot functions must be inlined. * gc.c: for performance, preceding arguments of `.*newobj_of.*` must be same, so that the arg registers can be reused in case of TCO. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (newobj_of): divide fast path and slow pathko12015-10-071-33/+70
| | | | | | | | | to avoid register savings for fast path. This idea is given by Kazuho Oku <kazuho@natadeco.co>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e