aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* File.mkfifo releases GVLnormal2017-11-201-3/+18
| | | | | | | | | | | mkfifo(3) is subject to the same problems as open(2) on slow filesystems. Release the GVL and let the rest of the VM run while we call mkfifo. * file.c (nogvl_mkfifo): new function (rb_file_s_mkfifo): release GVL git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/matrix: Add hadamard_product/entrywise_product.marcandre2017-11-202-0/+25
| | | | | | Based on a patch by Charley Hutchison. [GH-674] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/matrix: Add Matrix{.|#}combinemarcandre2017-11-202-0/+46
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/matrix: accept vectors in {h|v}stackmarcandre2017-11-202-5/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/matrix: Add explicit coercion #to_matrixmarcandre2017-11-203-0/+26
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32.c: vm_exit_handlernobu2017-11-203-24/+35
| | | | | | | | | | | | | * win32/win32.c (vm_exit_handler): separate exit handler for resources which must be released at exit of Ruby VM. * win32/win32.c (socklist_insert, constat_handle): install the VM exit handler. * gc.c (ENABLE_VM_OBJSPACE): no longer needs process global object space on Windows too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Update the last location of NODE_BLOCKyui-knk2017-11-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | * parse.y (block_append_gen): Update the last location of NODE_BLOCK when a tail is appended. e.g. The locations of NODE_BLOCK is fixed: ``` a; b; c ``` * Before ``` NODE_BLOCK (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 4) ``` * After ``` NODE_BLOCK (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 7) ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/bug-13526.rb: Fix to actually refer to an existing fileeregon2017-11-191-2/+4
| | | | | | | * Add Thread.report_on_exception=true to catch problems early. * Increase the number of Thread.pass to let the autoload start. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * properties.svn2017-11-190-0/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * append newline at EOF.svn2017-11-191-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add specs for concurrent Module#autoloaderegon2017-11-192-0/+50
| | | | | | * When the file does not exist or the constant is not set. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2017-11-20svn2017-11-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Reorganize Module#autoload to have similar specs next to each othereregon2017-11-191-20/+16
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: moved ENABLE_VM_OBJSPACE from vm_core.hnobu2017-11-192-13/+13
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c (rb_file_s_mkfifo): use mode_t instead of intnormal2017-11-191-2/+2
| | | | | | | | | | mode_t is the correct type for mkfifo(3). This fixes an oversight from r60592 which made the same change to several other functions. * file.c (rb_file_s_mkfifo): use mode_t instead of int git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c: fix 64-bit conversion warnings from r60844normal2017-11-191-2/+3
| | | | | | | * file.c (nogvl_truncate): cast int to VALUE before "void *" (rb_file_s_truncate): cast "void *" to VALUE before int git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* File.readlink and rb_readlink releases GVLnormal2017-11-191-1/+28
| | | | | | | | | | | | The `readlink' can stall on slow filesystems like `open' and `read' syscalls. Release the GVL and let the rest of the VM function while `readlink' runs. * file.c (nogvl_readlink): new function (readlink_without_gvl): ditto (rb_readlink): use readlink_without_gvl git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file: File#truncate and File.truncate release GVLnormal2017-11-181-40/+71
| | | | | | | | | | | | | Like IO#write and IO.open, these file operations have unpredictable performance on slow file systems. Allow other threads of the VM to proceed while they are taking place. * file.c (nogvl_truncate): extract from rb_file_s_truncate (rb_file_s_truncate): release GVL (nogvl_ftruncate): extract from rb_file_truncate (rb_file_truncate): release GVL git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* addr2line.c: fix r60841 for glibc before 2.22normal2017-11-181-0/+4
| | | | | | | | | | | SHF_COMPRESSED was not defined until glibc 2.22, and there are older distros (e.g. Debian 8.x jessie) which do not have this defined. Perhaps it is safe to define SHF_COMPRESSED to (1 << 11) ourselves, too, since ELF should be a standardized format. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2017-11-19svn2017-11-181-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* explictly skip compressed debug linenaruse2017-11-181-2/+8
| | | | | | | | To identify the line of backtrace with ease, show the offset address of library. You can just find the source filename and the line with `addr2line -e libruby.so.2.5.0 0xXXXX` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Fix the locations of NODE_ITERyui-knk2017-11-181-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | * parse.y: Update the locations of NODE_ITER when nd_iter is determined. e.g. The locations of NODE_ITER is fixed: ``` a {b} ``` * Before ``` NODE_ITER (line: 1, first_lineno: 1, first_column: 2, last_lineno: 1, last_column: 5) ``` * After ``` NODE_ITER (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 5) ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* call only with ISEQ_TRACE_EVENTS.ko12017-11-181-1/+1
| | | | | | | | * vm_insnhelper.c (vm_trace): rb_iseq_trace_set() only accepts ISEQ_TRACE_EVENTS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* introduce `trace_events' info for iseq.ko12017-11-185-70/+104
| | | | | | | | | | | | | | | | | | | | | * vm_core.h (rb_iseq_t::aux): add `trace_events` which represents which events are enabled on this iseq. With this information, we can skip useless trace-on changes for ISeqs. * vm_trace.c (RUBY_EVENTS_TRACE_BY_ISEQ): moved to iseq.h and rename it with ISEQ_TRACE_EVENTS. * iseq.h: introduce ISEQ_USE_COMPILE_DATA iseq (imemo) flag to represent COMPILE_DATA is available. In other words, iseq->aux.trace_events is not available when this flag is set. * ISEQ_COMPILE_DATA() is changed from a macro. * ISEQ_COMPILE_DATA_ALLOC() is added. * ISEQ_COMPILE_DATA_CLEAR() is added. * iseq.c: use them. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Cannot call rb_thread_call_with{out,}_gvl before running VMusa2017-11-181-5/+17
| | | | | | | | | * dir.c (opendir_without_gvl, with_gvl_gc_for_fd, opendir_at): check the VM is already initialized before calling rb_thread_call_with{out,}_gvl(). [Bug #14115] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Fix the locations of NODE_DVAR and NODE_LVARyui-knk2017-11-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | * parse.y: Fix the locations of NODE_DVAR and NODE_LVAR when it's a multiple assignment method parameter. e.g. The locations of NODE_DVAR is fixed: ``` a {|(b, c)| d} ``` * Before ``` NODE_DVAR (line: 1, first_lineno: 1, first_column: 4, last_lineno: 1, last_column: 10) ``` * After ``` NODE_DVAR (line: 1, first_lineno: 1, first_column: 5, last_lineno: 1, last_column: 9) ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* .gdbinit: fix print_pathobjktsj2017-11-181-1/+1
| | | | | | $str is not C string but RString. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* .gdbinit: follow up changes in r60726ktsj2017-11-181-2/+2
| | | | | | | rb_iseq_constant_body::line_info_size and line_info_table have been renamed to insns_info_size, insns_info. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: Use node_assignyui-knk2017-11-181-4/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/win32ole/win32ole.c: use WIN32OLEQueryInterfaceError when failedsuke2017-11-183-15/+15
| | | | | | | | to query com interface. * ext/win32ole/win32ole_event.c: ditto. * ext/win32ole/win32ole_method.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: openat calls release GVL, toonormal2017-11-181-42/+77
| | | | | | | | | | | | | | | openat(2) also performs a path lookup, so it is also subject to pathological slowdowns like opendir(3) and open(2) syscalls. * dir.c (struct opendir_at_arg): new struct for callback (with_gvl_gc_for_fd): new callback for rb_thread_call_with_gvl (gc_for_fd_with_gvl): moved up (nogvl_opendir_at): extracted from do_opendir (opendir_at): new wrapper to release GVL for opendir_at (do_opendir): use new wrappers to release GVL (nogvl_dir_empty_p): adjust for gc_for_fd_with_gvl git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir: release GVL on opendirnormal2017-11-181-5/+23
| | | | | | | | | | | | | opendir(3) is subject to the same pathological slowdowns on slow or unreliable filesystems as open(2), so release the GVL to avoid stalling the entire VM like we do with IO#open * dir.c (nogvl_opendir): new function (opendir_without_gvl): new function (dir_initialize): s/opendir/&_without_gvl/ (do_opendir): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Update the last location of NODE_ARRAYyui-knk2017-11-181-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | * parse.y (list_append_gen, list_concat): Update the last location of NODE_ARRAY when an item is appended or concatenated with another NODE_ARRAY. e.g. The locations of NODE_ARRAY is fixed: ``` a(1,2,3) ``` * Before ``` NODE_ARRAY (line: 1, first_lineno: 1, first_column: 2, last_lineno: 1, last_column: 3) ``` * After ``` NODE_ARRAY (line: 1, first_lineno: 1, first_column: 2, last_lineno: 1, last_column: 7) ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2017-11-18svn2017-11-171-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix typo in `Timeout` doc [ci skip]kazu2017-11-171-2/+2
| | | | | | | | Author: yuuji.yaginuma <yuuji.yaginuma@gmail.com> https://github.com/ruby/ruby/pull/1760 [Fix GH-1760] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: RUBY_SET_YYLLOC to rb_parser_set_locationnobu2017-11-171-8/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: RUBY_SET_YYLLOCnobu2017-11-171-4/+6
| | | | | | | | | * parse.y (RUBY_SET_YYLLOC): extract setting locations from the source line. * parse.y (yylex): use RUBY_SET_YYLLOC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add examples to Set documentation [ci skip]knu2017-11-171-7/+47
| | | | | | | GitHub PR: https://github.com/ruby/ruby/pull/1752 [Fix GH-1752] Submitted by: @Ana06 <anamma06@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* NODE_CALL is not passed to node_assign_genyui-knk2017-11-171-1/+0
| | | | | | | | * parse.y (node_assign_gen): NODE_CALL is not passed to node_assign_gen. NODE_CALL is not assignable. Assignable method call (array set and attr set) is represented by NODE_ATTRASGN. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* don't use `goto`.ko12017-11-171-6/+2
| | | | | | | * vm_trace.c (rb_exec_event_hooks): we don't need to use goto statement. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix location of assignable nodesyui-knk2017-11-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * parse.y (node_assign_gen): NODE_ATTRASGN is created before rhs is created. It is needed to set location after rhs is created to rhs range be included to the location of NODE_ATTRASGN. e.g. The locations of NODE_ATTRASGN is fixed: ``` a[1] = 2 ``` * Before ``` NODE_ATTRASGN (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 4) ``` * After ``` NODE_ATTRASGN (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 8) ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove a wrong assertion.ko12017-11-171-1/+0
| | | | | | | | | * iseq.c (rb_iseq_trace_set): remove a wrong assertion. This assertion checked `insn` is `trace_` prefix instruction but threaded code `insn` is original code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* reuse gvar value.ko12017-11-172-48/+50
| | | | | | | | | | * vm_core.h (EXEC_EVENT_HOOK_VM_TRACE): added to pass vm_event_flags (== ruby_vm_event_flags) as a macro parameter. * vm_insnhelper.c (vm_trace): use an added macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.svn2017-11-171-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove `trace_` prefix insns lazily.ko12017-11-174-13/+24
| | | | | | | | | | | | | * vm_trace.c (update_global_event_hook): set only when tracing is added. If tracing was off (event flags are decreased), then ignore them. Next `trace_` prefix instruction will trace off itself (lazy tracing off). * vm_insnhelper.c (vm_trace): trace-off for when trace is not needed. * iseq.c (rb_iseq_trace_set): fix trace-off process (it was never off tracing). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix location of assignable nodesyui-knk2017-11-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * parse.y (node_assign_gen): In some case assignable nodes are created before rhs is created. In this case it is needed to set location after rhs is shifted to rhs range be included to assignable nodes. e.g. The locations of NODE_DASGN_CURR is fixed: ``` a = 10 ``` * Before ``` NODE_DASGN_CURR (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 1) ``` * After ``` NODE_DASGN_CURR (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 6) ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2017-11-17svn2017-11-161-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix location of NODEs generated by new_op_assign_genyui-knk2017-11-161-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * parse.y (new_op_assign_gen): Use a location of lhs when call gettable, bacause gettable creates a variable node. Use a location of rhs when call new_list, because item of new_list is rhs. The locations of NODE_DVAR(nd_vid: :a) and NODE_ARRAY are fixed: ``` a -= 1 ``` * Before ``` NODE_DVAR (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 6) NODE_ARRAY (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 6) ``` * After ``` NODE_DVAR (line: 1, first_lineno: 1, first_column: 0, last_lineno: 1, last_column: 1) NODE_ARRAY (line: 1, first_lineno: 1, first_column: 5, last_lineno: 1, last_column: 6) ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Old gem file had not been removedusa2017-11-161-1/+1
| | | | | | | | | * common.mk (update-gems): `old.delete("gems/#{gem}")` always returns nil because when really downloading new gem, the filename is not in `old`. the real intention of this condition might be checking `old` is empty or not. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Refactoring out the direct accesses of NODE's u1, u2, and u3mame2017-11-164-16/+19
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e