* hash.c, internal.h: support theap for small Hash.
Introduce RHASH_ARRAY (li_table) besides st_table and small Hash
(<=8 entries) are managed by an array data structure.
This array data can be managed by theap.
If st_table is needed, then converting array data to st_table data.
For st_table using code, we prepare "stlike" APIs which accepts hash value
and are very similar to st_ APIs.
This work is based on the GSoC achievement
by tacinight <tacingiht@gmail.com> and refined by ko1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: now instance variable space has theap supports.
obj_ivar_heap_alloc() tries to acquire memory from theap.
* debug_counter.h: add some counters for theap.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* transient_heap.c, transient_heap.h: implement TransientHeap (theap).
theap is designed for Ruby's object system. theap is like Eden heap
on generational GC terminology. theap allocation is very fast because
it only needs to bump up pointer and deallocation is also fast because
we don't do anything. However we need to evacuate (Copy GC terminology)
if theap memory is long-lived. Evacuation logic is needed for each type.
See [Bug #14858] for details.
* array.c: Now, theap for T_ARRAY is supported.
ary_heap_alloc() tries to allocate memory area from theap. If this trial
sccesses, this array has theap ptr and RARRAY_TRANSIENT_FLAG is turned on.
We don't need to free theap ptr.
* ruby.h: RARRAY_CONST_PTR() returns malloc'ed memory area. It menas that
if ary is allocated at theap, force evacuation to malloc'ed memory.
It makes programs slow, but very compatible with current code because
theap memory can be evacuated (theap memory will be recycled).
If you want to get transient heap ptr, use RARRAY_CONST_PTR_TRANSIENT()
instead of RARRAY_CONST_PTR(). If you can't understand when evacuation
will occur, use RARRAY_CONST_PTR().
(re-commit of r65444)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: now instance variable space has theap supports.
obj_ivar_heap_alloc() tries to acquire memory from theap.
* debug_counter.h: add some counters for theap.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* transient_heap.c, transient_heap.h: implement TransientHeap (theap).
theap is designed for Ruby's object system. theap is like Eden heap
on generational GC terminology. theap allocation is very fast because
it only needs to bump up pointer and deallocation is also fast because
we don't do anything. However we need to evacuate (Copy GC terminology)
if theap memory is long-lived. Evacuation logic is needed for each type.
See [Bug #14858] for details.
* array.c: Now, theap for T_ARRAY is supported.
ary_heap_alloc() tries to allocate memory area from theap. If this trial
sccesses, this array has theap ptr and RARRAY_TRANSIENT_FLAG is turned on.
We don't need to free theap ptr.
* ruby.h: RARRAY_CONST_PTR() returns malloc'ed memory area. It menas that
if ary is allocated at theap, force evacuation to malloc'ed memory.
It makes programs slow, but very compatible with current code because
theap memory can be evacuated (theap memory will be recycled).
If you want to get transient heap ptr, use RARRAY_CONST_PTR_TRANSIENT()
instead of RARRAY_CONST_PTR(). If you can't understand when evacuation
will occur, use RARRAY_CONST_PTR().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
For robustness against future changes. There should be no impact
at the moment,here, but we may call mjit_finish more than once
in a process lifetime in the future (implementing "stop"
instead of just "pause")
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
I don't think we fixed that, but if so, I would like to see more test
failures. Previous failures didn't keep enough C-backtrace information
about the failure and it's hard to debug for now.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
because it's not supported by this file. Also, shared `def_iseq_ptr`
instead of copying the main definition of it.
vm_core.h: moved `def_iseq_ptr` to this place. added `inline` to avoid
compiler warnings since it's not used in some files including vm_core.h.
vm_insnhelper.c: moved `def_iseq_ptr` to vm_core.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Following how mjit_worker.c currently works, rb_f_system
now ensures the VM-wide waitpid lists is locked before
creating a new process via fork/vfork.
This ensures other rb_waitpid callers cannot steal work and
there are no possible race conditions from toggling
ruby_nocldwait without the use of atomics.
This sets us up for implementing MJIT process management
logic using normal Ruby APIs prepares us for VM-wide
asynchronous/event-base waitpid which can allow MJIT to
work without worker threads.
Take 2: set waitpid_state.pid on platforms w/o fork.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Following how mjit_worker.c currently works, rb_f_system
now ensures the VM-wide waitpid lists is locked before
creating a new process via fork/vfork.
This ensures other rb_waitpid callers cannot steal work and
there are no possible race conditions from toggling
ruby_nocldwait without the use of atomics.
This sets us up for implementing MJIT process management
logic using normal Ruby APIs prepares us for VM-wide
asynchronous/event-base waitpid which can allow MJIT to
work without worker threads.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* class.c (rb_keyword_error_new): use RARRAY_AREF() because
RARRAY_CONST_PTR() can introduce additional overhead in a futre.
Same fixes for other files.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
The idea behind this commit is that handles_sp and leaf are two
concepts that are not mutually independent. By making one explicitly
depend another, we can reduces the number of lines of codes written,
thus making things concise.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This enhances stability of the generated source code (namely
insns_info.inc) across attribute insertion / deletion. It does
not change the compiled binary at all; just a bit of readability.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* time.c (tm_initialize): allow 7th argument as well as
Time#initialize, but just ignore.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* spec/ruby/library/win32ole/fixtures/event.xml use MSXML.DOMDocument
instead of InternetExplorer.Application. InternetExplorer.Application
is not available on some environments. Thanks to MSP-Greg (Greg L).
* spec/ruby/library/win32ole/win32ole_event/on_event_spec.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* spec/ruby/library/win32ole/win32ole_event/new_spec.rb: use
MSXML.DOMDocument. InternetExplorer.Application is not available on
some environments. Thanks to MSP-Greg (Greg L).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c (ibf_dump_object_hash): use `rb_hash_foreach()`
instead of using `st_foreach()`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* spec/ruby/library/win32ole/win32ole/shared/setproperty.rb: use
Scripting.Dictionary. InternetExplorer.Application is not available on
some environments. Thanks to MSP-Greg (Greg L).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* spec/ruby/library/win32ole/win32ole/ole_put_methods_spec.rb: use
Scripting.Dictionary. InternetExplorer.Application is not available on
some enviroments. Thanks to MSP-Greg (Greg L).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* spec/ruby/library/win32ole/win32ole/ole_methods_spec.rb: use Scripting
Dictionary. InternetExplorer.Application is not available on some
environments. Thanks to MSP-Greg (Greg L).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* spec/ruby/library/win32ole/win32ole/ole_obj_help_spec.rb: use
Scripting.Dictionary. InternetExplorer.Application is not available on
some environments. Thanks to MSP-Greg (Greg L).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* spec/ruby/library/win32ole/win32ole/ole_method_spec.rb: recuire in
platform_is block.
* spec/ruby/library/win32ole/win32ole/ole_func_methods_spec.rb: ditto.
* spec/ruby/library/win32ole/win32ole/shared/ole_method.rb: use
Scripting.Dictionary. InternetExplorer.Application is not available on
some environments. Thanks to MSP-Greg (Greg L).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e