summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-11-08Rubified the APIs of pack.cYusuke Endoh
Notes: Merged: https://github.com/ruby/ruby/pull/2659
2019-11-08tool/mk_builtin_loader.rb: check if op is an array or notYusuke Endoh
The insn array includes not only an array but also some literal objects.
2019-11-08Make prefix staticNobuyoshi Nakada
2019-11-08Update builtin include filesNobuyoshi Nakada
2019-11-08Add VPATH to rbinc rule for nmakeNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/2660
2019-11-08delete cc->aux.inc_sp卜部昌平
Nobody uses it.
2019-11-08Add file mode to generated files [ci skip]Nobuyoshi Nakada
2019-11-08builtin.h must be included *AFTER* vm_core.hNobuyoshi Nakada
2019-11-08Renamed `load_*.inc` as `*.rbinc` to utilize a suffix ruleNobuyoshi Nakada
2019-11-08Suppress "shadowing outer local variable" warning in 2.5aycabta
2019-11-08cstr -> bytesKoichi Sasada
rb_iseq_ibf_load_cstr() accepts bytes, but not NUL-terminate C string. To make it clear, rename it to _bytes.
2019-11-08fix line break code (fix to LF)Koichi Sasada
2019-11-08forget to add gc.rbKoichi Sasada
2019-11-08use builtins for GC.Koichi Sasada
Define a part of GC in gc.rb.
2019-11-08Stop compiling if type mismatch was found.Koichi Sasada
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.
2019-11-08builtin.h must be included *AFTER* vm_core.hNobuyoshi Nakada
2019-11-08Removed BOM [ci skip]Nobuyoshi Nakada
2019-11-08Fix typoKazuki Tsujimoto
2019-11-08name the result of calccall卜部昌平
This is a pure refactoring for better understanding of what is happening here. Should change nothing but readability.
2019-11-08Define Struct#deconstruct_keysKazuki Tsujimoto
2019-11-08revival of __func__卜部昌平
dad2abc69fdd1af52df353b8604017bd6a5c6a99 deleted __func__ but ruby already use this feature under RUBY_FUNCTION_NAME_STRING macro. Use it.
2019-11-08describe vm_cache_check_for_class_serial [ci skip]卜部昌平
Added comments describing what it is. Requested by ko1.
2019-11-08Change requirements of BASERUBY.Koichi Sasada
"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.
2019-11-08Define IO#read/write_nonblock with builtins.Koichi Sasada
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.
2019-11-08do not use __func__.Koichi Sasada
Microsoft Visual Studio 12.0 doesn't support it.
2019-11-08fix line break code (fix to LF)Koichi Sasada
2019-11-08fix typeKoichi Sasada
2019-11-08* remove trailing spaces. [ci skip]git
2019-11-08use builtin for RubyVM::AbstractSyntaxTree.Koichi Sasada
Define RubyVM::AbstractSyntaxTree in ast.rb with __builtin functions. Notes: Merged: https://github.com/ruby/ruby/pull/2655
2019-11-08use builtin for TracePoint.Koichi Sasada
Define TracePoint in trace_point.rb and use __builtin_ syntax. Notes: Merged: https://github.com/ruby/ruby/pull/2655
2019-11-08support builtin features with Ruby and C.Koichi Sasada
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
2019-11-07Add a counter for compactionAaron Patterson
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.
2019-11-08* 2019-11-08 [ci skip]git
2019-11-07Use a monotonically increasing number for object_idJohn Hawthorn
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>
2019-11-07Suppress unused variable warningNobuyoshi Nakada
2019-11-07Use FIX2LONG instead of FIX2INT like 26843cbcd0NARUSE, Yui
2019-11-07Use FIX2LONG to avoid unexpected exceptionNARUSE, Yui
Though it won't happen in the real world in this context, FIX2INT may raise an exception and it cause to generate extra code.
2019-11-07extend rb_call_cache卜部昌平
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
2019-11-07Fixed test failure related Net::ProtocolHiroshi SHIBATA
2019-11-07SMTP is not moduleHiroshi SHIBATA
2019-11-07Promote cgi to default gemsHiroshi SHIBATA
2019-11-07Promote net-smtp to default gemsHiroshi SHIBATA
2019-11-07Promote net-pop to default gemsHiroshi SHIBATA
2019-11-07Promote benchmark to default gemsHiroshi SHIBATA
2019-11-07Promote delegate to default gemsHiroshi SHIBATA
2019-11-07Promote pstore to default gemsHiroshi SHIBATA
2019-11-07Promote getoptlong to default gemsHiroshi SHIBATA
2019-11-07Fixed an Errno::ENOENT with non-test librariesHiroshi SHIBATA
2019-11-07Disallow duplicated pattern variableKazuki Tsujimoto
2019-11-07Add missing semicolonKazuki Tsujimoto