aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Move test_extlibs.rb because it's not the test of ruby itselfusa2017-04-201-0/+0
| | | | | | | * test/test_extlibs.rb: moved from test/ruby. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2017-04-20svn2017-04-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix infinite recursionnobu2017-04-191-2/+3
| | | | | | | * vm_insnhelper.c (vm_once_dispatch): no guarantee that tail call is always optimized away. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* extmk.rb: improve message printed when configuring extensions failsrhe2017-04-191-19/+18
| | | | | | | Point to the mkmf.log if configuring an extension fails so that people can find and fix the culprit easily. [ruby-core:80131] [Feature #13302] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Rervert r58304. Because Rubygems have specialized finder for default gems.hsbt2017-04-191-1/+1
| | | | | | We need to list library entries for default gems. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* refactor extract binop dispatchershyouhei2017-04-191-171/+107
| | | | | | | | | | | | | | | | | | | | | | Those opt_something instructions are worth refactoring. They tend to have similar ways of executions. By extracting the common part, generated vm_exec_core function shrinks from 26,816 bytes to 26,256 bytes (according to nm(1)). This changeset introduces negligible performance impact. 3 repeated runs of optcarrot benchmark on my machine resulted in: before this: 28.813363684823557, 27.523907198440366, 27.292766121965400 after this: 28.174038497265080, 28.999513875020405, 29.621399800428065 in fps (greater==faster). ---- * vm_insnhelper.c (vm_opt_binop_dispatch): new function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2017-04-19svn2017-04-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* socket: avoid fcntl for read/write_nonblock on Linuxnormal2017-04-193-0/+72
| | | | | | | | | | | | | | | | | | | | | | On platforms where MSG_DONTWAIT works reliably on all sockets (so far, I know of Linux), we can avoid fcntl syscalls and implement IO#write_nonblock and IO#read_nonblock in terms of the socket-specific send and recv family of syscalls. This avoids side effects on the socket, and also encourages generic code to be written in cases where IO wrappers like OpenSSL::SSL::SSLSocket are used. Perhaps in the future, side-effect-free non-blocking I/O can be standard on all files and OSes: https://cr.yp.to/unix/nonblock.html * ext/socket/lib/socket.rb (read_nonblock, write_nonblock): Linux-specific wrapper without side effects [ruby-core:80780] [Feature #13362] * test/socket/test_basicsocket.rb (test_read_write_nonblock): new test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fixup! vm_insnhelper.c: adjust indent [ci skip]nobu2017-04-181-12/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: wrong optimizationnobu2017-04-182-11/+44
| | | | | | | | * compile.c (compile_branch_condition): expression which has side effects should not be eliminated. [ruby-core:80740] [Bug #13444] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_insnhelper.c: adjust indent [ci skip]nobu2017-04-181-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* typo fix (sorry!) [ci skip]shyouhei2017-04-181-1/+1
| | | | | | | Surprisingly this was not a syntax error on my machine. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_optimization.rb: heredoc code stylenobu2017-04-181-36/+50
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix compile error.ko12017-04-181-1/+1
| | | | | | | * insns.def (trace): use cast `flag` to pass compilation with clang on MacOSX. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix heading of README.hsbt2017-04-181-1/+1
| | | | | | [Fix GH-1586] Patch by @jbampton git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* tabify (sorry!) [ci skip]shyouhei2017-04-182-5/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.svn2017-04-181-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* split insns.def into functionsshyouhei2017-04-183-663/+977
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Contemporary C compilers are good at function inlining. They fold multiple functions into one. However they are not yet smart enough to unfold a function into several ones. So generally speaking, it is wiser for a C programmer to manually split C functions whenever possible. That should make rooms for compilers to optimize at will. Before this changeset insns.def was converted into single HUGE function called vm_exec_core(). By moving each instruction's core into individual functions, generated C source code is reduced from 3,428 lines to 2,847 lines. Looking at the generated assembly however, it seems my compiler (gcc 6.2) is extraordinary smart so that it inlines almost all functions I introduced in this changeset back into that vm_exec_core. On my machine compiled machine binary of the function does not shrink very much in size (28,432 bytes to 26,816 bytes, according to nm(1)). I believe this change is zero-cost. Several benchmarks I exercised showed no significant difference beyond error mergin. For instance 3 repeated runs of optcarrot benchmark on my machine resulted in: before this: 28.330329285707490, 27.513378371065920, 29.40420215754537 after this: 27.107195867280414, 25.549324021385907, 30.31581919050884 in fps (greater==faster). ---- * internal.h (rb_obj_not_equal): used from vm_insnhelper.c * insns.def: move vast majority of lines into vm_insnhelper.c * vm_insnhelper.c: moved here. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval.c: fix exit inside TAGnobu2017-04-181-6/+4
| | | | | | | * eval.c (setup_exception): do not exit by goto inside PUSH_TAG/POP_TAG. it causes an infinite loop. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in: honor GIT envnobu2017-04-181-2/+2
| | | | | | | * configure.in (--with-git): honor environment variable GIT if set. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vcs.rb: env for commandnobu2017-04-181-15/+17
| | | | | | | * tool/vcs.rb (VCS::SVN::COMMAND, VCS::GIT::COMMAND): customize command paths by environment variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* enc/depend: remove Unicode versionsnobu2017-04-181-2/+0
| | | | | | | * enc/depend (enc/unicode.o): remove hardcoded Unicode versions. this object file must be compiled by toplevel make. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2017-04-18svn2017-04-171-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* should not return.ko12017-04-171-1/+1
| | | | | | | | * test/ruby/test_settracefunc.rb (test_throwing_return_with_finish_frame): should not use `return`, but should use `next`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c: improve insertion performacenobu2017-04-171-1/+8
| | | | | | | | * string.c (rb_str_splice_0): improve performace of single byte optimizable cases, insertion 7bit string to 7bit string. [ruby-dev:49984] [Bug #13228] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread_win32.c: fix indexnobu2017-04-171-1/+2
| | | | | | | * thread_win32.c (w32_wait_events): fix wait object index in the case of interrupt_event is not usable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval.c: copy before cause setupnobu2017-04-172-11/+22
| | | | | | | * eval.c (setup_exception): copy frozen exception before setting up a cause not only a backtrace. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval.c: copy special exceptions before raisenobu2017-04-173-49/+27
| | | | | | | | | | | | * eval.c (setup_exception): consider if the exception is frozen, but not one of special exception objects. * gc.c (rb_memerror): copy minimum objects. * thread.c (rb_threadptr_execute_interrupts): prepare special exception queued by another thread to be raised. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_insnhelper.c: rb_threadptr_stack_overflownobu2017-04-173-17/+31
| | | | | | | * vm_insnhelper.c (rb_threadptr_stack_overflow): move from thread.c and integrate with vm_stackoverflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix for empty `__VA_ARGS__`nobu2017-04-171-2/+2
| | | | | | | | * parse.y (WARN_CALL, WARNING_CALL): need `##` between a comman and `__VA_ARGS__` in the case it is empty, not to end arguments with a comma. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_backtrace.c: backtrace functions per threadsnobu2017-04-177-30/+24
| | | | | | | | | | | | * vm_backtrace.c (rb_threadptr_backtrace_object): rename and extern. * vm_backtrace.c (rb_threadptr_backtrace_str_ary): rename as threadptr since the parameter is rb_thread_t*. * vm_backtrace.c (rb_threadptr_backtrace_location_ary): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* eval.c: share rb_longjmpnobu2017-04-171-9/+5
| | | | | | | * eval.c (rb_longjmp, rb_raise_jump): parameterize thread, and share rb_longjmp. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: rb_threadptr_stack_checknobu2017-04-173-1/+9
| | | | | | | | | | * gc.c (rb_threadptr_stack_check): check probability of stack overflow for the given thread, not the current thread. * vm_eval.c (stack_check): check the given thread, not the current thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: PREVENT_STACK_OVERFLOWnobu2017-04-171-7/+11
| | | | | | | | | * gc.c (PREVENT_STACK_OVERFLOW): define TRUE to try preventing stack overflow before actually happens. * gc.c (stack_check): parameterize thread pointer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2017-04-17svn2017-04-161-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_integer.rb: simplify teststomar2017-04-161-8/+5
| | | | | | * test/ruby/test_integer.rb: simplify test for Integer.sqrt. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rbinstall.rb: ignore skipped extsnobu2017-04-161-2/+7
| | | | | | | * tool/rbinstall.rb (default-gems): skip gemspec if corresponding Makefile does not exist. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread_win32.c: no GVL for interrupt_eventnobu2017-04-161-25/+7
| | | | | | | | * thread_win32.c (w32_wait_events): do not acquire GVL, to fix deadlock at read/close race condition. instead, just ignore interrupt_event if it is closed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_io.rb: use Thread.stop? to waitnobu2017-04-161-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_io.rb (test_race_closed_stream): separate because it stopsusa2017-04-161-18/+21
| | | | | | | entire test process on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2017-04-16svn2017-04-151-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* bignum.c: fix inexact estimationnobu2017-04-152-0/+15
| | | | | | | | * bignum.c (estimate_initial_sqrt): estimated square root is inexact if it is not equal to its ceil, needs Newton's method. [ruby-core:80696] [Bug #13440] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * properties.svn2017-04-150-0/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix ext/-test-/struct/ dependenciesnormal2017-04-152-0/+48
| | | | | | | | | | | | | | I started writing a template for auto-generation and let "tool/update-deps --fix" fill in the rest. Hopefully this fixes problems with some CI builds after r58359. Further changes to other ext/-test-/ files should probably add or update "depend" files, too. * ext/-test-/struct/depend: new file * enc/depend: auto-updated with unicode 9.0.0 headers (side-effect) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: last tag page conditionnobu2017-04-151-1/+1
| | | | | | | * signal.c (check_stack_overflow): drop the last tag when it is close to the fault page, not same as sp page. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.h: check argc to rb_funcallnobu2017-04-155-2/+22
| | | | | | | * include/ruby/ruby.h (rb_funcall): check if argc matches the number of variadic arguments, and replace with rb_funcallv. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: prefer pthread_sigmasknobu2017-04-151-4/+10
| | | | | | | * signal.c (raise_stack_overflow): prefer pthread_sigmask to sigprocmask, for multithreading. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * properties.svn2017-04-150-0/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix RSTRUCT_LEN macro in public C APInormal2017-04-153-1/+24
| | | | | | | | | | | | rb_struct_size returns an Integer VALUE, so it must be converted to a `long` for compatibility with previous Ruby C API versions. * ext/-test-/struct/len.c: new * test/-ext-/struct/test_len.rb: new * include/ruby/ruby.h (RSTRUCT_LEN): use NUM2LONG [ruby-core:80692] [Bug #13439] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e