Top Description Fields Constructors Methods
org.jruby.internal.runtime.methods

public Class DefineMethodMethod

extends MixedModeIRMethod
Class Inheritance
Imports
org.jruby.RubyModule, org.jruby.ir.IRScope, org.jruby.runtime.Block, .ThreadContext, .Visibility, org.jruby.runtime.builtin.IRubyObject

Supports optimization for define_method. block that defined_method sees happens to be the block passed to the scope where the define_method originally was called...not the block potentially passed to the newly defined method.

Field Summary

Modifier and TypeField and Description
private final Block

Constructor Summary

AccessConstructor and Description
public
DefineMethodMethod(IRScope method, Visibility visibility, RubyModule implementationClass, Block capturedBlock)

Method Summary

Modifier and TypeMethod and Description
public IRubyObject
call(ThreadContext
The thread context for the currently executing thread
context
,
IRubyObject
The 'self' or 'receiver' object to use for this call
self
,
RubyModule
The Ruby class against which this method is binding
clazz
,
String
The incoming name used to invoke this method
name
,
IRubyObject[]
The argument list to this invocation
args
,
Block
The block passed to this invocation
block
)

Overrides org.jruby.internal.runtime.methods.MixedModeIRMethod.call.

The minimum 'call' method required for a dynamic method handle.

public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
Inherited from org.jruby.internal.runtime.methods.MixedModeIRMethod:
completeBuilddupfinishSplitCallforceBuildgetActualMethodpostprepreSplitprintMethodIRstartSplitSuperCall

Field Detail

capturedBlockback to summary
private final Block capturedBlock

Constructor Detail

DefineMethodMethodback to summary
public DefineMethodMethod(IRScope method, Visibility visibility, RubyModule implementationClass, Block capturedBlock)

Method Detail

callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args, Block block)

Overrides org.jruby.internal.runtime.methods.MixedModeIRMethod.call.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.call.

The minimum 'call' method required for a dynamic method handle. Subclasses must implement this method, but may implement the other signatures to provide faster, non-boxing call paths. Typically subclasses will implement this method to check variable arity calls, then performing a specific-arity invocation to the appropriate method or performing variable-arity logic in-line.

Parameters
context:ThreadContext

The thread context for the currently executing thread

self:IRubyObject

The 'self' or 'receiver' object to use for this call

clazz:RubyModule

The Ruby class against which this method is binding

name:String

The incoming name used to invoke this method

args:IRubyObject[]

The argument list to this invocation

block:Block

The block passed to this invocation

Returns:IRubyObject

The result of the call

Annotations
@Override
callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, Block block)

Overrides org.jruby.internal.runtime.methods.MixedModeIRMethod.call.

Annotations
@Override
callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0, Block block)

Overrides org.jruby.internal.runtime.methods.MixedModeIRMethod.call.

Annotations
@Override
callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0, IRubyObject arg1, Block block)

Overrides org.jruby.internal.runtime.methods.MixedModeIRMethod.call.

Annotations
@Override
callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)

Overrides org.jruby.internal.runtime.methods.MixedModeIRMethod.call.

Annotations
@Override