summaryrefslogtreecommitdiff
path: root/spec/ruby/optional
AgeCommit message (Collapse)Author
2022-10-19Transition frozen string to frozen root shapeJemma Issroff
Co-Authored-By: Aaron Patterson <[email protected]> Notes: Merged: https://github.com/ruby/ruby/pull/6590
2022-09-28Update to ruby/spec@1d9d5c6Benoit Daloze
2022-09-28This commit implements the Object Shapes technique in CRuby.Jemma Issroff
Object Shapes is used for accessing instance variables and representing the "frozenness" of objects. Object instances have a "shape" and the shape represents some attributes of the object (currently which instance variables are set and the "frozenness"). Shapes form a tree data structure, and when a new instance variable is set on an object, that object "transitions" to a new shape in the shape tree. Each shape has an ID that is used for caching. The shape structure is independent of class, so objects of different types can have the same shape. For example: ```ruby class Foo def initialize # Starts with shape id 0 @a = 1 # transitions to shape id 1 @b = 1 # transitions to shape id 2 end end class Bar def initialize # Starts with shape id 0 @a = 1 # transitions to shape id 1 @b = 1 # transitions to shape id 2 end end foo = Foo.new # `foo` has shape id 2 bar = Bar.new # `bar` has shape id 2 ``` Both `foo` and `bar` instances have the same shape because they both set instance variables of the same name in the same order. This technique can help to improve inline cache hits as well as generate more efficient machine code in JIT compilers. This commit also adds some methods for debugging shapes on objects. See `RubyVM::Shape` for more details. For more context on Object Shapes, see [Feature: #18776] Co-Authored-By: Aaron Patterson <[email protected]> Co-Authored-By: Eileen M. Uchitelle <[email protected]> Co-Authored-By: John Hawthorn <[email protected]>
2022-09-26Revert this until we can figure out WB issues or remove shapes from GCAaron Patterson
Revert "* expand tabs. [ci skip]" This reverts commit 830b5b5c351c5c6efa5ad461ae4ec5085e5f0275. Revert "This commit implements the Object Shapes technique in CRuby." This reverts commit 9ddfd2ca004d1952be79cf1b84c52c79a55978f4.
2022-09-26This commit implements the Object Shapes technique in CRuby.Jemma Issroff
Object Shapes is used for accessing instance variables and representing the "frozenness" of objects. Object instances have a "shape" and the shape represents some attributes of the object (currently which instance variables are set and the "frozenness"). Shapes form a tree data structure, and when a new instance variable is set on an object, that object "transitions" to a new shape in the shape tree. Each shape has an ID that is used for caching. The shape structure is independent of class, so objects of different types can have the same shape. For example: ```ruby class Foo def initialize # Starts with shape id 0 @a = 1 # transitions to shape id 1 @b = 1 # transitions to shape id 2 end end class Bar def initialize # Starts with shape id 0 @a = 1 # transitions to shape id 1 @b = 1 # transitions to shape id 2 end end foo = Foo.new # `foo` has shape id 2 bar = Bar.new # `bar` has shape id 2 ``` Both `foo` and `bar` instances have the same shape because they both set instance variables of the same name in the same order. This technique can help to improve inline cache hits as well as generate more efficient machine code in JIT compilers. This commit also adds some methods for debugging shapes on objects. See `RubyVM::Shape` for more details. For more context on Object Shapes, see [Feature: #18776] Co-Authored-By: Aaron Patterson <[email protected]> Co-Authored-By: Eileen M. Uchitelle <[email protected]> Co-Authored-By: John Hawthorn <[email protected]> Notes: Merged: https://github.com/ruby/ruby/pull/6386
2022-08-29Update to ruby/spec@d01709fBenoit Daloze
2022-07-27Update to ruby/spec@cbfaf51Benoit Daloze
2022-06-26Update to ruby/spec@ab32a1aBenoit Daloze
2022-04-25Update to ruby/spec@3affe1eBenoit Daloze
2022-04-07Get rid of type aliasingNobuyoshi Nakada
2022-04-07Suppress an unused functionNobuyoshi Nakada
2022-04-06Raise RuntimeError if Kernel#binding is called from a non-Ruby frameJeremy Evans
Check whether the current or previous frame is a Ruby frame in call_trace_func and rb_tracearg_binding before attempting to create a binding for the frame. Fixes [Bug #18487] Co-authored-by: Alan Wu <[email protected]> Notes: Merged: https://github.com/ruby/ruby/pull/5767 Merged-By: jeremyevans <[email protected]>
2022-04-01Revert "Raise RuntimeError if Kernel#binding is called from a non-Ruby frame"Jeremy Evans
This reverts commit 343ea9967e4a6b279eed6bd8e81ad0bdc747f254. This causes an assertion failure with -DRUBY_DEBUG=1 -DRGENGC_CHECK_MODE=2
2022-03-28Update to ruby/spec@aaf998fBenoit Daloze
2022-03-24Raise RuntimeError if Kernel#binding is called from a non-Ruby frameJeremy Evans
Check whether the current or previous frame is a Ruby frame in call_trace_func before attempting to create a binding for the frame. Fixes [Bug #18487] Co-authored-by: Alan Wu <[email protected]> Notes: Merged: https://github.com/ruby/ruby/pull/5567
2022-03-24Now all extension libraries must consider the ABI headerNobuyoshi Nakada
2022-03-03Update to ruby/spec@82cd3a3Benoit Daloze
2022-01-28Update to ruby/spec@902ab83Benoit Daloze
2022-01-10Update to ruby/spec@226cfdcBenoit Daloze
2021-12-26Remove tainted and trusted featuresNobuyoshi Nakada
Already these had been announced to be removed in 3.2. Notes: Merged: https://github.com/ruby/ruby/pull/5348
2021-11-29Update to ruby/spec@7f22a0bBenoit Daloze
2021-10-25[Feature #18239] Implement VWA for stringsPeter Zhu
This commit adds support for embedded strings with variable capacity and uses Variable Width Allocation to allocate strings. Notes: Merged: https://github.com/ruby/ruby/pull/4933
2021-10-05Update to ruby/spec@ccf0d85Benoit Daloze
2021-09-25FL_USER flags on ohter than T_DATA are reserved [Misc #18059]Nobuyoshi Nakada
2021-09-24FL_USER flags on ohter than T_DATA are reserved [Misc #18059]Nobuyoshi Nakada
2021-09-20Don't describe C function that does not exist in prior versions.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/4871
2021-09-20Add C interface spec.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/4649
2021-09-12Add printf attribute to functions call va_list format functionsNobuyoshi Nakada
2021-09-10spec/ruby/optional/capi/ext: must support GCC 5卜部昌平
What a silly bug. Notes: Merged: https://github.com/ruby/ruby/pull/4815
2021-09-10spec/ruby/optional/capi/ext: support ruby < 3卜部昌平
RBIMPL_WARNING_PUSH is a 3.0 feature. Rubyspec OTOH has to support 2.x. Notes: Merged: https://github.com/ruby/ruby/pull/4815
2021-09-10spec/ruby/optional/capi/ext: suppress warnings卜部昌平
These warnings are okay here. Notes: Merged: https://github.com/ruby/ruby/pull/4815
2021-09-07Update to ruby/spec@b1e93a2Benoit Daloze
2021-08-30Fix rubyspec_capiext dependency and flagsNobuyoshi Nakada
- The file needed to link may be the import library. - Remove duplicate flags.
2021-08-30Fix dllimport attributeNobuyoshi Nakada
2021-08-07Suppress unused-result warningsS.H
* Hide read function warning in string_spec_RSTRING_PTR_read function * The type of `read` may be `ssize_t` Co-authored-by: Nobuyoshi Nakada <[email protected]> Notes: Merged: https://github.com/ruby/ruby/pull/4703 Merged-By: nobu <[email protected]>
2021-07-30Tweak rb_str_modify_expand() + read() spec to try to find out why it fails ↵Benoit Daloze
on some platforms * Use a longer string as <= 23 characters it's embedded on CRuby and the value of rb_str_capacity() is implementation-specific.
2021-07-29Update to ruby/spec@b65d01fBenoit Daloze
2021-07-26rb_iterate is no longer used in ruby/specBenoit Daloze
2021-07-18Use rb_block_call() instead of the deprecated rb_iterate()Nobuyoshi Nakada
2021-06-02Update to ruby/spec@a0b7d0dBenoit Daloze
2021-05-11Run nmake check on Actions (#4487)Takashi Kokubun
* Run nmake check on Actions * Skip tests not working in mswin GitHub Actions * Override TEMP * Revert "Skip tests not working in mswin GitHub Actions" This reverts commit 544d2575fcdf23ae63cd25aa03fce10c28b259f2. * Revert "Revert "Skip tests not working in mswin GitHub Actions"" This reverts commit e1f8ad7862c9c4be52dc6e1031a004621eb07e6e. * Fix timeouts * Skip some more broken tests * Update windows.yml * Add a guard for rbasic_spec * Revert "Update windows.yml" This reverts commit bc9694b6b3b9594d406378d15ca11723fb052bc8. * Skip the ensure clause * Simplify the ensure Notes: Merged-By: k0kubun <[email protected]>
2021-03-27Update to ruby/spec@fd6edddBenoit Daloze
2021-02-28Skip spec which does not work on mingwBenoit Daloze
* https://github.com/ruby/ruby/runs/1994688198 ruby 3.1.0dev (2021-02-27T16:42:17Z master 8305a48413) [x64-mingw32] C-API Thread function rb_thread_call_without_gvl runs a C function with the global lock unlocked and unlocks IO with the generic RUBY_UBF_IO Example took longer than the configured timeout of 60.0s
2021-02-27Update to ruby/spec@37e52e5Benoit Daloze
2021-01-28Update to ruby/spec@8cafaa5Benoit Daloze
2021-01-27Taint flags has been deprecated in 3.1Nobuyoshi Nakada
2020-12-27Update to ruby/spec@4ce9f41Benoit Daloze
2020-12-22Remvoed no longer needed version guardsNobuyoshi Nakada
2020-12-22Removed rb_cData entityNobuyoshi Nakada
* Use the wrapper of rb_cObject instead of data access * Replaced rest of extentions * Updated the version guard for Data * Added the version guard of rb_cData Notes: Merged: https://github.com/ruby/ruby/pull/3961
2020-11-27Update to ruby/spec@ac878adBenoit Daloze