Age | Commit message (Collapse) | Author |
|
when it's not used. This macro is not used when it's direct threaded code.
This patch is purely for readability and has no impact for any behavior.
|
|
|
|
The original code looks unnecessarily complicated (to me).
Also, it creates a pre-allocated array only for the prefix of the array.
The new code optimizes not only the prefix but also the subsequence that
is longer than 0x40 elements.
# not optimized
10000000.times { [1+1, 1,2,3,4,...,63] } # 2.12 sec.
# (1+1; push 1; push 2; ...; puts 63; newarray 64; concatarray)
# optimized
10000000.times { [1+1, 1,2,3,4,...,63,64] } # 1.46 sec.
# (1+1; newarray 1; putobject [1,2,3,...,64]; concatarray)
|
|
The same refactoring as to b601b13c7267889bf394146353c5f2b0eb488278.
|
|
"popped" case can be so simple, so this change moves the branch to the
first, instead of scattering `if (popped)` branches to the main part.
Also, the return value "len" is not used. So it returns just 0 or 1.
|
|
[Bug #16007]
|
|
|
|
|
|
compile_list was for the compilation of Array literal and Hash literal.
I guess it was originally reasonable to handle them in one function, but
now, compilation of Array is very different from Hash. So the function
was complicated by many branches for Array and Hash.
This change separates the function to two ones for Array and Hash.
|
|
An array literal [1,2,...,301] was compiled to the following iseq:
duparray [1,2,...,300]
putobject [301]
concatarray
The Array literal optimization took every two elements maybe because it
must handle not only Array but also Hash.
Now the optimization takes each element if it is an Array literal. So
the new iseq is: duparray [1,2,...,301].
|
|
`[{}, {}, {}, ..., {}, *{}]` is wrongly created.
A big array literal is created and concatenated for every 256 elements.
The newarraykwsplat must be emitted only at the last chunk.
|
|
|
|
from array to list.
Follow up to ac50ac03aeb210763730cdc45f230e236519223d
|
|
and NODE_ZARRAY to NODE_ZLIST.
NODE_ARRAY is used not only by an Array literal, but also the contents
of Hash literals, method call arguments, dynamic string literals, etc.
In addition, the structure of NODE_ARRAY is a linked list, not an array.
This is very confusing, so I believe `NODE_LIST` is a better name.
|
|
|
|
|
|
|
|
|
|
This were previously hidden because calls from C were not warned.
Notes:
Merged: https://github.com/ruby/ruby/pull/2432
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/2432
|
|
Previously, Ruby did not warn in these cases, and in some cases
did not have the same behavior. This makes calls from C handled
the same way as calls from Ruby.
Notes:
Merged: https://github.com/ruby/ruby/pull/2432
|
|
This makes objects created via #to_enum and related methods pass
keyword arguments as keywords.
To implement this, add a kw_splat member of struct enumerator and
struct iter_method_arg, and add rb_block_call_kw, which is the
same as rb_block_call_kw with a flag for whether the last argument
is keyword options.
Notes:
Merged: https://github.com/ruby/ruby/pull/2432
|
|
Method#call, UnboundMethod#bind_call
Also add keyword argument separation warnings for Class#new and Method#call.
To allow for keyword argument to required positional hash converstion in
cfuncs, add a vm frame flag indicating the cfunc was called with an empty
keyword hash (which was removed before calling the cfunc). The cfunc can
check this frame flag and add back an empty hash if it is passing its
arguments to another Ruby method. Add rb_empty_keyword_given_p function
for checking if called with an empty keyword hash, and
rb_add_empty_keyword for adding back an empty hash to argv.
All of this empty keyword argument support is only for 2.7. It will be
removed in 3.0 as Ruby 3 will not convert empty keyword arguments to
required positional hash arguments. Comment all of the relevent code
to make it obvious this is expected to be removed.
Add rb_funcallv_kw as an public C-API function, just like rb_funcallv
but with a keyword flag. This is used by rb_obj_call_init (internals
of Class#new). This also required expected call_type enum with
CALL_FCALL_KW, similar to the recent addition of CALL_PUBLIC_KW.
Add rb_vm_call_kw as a internal function, used by call_method_data
(internals of Method#call and UnboundMethod#bind_call). Add tests
for UnboundMethod#bind_call keyword handling.
Notes:
Merged: https://github.com/ruby/ruby/pull/2432
|
|
|
|
|
|
|
|
|
|
* check --srcdir if given twice or more
* falls back to the current working directory if no --srcdir
option is given.
* define common VCS options.
|
|
|
|
As AppVeyor's MSYS2 install gets out of date, this may require 'special' code...
This code also adds updating the database, which currently updates gcc from 9.1.0 to 9.2.0.
Notes:
Merged: https://github.com/ruby/ruby/pull/2433
|
|
This return skips `va_end(ap)`, which is not intended, I guess.
Coverity Scan found this.
|
|
Fixing a bug on Windows introduced in v0.15.0
|
|
The first time SortedSet#initialize is called, it overwrites
itself, then recalls #initialize, which results in calling the
subclass's initialize, not the current initialize.
Just inline the default initialize behavior to avoid this issue.
No test for this as it can only be triggered the very first time
that SortedSet#initialize is called.
Fixes [Bug #15830]
|
|
|
|
It got some nice features for better support of
benchmark_driver-output-charty, Windows, ridk, and rbenv.
|
|
`str2 = rb_str_new_frozen(str1)` seems to make str1 a shared string that
refers to str2, but str2 is not marked as STR_IS_SHARED_M nor
STR_NOFREE.
`rb_fstring(str2)` frees str2's ptr because it is not marked, and the
free'ed pointer is the same as str1's ptr.
After that, accessing str1 may cause use-after-free memory corruption.
I guess this is a bug of rb_str_new_frozen, but I'm completely unsure
what it should be; the string states and flags are not documented.
So, this is a workaround for [Bug #16136]. I confirmed that rspec of
activeadmin runs gracefully.
|
|
|
|
|
|
|
|
Kill the failing tests.
|
|
https://github.com/ruby/ruby/runs/213995386#step:7:810
```
cxxanyargs.cpp
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt\corecrt_malloc.h(54): error C2485: '__restrict': unrecognized extended attribute
```
|
|
Otherwise the dynamic linker cannot find this function.
See also https://ci.appveyor.com/project/ruby/ruby/builds/27224231/job/4pg6lxlsnsjotu2l
|
|
Should use numeric 0 for maximum portability.
See also https://travis-ci.org/ruby/ruby/jobs/581543798
|
|
See also https://github.com/ruby/ruby/runs/213964487
|
|
|
|
Compilation of extension libraries written in C++ are reportedly
broken due to https://github.com/ruby/ruby/pull/2404
The root cause of this issue was that the definition of ANYARGS
differ between C and C++, and that of C++ is incompatible with the
updated ones.
We are using the incompatibility against itself. In C++ two distinct
function prototypes can be overloaded. We provide the old, ANYARGSed
prototypes in addition to the current granular ones; and let the
older ones warn about types.
|
|
|
|
This reverts commit 433c9c00d96124e3b416d0a20ff795b0ad4273fa.
Successfully captured some traces, and
3b60e5e6bc2c84b971bea9c8312eb5d33ada2ff5 seems to fix the issue.
|
|
|
|
|