Skip to content
Snippets Groups Projects
Commit a14070db authored by Zbynek Slajchrt's avatar Zbynek Slajchrt
Browse files

Combine fixes

parent 3f42b180
No related branches found
No related tags found
No related merge requests found
......@@ -151,6 +151,17 @@ public abstract class Combine extends RBuiltinNode {
return result;
}
@TruffleBoundary
@Specialization(limit = "COMBINE_CACHED_LIMIT", contains = "combineCached", guards = {"!recursive", "cachedPrecedence == precedence(args)"})
protected Object combine(RArgsValuesAndNames args, @SuppressWarnings("unused") boolean recursive, //
@Cached("precedence(args, args.getLength())") int cachedPrecedence, //
@Cached("createCast(cachedPrecedence)") CastNode cast, //
@Cached("create()") BranchProfile naNameBranch, //
@Cached("create()") NACheck naNameCheck, //
@Cached("createBinaryProfile()") ConditionProfile hasNamesProfile) {
return combineCached(args, false, args.getSignature(), cachedPrecedence, cast, naNameBranch, naNameCheck, hasNamesProfile);
}
@Specialization(guards = "recursive")
protected Object combineRecursive(RArgsValuesAndNames args, @SuppressWarnings("unused") boolean recursive,
@Cached("create()") Combine recursiveCombine, //
......@@ -318,17 +329,6 @@ public abstract class Combine extends RBuiltinNode {
return signature != null && signature.getNonNullCount() > 0;
}
@TruffleBoundary
@Specialization(limit = "COMBINE_CACHED_LIMIT", contains = "combineCached", guards = "cachedPrecedence == precedence(args)")
protected Object combine(RArgsValuesAndNames args, boolean recursive, //
@Cached("precedence(args, args.getLength())") int cachedPrecedence, //
@Cached("createCast(cachedPrecedence)") CastNode cast, //
@Cached("create()") BranchProfile naNameBranch, //
@Cached("create()") NACheck naNameCheck, //
@Cached("createBinaryProfile()") ConditionProfile hasNamesProfile) {
return combineCached(args, false, args.getSignature(), cachedPrecedence, cast, naNameBranch, naNameCheck, hasNamesProfile);
}
@Specialization(guards = "!isArguments(args)")
protected Object nonArguments(Object args, boolean recursive, @Cached("create()") Combine combine) {
return combine.executeCombine(new RArgsValuesAndNames(new Object[]{args}, EMPTY_SIGNATURE), recursive);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment