Skip to content
Snippets Groups Projects
Commit ddf7cedf authored by Stepan Sindelar's avatar Stepan Sindelar
Browse files

[GR-2798] DSL Caching related fixes.

PullRequest: fastr/1315
parents cf1eac07 22d843ab
No related branches found
No related tags found
No related merge requests found
......@@ -178,6 +178,16 @@ public abstract class Combine extends RBuiltinNode.Arg2 {
return combineCached(args, false, args.getSignature(), cachedPrecedence, cast, naNameBranch, hasNamesProfile, getNamesNode);
}
@TruffleBoundary
@Specialization(replaces = "combine", guards = {"!recursive"})
protected Object combineGeneric(RArgsValuesAndNames args, @SuppressWarnings("unused") boolean recursive,
@Cached("create()") BranchProfile naNameBranch,
@Cached("createBinaryProfile()") ConditionProfile hasNamesProfile,
@Cached("create()") GetNamesAttributeNode getNamesNode) {
int cachedPrecedence = precedence(args, args.getLength());
return combineCached(args, false, args.getSignature(), cachedPrecedence, createCast(cachedPrecedence), naNameBranch, hasNamesProfile, getNamesNode);
}
@Specialization(guards = "recursive")
protected Object combineRecursive(RArgsValuesAndNames args, @SuppressWarnings("unused") boolean recursive,
@Cached("create()") Combine recursiveCombine,
......
......@@ -496,7 +496,7 @@ abstract class VectorMapBinaryInternalNode extends RBaseNode {
@Cached("createCountingProfile()") LoopConditionProfile leftProfile,
@Cached("createCountingProfile()") LoopConditionProfile rightProfile,
@Cached("createBinaryProfile()") ConditionProfile smallRemainderProfile) {
assert result != right || rightLength == leftLength;
assert result.getLength(resultIter) == leftLength;
leftProfile.profileCounted(leftLength);
rightProfile.profileCounted(rightLength);
while (leftProfile.inject(leftIter.getIndex() + 1 < leftLength)) {
......@@ -527,7 +527,7 @@ abstract class VectorMapBinaryInternalNode extends RBaseNode {
@Cached("createCountingProfile()") LoopConditionProfile leftProfile,
@Cached("createCountingProfile()") LoopConditionProfile rightProfile,
@Cached("createBinaryProfile()") ConditionProfile smallRemainderProfile) {
assert result != left || rightLength == leftLength;
assert result.getLength(resultIter) == rightLength;
leftProfile.profileCounted(leftLength);
rightProfile.profileCounted(rightLength);
while (rightProfile.inject(rightIter.getIndex() + 1 < rightLength)) {
......
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