Skip to content

Commit 8ec5d57

Browse files
authored
Merge pull request jruby#9349 from headius/no_indy_alias_magic
Disable AliasMethod direct binding for now
2 parents 35f6c17 + 6dc99bf commit 8ec5d57

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

core/src/main/java/org/jruby/ir/targets/indy/InvokeSite.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,22 +1334,22 @@ MethodHandle buildAliasHandle(ThreadContext context, CacheEntry entry, IRubyObje
13341334
if (method instanceof PartialDelegatingMethod delegate) {
13351335
DynamicMethod innerMethod = delegate.getRealMethod();
13361336
mh = getHandle(context, self, new CacheEntry(innerMethod, entry.sourceModule, entry.token));
1337-
} else if (method instanceof AliasMethod alias) {
1338-
DynamicMethod innerMethod = alias.getRealMethod();
1339-
String name = alias.getName();
1340-
1341-
// Use a second site to mimic invocation from AliasMethod
1342-
MethodType type = type();
1343-
if (!functional) type = type.dropParameterTypes(1, 2);
1344-
InvokeSite innerSite = (InvokeSite) SelfInvokeSite.bootstrap(LOOKUP, "callFunctional:" + name, type, literalClosure ? 1 : 0, flags, file, line);
1345-
mh = innerSite.getHandle(context, self, new CacheEntry(innerMethod, entry.sourceModule, entry.token));
1346-
if (!functional) mh = MethodHandles.dropArguments(mh, 1, IRubyObject.class);
1347-
1348-
alias.setHandle(mh);
1349-
1350-
if (Options.INVOKEDYNAMIC_LOG_BINDING.load()) {
1351-
LOG.info(name() + "\tbound directly through alias to " + Bootstrap.logMethod(method));
1352-
}
1337+
// } else if (method instanceof AliasMethod alias) {
1338+
// DynamicMethod innerMethod = alias.getRealMethod();
1339+
// String name = alias.getName();
1340+
//
1341+
// // Use a second site to mimic invocation from AliasMethod
1342+
// MethodType type = type();
1343+
// if (!functional) type = type.dropParameterTypes(1, 2);
1344+
// InvokeSite innerSite = (InvokeSite) SelfInvokeSite.bootstrap(LOOKUP, "callFunctional:" + name, type, literalClosure ? 1 : 0, flags, file, line);
1345+
// mh = innerSite.getHandle(context, self, new CacheEntry(innerMethod, entry.sourceModule, entry.token));
1346+
// if (!functional) mh = MethodHandles.dropArguments(mh, 1, IRubyObject.class);
1347+
//
1348+
// alias.setHandle(mh);
1349+
//
1350+
// if (Options.INVOKEDYNAMIC_LOG_BINDING.load()) {
1351+
// LOG.info(name() + "\tbound directly through alias to " + Bootstrap.logMethod(method));
1352+
// }
13531353
}
13541354

13551355
return mh;

0 commit comments

Comments
 (0)