Age | Commit message (Collapse) | Author |
|
Nobody uses it.
|
|
|
|
|
|
|
|
|
|
rb_iseq_ibf_load_cstr() accepts bytes, but not NUL-terminate
C string. To make it clear, rename it to _bytes.
|
|
|
|
|
|
Define a part of GC in gc.rb.
|
|
If there is a type mismatch between expected builtin function type
and actual function type, C compiler shows warning.
For example, `__builtin_func(1, 2)` expects
`func(rb_ec_t*, VALUE self, VALUE p1, VALUE p2)` function definition.
However, it is easy to overlook "warning" messages. So this patch
changes to stop compiling as an error if there is a mismatch.
|
|
|
|
|
|
|
|
This is a pure refactoring for better understanding of what is
happening here. Should change nothing but readability.
|
|
|
|
dad2abc69fdd1af52df353b8604017bd6a5c6a99 deleted __func__ but ruby
already use this feature under RUBY_FUNCTION_NAME_STRING macro.
Use it.
|
|
Added comments describing what it is. Requested by ko1.
|
|
"BASERUBY: Ruby 1.9.3" test on Travis-CI checks builds on Ruby 1.9.3.
However this version is too old and 46acd0075d requires Ruby 2.2 and
later.
|
|
IO#read/write_nonblock methods are defined in prelude.rb with
special private method __read/write_nonblock to reduce keyword
parameters overhead. We can move them into io.rb with builtin
functions.
|
|
Microsoft Visual Studio 12.0 doesn't support it.
|
|
|
|
|
|
|
|
Define RubyVM::AbstractSyntaxTree in ast.rb
with __builtin functions.
Notes:
Merged: https://github.com/ruby/ruby/pull/2655
|
|
Define TracePoint in trace_point.rb and use __builtin_ syntax.
Notes:
Merged: https://github.com/ruby/ruby/pull/2655
|
|
Support loading builtin features written in Ruby, which implement
with C builtin functions.
[Feature #16254]
Several features:
(1) Load .rb file at boottime with native binary.
Now, prelude.rb is loaded at boottime. However, this file is contained
into the interpreter as a text format and we need to compile it.
This patch contains a feature to load from binary format.
(2) __builtin_func() in Ruby call func() written in C.
In Ruby file, we can write `__builtin_func()` like method call.
However this is not a method call, but special syntax to call
a function `func()` written in C. C functions should be defined
in a file (same compile unit) which load this .rb file.
Functions (`func` in above example) should be defined with
(a) 1st parameter: rb_execution_context_t *ec
(b) rest parameters (0 to 15).
(c) VALUE return type.
This is very similar requirements for functions used by
rb_define_method(), however `rb_execution_context_t *ec`
is new requirement.
(3) automatic C code generation from .rb files.
tool/mk_builtin_loader.rb creates a C code to load .rb files
needed by miniruby and ruby command. This script is run by
BASERUBY, so *.rb should be written in BASERUBY compatbile
syntax. This script load a .rb file and find all of __builtin_
prefix method calls, and generate a part of C code to export
functions.
tool/mk_builtin_binary.rb creates a C code which contains
binary compiled Ruby files needed by ruby command.
Notes:
Merged: https://github.com/ruby/ruby/pull/2655
|
|
Keep track of the number of times the compactor ran. I would like to
use this as a way to keep track of inline cache reference updates.
|
|
|
|
This changes object_id from being based on the objects location in
memory (or a nearby memory location in the case of a conflict) to be
based on an always increasing number.
This number is a Ruby Integer which allows it to overflow the size of a
pointer without issue (very unlikely to happen in real programs
especially on 64-bit, but a nice guarantee).
This changes obj_to_id_tbl and id_to_obj_tbl to both be maps of Ruby
objects to Ruby objects (previously they were Ruby object to C integer)
which simplifies updating them after compaction as we can run them
through gc_update_table_refs.
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
|
|
|
|
|
|
Though it won't happen in the real world in this context, FIX2INT may
raise an exception and it cause to generate extra code.
|
|
Prior to this changeset, majority of inline cache mishits resulted
into the same method entry when rb_callable_method_entry() resolves
a method search. Let's not call the function at the first place on
such situations.
In doing so we extend the struct rb_call_cache from 44 bytes (in
case of 64 bit machine) to 64 bytes, and fill the gap with
secondary class serial(s). Call cache's class serials now behavies
as a LRU cache.
Calculating -------------------------------------
ours 2.7 2.6
vm2_poly_same_method 2.339M 1.744M 1.369M i/s - 6.000M times in 2.565086s 3.441329s 4.381386s
Comparison:
vm2_poly_same_method
ours: 2339103.0 i/s
2.7: 1743512.3 i/s - 1.34x slower
2.6: 1369429.8 i/s - 1.71x slower
Notes:
Merged: https://github.com/ruby/ruby/pull/2583
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
These functions are the same, so remove one.
Co-authored-by: John Hawthorn <john@hawthorn.email>
|
|
This reverts commit bd2b314a05ae9192b3143e1e678a37c370d8a9ce.
|
|
This changes object_id from being based on the objects location in
memory (or a nearby memory location in the case of a conflict) to be
based on an always increasing number.
This number is a Ruby Integer which allows it to overflow the size of a
pointer without issue (very unlikely to happen in real programs
especially on 64-bit, but a nice guarantee).
This changes obj_to_id_tbl and id_to_obj_tbl to both be maps of Ruby
objects to Ruby objects (previously they were Ruby object to C integer)
which simplifies updating them after compaction as we can run them
through gc_update_table_refs.
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
Notes:
Merged: https://github.com/ruby/ruby/pull/2638
|
|
|
|
|