Project

General

Profile

Bug #12938

forwardable.rb is no longer compatible with any alternative implementation

Added by headius (Charles Nutter) almost 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
master as of today
[ruby-core:78138]

Description

The following commits have made forwardable.rb unusable on any implementation except MRI, because they use YARV-specific RubyVM module and features. I believe all of these changes were done by nobu.

These introduce uses of RubyVM::InstructionSequence, which does not (and probably will not ever) exist on other Ruby implementations:

r53383: forwardable.rb: adjust backtrace by tail call
r55376: forwardable.rb: optimize awy send

This commit moves code around, so I wasn't sure if anything incompatible was introduced.

r55366: forwardable.rb: fix for non-module objects

The standard library of Ruby is shared by all Ruby implementations, and I believe every effort should be made to avoid using MRI-specific features. If such features must be used, there must always be a fallback path that works on all Rubies of a given compatibility level (2.4 in this case).

Associated revisions

Revision 2283d14c
Added by nobu (Nobuyoshi Nakada) almost 3 years ago

forwardable/impl.rb

  • lib/forwardable/impl.rb (_valid_method?, _compile_method): extract to separate implementation specific part. [ruby-core:78138] [Bug #12938]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 56848
Added by nobu (Nobuyoshi Nakada) almost 3 years ago

forwardable/impl.rb

  • lib/forwardable/impl.rb (_valid_method?, _compile_method): extract to separate implementation specific part. [ruby-core:78138] [Bug #12938]

Revision 56848
Added by nobu (Nobuyoshi Nakada) almost 3 years ago

forwardable/impl.rb

  • lib/forwardable/impl.rb (_valid_method?, _compile_method): extract to separate implementation specific part. [ruby-core:78138] [Bug #12938]

Revision 56848
Added by nobu (Nobuyoshi Nakada) almost 3 years ago

forwardable/impl.rb

  • lib/forwardable/impl.rb (_valid_method?, _compile_method): extract to separate implementation specific part. [ruby-core:78138] [Bug #12938]

Revision 56848
Added by nobu (Nobuyoshi Nakada) almost 3 years ago

forwardable/impl.rb

  • lib/forwardable/impl.rb (_valid_method?, _compile_method): extract to separate implementation specific part. [ruby-core:78138] [Bug #12938]

History

Updated by headius (Charles Nutter) almost 3 years ago

This should be fixed before 2.4, so JRuby does not have to ship an old version of forwardable.rb.

#2

Updated by nobu (Nobuyoshi Nakada) almost 3 years ago

  • Status changed from Open to Closed

Applied in changeset r56848.


forwardable/impl.rb

  • lib/forwardable/impl.rb (_valid_method?, _compile_method): extract to separate implementation specific part. [ruby-core:78138] [Bug #12938]

Updated by headius (Charles Nutter) almost 3 years ago

This is great, thanks nobu!

Also available in: Atom PDF