summaryrefslogtreecommitdiff
path: root/common.mk
AgeCommit message (Collapse)Author
2020-12-17make RB_DEBUG_COUNTER_INC()_thread-safeKoichi Sasada
Notes: Merged: https://github.com/ruby/ruby/pull/3915
2020-12-16[memory_view] Make MemoryView API Ractor-safe (#3911)Kenta Murata
* memory_view.c: make Ractor-safe * test/ruby/test_memory_view.rb: Add test_ractor * memory_view: fix typo * memory_view.c: Use st_update in unregster_exported_object * memory_view: update dependency Notes: Merged-By: mrkn <mrkn@ruby-lang.org>
2020-12-16add vm_sync debug countersKoichi Sasada
* vm_sync_lock * vm_sync_lock_enter * vm_sync_lock_enter_nb * vm_sync_lock_enter_cr * vm_sync_barrier Notes: Merged: https://github.com/ruby/ruby/pull/3910
2020-12-14Update dependenciesAlan Wu
2020-12-12trap on non-main ractorKoichi Sasada
trap can accept blopck/Proc and it can violate Rator isolation, so the Proc should be isolatable when trap is used on non-main ractor. Notes: Merged: https://github.com/ruby/ruby/pull/3888
2020-12-11add RUNOPT and RUNOPT0 for dev rules.Koichi Sasada
run, runruby, ... accept RUNOPT and RUNOPT0 configuration to pass some commandline argument like that: $(BTESTRUBY) $(RUNOPT0) $(TESTRUN_SCRIPT) $(RUNOPT) RUNOPT0 is options for ruby interpreter (-w, -v, ...) RUNOPT is options for the script (ARGV/ARGF)
2020-12-10Added tool/lib into test-spec loadpathHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3729
2020-12-09Fix ArithmeticSequence#last and ArithmeticSequence#each for non-integer ↵Kenta Murata
sequences (#3870) [Bug #17218] [ruby-core:100312] Notes: Merged-By: mrkn <mrkn@ruby-lang.org>
2020-12-09Add support for non-blocking `Process.wait`.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3853
2020-12-07cancel theap on multi-ractorsKoichi Sasada
accessing theap needs complicating synchronization but it reduce performance on multi-ractor mode. So simply stop using theap on multi-ractor mode. In future, theap should be replaced with more cleaver memory strategy. Notes: Merged: https://github.com/ruby/ruby/pull/3842
2020-12-06Moved update-bundled_gems code to a toolNobuyoshi Nakada
2020-12-05Proposed method for dealing with stack locals which have non-local lifetime.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3624
2020-12-02test-bundled-gems: select bundled gems to test by BUNDLED_GEMSNobuyoshi Nakada
2020-12-01ractor local storage C-APIKoichi Sasada
To manage ractor-local data for C extension, the following APIs are defined. * rb_ractor_local_storage_value_newkey * rb_ractor_local_storage_value * rb_ractor_local_storage_value_set * rb_ractor_local_storage_ptr_newkey * rb_ractor_local_storage_ptr * rb_ractor_local_storage_ptr_set At first, you need to create a key of storage by rb_ractor_local_(value|ptr)_newkey(). For ptr storage, it accepts the type of storage, how to mark and how to free with ractor's lifetime. rb_ractor_local_storage_value/set are used to access a VALUE and rb_ractor_local_storage_ptr/set are used to access a pointer. random.c uses this API. Notes: Merged: https://github.com/ruby/ruby/pull/3822
2020-11-30Clean temproray directory created by test-specNobuyoshi Nakada
2020-11-30Clean static-rubyNobuyoshi Nakada
2020-11-30Keep references of memory-view-exported objects (#3816)Kenta Murata
* memory_view.c: remove a reference in view->obj at rb_memory_view_release * memory_view.c: keep references of memory-view-exported objects * Update common.mk * memory_view.c: Use st_update Notes: Merged-By: mrkn <mrkn@ruby-lang.org>
2020-11-22Make --disable-jit-support compileTakashi Kokubun
vm_core.h needs to be included to know rb_execution_context_t, etc. I also added a trivial refactoring in mjit.c and missing dependency for process.c.
2020-11-22Combine mjit.h and internal/mjit.hTakashi Kokubun
It's very hard to remember which mjit.h has what.
2020-11-22dist: added DISTOPTS and PKGSDIRNobuyoshi Nakada
2020-11-18fix public interfaceKoichi Sasada
To make some kind of Ractor related extensions, some functions should be exposed. * include/ruby/thread_native.h * rb_native_mutex_* * rb_native_cond_* * include/ruby/ractor.h * RB_OBJ_SHAREABLE_P(obj) * rb_ractor_shareable_p(obj) * rb_ractor_std*() * rb_cRactor and rm ractor_pub.h and rename srcdir/ractor.h to srcdir/ractor_core.h (to avoid conflict with include/ruby/ractor.h) Notes: Merged: https://github.com/ruby/ruby/pull/3775
2020-11-07Update dependenciesSamuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/3742
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