* prelude.rb (Thread.exclusive): pass the block as a block
argument.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* template/prelude.c.tmpl (PRELUDE_STR): make string objects with
static literals not to copy them.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* template/prelude.c.tmpl (prelude_eval): fix optimization
options. trace_instruction member has been removed. filled
coverage_enabled and debug_level members instead.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c (iseq_compile_each): for empty method, block and so on,
`last_line` is not set so that line number of `putnil` instruction
will be zero. This patch set `first_lineno` for such `putnil`.
Problem is reported by deivid-rodriguez via Yuichiro Kaneko.
* test/ruby/test_iseq.rb: add a test for this spec.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
I heard that notable performance improvements should be written to
"Implementation Improvements". So I put the sentence here.
Also, the sentence itself is fixed to be the same as Ruby 2.5 release
note draft's one.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.h (rb_compile_option_struct): trace instruction is removed so that
remove the trace_instruction compile option.
Don't show warning (just ignore) for Ruby 2.5.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
improvement.
There is no specific ticket for it, but improving the ERB's performance
was my largest passion that made me a Ruby committer.
See r58735, r58842, r58904, r58905, r58916.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This release removes uses of Kernel#open to avoid unintended
behaviors and make future auditing easier. [Misc #14216]
6 changes since 1.4.1:
webrick: httpauth requires regular files
webrick/httpservlet/cgi_runner.rb: remove unnecessary open
webrick: WEBrick::Log requires path arg when given string
webrick/httpservlet/*handler: use File.open
webrick/httputils: note Kernel#open behavior
webrick/httpservelet/cgi_runner: avoid IO#reopen on pathname
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c (compile_return): evaluate arguments to top-level
return but ignore the results.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
It fixes an installation error of activerecord.
https://github.com/ruby/rdoc/issues/571
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
GCC 4.8 with optimization causes error if it compiles following code.
[Bug #14221]
```c
__builtin_choose_expr(__builtin_constant_p(b),0,1)
```
https://github.com/ruby/ruby/pull/1778
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c (iseqw_trace_points): add `RubyVM::InstructionSequence#trace_points`
method for tools which want to manipulate ISeq (and traces).
* test/ruby/test_iseq.rb: add a test for this method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c (iseqw_each_child): add RubyVM::InstructionSequence#each_child
method for tools which want to manipulate ISeq.
* test/ruby/test_iseq.rb: add a test for this method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c (rb_iseq_compile_node): line number spec of :return, :b_return
and :end events of 'TracePoint` is changed for [Feature #14104].
Quoted from [Feature #14104]:
> Line numbers on :return/:b_return events show the last executed lines,
> instead of end lines (without return statement).
Note that :end event also affected.
However, "buybug", a well-known ruby debugger depends on previous behavior
so that I reverted this specification.
* test/ruby/test_settracefunc.rb: catch up this fix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
My motivation was to improve the output of `ruby --dump=insns xxx.rb`.
When one file has many iseqs, it's hard to find the one I want to read.
So I wanted `iseq_disasm` to show first_lineno. I unified the behavior
of `iseqw_disasm` for consistency.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c (rb_insn_operand_intern): simplified the condition for
local variable names, assume TS_LINDEX and TS_NUM combinations
are only for local variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* insns.def (checkkeyword): adjust argument type to
vm_check_keyword as lindex_t.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/enc/test_regex_casefold.rb: fix searching unicode data
directory, like as test_case_comprehensive.rb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
I faced a big issue about Bundler with ruby core.
I have no time to resolve it issue before 2.5 final release.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (nogvl_copy_file_range): ignore EPERM and fallback to
sendfile(2) or read/write. copy_file_range(2) may not exist
even if __NR_copy_file_range is defined in the build environment.
[Bug #14207]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/erb.rb (ERB#new_toplevel): shadow already defined local
variables by block local variabes, not to overwrite them.
[ruby-core:84390] [Bug #14215]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
IO#reopen seems to behave strangely on Win32 based on the logs
posted by Greg for [Bug #14420]. Lets try to fix the issue by
using File.open explicitly (but not Kernel#open).
* lib/webrick/httpservelet/cgi_runner: use File.open explicitly
[Bug #14220]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/rdoc/test_rdoc_markup_pre_process.rb: show
`RDoc::Markup::PreProcess.post_processors` as a failure message
for debugging.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e