`Rational(int, bignum).to_f` sometimes returned a wrong result because
`Bignum#div` casted its divisor to double. [Bug #14637] [ruby-core:86330]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This should be basically safe because VM already does this check.
I don't think JIT-ed code, which should be specially optimized, should
still do this.
* Benchmark
Calculating -------------------------------------
before before,--jit after,--jit
optcarrot 53.851 68.050 71.641 fps
Comparison:
optcarrot
after,--jit: 71.6 fps
before,--jit: 68.1 fps - 1.05x slower
before: 53.9 fps - 1.33x slower
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* cont.c (root_fiber_alloc): call `ConvertThreadToFiber()` here.
`rb_fiber_t` for root_fiber is allocated before running Threads.
Fiber objects wrapping this rb_fiber_t for root_fiber are created
when root Fiber object is required explicitly (for example, Fiber
switching and so on). We can put calling `ConvertThreadToFiber()`.
In other words, we can pending `ConvertThreadToFiber()`
until Fiber objects are created.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[Bug #14600]
* lib/rexml/xpath_parser.rb: Fix a bug that "/child::node()" returns
XML declaration and text nodes out of root element.
* test/rexml/test_jaxen.rb: Enable more tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_bignum.rb (test_interrupt_during_to_s): should not use
"while" synchronization, but should use Queue.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[Bug #14600]
* lib/rexml/functions.rb: Fix a bug that "@attribute/parent" doesn't
return element of its attribute.
* test/rexml/test_jaxen.rb: Enable more tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_fiber.rb (test_create_fiber_in_new_thread):
prefix to run, and get the result value not only waiting.
[Bug #14642]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[Bug #14600]
* lib/rexml/functions.rb: Fix a bug that "name(node-set)" returns
element instead of element name.
* test/rexml/test_jaxen.rb: Enable more tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
for toplevel self.
Toplevel self's class is not `Object` but `#<Class:Object>`.
This commit allows to inline method call setup for toplevel methods.
I've thought r63053 works but it doesn't...
I actually want to add all singleton classes but I'm not sure what's the
good way for it. I assumed that using ObjectSpace.each_object is suboptimal.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* cont.c (rb_threadptr_root_fiber_setup): divide into two functions:
* rb_threadptr_root_fiber_setup_by_parent(): called by the parent thread.
* rb_threadptr_root_fiber_setup_by_child(): called by the created thread.
`rb_threadptr_root_fiber_setup()` is called by the parent thread and
set fib->fib_handle by ConvertThreadToFiber() on the parent thread on
Windows enveironment.
This means that root_fib->fib_handle of child thread is initialized
with parent thread's Fiber handle. Furthermore, second call of
`ConvertThreadToFiber()` for the same thread fails.
This patch solves this weird situateion. However, maybe we can make more
clean code.
* thread.c (thread_start_func_2): call
`rb_threadptr_root_fiber_setup_by_child()` at thread initialize routine.
* vm.c (th_init): call `rb_threadptr_root_fiber_setup_by_parent()`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* proc.c (rb_obj_singleton_method): bail out if the receiver does
not have the singleton class without accessing the origin class
not to segfault. [Bug #14658]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* error.c (rb_warn_m): prepend the string "warning: " if uplevel
keyword is given, even if caller file and line information are
not available.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/mkmf.rb: Improve the error message when ruby.h is missing,
to suggest installing separate packages. [Feature #14656]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[Bug #14600]
Reported by MSP-Greg. Thanks!!!
* lib/rexml/xpath_parser.rb: Fix a bug that "following_siblings::*[N]"
doesn't work.
* test/rexml/test_jaxen.rb: Enable only axis test for now.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_time_tz.rb (gen_variational_zdump_test): Update
Lisbon zdump data, which fixed the 1912-01-01 transition for
Portugual and its colonies. [Bug #14655]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_time_tz.rb (gen_zdump_test): fix the expected
data at the Kiritimati's skip of New Year's Eve 1994.
[Bug #14655]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_time_tz.rb (TestTimeTZ#test_pacific_kiritimati):
fix the expected data at the skip of New Year's Eve 1994.
[Bug #14655]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Without this change, we couldn't inline method call setup for methods
which are defined in the top level.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c (compile_if): branch to end_label is not used if
else_seq is not used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* spec/ruby/core/file/ftype_spec.rb: use require_relative which
resolves symbolic links consistently to git rid of constant
re-definition warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* spec/ruby/core/file/fixtures/file_types.rb (configure_types):
try the current standard input terminal device first to get rid
of a race condition. other terminal devices may be used by
other processes and disposed during the test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e