summaryrefslogtreecommitdiff
path: root/test/ruby
AgeCommit message (Collapse)Author
2018-06-19variable.c: fix receiver on private constantnobu
* variable.c (rb_const_search): fix NameError :receiver attribute on private constant, should raise with the included module, not the ICLASS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-15gettimeofday is obsoletenobu
* test/ruby/test_process.rb gettimeofday is obsolete in SUSv4, and may not be available in the future. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-15Remove warnings of flip-flop deprecation from tests and specsmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-15parse.y: Deprecate flip-flopsmame
Ref #5400 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-13Revert "range.c: prohibit `(1..nil)`"mame
This reverts commit a44c010764a16ae09aaed49d76eec055ca0057c8. Refs #14845. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-13range.c: prohibit `(1..nil)`mame
Now endless range can be created by either a literal `(1..)` or explicit range creation `Range.new(1, nil)`. [Bug #14845] This change is intended for "early failure"; for example, `(1..var).to_a` causes out of memory if `var` is inadvertently nil. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-08ast.c: fix callsnobu
* ast.c (node_children): fix the member for method IDs as nd_mid. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-07ast.c: refine AST#childrennobu
* ast.c (node_children): refined RubyVM::AST#children to include symbols (variables, methods, classes, etc). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-07ast.c: Fix to raise `SyntaxError`yui-knk
* ast.c: Fix to raise `SyntaxError` when `RubyVM::AST.parse` or `RubyVM::AST.parse_file` fail to parse input. * test/ruby/test_ast.rb: Add test cases for invalid syntax. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-06math.c: adjust cbrtnobu
* math.c (math_cbrt): refine the approximation result on boundary values by an iteration of Newton-Raphson method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-05test_ast.rb: Add test cases of heredoc columnsyui-knk
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-05Move a test fileyui-knk
* test/-ext-/ast/test_ast.rb: This test file has not depended C extension since r63534, so move to 'test/ruby/'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-03Add TracePoint#parametersmame
It can be used to get the parameters' information of method and block. There was no way to get block parameters. It was possible but ineffective to get method parameters via Method object: `tp.defined_class.method(tp.method_id).parameters` TracePoint#parameters allows us to get the information easily. [Feature #14694] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-02Fixed wrong variable name.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-02Added test for default gems validation.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-31fix the conditionnobu
* test/ruby/test_rubyoptions.rb: Process.wait with WNOHANG returns nil while the target process is alive. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-31test_rubyoptions.rb: relax timeoutnobu
* test/ruby/test_rubyoptions.rb: wait for setting process title until the child process dies, in the case of extra heavy loads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-29fake.rb: fix RUBY_DESCRIPTION for MJITnobu
* template/fake.rb.in: reflect MJIT to RUBY_DESCRIPTION. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-24test_rubyoptions.rb: RbConfig::CONFIG['cppflags'] can be nilk0kubun
not '' at least on AppVeyor git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-24test_rubyoptions.rb: allow passing test_verbosek0kubun
with -DMJIT_FORCE_ENABLE. With -DMJIT_FORCE_ENABLE, absence of --jit doesn't mean JIT disabled. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-23remove VM_ENV_DATA_INDEX_ENV_PROC.ko1
* vm_core.h (VM_ENV_DATA_INDEX_ENV_PROC): ep[VM_ENV_DATA_INDEX_ENV_PROC] is allocated to mark a Proc which is created from iseq block. However, `lep[0]` keeps Proc object itself as a block handler (Proc). So we don't need to keep it. * vm_core.h (VM_ENV_PROCVAL): ditto. * vm.c (vm_make_env_each): do not need to keep blockprocval as special value. * vm.c (vm_block_handler_escape): simply return Proc value. * proc.c (proc_new): we don't need to check Env because a Proc type block handler is a Proc object itself. [Bug #14782] * test/ruby/test_proc.rb: add a test for [Bug #14782] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-22test_jit.rb: propagate suspicious stderrk0kubun
of child ruby process to parent stderr using `Kernel#warn`. This fixes a warning in {set,get}classvariable as well. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-17range.c: === by cover?nobu
* range.c (range_eqq): switch `Range#===` to use `cover?` instead of `include?`. [Feature #14575] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-15Split TestThread#test_join_limits into peacesngoto
* test/ruby/test_thread.rb (TestThread#test_join_limit_*): Split TestThread#test_join_limits for investigating hang-up on Solaris. Each method tests only a single limit value. [ruby-core:87045] [Bug #14761] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-14error.c: check redefined backtrace resultnobu
* error.c (rb_get_backtrace): check the result of `backtrace` even if the method is redefined. [ruby-core:87013] [Bug #14756] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-11Use `&.` instead of modifier ifkazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-10variable.c: fix multiple autoload with identical file (again)normal
We need to ensure autoload declarations pointing to the same feature (aka "file") can wait on each other to avoid deadlock situations. So, reorganize autoload data structures to maintain a feature => autoload_data_i mapping, and have module constant tables point to the new autoload_const struct instead of directly to autoload_data_i. This allows multiple autoload_const structs to refer to the SAME autoload_data_i struct, and with it, the on-stack autoload_state.waitq. The end result is different constants can share the same waitq (tied to the feature name), and not deadlock each other during loading. Thanks to Eugene Kenny for the bug report and reproducible test case. Reported-by: Eugene Kenny <elkenny@gmail.com> * variable.c (autoload_featuremap): new global (struct autoload_const): new per-const struct (struct autoload_state): reference autoload_const instead of autoload_data_i (struct autoload_data_i): remove per-const (autoload_i_mark): delete from autoload_featuremap if unreferenced (autoload_c_mark): new dmark callback (autoload_c_free): new dfree callback (autoload_c_memsize): new memsize callback (autoload_const_type): new data type (get_autoload_data): set autoload_const as well (rb_autoload_str): use new data structures (autoload_delete): cleanup from autoload_featuremap (check_autoload_required): adjust for new internals (rb_autoloading_value): ditto (struct autoload_const_set_args): remove, redundant with autoload_const (const_tbl_update): adjust for new internals (autoload_const_set): ditto (autoload_require): ditto (autoload_reset): ditto (rb_autoload_load): ditto (rb_const_set): ditto (current_autoload_data): ditto (set_const_visibility): ditto * test/ruby/test_autoload.rb (test_autoload_same_file): new test (test_no_leak): new test [ruby-core:86935] [Bug #14742] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-10revert r63387 and r63389 for nownormal
I can't reproduce the problem on my 32-bit machine, and I have connectivity problems to my 64-bit systems at the moment. Will revisit in a few hours hopefully. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-10variable.c: fix autoload object lifetimes and leaknormal
We must not call normal Hash methods inside GC free callback, either, however identity hash may be used. [ruby-core:86935] [Bug #14742] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-10variable.c: fix multiple autoload with identical filenormal
We need to ensure autoload declarations pointing to the same feature (aka "file") can wait on each other to avoid deadlock situations. So, reorganize autoload data structures to maintain a feature => autoload_data_i mapping, and have module constant tables point to the new autoload_const struct instead of directly to autoload_data_i. This allows multiple autoload_const structs to refer to the SAME autoload_data_i struct, and with it, the on-stack autoload_state.waitq. The end result is different constants can share the same waitq (tied to the feature name), and not deadlock each other during loading. Thanks to Eugene Kenny for the bug report and reproducible test case. Reported-by: Eugene Kenny <elkenny@gmail.com> * variable.c (autoload_featuremap): new global (struct autoload_const): new per-const struct (struct autoload_state): reference autoload_const instead of autoload_data_i (struct autoload_data_i): remove per-const (autoload_i_mark): delete from autoload_featuremap if unreferenced (autoload_c_mark): new dmark callback (autoload_c_free): new dfree callback (autoload_c_memsize): new memsize callback (autoload_const_type): new data type (get_autoload_data): set autoload_const as well (rb_autoload_str): use new data structures (autoload_delete): cleanup from autoload_featuremap (check_autoload_required): adjust for new internals (rb_autoloading_value): ditto (struct autoload_const_set_args): remove, redundant with autoload_const (const_tbl_update): adjust for new internals (autoload_const_set): ditto (autoload_require): ditto (autoload_reset): ditto (rb_autoload_load): ditto (rb_const_set): ditto (current_autoload_data): ditto (set_const_visibility): ditto * test/ruby/test_autoload.rb (test_autoload_same_file): new test [ruby-core:86935] [Bug #14742] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09_mjit_compile_send.erb: revert r63350k0kubun
Revert "_mjit_compile_send.erb: inline recursive call" I reverted r63360 in r63379, but the errors were reproductive from r63350. So I need to revert this. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-09Use `&.` instead of modifier ifkazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-08Remove unreachable breakkazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-08Modify spaces [ci skip]kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-07_mjit_compile_send.erb: inline recursive callk0kubun
mjit_compile.c: propagate funcname to compile_insn test_jit.rb: add test covering this behavior * Benchmark ``` require 'benchmark_driver' Benchmark.driver(runner: :time, repeat_count: 4) do |x| x.prelude %{ def fib(x) return x if x == 0 || x == 1 fib(x-1) + fib(x-2) end } x.report 'fib(40)' x.loop_count 1 x.rbenv( 'before,--jit', 'before', 'after,--jit', 'after', ) x.verbose end ``` ``` before,--jit: ruby 2.6.0dev (2018-05-08 trunk 63349) +JIT [x86_64-linux] before: ruby 2.6.0dev (2018-05-08 trunk 63349) [x86_64-linux] after,--jit: ruby 2.6.0dev (2018-05-08 trunk 63349) +JIT [x86_64-linux] last_commit=_mjit_compile_send.erb: inline recursive call after: ruby 2.6.0dev (2018-05-08 trunk 63349) [x86_64-linux] last_commit=_mjit_compile_send.erb: inline recursive call Calculating ------------------------------------- before,--jit before after,--jit after fib(40) 2.886 8.685 2.562 8.800 s - 1.000 times Comparison: fib(40) after,--jit: 2.6 s before,--jit: 2.9 s - 1.13x slower before: 8.7 s - 3.39x slower after: 8.8 s - 3.44x slower ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-07Remove needless require [ci skip]kazu
already require on top git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-07Use `&.` instead of modifier if and remove needless closed?kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-07Fix a typo [ci skip]kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-04object.c: raise on long invalid float stringnobu
* object.c (rb_cstr_to_dbl_raise): check long invalid float string more precisely when truncating insignificant part. [ruby-core:86800] [Bug #14729] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-03_mjit_compile_send.erb: retry inlining attr_readerk0kubun
This reverts r63249 (revert r63212) and fixes a bug in it. The test to prevent the bug is added as well. vm_insnhelper.c: add `index` argument to vm_getivar. The argument is created so that MJIT can pass the value of `cc->aux.index` on compilation time. The cache invalidation in _mjit_compile_send_guard.erb is only working for the cache value on compilation time. Note: As `index` is always passed as constant and it's force-inlined, the performance of `vm_getivar` won't be degraded in VM. _mjit_compile_send_guard.erb: New. Used to invalidate inlined values of cc. common.mk: update dependencies for _mjit_compile_send_guard.erb git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-02test_jit.rb: test local variablesk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-02test_jit.rb: test opt_aref_with againk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-02test_jit.rb: make it possible to automatically findk0kubun
untested insns. Resolved some warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-02test_jit.rb: verify tested insnsk0kubun
and fix some untested insns git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-02object.c: fix exponent with underscorenobu
* object.c (rb_cstr_to_dbl_raise): do not ignore exponent part when the input string longer than internal buffer contains underscore(s). [ruby-core:86836] [Bug #14731] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-02test_jit.rb: add missing dependencyk0kubun
The test works with make test-all, but I sometimes want to do a thing like: `.ruby-svn/ruby -Itest/lib test/ruby/test_jit.rb -n test_clean_so` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-02compile.c: mark catch_except_p of iseqk0kubun
which has throw insn, not only ancestor iseqs of it. I think we should remove catch_except_p flag and try to simplify the catch table itself, to prevent similar bugs in the future. test_jit.rb: add test to prevent the bug git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-28test_rubyoptions.rb: let all tests work with --jitk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-28test_bug_reporter.rb: make it work with --jitk0kubun
test_rubyoptions.rb: replace gsub with sub because it's suboptimal for this git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-28test_rubyoptions.rb: let test_verbose work w/ --jitk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e