aboutsummaryrefslogtreecommitdiffstats
path: root/vm_dump.c
Commit message (Collapse)AuthorAgeFilesLines
* Loaded script is unset yet when crashed in the initialization phaseNobuyoshi Nakada2020-12-021-3/+5
|
* fix public interfaceKoichi Sasada2020-11-181-1/+1
| | | | | | | | | | | | | | | | | | To make some kind of Ractor related extensions, some functions should be exposed. * include/ruby/thread_native.h * rb_native_mutex_* * rb_native_cond_* * include/ruby/ractor.h * RB_OBJ_SHAREABLE_P(obj) * rb_ractor_shareable_p(obj) * rb_ractor_std*() * rb_cRactor and rm ractor_pub.h and rename srcdir/ractor.h to srcdir/ractor_core.h (to avoid conflict with include/ruby/ractor.h)
* Introduce Ractor mechanism for parallel executionKoichi Sasada2020-09-031-3/+5
| | | | | | | | | | | | | | | | This commit introduces Ractor mechanism to run Ruby program in parallel. See doc/ractor.md for more details about Ractor. See ticket [Feature #17100] to see the implementation details and discussions. [Feature #17100] This commit does not complete the implementation. You can find many bugs on using Ractor. Also the specification will be changed so that this feature is experimental. You will see a warning when you make the first Ractor with `Ractor.new`. I hope this feature can help programmers from thread-safety issues.
* Prefer configured printf format for mingw gcc 10Nobuyoshi Nakada2020-05-261-1/+1
|
* sed -i 's|ruby/impl|ruby/internal|'卜部昌平2020-05-111-1/+1
| | | | To fix build failures.
* sed -i s|ruby/3|ruby/impl|g卜部昌平2020-05-111-1/+1
| | | | This shall fix compile errors.
* vm_dump.c: Do not show C backtrace on riscvYusuke Endoh2020-04-201-1/+1
| | | | | Currently, objdump -W miniruby emits some errors on riscv, so I guess that DWARF is corrupted.
* Removed useless VMDEBUG definition [ci skip]Nobuyoshi Nakada2020-04-191-6/+0
| | | | VMDEBUG is always defined as defaulted to 0 in vm_core.h.
* Update VMDEBUG reference doc [ci skip]Nguyễn Quang Minh2020-04-191-1/+1
| | | Since this commit (https://github.com/ruby/ruby/commit/9e1b06e17d27fb4ddf51e9244f205417e9c4dd5c), the VM Debug Level constant is moved from `vm_insnhelper.h` to `vm_core.h`. This PR is a super tiny update to reflect that change so that people won't waste time on searching in a wrong file.
* Merge pull request #2991 from shyouhei/ruby.h卜部昌平2020-04-081-2/+2
| | | Split ruby.h
* Introduce disposable call-cache.Koichi Sasada2020-02-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch contains several ideas: (1) Disposable inline method cache (IMC) for race-free inline method cache * Making call-cache (CC) as a RVALUE (GC target object) and allocate new CC on cache miss. * This technique allows race-free access from parallel processing elements like RCU. (2) Introduce per-Class method cache (pCMC) * Instead of fixed-size global method cache (GMC), pCMC allows flexible cache size. * Caching CCs reduces CC allocation and allow sharing CC's fast-path between same call-info (CI) call-sites. (3) Invalidate an inline method cache by invalidating corresponding method entries (MEs) * Instead of using class serials, we set "invalidated" flag for method entry itself to represent cache invalidation. * Compare with using class serials, the impact of method modification (add/overwrite/delete) is small. * Updating class serials invalidate all method caches of the class and sub-classes. * Proposed approach only invalidate the method cache of only one ME. See [Feature #16614] for more details.
* support RUBY_ON_BUG envval on assert failure.Koichi Sasada2020-01-061-0/+12
| | | | Check RUBY_ON_BUG env val also on rb_assert_failure().
* Get rid of LIST_HEAD conflict with a system header on macOSNobuyoshi Nakada2019-12-271-0/+3
|
* decouple internal.h headers卜部昌平2019-12-261-15/+20
| | | | | | | | | | | | | | | | | | Saves comitters' daily life by avoid #include-ing everything from internal.h to make each file do so instead. This would significantly speed up incremental builds. We take the following inclusion order in this changeset: 1. "ruby/config.h", where _GNU_SOURCE is defined (must be the very first thing among everything). 2. RUBY_EXTCONF_H if any. 3. Standard C headers, sorted alphabetically. 4. Other system headers, maybe guarded by #ifdef 5. Everything else, sorted alphabetically. Exceptions are those win32-related headers, which tend not be self- containing (headers have inclusion order dependencies).
* Fixed misspellingsNobuyoshi Nakada2019-12-201-1/+1
| | | | Fixed misspellings reported at [Bug #16437], only in ruby and rubyspec.
* show self on control frame dump.Koichi Sasada2019-12-121-0/+2
| | | | | control frame detailed info on RUBY_DEBUG=ci should also show self information.
* add additional CF info for CI envKoichi Sasada2019-12-051-7/+43
| | | | | | | | | Introduce new RUBY_DEBUG option 'ci' to inform Ruby interpreter that an interpreter is running on CI environment. With this option, `rb_bug()` shows more information includes method entry information, local variables information for each control frame.
* Adjusted spaces [ci skip]Nobuyoshi Nakada2019-09-271-1/+2
|
* crash report on mac little updateDavid CARLIER2019-08-191-0/+45
| | | | | | displaying vm info as Linux and FreeBSD. checking libproc as it is present only from 10.5 version. https://github.com/ruby/ruby/pull/2384
* #include <> for system headersNobuyoshi Nakada2019-08-091-1/+1
|
* Remove IA64 support.Samuel Williams2019-06-191-8/+0
|
* Split procstat_vm.cnobu2019-02-071-85/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * expand tabs. [ci skip]svn2018-11-071-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add cast to suppress warnings on Solaris [ci skip]nobu2018-11-071-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Support Mach-O on backtrace with DWARFnaruse2018-10-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix for old names of mcontext registersnobu2018-09-221-19/+30
| | | | | | c.f. https://github.com/mistydemeo/tigerbrew/issues/473 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_core.h, vm_dump.c: fix castktsj2018-07-151-1/+1
| | | | | | Revert r63968 and cast at caller side to prevent unintentional casting. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_dump.c: fix warning about constnessktsj2018-07-151-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* delete extra #undef [ci skip]shyouhei2018-01-031-1/+0
| | | | | | Sorry, this was a garbage. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* "%z" printf format specifier is a C99ismshyouhei2018-01-021-2/+3
| | | | | | PRIxSIZE is also. But shimmed in ruby.h git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* explicit cast to void* required for %pshyouhei2018-01-021-1/+1
| | | | | | | These functions take variadic arguments so no automatic type promotion is expected. You have to do it by hand. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_dump.c: [DOC] fix grammarstomar2017-11-071-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_dump.c (vm_stack_dump_each): accepts `ec`.ko12017-10-291-7/+7
| | | | | | | * vm_dump.c (vm_base_ptr): constify. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use `GET_VM()` directly.ko12017-10-291-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* `th` -> `ec` for VM dump related functions.ko12017-10-291-34/+34
| | | | | | | | | | | | * vm_dump.c: `th` -> `ec` (and constify) for: * control_frame_dump * rb_vmdebug_stack_dump_raw * rb_vmdebug_debug_print_register * rb_vmdebug_debug_print_pre * rb_vmdebug_debug_print_post git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use rb_execution_context_t instead of rb_thread_tko12017-10-261-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | to represent execution context [Feature #14038] * vm_core.h (rb_thread_t): rb_thread_t::ec is now a pointer. There are many code using `th` to represent execution context (such as cfp, VM stack and so on). To access `ec`, they need to use `th->ec->...` (adding one indirection) so that we need to replace them by passing `ec` instead of `th`. * vm_core.h (GET_EC()): introduced to access current ec. Also remove `ruby_current_thread` global variable. * cont.c (rb_context_t): introduce rb_context_t::thread_ptr instead of rb_context_t::thread_value. * cont.c (ec_set_vm_stack): added to update vm_stack explicitly. * cont.c (ec_switch): added to switch ec explicitly. * cont.c (rb_fiber_close): added to terminate fibers explicitly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix typos [ci skip]kazu2017-09-151-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix the case High Sierra's mincore(2) may return -128 [Bug #13895]naruse2017-09-141-2/+29
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fixed compilationn error with VMDEBUG=3.hsbt2017-09-061-1/+1
| | | | | | [fix GH-1690] Patch from @musaprg(Kotaro Inoue) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix C level backtrace on Darwinnaruse2017-09-011-2/+7
| | | | | | SEGV caused by invalid instruction call. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rename rb_execution_context_t::stack(_size) to vm_stack(_size).ko12017-08-101-15/+15
| | | | | | | | | * vm_core.h: Ruby processes run with two stacks, a machine stack and a VM stack. To make it clear, this fix renames rb_execution_context_t::stack(_size) to vm_stack(_size). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* introduce rb_thread_ptr() to replace GetThreadPtr().ko12017-06-281-10/+5
| | | | | | | | | | * vm_core.h (rb_thread_ptr): added to replace GetThreadPtr() macro. * thread.c (in some functions: use "target_th" instead of "th" to make clear that it is not a current thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h: remove VM_FRAME_MAGIC_LAMBDA and introduceko12017-06-031-8/+0
| | | | | | | | | | VM_FRAME_FLAG_LAMBDA. So that lambda block frame is VM_FRAME_MAGIC_BLOCK | VM_FRAME_FLAG_LAMBDA. * vm_core.h: remvoe VM_FRAME_MAGIC_PROC because nobody uses it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rename absolute_path to realpath internally and introduce pathobj.ko12017-06-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * vm_core.h: rename absolute_path to realpath because it is expected name. external APIs (#absolute_path methods) are remained. * vm_core.h: remove rb_iseq_location_struct::path and rb_iseq_location_struct::absolute_path and introduce pathobj. if given path equals to given absolute_path (and most of case it is true), pathobj is simply given path String. If it is not same, pathobj is Array and pathobj[0] is path and pathobj[1] is realpath. This size optimization reduce 8 bytes and sizeof(struct rb_iseq_constant_body) is 200 bytes -> 192 bytes on 64bit CPU. To support this change, the following functions are introduced: * pathobj_path() (defined in vm_core.h) * pathobj_realpath() (ditto) * rb_iseq_path() (decl. in vm_core.h) * rb_iseq_realpath() (ditto) * rb_iseq_pathobj_new() (ditto) * rb_iseq_pathobj_set() (ditto) * vm_core.h (rb_binding_t): use pathobj instead of path. If binding is given at eval methods, realpath (absolute_path) was caller's realpath. However, they should use binding's realpath. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Treat NULL reference case [Bug #13566]naruse2017-05-171-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rb_execution_context_t: move stack, stack_size and cfp from rb_thread_tnormal2017-05-091-21/+22
| | | | | | | | | | The goal is to reduce rb_context_t and rb_fiber_t size by removing the need to store the entire rb_thread_t in there. [ruby-core:81045] Work-in-progress: soon, we will move more fields here. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_dump.c: non-scalar thread_idnobu2017-04-211-0/+10
| | | | | | | * vm_dump.c (rb_vmdebug_stack_dump_all_threads): fix for non-scalar thread_id platforms. c.f. [Bug #9884] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_dump.c (rb_vmdebug_stack_dump_all_threads): cast to `void*`.ko12017-04-201-1/+1
| | | | | | | | Pointed out at <https://github.com/ruby/ruby/commit/fbc1deca89595e60af21e58b7e164f376e4bd2fc#commitcomment-21839826> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add a debug function.ko12017-04-201-0/+12
| | | | | | | | * vm_dump.c (rb_vmdebug_stack_dump_all_threads): dump stack dump for all living threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* introduce imemo_type_p(v, imemo_type)ko12017-04-071-1/+1
| | | | | | | | * internal.h: introduce imemo_type_p() which checks the given value is T_IMEMO and imemo_type() == given imemo_type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e