Граф коммитов

816 Коммитов

Автор SHA1 Сообщение Дата
John Hawthorn 02f1554224
Implement object shapes for T_CLASS and T_MODULE (#6637)
* Avoid RCLASS_IV_TBL in marshal.c
* Avoid RCLASS_IV_TBL for class names
* Avoid RCLASS_IV_TBL for autoload
* Avoid RCLASS_IV_TBL for class variables
* Avoid copying RCLASS_IV_TBL onto ICLASSes
* Use object shapes for Class and Module IVs
2022-10-31 14:05:37 -07:00
Jemma Issroff f2ae58119d In init_copy, set shape after copying ivars
GC uses shapes to determine IV buffer width. Since allocation can
trigger GC, we need to ensure we only set the shape once we've fully
allocated new memory for the IV buffer, otherwise the GC can end up
trying to mark invalid memory.
2022-10-21 10:57:05 -07:00
Ufuk Kayserilioglu 0378e2f4a8 Add Class#attached_object
Implements [Feature #12084]

Returns the object for which the receiver is the singleton class, or
raises TypeError if the receiver is not a singleton class.
2022-10-20 17:30:17 +02:00
Nobuyoshi Nakada 7563604fb8 [Bug #18998] Honor `#to_str` next to `#to_int` in `Kernel#Integer` 2022-10-20 15:35:31 +09:00
Jemma Issroff b54c8ba8fc Simplified rb_obj_copy_ivar implementation 2022-10-17 14:47:45 -07:00
Jemma Issroff 913979bede
Make inline cache reads / writes atomic with object shapes
Prior to this commit, we were reading and writing ivar index and
shape ID in inline caches in two separate instructions when
getting and setting ivars. This meant there was a race condition
with ractors and these caches where one ractor could change
a value in the cache while another was still reading from it.

This commit instead reads and writes shape ID and ivar index to
inline caches atomically so there is no longer a race condition.

Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
Co-Authored-By: John Hawthorn <john@hawthorn.email>
2022-10-11 08:40:56 -07:00
Jemma Issroff ad63b668e2
Revert "Revert "This commit implements the Object Shapes technique in CRuby.""
This reverts commit 9a6803c90b.
2022-10-11 08:40:56 -07:00
Jean Boussier 1a7e7bb2d1 object.c: rb_eql returns int not VALUE
It works, but assumes `Qfalse == 0`, which is true today
but might not be forever.
2022-10-10 11:35:16 +02:00
Aaron Patterson 9a6803c90b
Revert "This commit implements the Object Shapes technique in CRuby."
This reverts commit 68bc9e2e97d12f80df0d113e284864e225f771c2.
2022-09-30 16:01:50 -07:00
Jemma Issroff d594a5a8bd
This commit implements the Object Shapes technique in CRuby.
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 <tenderlove@ruby-lang.org>
Co-Authored-By: Eileen M. Uchitelle <eileencodes@gmail.com>
Co-Authored-By: John Hawthorn <john@hawthorn.email>
2022-09-28 08:26:21 -07:00
Aaron Patterson 06abfa5be6
Revert this until we can figure out WB issues or remove shapes from GC
Revert "* expand tabs. [ci skip]"

This reverts commit 830b5b5c35.

Revert "This commit implements the Object Shapes technique in CRuby."

This reverts commit 9ddfd2ca00.
2022-09-26 16:10:11 -07:00
Jemma Issroff 9ddfd2ca00 This commit implements the Object Shapes technique in CRuby.
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 <tenderlove@ruby-lang.org>
Co-Authored-By: Eileen M. Uchitelle <eileencodes@gmail.com>
Co-Authored-By: John Hawthorn <john@hawthorn.email>
2022-09-26 09:21:30 -07:00
Nobuyoshi Nakada 332d29df53
[DOC] non-positive `base` in `Kernel#Integer` and `String#to_i` 2022-09-08 11:52:16 +09:00
S-H-GAMELINKS fc5382d465 Reuse rb_class_new_instance_kw function 2022-08-20 12:25:01 +09:00
Nobuyoshi Nakada f42230ff22
Adjust styles [ci skip] 2022-07-27 18:42:27 +09:00
Takashi Kokubun 5b21e94beb Expand tabs [ci skip]
[Misc #18891]
2022-07-21 09:42:04 -07:00
Peter Zhu 7424ea184f Implement Objects on VWA
This commit implements Objects on Variable Width Allocation. This allows
Objects with more ivars to be embedded (i.e. contents directly follow the
object header) which improves performance through better cache locality.
2022-07-15 09:21:07 -04:00
Nobuyoshi Nakada a58611dfb1 Allow to just warn as bool expected, without an exception 2022-06-20 19:35:12 +09:00
Jemma Issroff fc484be5e5 Add assertion for embedded to embedded ivar copy 2022-06-10 13:47:42 -07:00
Jeremy Evans 7cda7fbbdc
Add Module#undefined_instance_methods
Implements [Feature #12655]

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-06-06 09:57:32 -07:00
Burdette Lamar ac75c710cc
Link from printf methods to format spec doc (#5886) 2022-05-05 09:01:12 -05:00
Burdette Lamar f553180a86
[DOC] Enhanced RDoc for Kernel (#5847)
Treats #Integer; fixes an error in #String.
2022-04-27 06:00:22 -05:00
John Hawthorn a8541475d1 Faster rb_class_superclass
This uses the RCLASS_SUPERCLASSES array to quickly find the next
SUPERCLASS of klass which is a T_CLASS.
2022-04-26 14:08:55 -07:00
Burdette Lamar 5ce0d2aa35
[DOC] Enhanced RDoc for Kernel (#5846)
Treats:
    #Array
    #Hash
    #String
2022-04-25 15:59:09 -05:00
Akshay Birajdar 8751c5c267 [DOC] Enhance documentation for `Module#<` & `Module#>` 2022-04-14 08:52:22 -04:00
Nobuyoshi Nakada 295030969c
[DOC] Prefer RDOCLINK to the method name 2022-04-14 14:57:39 +09:00
Nobuyoshi Nakada 2ff41e97fa
[DOC] Now underscore methods can cross-reference 2022-04-14 12:55:44 +09:00
Nobuyoshi Nakada 0bca029d2f
[DOC] Use simple references to operator methods
Method references is not only able to be marked up as code, also
reflects `--show-hash` option.
The bug that prevented the old rdoc from correctly parsing these
methods was fixed last month.
2022-03-30 10:54:52 +09:00
Burdette Lamar c8e1ae4db7
[DOC] Repair format of What's Here sections in object.c (#5722)
* Repair format of What's Here sections in object.c
2022-03-29 06:19:51 -05:00
John Hawthorn b8e72bd2e9 Revert "Faster rb_class_superclass"
This reverts commit 29b68b89a0.
2022-03-17 11:56:49 -07:00
John Hawthorn 29b68b89a0 Faster rb_class_superclass
This uses the RCLASS_SUPERCLASSES array to quickly find the next
SUPERCLASS of klass which is a T_CLASS.
2022-03-17 11:48:39 -07:00
John Hawthorn d76ba1c219 Fast rb_class_inherited_p
This uses the superclass table recently introduced to implement fast
inheritance checking between classes (ex. Foo < Bar).

This is almost identical to what we do in class_search_class_ancestor
(as called by rb_obj_is_kind_of) except that we are checking both
directions: ie. both whether Foo < Bar and whether Bar < Foo.
2022-03-15 08:49:53 -07:00
John Hawthorn 4d8f76286b Fast object is iclass checks
Calling rb_obj_is_kind_of with an ICLASS returns the same result as
calling it with the ICLASS's original Module.

Most of the time we encounter an ICLASS here checking the validity of a
protected method or super call, which we expect to return true (or raise
a slow exception anyways). We can take advantage of this by performing a
fast class inheritance check on the ICLASS's "includer" in hopes that it
returns true.

If the includer class check returns false we still have to fallback to
the full inheritance chain scan for the module's inclusion, but this
should be less common.
2022-03-11 10:36:19 -08:00
John Hawthorn 82dea29073 Revert "Fast object is iclass checks"
This reverts commit 1b15756d24.
2022-03-10 11:06:42 -08:00
John Hawthorn 1b15756d24 Fast object is iclass checks
Calling rb_obj_is_kind_of with an ICLASS returns the same result as
calling it with the ICLASS's original Module.

Most of the time we encounter an ICLASS here checking the validity of a
protected method or super call, which we expect to return true (or raise
a slow exception anyways). We can take advantage of this by performing a
fast class inheritance check on the ICLASS's "includer" in hopes that it
returns true.

If the includer class check returns false we still have to fallback to
the full inheritance chain scan for the module's inclusion, but this
should be less common.
2022-03-10 09:34:08 -08:00
John Hawthorn b13a7c8e36 Constant time class to class ancestor lookup
Previously when checking ancestors, we would walk all the way up the
ancestry chain checking each parent for a matching class or module.

I believe this was especially unfriendly to CPU cache since for each
step we need to check two cache lines (the class and class ext).

This check is used quite often in:
* case statements
* rescue statements
* Calling protected methods
* Class#is_a?
* Module#===
* Module#<=>

I believe it's most common to check a class against a parent class, to
this commit aims to improve that (unfortunately does not help checking
for an included Module).

This is done by storing on each class the number and an array of all
parent classes, in order (BasicObject is at index 0). Using this we can
check whether a class is a subclass of another in constant time since we
know the location to expect it in the hierarchy.
2022-02-23 19:57:42 -08:00
John Hawthorn 764e4fa850 Never call kind_of with klass=0 2022-02-23 19:57:42 -08:00
Burdette Lamar e9a2b30744
Enhanced RDoc concerning command injection (#5537)
Clarifies security vulnerabilities for commands.

Treats:

    Kernel.system
    Kernel.` (backtick)
    IO.popen
    IO.read
    IO.write
    IO.binread
    IO.binwrite
    IO.readlines
    IO.foreach
2022-02-18 06:46:04 -06:00
Nobuyoshi Nakada 50c972a1ae
[DOC] Simplify operator method references 2022-02-12 12:38:36 +09:00
Peter Zhu a32e5e1b97 [DOC] Use RDoc link style for links in the same class/module
I used this regex:

(?<=\[)#(?:class|module)-([A-Za-z]+)-label-([A-Za-z0-9\-\+]+)

And performed a global find & replace for this:

rdoc-ref:$1@$2
2022-02-07 09:52:06 -05:00
Peter Zhu f9a2802bc5 [DOC] Use RDoc link style for links to other classes/modules
I used this regex:

([A-Za-z]+)\.html#(?:class|module)-[A-Za-z]+-label-([A-Za-z0-9\-\+]+)

And performed a global find & replace for this:

rdoc-ref:$1@$2
2022-02-07 09:52:06 -05:00
Jean Boussier 8d05047d72 Add a Module#const_added callback
[Feature #17881]

Works similarly to `method_added` but for constants.

```ruby
Foo::BAR = 42 # call Foo.const_added(:FOO)
class Foo::Baz; end # call Foo.const_added(:Baz)
Foo.autoload(:Something, "path") # call Foo.const_added(:Something)
```
2022-01-14 11:30:07 +01:00
Jeremy Evans a79c59472d Allow include before calling Module#initialize
This is to allow Module subclasses that include modules before
calling super in the subclass's initialize.

Remove rb_module_check_initializable from Module#initialize.
Module#initialize only calls module_exec if a block is passed,
it doesn't have other issues that would cause problems if
called multiple times or with an already initialized module.

Move initialization of super to Module#allocate, though I'm not
sure it is required there.  However, it's needed to be removed
from Module#initialize for this to work.

Fixes [Bug #18292]
2022-01-06 08:03:33 -08:00
卜部昌平 980bf94f02
Kernel#=~: delete
Has been deprecated since ebff9dc10e.
2022-01-03 22:33:38 +09:00
Nobuyoshi Nakada 069cca6f74
Negative RBOOL usage 2022-01-01 17:02:04 +09:00
Nobuyoshi Nakada 39bc5de833
Remove tainted and trusted features
Already these had been announced to be removed in 3.2.
2021-12-26 23:28:54 +09:00
Jeremy Evans 3bd5f27f73 Remove Class#descendants 2021-12-20 11:02:15 -08:00
Nobuyoshi Nakada 3021c3cedc Add `to_f` to predefined conversion method name to ID table 2021-12-08 19:11:02 +09:00
Jean Boussier c0c2b31a35 Add Class#subclasses
Implements [Feature #18273]

Returns an array containing the receiver's direct subclasses without
singleton classes.
2021-11-23 10:50:44 +01:00
Jeremy Evans b08dacfea3
Optimize dynamic string interpolation for symbol/true/false/nil/0-9
This provides a significant speedup for symbol, true, false,
nil, and 0-9, class/module, and a small speedup in most other cases.

Speedups (using included benchmarks):
:symbol        :: 60%
0-9            :: 50%
Class/Module   :: 50%
nil/true/false :: 20%
integer        :: 10%
[]             :: 10%
""             :: 3%

One reason this approach is faster is it reduces the number of
VM instructions for each interpolated value.

Initial idea, approach, and benchmarks from Eric Wong. I applied
the same approach against the master branch, updating it to handle
the significant internal changes since this was first proposed 4
years ago (such as CALL_INFO/CALL_CACHE -> CALL_DATA). I also
expanded it to optimize true/false/nil/0-9/class/module, and added
handling of missing methods, refined methods, and RUBY_DEBUG.

This renames the tostring insn to anytostring, and adds an
objtostring insn that implements the optimization. This requires
making a few functions non-static, and adding some non-static
functions.

This disables 4 YJIT tests.  Those tests should be reenabled after
YJIT optimizes the new objtostring insn.

Implements [Feature #13715]

Co-authored-by: Eric Wong <e@80x24.org>
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
Co-authored-by: Yusuke Endoh <mame@ruby-lang.org>
Co-authored-by: Koichi Sasada <ko1@atdot.net>
2021-11-18 15:10:20 -08:00
S.H 05a3dc1a65
Improve performance Kernel#Float with using Primitive.mandatory_only? method [Feature #18344] (#5133) 2021-11-17 20:26:40 -08:00
Jeremy Evans 717ab0bb2e
Add Class#descendants
Doesn't include receiver or singleton classes.

Implements [Feature #14394]

Co-authored-by: fatkodima <fatkodima123@gmail.com>
Co-authored-by: Benoit Daloze <eregontp@gmail.com>
2021-10-26 12:35:21 -07:00
Shugo Maeda 6606597109
Deprecate include/prepend in refinements and add Refinement#import_methods instead
Refinement#import_methods imports methods from modules.
Unlike Module#include, it copies methods and adds them into the refinement,
so the refinement is activated in the imported methods.

[Bug #17429] [ruby-core:101639]
2021-10-21 16:31:54 +09:00
Alan Wu 5906a5a732 Add comments about special runtime routines YJIT calls
When YJIT make calls to routines without reconstructing interpreter
state through jit_prepare_routine_call(), it relies on the routine to
never allocate, raise, and push/pop control frames. Comment about this
on the routines that YJTI calls.

This is probably something we should dynamically verify on debug builds.
It's hard to statically verify this as it requires verifying all
functions in the call tree. Maybe something to look at in the future.
2021-10-20 18:19:43 -04:00
Nobuyoshi Nakada c0a892a7f0
Fix a typo [Bug #17048] 2021-09-19 22:39:18 +09:00
Nobuyoshi Nakada fd918d1afa
Removed Module.allocate [Bug #17048] 2021-09-17 11:14:08 +09:00
Nobuyoshi Nakada 178ee1e801
Already initialized modules cannot be replaced [Bug #17048] 2021-09-17 11:14:04 +09:00
S-H-GAMELINKS 83a5e2bb5c Using RB_FLOAT_TYPE_P macro 2021-09-12 11:16:31 +09:00
S-H-GAMELINKS 032534dbdf Using RB_BIGNUM_TYPE_P macro 2021-09-11 09:13:24 +09:00
卜部昌平 e18bc14a05 include/ruby/ruby.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 6e62cf46ed include/ruby/internal/arithmetic/double.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 d43accae15 include/ruby/internal/intern/object.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 a2b8f61cba include/ruby/internal/core/rbasic.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 7c28330ca0 include/ruby/internal/core/rclass.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 4881a3ed38 include/ruby/internal/fl_type.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 3be4adcf2b include/ruby/internal/globals.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
卜部昌平 1f66d8a77b include/ruby/internal/newobj.h: add doxygen
Must not be a bad idea to improve documents. [ci skip]
2021-09-10 20:00:06 +09:00
S.H 378e8cdad6
Using RBOOL macro 2021-08-02 12:06:44 +09:00
Nobuyoshi Nakada 6329da588b Use predefined IDs 2021-07-27 15:40:27 +09:00
Nobuyoshi Nakada bc1323ce5c
Use RB_INTEGER_TYPE_P 2021-07-20 21:45:11 +09:00
Nobuyoshi Nakada 8a6ef5ef8f
Make boolean expected messages more consitent 2021-07-18 20:51:30 +09:00
Nobuyoshi Nakada 56d983697f
Constified a local table 2021-07-18 19:56:36 +09:00
Nobuyoshi Nakada 301d194ee3 Add Integer.try_convert [Feature #15211] 2021-07-16 17:49:53 +09:00
S-H-GAMELINKS b32ae9898f Move rb_str_escape function declaration 2021-07-11 18:26:20 +09:00
Nobuyoshi Nakada 94bd3bde81 Specify version to remove as bare numbers 2021-06-30 10:47:01 +09:00
Nobuyoshi Nakada 8118d435d0 rb_warn_deprecated_to_remove_at [Feature #17432]
At compilation time with RUBY_DEBUG enabled, check if the removal
version has been reached.
2021-06-30 10:47:01 +09:00
Nobuyoshi Nakada 47a9b58b2a
Share freeze option handling 2021-06-28 10:53:37 +09:00
Nobuyoshi Nakada e4f891ce8d
Adjust styles [ci skip]
* --braces-after-func-def-line
* --dont-cuddle-else
* --procnames-start-lines
* --space-after-for
* --space-after-if
* --space-after-while
2021-06-17 10:13:40 +09:00
S.H 28b481938b
Implemented some NilClass method in Ruby code is faster [Feature #17054] (#3366) 2021-06-02 20:04:56 -07:00
Burdette Lamar 6b32f1f338
Object whats here (#4503)
What's Here section for class Object.
2021-05-18 08:16:29 -05:00
Burdette Lamar 434cd3c399
What's Here for BasicObject (#4499)
* What's Here for BasicObject
2021-05-13 17:19:07 -05:00
Burdette Lamar 879cc64d06
What's Here for Kernel (#4488) 2021-05-13 12:09:07 -05:00
Aaron Patterson 9a6226c61e Eagerly allocate instance variable tables along with object
This allows us to allocate the right size for the object in advance,
meaning that we don't have to pay the cost of ivar table extension
later.  The idea is that if an object type ever became "extended" at
some point, then it is very likely it will become extended again.  So we
may as well allocate the ivar table up front.
2021-05-03 14:11:48 -07:00
Kenichi Kamiya c080bb2284 [Doc] Update to FrozenError from RuntimeError in Object#freeze 2021-04-01 10:10:02 -07:00
Nobuyoshi Nakada 1499f626a5
[DOC] Modified prefixes to get rid of conflicts 2021-02-07 23:35:06 +09:00
Nobuyoshi Nakada 03e3cc2b72
[DOC] make individual names so that rdoc can find each documents 2021-02-07 23:12:06 +09:00
Nobuyoshi Nakada 0261519f6e
[DOC] Module#method_undefined 2021-02-07 23:11:59 +09:00
Marcus Stollsteimer c3f91f9d88 [DOC] Fix typos 2020-12-24 23:09:51 +01:00
卜部昌平 7fbad92241 rb_cData: no longer exists
Commit 8918a9cf6c introduced macro
`#define rb_cData rb_cData()`.  This deleting `VALUE rb_cData;`
declaration was then macro-expanded into `VALUE rb_cData();`.  This
worked by accident because the expanded expression happen to be a K&R
style function declaration.

This is rather complicated and I guess unintended.  Just delete the line
to keep things simple straight forward.
2020-12-22 16:18:17 +09:00
Nobuyoshi Nakada 8918a9cf6c Removed rb_cData entity
* 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
2020-12-22 02:51:49 +09:00
卜部昌平 c30f03d328 Data: delete
Has been deprecated since 684bdf6171.

Matz says in [ruby-core:83954] that Data should be an alias of Object.
Because rb_cData has not been deprecated, let us deprecate the constant
to make it a C-level synonym of rb_cObject.
2020-12-22 02:51:49 +09:00
Nobuyoshi Nakada 34f6b22df0
Use rb_id_attrset without intermediate strings 2020-12-19 11:44:05 +09:00
Radosław Bułat d40d95296d Feature 17314: update docs and NEWS about attr* methods returning array of symbols 2020-12-19 09:22:26 +09:00
Yusuke Endoh aa7a020710 Revert "Revert "Use rb_id_attrset without intermediate strings""
This reverts commit 41c208d4a4.

Reintroduce 66090b9d10.
2020-12-19 03:20:09 +09:00
Radosław Bułat 5944c4b3cf
attr_reader, attr_writer, attr_accessor and attr methods returns array of symbols (#3935)
Co-authored-by: Yusuke Endoh <mame@ruby-lang.org>
2020-12-19 03:11:35 +09:00
Jeremy Evans 05313c914b Use category: :deprecated in warnings that are related to deprecation
Also document that both :deprecated and :experimental are supported
:category option values.

The locations where warnings were marked as deprecation warnings
was previously reviewed by shyouhei.

Comment a couple locations where deprecation warnings should probably
be used but are not currently used because deprecation warning
enablement has not occurred at the time they are called
(RUBY_FREE_MIN, RUBY_HEAP_MIN_SLOTS, -K).

Add assert_deprecated_warn to test assertions.  Use this to simplify
some tests, and fix failing tests after marking some warnings with
deprecated category.
2020-12-18 09:54:11 -08:00
Yusuke Endoh 982443e6e3 Revert "Better cooperation between public/protected/private with attr* and alias_method"
This reverts commit 81739ad4fd.
2020-12-18 16:08:55 +09:00
Yusuke Endoh 41c208d4a4 Revert "Use rb_id_attrset without intermediate strings"
This reverts commit 66090b9d10.
2020-12-18 16:08:25 +09:00
Nobuyoshi Nakada 66090b9d10
Use rb_id_attrset without intermediate strings 2020-12-18 12:10:20 +09:00
Radosław Bułat 81739ad4fd Better cooperation between public/protected/private with attr* and alias_method 2020-12-17 12:46:02 -05:00