| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Same as last commit, make some fields `const`.
include/ruby/ruby.h:
* Rasic::klass
* RArray::heap::aux::shared_root
* RRegexp::src
internal.h:
* rb_classext_struct::origin_, redefined_class
* vm_svar::cref_or_me, lastline, backref, others
* vm_throw_data::throw_obj
* vm_ifunc::data
* MEMO::v1, v2, u3::value
While modifying this patch, I found write-barrier miss on
rb_classext_struct::redefined_class.
Also vm_throw_data::throw_state is only `int` so change the type.
|
|
|
|
|
|
|
| |
RHash::ifnone should be protected by write-barriers so this field
should be const. However, to introduce GC.compact, the const was
removed. This commit revert this removing `const` and modify
gc.c `TYPED_UPDATE_IF_MOVED` to remove `const` forcely by a type cast.
|
|
|
|
|
|
| |
Check for `exception` option in rb_execarg_addopt, as well as
other options. And then raise a particular ArgumentError if it is
not allowed.
|
| |
|
| |
|
|
|
|
| |
see RUBY_DEBUG for each debug options.
|
|
|
|
| |
Thanks for the patch by normalperson (Eric Wong) [Bug #14204].
|
| |
|
|
|
|
| |
The latter is same as the former, removed the duplicate function.
|
| |
|
|
|
|
|
|
| |
[Feature #15777]
Closes: https://github.com/ruby/ruby/pull/2173
|
|
|
|
|
|
|
|
|
|
|
|
| |
only when its receiver and the argument are both Integers.
Since 6bedbf4625, Integer#[] has supported a range extraction.
This means that Integer#[] now accepts multiple arguments, which made
the method very slow unfortunately.
This change fixes the performance issue by adding a special handling for
its traditional use case: `num[idx]` where both `num` and `idx` are
Integers.
|
|
|
|
|
|
|
|
|
|
|
| |
* internal.h (UNALIGNED_MEMBER_ACCESS, UNALIGNED_MEMBER_PTR):
moved from eval_intern.h.
* compile.c iseq.c, vm.c: use UNALIGNED_MEMBER_PTR for `entries`
in `struct iseq_catch_table`.
* vm_eval.c, vm_insnhelper.c: use UNALIGNED_MEMBER_PTR for `body`
in `rb_method_definition_t`.
|
|
|
|
|
| |
Coverity Scan says `Execution cannot reach this statement: "poison_object(v);"`,
so do nothing when `ptr` is always 0 without address_sanitizer.
|
| |
|
|
|
|
| |
[Feature #15665]
|
|
|
|
| |
Also requested by Ko1.
|
|
|
|
| |
requested by Ko1.
|
|
|
|
|
| |
This function is used for marking / pinning vm stack values, so it
should have "vm" in the function name to be more clear.
|
| |
|
|
|
|
|
| |
clang's sanitizer/msan_interface.h has fallback macros.
It causes redefinition of __msan_unpoison().
|
| |
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
🙏
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
For some reason symbols (or classes) are being overridden in trunk
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
[ruby-core:87945] [Feature #14912]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds the new method `GC.compact` and compacting GC support.
Please see this issue for caveats:
https://bugs.ruby-lang.org/issues/15626
[Feature #15626]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
Because hard to specify commits related to r67479 only.
So please commit again.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds the new method `GC.compact` and compacting GC support.
Please see this issue for caveats:
https://bugs.ruby-lang.org/issues/15626
[Feature #15626]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* internal.h (rb_imemo_tmpbuf_auto_free_pointer_new_from_an_RString):
create tmpbuf to keep the pointer before xmalloc which can raise
a NoMemoryError exception. extracted from
https://github.com/bear-metal/ruby/tree/transient-imemo-tmpbuf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
This fixes some ASAN errors
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* include/ruby/ruby.h: replace a magic number with RVALUE_EMBED_LEN_MAX,
which indicates the number of VALUE elements can be embedded in a RVALUE.
* internal.h: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* enumerator.c (arith_seq_first): fix for Float::INFINITY.
* test/ruby/test_arithmetic_sequence.rb: add tests.
* numeric.c (ruby_float_step_size): export for internal use.
* internal.h: add prototype declaration of ruby_float_step_size.
[ruby-core:90937][Bug #15518]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
and functions to clarify the intention and make sure it's not used in a
surprising way (like using 2, 3, ... other than 0, 1 even while it seems
to be a boolean).
This is a retry of r66775. It included some typos...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
This reverts commit bb1a1aeab0f2a5fe437c89b841a887ba56653453.
We hit something on ci.rvm.jp, reverting until investigation is done.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
and functions to clarify the intention and make sure it's not used in a
surprising way (like using 2, 3, ... other than 0, 1 even while it seems
to be a boolean).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* hash.c: add special setter function (inc and dec).
* internal.h: constify RHash::iter_leve.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
| |
* eval_error.c (print_errinfo): defer escaping control char in
error messages until writing to stderr, instead of quoting at
building the message. [ruby-core:90853] [Bug #15497]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
because we had another one in missing/stdbool.h as well.
Assuming that _Bool does not exist when stdbool.h is absent, I'm in
favor of r57462 implementation rather than r61326.
Note that Visual Studio 2013 has stdbool.h and thus r57462's commit
message is somewhat misleading. This missing/stdbool.h is for Visual
Studio 2012 or older, and for Oracle Solaris Studio 12.2 or older because
it's added in 12.3 https://docs.oracle.com/cd/E24457_01/html/E21987/gkeza.html.
missing/stdbool.h: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Optimize f_mul for the core numeric class components.
This change improves the computation time of Complex#* and Complex#**.
```
$ make benchmark ITEM=complex_float_ COMPARE_RUBY=/Users/mrkn/.rbenv/versions/2.6.0/bin/ruby
generating known_errors.inc
known_errors.inc unchanged
/Users/mrkn/src/github.com/ruby/ruby/revision.h unchanged
/Users/mrkn/.rbenv/shims/ruby --disable=gems -rrubygems -I/Users/mrkn/src/github.com/ruby/ruby/benchmark/lib /Users/mrkn/src/github.com/ruby/ruby/benchmark/benchmark-driver/exe/benchmark-driver \
--executables="compare-ruby::/Users/mrkn/.rbenv/versions/2.6.0/bin/ruby -I.ext/common --disable-gem" \
--executables="built-ruby::./miniruby -I/Users/mrkn/src/github.com/ruby/ruby/lib -I. -I.ext/common -r/Users/mrkn/src/github.com/ruby/ruby/prelude --disable-gem" \
$(find /Users/mrkn/src/github.com/ruby/ruby/benchmark -maxdepth 1 -name '*complex_float_*.yml' -o -name '*complex_float_*.rb' | sort)
Calculating -------------------------------------
compare-ruby built-ruby
complex_float_add 6.558M 13.012M i/s - 1.000M times in 0.152480s 0.076850s
complex_float_div 576.821k 567.969k i/s - 1.000M times in 1.733640s 1.760660s
complex_float_mul 1.690M 2.628M i/s - 1.000M times in 0.591786s 0.380579s
complex_float_new 1.350M 1.268M i/s - 1.000M times in 0.740669s 0.788762s
complex_float_power 1.571M 1.835M i/s - 1.000M times in 0.636507s 0.544909s
complex_float_sub 8.635M 8.779M i/s - 1.000M times in 0.115814s 0.113906s
Comparison:
complex_float_add
built-ruby: 13012361.7 i/s
compare-ruby: 6558237.1 i/s - 1.98x slower
complex_float_div
compare-ruby: 576821.0 i/s
built-ruby: 567968.8 i/s - 1.02x slower
complex_float_mul
built-ruby: 2627575.4 i/s
compare-ruby: 1689800.0 i/s - 1.55x slower
complex_float_new
compare-ruby: 1350130.8 i/s
built-ruby: 1267809.6 i/s - 1.06x slower
complex_float_power
built-ruby: 1835168.8 i/s
compare-ruby: 1571074.6 i/s - 1.17x slower
complex_float_sub
built-ruby: 8779168.8 i/s
compare-ruby: 8634534.7 i/s - 1.02x slower
```
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Optimize f_add defined in complex.c for some specific conditions.
It makes Complex#+ about 1.4x faster than r66678.
Compared to r66678:
```
mrkn-mbp15-late2016:complex-optim-o3 mrkn$ make benchmark ITEM=complex_float_ COMPARE_RUBY=/Users/mrkn/.rbenv/versions/trunk-o3/bin/ruby
/Users/mrkn/src/github.com/ruby/ruby/revision.h unchanged
/Users/mrkn/.rbenv/shims/ruby --disable=gems -rrubygems -I/Users/mrkn/src/github.com/ruby/ruby/benchmark/lib /Users/mrkn/src/github.com/ruby/ruby/benchmark/benchmark-driver/exe/benchmark-driver \
--executables="compare-ruby::/Users/mrkn/.rbenv/versions/trunk-o3/bin/ruby -I.ext/common --disable-gem" \
--executables="built-ruby::./miniruby -I/Users/mrkn/src/github.com/ruby/ruby/lib -I. -I.ext/common -r/Users/mrkn/src/github.com/ruby/ruby/prelude --disable-gem" \
$(find /Users/mrkn/src/github.com/ruby/ruby/benchmark -maxdepth 1 -name '*complex_float_*.yml' -o -name '*complex_float_*.rb' | sort)
Calculating -------------------------------------
compare-ruby built-ruby
complex_float_add 9.132M 12.864M i/s - 1.000M times in 0.109511s 0.077734s
complex_float_div 600.723k 627.878k i/s - 1.000M times in 1.664662s 1.592666s
complex_float_mul 2.320M 2.347M i/s - 1.000M times in 0.431039s 0.426113s
complex_float_new 1.473M 1.489M i/s - 1.000M times in 0.678791s 0.671750s
complex_float_power 1.690M 1.722M i/s - 1.000M times in 0.591863s 0.580775s
complex_float_sub 8.870M 9.516M i/s - 1.000M times in 0.112740s 0.105091s
Comparison:
complex_float_add
built-ruby: 12864383.7 i/s
compare-ruby: 9131502.8 i/s - 1.41x slower
complex_float_div
built-ruby: 627878.0 i/s
compare-ruby: 600722.5 i/s - 1.05x slower
complex_float_mul
built-ruby: 2346795.3 i/s
compare-ruby: 2319975.7 i/s - 1.01x slower
complex_float_new
built-ruby: 1488649.1 i/s
compare-ruby: 1473207.5 i/s - 1.01x slower
complex_float_power
built-ruby: 1721837.2 i/s
compare-ruby: 1689580.2 i/s - 1.02x slower
complex_float_sub
built-ruby: 9515562.7 i/s
compare-ruby: 8869966.3 i/s - 1.07x slower
```
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
| |
* internal.h: move ar_table def to hash.c because other files
don't need to know implementation of ar_table.
* hash.c (rb_hash_ar_table_size): added because gc.c needs to know
the size_of(ar_table).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
Reject ArithmeticSequence in rb_range_values so that methods like
Array#[] raises TypeError for ArithmeticSequence as an index.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
| |
* compile.c (compile_array): hide source Hash object.
* hash.c (rb_hash_resurrect): introduced to dup Hash object
using rb_cHash.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* internal.h: rename the following names:
* li_table -> ar_table. "li" means linear (from linear search),
but we use the word "array" (from data layout).
* RHASH_ARRAY -> RHASH_AR_TABLE. AR_TABLE is more clear.
* rb_hash_array_* -> rb_hash_ar_table_*.
* RHASH_TABLE_P() -> RHASH_ST_TABLE_P(). more clear.
* RHASH_CLEAR() -> RHASH_ST_CLEAR().
* hash.c: rename "linear_" prefix functions to "ar_" prefix.
* hash.c (linear_init_table): rename to ar_alloc_table.
* debug_counter.h: rename obj_hash_array to obj_hash_ar.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
[Feature #15066]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
|
|
| |
* complex.c (rb_complex_new_polar): renamed with _new to clarify
that it creates a new instance, but is not an instance method.
* complex.c (rb_complex_polar): deprecated.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|