summaryrefslogtreecommitdiff
path: root/ext/rubyvm/lib/forwardable/impl.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/rubyvm/lib/forwardable/impl.rb')
-rw-r--r--ext/rubyvm/lib/forwardable/impl.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/rubyvm/lib/forwardable/impl.rb b/ext/rubyvm/lib/forwardable/impl.rb
new file mode 100644
index 0000000000..e9bde2f299
--- /dev/null
+++ b/ext/rubyvm/lib/forwardable/impl.rb
@@ -0,0 +1,16 @@
+# :stopdoc:
+module Forwardable
+ def self._valid_method?(method)
+ iseq = RubyVM::InstructionSequence.compile("().#{method}", nil, nil, 0, false)
+ rescue SyntaxError
+ false
+ else
+ iseq.to_a.dig(-1, 1, 1, :mid) == method.to_sym
+ end
+
+ def self._compile_method(src, file, line)
+ RubyVM::InstructionSequence.compile(src, file, file, line,
+ trace_instruction: false)
+ .eval
+ end
+end
td>Aaron Patterson 2022-09-26This commit implements the Object Shapes technique in CRuby.Jemma Issroff 2022-09-23Builtin RubyVM::MJIT::CTakashi Kokubun 2022-09-18Demote mjit_instruction.rb from builtin to stdlibTakashi Kokubun 2022-09-04Ruby MJIT (#6028)Takashi Kokubun 2022-08-02Implement Queue#pop(timeout: sec)Jean Boussier 2022-06-15Move RubyVM::MJIT to builtin RubyTakashi Kokubun 2021-11-10IO::Buffer for scheduler interface.Samuel Williams 2021-10-20Match the main-branch location of yjit in inits.cNoah Gibbs 2021-10-20Yet Another Ruby JIT!Jose Narvaez 2021-10-20Directly link libcapstone for easier developmentAaron Patterson 2021-10-05marshal.c Marshal.load accepts a freeze: true option.Jean Boussier 2021-06-02Implemented some NilClass method in Ruby code is faster [Feature #17054] (#3366)S.H 2021-02-09Expose scheduler as public interface & bug fixes. (#3945)Samuel Williams 2021-01-01Improve performance some Float methods [Feature #17498] (#4018)S.H 2020-12-31Moved time.rb to timev.rbNobuyoshi Nakada 2020-12-31Add time.rb as builtinNobuyoshi Nakada 2020-09-25Buffer protocol proposal (#3261)Kenta Murata 2020-09-14Standardised scheduler interface.Samuel Williams 2020-09-10If the GC runs before the Mutex's are initialised then we get a crash in pthr...Matt Valentine-House 2020-09-03Introduce Ractor mechanism for parallel executionKoichi Sasada