summaryrefslogtreecommitdiff
path: root/common.mk
AgeCommit message (Collapse)Author
2020-10-26Include c_escape.rb in COMPILE_PRELUDENobuyoshi Nakada
template/prelude.c.tmpl requires tool/ruby_vm/helpers/c_escape.rb.
2020-10-21Ractor.make_shareable(obj)Koichi Sasada
Introduce new method Ractor.make_shareable(obj) which tries to make obj shareable object. Protocol is here. (1) If obj is shareable, it is shareable. (2) If obj is not a shareable object and if obj can be shareable object if it is frozen, then freeze obj. If obj has reachable objects (rs), do rs.each{|o| Ractor.make_shareable(o)} recursively (recursion is not Ruby-level, but C-level). (3) Otherwise, raise Ractor::Error. Now T_DATA is not a shareable object even if the object is frozen. If the method finished without error, given obj is marked as a sharable object. To allow makng a shareable frozen T_DATA object, then set `RUBY_TYPED_FROZEN_SHAREABLE` as type->flags. On default, this flag is not set. It means user defined T_DATA objects are not allowed to become shareable objects when it is frozen. You can make any object shareable by setting FL_SHAREABLE flag, so if you know that the T_DATA object is shareable (== thread-safe), set this flag, at creation time for example. `Ractor` object is one example, which is not a frozen, but a shareable object. Notes: Merged: https://github.com/ruby/ruby/pull/3678
2020-10-20Some global variables can be accessed from ractorsKoichi Sasada
Some global variables should be used from non-main Ractors. [Bug #17268] ```ruby # ractor-local (derived from created ractor): debug '$DEBUG' => $DEBUG, '$-d' => $-d, # ractor-local (derived from created ractor): verbose '$VERBOSE' => $VERBOSE, '$-w' => $-w, '$-W' => $-W, '$-v' => $-v, # process-local (readonly): other commandline parameters '$-p' => $-p, '$-l' => $-l, '$-a' => $-a, # process-local (readonly): getpid '$$' => $$, # thread local: process result '$?' => $?, # scope local: match '$~' => $~.inspect, '$&' => $&, '$`' => $`, '$\'' => $', '$+' => $+, '$1' => $1, # scope local: last line '$_' => $_, # scope local: last backtrace '$@' => $@, '$!' => $!, # ractor local: stdin, out, err '$stdin' => $stdin.inspect, '$stdout' => $stdout.inspect, '$stderr' => $stderr.inspect, ``` Notes: Merged: https://github.com/ruby/ruby/pull/3670
2020-10-20Bundle typeprof gem as bundled gemsYusuke Endoh
Notes: Merged: https://github.com/ruby/ruby/pull/3668
2020-10-17sync RClass::ext::iv_index_tblKoichi Sasada
iv_index_tbl manages instance variable indexes (ID -> index). This data structure should be synchronized with other ractors so introduce some VM locks. This patch also introduced atomic ivar cache used by set/getinlinecache instructions. To make updating ivar cache (IVC), we changed iv_index_tbl data structure to manage (ID -> entry) and an entry points serial and index. IVC points to this entry so that cache update becomes atomically. Notes: Merged: https://github.com/ruby/ruby/pull/3662
2020-10-14sync generic_ivtblKoichi Sasada
generic_ivtbl is a process global table to maintain instance variables for non T_OBJECT/T_CLASS/... objects. So we need to protect them for multi-Ractor exection. Hint: we can make them Ractor local for unshareable objects, but now it is premature optimization. Notes: Merged: https://github.com/ruby/ruby/pull/3655
2020-10-14sync enc_table and rb_encoding_listKoichi Sasada
enc_table which manages Encoding information. rb_encoding_list also manages Encoding objects. Both are accessed/modified by ractors simultaneously so that they should be synchronized. For enc_table, this patch introduced GLOBAL_ENC_TABLE_ENTER/LEAVE/EVAL to access this table with VM lock. To make shortcut, three new global variables global_enc_ascii, global_enc_utf_8, global_enc_us_ascii are also introduced. For rb_encoding_list, we split it to rb_default_encoding_list (256 entries) and rb_additional_encoding_list. rb_default_encoding_list is fixed sized Array so we don't need to synchronized (and most of apps only needs it). To manage 257 or more encoding objects, they are stored into rb_additional_encoding_list. To access rb_additional_encoding_list., VM lock is needed. Notes: Merged: https://github.com/ruby/ruby/pull/3654
2020-09-29Fixed installation failure [Bug #17191]Nobuyoshi Nakada
Try update and extract bundled gems only when baseruby is available. It should be done only when installing from developemental build and not from the tarball, but it is not obvious to differentiate them.
2020-09-29Fix up dependencies on internal/sanitizers.hNobuyoshi Nakada
2020-09-26update-depsNARUSE, Yui
https://github.com/ruby/ruby/runs/1169621878
2020-09-25Buffer protocol proposal (#3261)Kenta Murata
* Add buffer protocol * Modify for some review comments * Per-object buffer availability * Rename to MemoryView from Buffer and make compilable * Support integral repeat count in memory view format * Support 'x' for padding bytes * Add rb_memory_view_parse_item_format * Check type in rb_memory_view_register * Update dependencies in common.mk * Add test of MemoryView * Add test of rb_memory_view_init_as_byte_array * Add native size format test * Add MemoryView test utilities * Add test of rb_memory_view_fill_contiguous_strides * Skip spaces in format string * Support endianness specifiers * Update documentation * Support alignment * Use RUBY_ALIGNOF * Fix format parser to follow the pack format * Support the _ modifier * Parse count specifiers in get_format_size function. * Use STRUCT_ALIGNOF * Fix test * Fix test * Fix total size for the case with tail padding * Fix rb_memory_view_get_item_pointer * Fix rb_memory_view_parse_item_format again Notes: Merged-By: mrkn <mrkn@ruby-lang.org>
2020-09-25Update dependenciesKazuhiro NISHIYAMA
Notes: Merged: https://github.com/ruby/ruby/pull/3582
2020-09-23Bundle rbs gem as bundled gems (#3496)Hiroshi SHIBATA
* Added rbs as bundled gems * Added the missing dependencies for rbs gem Notes: Merged-By: soutaro <matsumoto@soutaro.com>
2020-09-21When setting current thread scheduler to nil, invoke `#close`.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3557
2020-09-18sync ruby_global_symbolsKoichi Sasada
ruby_global_symbols can be accessed with multiple ractors so that the accesses should be synchronized. Notes: Merged: https://github.com/ruby/ruby/pull/3548
2020-09-15sync fstring poolKoichi Sasada
fstring pool should be sync with other Ractors. Notes: Merged: https://github.com/ruby/ruby/pull/3534
2020-09-14Update dependenciesSamuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3434
2020-09-14Standardised scheduler interface.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3434
2020-09-07separate rb_random_tNobuyoshi Nakada
* random.c: separate abstract rb_random_t and rb_random_mt_t for Mersenne Twister implementation. * include/ruby/random.h: the interface for extensions of Random class. * DLL imported symbol reference is not constant on Windows. * check if properly initialized. Notes: Merged: https://github.com/ruby/ruby/pull/3024
2020-09-05common.mk: UNALIGNED_MEMBER_ACCESS needs internal/warnings.h on some platformsNobuyoshi Nakada
2020-09-04Updated dependencyNobuyoshi Nakada
2020-09-03Introduce Ractor mechanism for parallel executionKoichi Sasada
This commit introduces Ractor mechanism to run Ruby program in parallel. See doc/ractor.md for more details about Ractor. See ticket [Feature #17100] to see the implementation details and discussions. [Feature #17100] This commit does not complete the implementation. You can find many bugs on using Ractor. Also the specification will be changed so that this feature is experimental. You will see a warning when you make the first Ractor with `Ractor.new`. I hope this feature can help programmers from thread-safety issues. Notes: Merged: https://github.com/ruby/ruby/pull/3365
2020-09-01Revert the workaround of minitest and hoeHiroshi SHIBATA
86737c509cd49cfe4509a65d300d390da0f07be6 3e1aea461320094e634ab32ca0b13dd43b69d8b0 Notes: Merged: https://github.com/ruby/ruby/pull/3493
2020-08-31Removed minitest and hoe because they didn't support Ruby 3 yetHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3480
2020-08-27sed -i '/rmodule.h/d'卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/3347
2020-08-27sed -i '/r_cast.h/d'卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/3346
2020-08-27sed -i '\,2/extern.h,d'卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/3338
2020-08-19tool/update-deps -fix卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/3427
2020-08-15tool/update-deps --fix卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/3419
2020-07-29Skip already extracted gemsNobuyoshi Nakada
2020-07-13common.mk: add missing dependency卜部昌平
2020-07-05Skip comment and empty lines in gems/bundled_gems fileNobuyoshi Nakada
2020-06-23Annotate Kernel#class as inline (#3250)Takashi Kokubun
``` $ benchmark-driver -v --rbenv 'before;after;before --jit;after --jit' benchmark/mjit_class.yml --repeat-count=4 before: ruby 2.8.0dev (2020-06-23T07:09:54Z master 37a2e48d76) [x86_64-linux] after: ruby 2.8.0dev (2020-06-23T17:29:56Z inline-class 0ff147c007) [x86_64-linux] before --jit: ruby 2.8.0dev (2020-06-23T07:09:54Z master 37a2e48d76) +JIT [x86_64-linux] after --jit: ruby 2.8.0dev (2020-06-23T17:29:56Z inline-class 0ff147c007) +JIT [x86_64-linux] Calculating ------------------------------------- before after before --jit after --jit mjit_class(self) 39.219M 40.060M 53.502M 69.202M i/s - 40.000M times in 1.019915s 0.998495s 0.747631s 0.578021s mjit_class(1) 39.567M 41.242M 52.100M 68.895M i/s - 40.000M times in 1.010935s 0.969885s 0.767749s 0.580591s Comparison: mjit_class(self) after --jit: 69201690.7 i/s before --jit: 53502336.4 i/s - 1.29x slower after: 40060289.1 i/s - 1.73x slower before: 39218939.2 i/s - 1.76x slower mjit_class(1) after --jit: 68895358.6 i/s before --jit: 52100353.0 i/s - 1.32x slower after: 41241993.6 i/s - 1.67x slower before: 39567314.0 i/s - 1.74x slower ``` Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2020-06-22Stop relying on `make benchmark`'s `-I$(srcdir)/benchmark/lib`Takashi Kokubun
These days I don't use `make benchmark`. The YAML files should be executable with bare `benchmark-driver` CLI without passing `RUBYOPT=-Ibenchmark/lib`.
2020-06-20Make Integer#zero? a separated method and builtin (#3226)Takashi Kokubun
A prerequisite to fix https://bugs.ruby-lang.org/issues/15589 with JIT. This commit alone doesn't make a significant difference yet, but I thought this commit should be committed independently. This method override was discussed in [Misc #16961]. Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2020-06-19Build configured extension libraries onlyNobuyoshi Nakada
Consider the libraries, which remain exts.mk but not listed in ext/configure-ext.mk, removed.
2020-06-18$(PREP) is needed to run $(MINIRUBY)Nobuyoshi Nakada
2020-06-17Replaced accessors of `Struct` with `invokebuiltin`Nobuyoshi Nakada
2020-06-16Revert "Replaced accessors of `Struct` with `invokebuiltin`"Nobuyoshi Nakada
This reverts commit 19cabe8b09d92d033c244f32ff622b8e513375f1, which didn't support tool/lib/iseq_loader_checker.rb.
2020-06-16Replaced accessors of `Struct` with `invokebuiltin`Nobuyoshi Nakada
2020-06-13Added install-dbgNobuyoshi Nakada
Scripts to run the interpreter via debugger.
2020-06-11Updated autogenerated dependenciesNobuyoshi Nakada
Sorted the lines asnd added mjit_build_dir.o dependencies.
2020-06-10Skip updating exts in test-all to reduce the turnaround timeNobuyoshi Nakada
2020-06-08Fixed main dependencyNobuyoshi Nakada
`programs` has depended on the "fake" script, which is used by `test-spec` and etc.
2020-06-08Fixed test dependenciesNobuyoshi Nakada
All tests of `test-all` or more require not only the `main` but also extension libraries.
2020-06-08Updated the benchmark-driver versionNobuyoshi Nakada
2020-06-08Defaulted benchmark output to markdown with comarisonNobuyoshi Nakada
2020-06-05Fixup test-bundler-parallelNobuyoshi Nakada
* Do not chdir in the runner process, to access miniruby. Chdir in worker processes instead. * GNU make does not export newly added environment variables by default, set PARALLEL_TESTS_EXECUTABLE in the runner. Notes: Merged: https://github.com/ruby/ruby/pull/3189
2020-06-05Fixup 347127794e8041a1257b7241bbbdd9d0db2921a5Hiroshi SHIBATA
2020-06-05spec/bundler/support/parallel.rb is no longer used parallel_rspec.Hiroshi SHIBATA