| Age | Commit message (Collapse) | Author |
|
|
|
Primitve.cexpr! and .cstmt! can access Ruby's parameter and
*local variables* (note that local parameters are also local
variables). However recent changes only allow to access
parameters. This patch fix it.
For example, the following code can work:
def foo a, b, k: :kw, **kwrest
c = a + b
d = k
e = kwrest
p Primitive.cstmt!(%q(rb_p(rb_ary_new_from_args(5, a, b, c, d, e));
return Qnil;))
end
|
|
Latest bundler includes a file named `.gitlab-ci.yml.tt`. Because of
this too specific .gitignore entry, it was failing to be properly
imported.
Notes:
Merged: https://github.com/ruby/ruby/pull/3230
|
|
* Make Kernel#then, #yield_self, #frozen? builtin
* Fix test_jit
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
|
|
when an ISeq has multiple ivar accesses.
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
|
|
|
|
* Rewrite Kernel#tap with Ruby
This was good for VM too, but of course my intention is to unblock JIT's inlining of a block over yield
(inlining invokeyield has not been committed though).
* Fix test_settracefunc
About the :tap deletions, the :tap events are actually traced (we already have a TracePoint test for builtin methods),
but it's filtered out by tp.path == "xyzzy" (it became "<internal:kernel>"). We could trace tp.path == "<internal:kernel>"
cases too, but the lineno is impacted by kernel.rb changes and I didn't want to make it fragile for kernel.rb lineno changes.
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
|
|
*Methods:
keep_if
delete
delete_at
slice!
Notes:
Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
|
|
Use ID instead of GENTRY for gvars.
Global variables are compiled into GENTRY (a pointer to struct
rb_global_entry). This patch replace this GENTRY to ID and
make the code simple.
We need to search GENTRY from ID every time (st_lookup), so
additional overhead will be introduced.
However, the performance of accessing global variables is not
important now a day and this simplicity helps Ractor development.
Notes:
Merged-By: ko1 <ko1@atdot.net>
|
|
* RUBY_DEBUG_LOG: Logging debug information mechanism
This feature provides a mechanism to store logging information
to a file, stderr or memory space with simple macros.
The following information will be stored.
* (1) __FILE__, __LINE__ in C
* (2) __FILE__, __LINE__ in Ruby
* (3) __func__ in C (message title)
* (4) given string with sprintf format
* (5) Thread number (if multiple threads are running)
This feature is enabled only USE_RUBY_DEBUG_LOG is enabled.
Release version should not enable it.
Running with the `RUBY_DEBUG_LOG` environment variable enables
this feature.
# logging into a file
RUBY_DEBUG_LOG=/path/to/file STDERR
# logging into STDERR
RUBY_DEBUG_LOG=stderr
# logging into memory space (check with a debugger)
# It will help if the timing is important.
RUBY_DEBUG_LOG=mem
RUBY_DEBUG_LOG_FILTER environment variable can specify the fileter string.
If "(3) __func__ in C (message title)" contains the specified string, the
infomation will be stored (example: RUBY_DEBUG_LOG_FILTER=str will enable
only on str related information).
In a MRI source code, you can use the following macros:
* RUBY_DEBUG_LOG(fmt, ...): Above (1) to (4) will be logged.
* RUBY_DEBUG_LOG2(file, line, fmt, ...):
Same as RUBY_DEBUG_LOG(), but (1) will be replaced with given file, line.
Notes:
Merged-By: ko1 <ko1@atdot.net>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3280
|
|
```
/home/mame/work/ruby/.ext/common/json/common.rb:263: warning: Float 23456789012E666 out of range
```
|
|
|
|
|
|
|
|
|
|
This changeset changes for instance Integer#integer? from:
== disasm: #<ISeq:to_i@<internal:integer>:66 (66,2)-(69,5)> (catch: FALSE)
0000 opt_invokebuiltin_delegate_leave <builtin!_bi7/0>, 0 (68)[LiCa]
0003 leave (69)[Re]
to:
== disasm: #<ISeq:to_i@<internal:integer>:66 (66,2)-(69,5)> (catch: FALSE)
0000 putself (68)[LiCa]
0001 leave (69)[Re]
which is of course faster.
Notes:
Merged: https://github.com/ruby/ruby/pull/3277
|
|
When rationalizing negative values.
|
|
|
|
|
|
|
|
|
|
|
|
https://github.com/flori/json/commit/26c1769969
|
|
https://github.com/flori/json/commit/ee5b6a74e9
|
|
When use non-frozen string for hash key with `rb_hash_aset()`, it will duplicate and freeze it internally.
To avoid duplicate and freeze, this patch will give a frozen string in `rb_hash_aset()`.
```
Warming up --------------------------------------
json 14.000 i/100ms
Calculating -------------------------------------
json 148.844 (± 1.3%) i/s - 756.000 in 5.079969s
```
```
Warming up --------------------------------------
json 16.000 i/100ms
Calculating -------------------------------------
json 165.608 (± 1.8%) i/s - 832.000 in 5.025367s
```
```
require 'json'
require 'securerandom'
require 'benchmark/ips'
obj = []
1000.times do |i|
obj << {
"id": i,
"uuid": SecureRandom.uuid,
"created_at": Time.now
}
end
json = obj.to_json
Benchmark.ips do |x|
x.report "json" do |iter|
count = 0
while count < iter
JSON.parse(json)
count += 1
end
end
end
```
https://github.com/flori/json/commit/18292c0c1d
|
|
https://github.com/flori/json/commit/ada48f0236
|
|
https://github.com/flori/json/commit/470d909c0d
|
|
https://github.com/flori/json/commit/7bee2c7c13
|
|
https://github.com/flori/json/commit/d5c6566b41
|
|
https://github.com/flori/json/commit/e7e3732130
|
|
|
|
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3272
|
|
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3270
|
|
This reverts commit c8dc2bf1401fc01d35a4a7587ed224f1f2fe29e6.
No longer necessary.
|
|
(I was not aware of this because I use clang, but) it seems gcc cannot
detect reachablility of this point. It renders an unused variable
warning, which is a false positive. Let us suppress the compiler.
https://github.com/ruby/ruby/runs/816997191#step:9:62
|
|
|
|
Reduce goto by splitting the function.
Notes:
Merged: https://github.com/ruby/ruby/pull/3247
|
|
Nobu likes this arrangement.
Notes:
Merged: https://github.com/ruby/ruby/pull/3247
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3247
|
|
Not every compilers understand that rb_raise does not return. When a
function does not end with a return statement, such compilers can issue
warnings. We would better tell them about reachabilities.
Notes:
Merged: https://github.com/ruby/ruby/pull/3247
|
|
Prevent casual typos inside of UNREACHABLE_RETURN(...).
Notes:
Merged: https://github.com/ruby/ruby/pull/3247
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3247
|
|
The rb_exc_new3() result is already ready to be returned. No need to
fall through the switch.
Notes:
Merged: https://github.com/ruby/ruby/pull/3247
|
|
Found that `if (builtin_class_name) { printf } else { printf }` happens
twice. It would be better if we could eliminate those if statements.
Notes:
Merged: https://github.com/ruby/ruby/pull/3247
|
|
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
Notes:
Merged: https://github.com/ruby/ruby/pull/3247
|