summaryrefslogtreecommitdiff
path: root/tool
AgeCommit message (Collapse)Author
2019-11-28Use more template feature of w.r-l.oNARUSE, Yui
2019-11-27rename __builtin_inline!(code) and introduce others.Koichi Sasada
rename __builtin_inline!(code) to __builtin_cstmt(code). Also this commit introduce the following inlining C code features. * __builtin_cstmt!(STMT) (renamed from __builtin_inline!) Define a function which run STMT implicitly and call this function at evatuation time. Note that you need to return some value in STMT. If there is a local variables (includes method parameters), you can read these values. static VALUE func(ec, self) { VALUE x = ...; STMT } Usage: def double a # a is readable from C code. __builtin_cstmt! 'return INT2FIX(FIX2INT(a) * 2);' end * __builtin_cexpr!(EXPR) Define a function which invoke EXPR implicitly like `__builtin_cstmt!`. Different from cstmt!, which compiled with `return EXPR;`. (`return` and `;` are added implicitly) static VALUE func(ec, self) { VALUE x = ...; return EXPPR; } Usage: def double a __builtin_cexpr! 'INT2FIX(FIX2INT(a) * 2)' end * __builtin_cconst!(EXPR) Define a function which invoke EXPR implicitly like cexpr!. However, the function is called once at compile time, not evaluated time. Any local variables are not accessible (because there is no local variable at compile time). Usage: GCC = __builtin_cconst! '__GNUC__' * __builtin_cinit!(STMT) STMT are writtein in auto-generated code. This code does not return any value. Usage: __builtin_cinit! '#include <zlib.h>' def no_compression? __builtin_cconst! 'Z_NO_COMPRESSION ? Qtrue : Qfalse' end
2019-11-26Write rbinc files to the source directoryNobuyoshi Nakada
Update the target file itself of the dependency on this script. Fall back to the current working directory if unwritable.
2019-11-26Add sync task for ruby/opensslHiroshi SHIBATA
2019-11-22Add github repo to remove_tagNARUSE, Yui
2019-11-22Use jsDelivr instead of raw.githubusercontent.comKazuhiro NISHIYAMA
Try to fix download error on Solaris CI https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-master/log/20191121T162422Z.fail.html.gz ``` tool/downloader.rb:243:in `rescue in download': failed to download config.guess (RuntimeError) Net::HTTPFatalError: 503 "Service Unavailable": https://raw.githubusercontent.com/gcc-mirror/gcc/master/config.guess ```
2019-11-18Dependents on probes.h need the dummy header tooNobuyoshi Nakada
2019-11-18Build ruby-runnerNobuyoshi Nakada
2019-11-18Skip dependencies on timestamp filesNobuyoshi Nakada
2019-11-18Warn on access/modify of $SAFE, and remove effects of modifying $SAFEJeremy Evans
This removes the security features added by $SAFE = 1, and warns for access or modification of $SAFE from Ruby-level, as well as warning when calling all public C functions related to $SAFE. This modifies some internal functions that took a safe level argument to no longer take the argument. rb_require_safe now warns, rb_require_string has been added as a version that takes a VALUE and does not warn. One public C function that still takes a safe level argument and that this doesn't warn for is rb_eval_cmd. We may want to consider adding an alternative method that does not take a safe level argument, and warn for rb_eval_cmd. Notes: Merged: https://github.com/ruby/ruby/pull/2476
2019-11-13Removed sync library from sync toolHiroshi SHIBATA
2019-11-13Avoid top-level search for nested constant reference from nil in defined?Dylan Thacker-Smith
Fixes [Bug #16332] Constant access was changed to no longer allow top-level constant access through `nil`, but `defined?` wasn't changed at the same time to stay consistent. Use a separate defined type to distinguish between a constant referenced from the current lexical scope and one referenced from another namespace. Notes: Merged: https://github.com/ruby/ruby/pull/2657
2019-11-13Add commit number of today to notification of GitHub ActionsKazuhiro NISHIYAMA
Notes: Merged: https://github.com/ruby/ruby/pull/2675
2019-11-12Strip the last line which become trailing spacesNobuyoshi Nakada
2019-11-12Get rid of `__` prefix which is presereved by C standardNobuyoshi Nakada
2019-11-12tool/lib/leakchecker.rb: show the code location that allocated leaked fdYusuke Endoh
by using ObjectSpace.trace_object_allocations. `make test-all LEAK_CHECKER_TRACE_OBJECT_ALLOCATION=true` will print not only leaked fds but also where it was created.
2019-11-12format-release uses the result of GitHub ActionsNARUSE, Yui
2019-11-12Always use git.ruby-lang.org as originNARUSE, Yui
naruse sets remote.origin.pushUrl = nonexistent as fail-safe configuration to avoid accidentally push a new branch to origin.
2019-11-11Revert "Revert "Promote uri to default gems""Hiroshi SHIBATA
This reverts commit fdfad905227a0e2e4c224d87181041fb75d5082e. f1f27da6c457684fdbfc0352297e6847f675ce4c resolved this.
2019-11-11__builtin_inline!Koichi Sasada
Add an experimental `__builtin_inline!(c_expression)` special intrinsic which run a C code snippet. In `c_expression`, you can access the following variables: * ec (rb_execution_context_t *) * self (const VALUE) * local variables (const VALUE) Not that you can read these variables, but you can not write them. You need to return from this expression and return value will be a result of __builtin_inline!(). Examples: `def foo(x) __builtin_inline!('return rb_p(x);'); end` calls `p(x)`. `def double(x) __builtin_inline!('return INT2NUM(NUM2INT(x) * 2);')` returns x*2.
2019-11-11Remove binary data at installationNobuyoshi Nakada
And revert "Relaxed warning assertions", 6f9be8505d172b110ec449478a791d70b9b74afb.
2019-11-09Remove unneeded exec bits from some filesDavid Rodríguez
I noticed that some files in rubygems were executable, and I could think of no reason why they should be. In general, I think ruby files should never have the executable bit set unless they include a shebang, so I run the following command over the whole repo: ```bash find . -name '*.rb' -type f -executable -exec bash -c 'grep -L "^#!" $1 || chmod -x $1' _ {} \; ``` Notes: Merged: https://github.com/ruby/ruby/pull/2662
2019-11-09Revert "Promote uri to default gems"Hiroshi SHIBATA
This reverts commit c5b4d2a2592942766dc2789f46105b91eba7026a. This commit affects with activation feature of RubyGems. [Bug #16337][ruby-core:95768]
2019-11-09Full-path of builtin scripts no longer neededNobuyoshi Nakada
2019-11-09Add debug printKazuhiro NISHIYAMA
http://ci.rvm.jp/results/trunk-mjit@silicon-docker/2380788 ``` test_all #<Thread:0x000055b6c8e9fca8@/tmp/ruby/v2/src/trunk-mjit/tool/lib/test/unit/parallel.rb:42 run> terminated with exception (report_on_exception is true): <internal:pack>:134:in `pack': no implicit conversion of false into String (TypeError) from /tmp/ruby/v2/src/trunk-mjit/tool/lib/test/unit/parallel.rb:160:in `_report' from /tmp/ruby/v2/src/trunk-mjit/tool/lib/test/unit/parallel.rb:45:in `block in _run_suite' ```
2019-11-09Promote uri to default gemsHiroshi SHIBATA
2019-11-09Promote yaml to default gemsHiroshi SHIBATA
2019-11-09Promote timeout to default gemsHiroshi SHIBATA
2019-11-09Promote observer to default gems. But not yet releasedHiroshi SHIBATA
2019-11-09Promote readline to default gems named readline-extHiroshi SHIBATA
2019-11-09Added gemspec for readline gem that is wrapper library for reline and ↵Hiroshi SHIBATA
readline extension
2019-11-09Revert "don't embed full-path."Koichi Sasada
This reverts commit dfac2e9eb3d697e56d91151584f1d3cf9d2c79c9. It does not work if cwd is different from builddir...
2019-11-09don't embed full-path.Koichi Sasada
miniruby load *.rb from srcdir. To specify file path, tool/mk_builtin_loader.rb embed full path of each *.rb file. However it prevent to pre-generation of required files for tarball. This patch generate srcdir/*.rb from __FILE__ information.
2019-11-09Prettify builtin_binary formatNobuyoshi Nakada
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-08Add file mode to generated files [ci skip]Nobuyoshi Nakada
2019-11-08Renamed `load_*.inc` as `*.rbinc` to utilize a suffix ruleNobuyoshi Nakada
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-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-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-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-07Fixed an Errno::ENOENT with non-test librariesHiroshi SHIBATA
2019-11-07Promote open3 to default gemsHiroshi SHIBATA
2019-11-07fallback standard structure library to sync_lib_gem methodHiroshi SHIBATA