Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attempt to remove WrapperMethod again.
Browse files Browse the repository at this point in the history
headius committed Jan 25, 2018
1 parent 82fe95d commit c827260
Showing 4 changed files with 9 additions and 123 deletions.
3 changes: 1 addition & 2 deletions core/src/main/java/org/jruby/RubyMethod.java
Original file line number Diff line number Diff line change
@@ -37,7 +37,6 @@
import org.jruby.internal.runtime.methods.DynamicMethod;
import org.jruby.internal.runtime.methods.IRMethodArgs;
import org.jruby.internal.runtime.methods.ProcMethod;
import org.jruby.internal.runtime.methods.WrapperMethod;
import org.jruby.runtime.ArgumentDescriptor;
import org.jruby.runtime.Block;
import org.jruby.runtime.ClassIndex;
@@ -252,7 +251,7 @@ public IRubyObject inspect() {
RubyModule definedClass;
RubyModule mklass = originModule;

if (method instanceof AliasMethod || method instanceof WrapperMethod) {
if (method instanceof AliasMethod) {
definedClass = method.getRealMethod().getDefinedClass();
}
else {
3 changes: 1 addition & 2 deletions core/src/main/java/org/jruby/RubyModule.java
Original file line number Diff line number Diff line change
@@ -79,7 +79,6 @@
import org.jruby.internal.runtime.methods.ProcMethod;
import org.jruby.internal.runtime.methods.SynchronizedDynamicMethod;
import org.jruby.internal.runtime.methods.UndefinedMethod;
import org.jruby.internal.runtime.methods.WrapperMethod;
import org.jruby.ir.IRClosure;
import org.jruby.ir.IRMethod;
import org.jruby.ir.runtime.IRRuntimeHelpers;
@@ -1838,7 +1837,7 @@ public void exportMethod(String name, Visibility visibility) {
if (this == method.getImplementationClass()) {
method.setVisibility(visibility);
} else {
DynamicMethod newMethod = new WrapperMethod(this, method, visibility);
DynamicMethod newMethod = new AliasMethod(this, visibility, method);

methodLocation.addMethod(name, newMethod);
}
Original file line number Diff line number Diff line change
@@ -34,6 +34,7 @@
import org.jruby.runtime.Arity;
import org.jruby.runtime.Block;
import org.jruby.runtime.ThreadContext;
import org.jruby.runtime.Visibility;
import org.jruby.runtime.builtin.IRubyObject;

/**
@@ -49,6 +50,12 @@ public AliasMethod(RubyModule implementationClass, DynamicMethod oldMethod, Stri
this.oldMethod = oldMethod;
}

public AliasMethod(RubyModule implementationClass, Visibility visiblity, DynamicMethod oldMethod) {
super(implementationClass, visiblity, oldMethod.getName());

this.oldMethod = oldMethod;
}

@Override
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name) {
return oldMethod.call(context, self, klazz, name);

This file was deleted.

0 comments on commit c827260

Please sign in to comment.