Avoid assigning to continuation where unnecessary
This commit is contained in:
@@ -3419,32 +3419,28 @@ PRESERVE_NONE void begin(CheckJob *job, CheckContext *context) {
|
|||||||
std::min(job->begin.size(), job->end.size()));
|
std::min(job->begin.size(), job->end.size()));
|
||||||
if (job->lcp == int(job->begin.size()) &&
|
if (job->lcp == int(job->begin.size()) &&
|
||||||
job->end.size() == job->begin.size() + 1 && job->end.back() == 0) {
|
job->end.size() == job->begin.size() + 1 && job->end.back() == 0) {
|
||||||
job->continuation = check_point_read_state_machine::begin;
|
|
||||||
// Call directly since we have nothing to prefetch
|
// Call directly since we have nothing to prefetch
|
||||||
MUSTTAIL return job->continuation(job, context);
|
MUSTTAIL return check_point_read_state_machine::begin(job, context);
|
||||||
}
|
}
|
||||||
if (job->lcp == int(job->begin.size() - 1) &&
|
if (job->lcp == int(job->begin.size() - 1) &&
|
||||||
job->end.size() == job->begin.size() &&
|
job->end.size() == job->begin.size() &&
|
||||||
int(job->begin.back()) + 1 == int(job->end.back())) {
|
int(job->begin.back()) + 1 == int(job->end.back())) {
|
||||||
job->continuation = check_prefix_read_state_machine::begin;
|
|
||||||
// Call directly since we have nothing to prefetch
|
// Call directly since we have nothing to prefetch
|
||||||
MUSTTAIL return job->continuation(job, context);
|
MUSTTAIL return check_prefix_read_state_machine::begin(job, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
++context->readContext.range_read_accum;
|
++context->readContext.range_read_accum;
|
||||||
job->remaining = job->begin.subspan(0, job->lcp);
|
job->remaining = job->begin.subspan(0, job->lcp);
|
||||||
|
|
||||||
if (job->remaining.size() == 0) {
|
if (job->remaining.size() == 0) {
|
||||||
job->continuation = doneCommonPrefixIterTable[job->n->getType()];
|
MUSTTAIL return doneCommonPrefixIterTable[job->n->getType()](job, context);
|
||||||
MUSTTAIL return job->continuation(job, context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto [c, maxV] = getChildAndMaxVersion(job->n, job->remaining[0]);
|
auto [c, maxV] = getChildAndMaxVersion(job->n, job->remaining[0]);
|
||||||
job->maxV = maxV;
|
job->maxV = maxV;
|
||||||
job->child = c;
|
job->child = c;
|
||||||
if (job->child == nullptr) {
|
if (job->child == nullptr) {
|
||||||
job->continuation = doneCommonPrefixIterTable[job->n->getType()];
|
MUSTTAIL return doneCommonPrefixIterTable[job->n->getType()](job, context);
|
||||||
MUSTTAIL return job->continuation(job, context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
job->continuation = commonPrefixIterTable[c.getType()];
|
job->continuation = commonPrefixIterTable[c.getType()];
|
||||||
@@ -3464,8 +3460,8 @@ void common_prefix_iter(CheckJob *job, CheckContext *context) {
|
|||||||
int i =
|
int i =
|
||||||
longestCommonPrefix(child->partialKey(), job->remaining.data() + 1, cl);
|
longestCommonPrefix(child->partialKey(), job->remaining.data() + 1, cl);
|
||||||
if (i != child->partialKeyLen) {
|
if (i != child->partialKeyLen) {
|
||||||
job->continuation = doneCommonPrefixIterTable[job->n->getType()];
|
MUSTTAIL return doneCommonPrefixIterTable[job->n->getType()](job,
|
||||||
MUSTTAIL return job->continuation(job, context);
|
context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
job->n = child;
|
job->n = child;
|
||||||
@@ -3482,16 +3478,14 @@ void common_prefix_iter(CheckJob *job, CheckContext *context) {
|
|||||||
++context->readContext.range_read_iterations_accum;
|
++context->readContext.range_read_iterations_accum;
|
||||||
|
|
||||||
if (job->remaining.size() == 0) {
|
if (job->remaining.size() == 0) {
|
||||||
job->continuation = done_common_prefix_iter<NodeT>;
|
MUSTTAIL return done_common_prefix_iter<NodeT>(job, context);
|
||||||
MUSTTAIL return job->continuation(job, context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto [c, maxV] = getChildAndMaxVersion(child, job->remaining[0]);
|
auto [c, maxV] = getChildAndMaxVersion(child, job->remaining[0]);
|
||||||
job->maxV = maxV;
|
job->maxV = maxV;
|
||||||
job->child = c;
|
job->child = c;
|
||||||
if (job->child == nullptr) {
|
if (job->child == nullptr) {
|
||||||
job->continuation = done_common_prefix_iter<NodeT>;
|
MUSTTAIL return done_common_prefix_iter<NodeT>(job, context);
|
||||||
MUSTTAIL return job->continuation(job, context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
job->continuation = commonPrefixIterTable[c.getType()];
|
job->continuation = commonPrefixIterTable[c.getType()];
|
||||||
@@ -3590,8 +3584,7 @@ PRESERVE_NONE void done_common_prefix_iter(CheckJob *job,
|
|||||||
auto c = nextSibling(job->n);
|
auto c = nextSibling(job->n);
|
||||||
job->n = c;
|
job->n = c;
|
||||||
if (job->n == nullptr) {
|
if (job->n == nullptr) {
|
||||||
job->continuation = done_left_side_iter;
|
MUSTTAIL return done_left_side_iter(job, context);
|
||||||
MUSTTAIL return job->continuation(job, context);
|
|
||||||
}
|
}
|
||||||
job->continuation = leftSideDownLeftSpineTable[c.getType()];
|
job->continuation = leftSideDownLeftSpineTable[c.getType()];
|
||||||
__builtin_prefetch(job->n);
|
__builtin_prefetch(job->n);
|
||||||
@@ -3634,18 +3627,16 @@ PRESERVE_NONE void left_side_iter(CheckJob *job, CheckContext *context) {
|
|||||||
job->setResult(false);
|
job->setResult(false);
|
||||||
MUSTTAIL return complete(job, context);
|
MUSTTAIL return complete(job, context);
|
||||||
}
|
}
|
||||||
job->continuation = done_left_side_iter;
|
MUSTTAIL return done_left_side_iter(job, context);
|
||||||
MUSTTAIL return job->continuation(job, context);
|
|
||||||
} else {
|
} else {
|
||||||
auto c = nextSibling(n);
|
auto c = nextSibling(n);
|
||||||
job->n = c;
|
job->n = c;
|
||||||
if (job->n == nullptr) {
|
if (job->n == nullptr) {
|
||||||
job->continuation = done_left_side_iter;
|
MUSTTAIL return done_left_side_iter(job, context);
|
||||||
MUSTTAIL return job->continuation(job, context);
|
|
||||||
}
|
}
|
||||||
job->continuation = leftSideDownLeftSpineTable[c.getType()];
|
job->continuation = leftSideDownLeftSpineTable[c.getType()];
|
||||||
__builtin_prefetch(job->n);
|
__builtin_prefetch(job->n);
|
||||||
MUSTTAIL return job->continuation(job, context);
|
MUSTTAIL return keepGoing(job, context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (commonLen == n->partialKeyLen) {
|
if (commonLen == n->partialKeyLen) {
|
||||||
@@ -3661,14 +3652,12 @@ PRESERVE_NONE void left_side_iter(CheckJob *job, CheckContext *context) {
|
|||||||
job->setResult(false);
|
job->setResult(false);
|
||||||
MUSTTAIL return complete(job, context);
|
MUSTTAIL return complete(job, context);
|
||||||
}
|
}
|
||||||
job->continuation = done_left_side_iter;
|
MUSTTAIL return done_left_side_iter(job, context);
|
||||||
MUSTTAIL return job->continuation(job, context);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (job->maxV <= job->readVersion) {
|
if (job->maxV <= job->readVersion) {
|
||||||
job->continuation = done_left_side_iter;
|
MUSTTAIL return done_left_side_iter(job, context);
|
||||||
MUSTTAIL return job->continuation(job, context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
++context->readContext.range_read_iterations_accum;
|
++context->readContext.range_read_iterations_accum;
|
||||||
@@ -3692,14 +3681,12 @@ PRESERVE_NONE void left_side_iter(CheckJob *job, CheckContext *context) {
|
|||||||
auto c = getChildGeq(n, job->remaining[0]);
|
auto c = getChildGeq(n, job->remaining[0]);
|
||||||
if (c != nullptr) {
|
if (c != nullptr) {
|
||||||
job->n = c;
|
job->n = c;
|
||||||
job->continuation = done_left_side_iter;
|
MUSTTAIL return done_left_side_iter(job, context);
|
||||||
MUSTTAIL return job->continuation(job, context);
|
|
||||||
} else {
|
} else {
|
||||||
auto c = nextSibling(job->n);
|
auto c = nextSibling(job->n);
|
||||||
job->n = c;
|
job->n = c;
|
||||||
if (job->n == nullptr) {
|
if (job->n == nullptr) {
|
||||||
job->continuation = done_left_side_iter;
|
MUSTTAIL return done_left_side_iter(job, context);
|
||||||
MUSTTAIL return job->continuation(job, context);
|
|
||||||
}
|
}
|
||||||
job->continuation = leftSideDownLeftSpineTable[c.getType()];
|
job->continuation = leftSideDownLeftSpineTable[c.getType()];
|
||||||
__builtin_prefetch(job->n);
|
__builtin_prefetch(job->n);
|
||||||
@@ -3754,8 +3741,7 @@ void left_side_down_left_spine(CheckJob *job, CheckContext *context) {
|
|||||||
job->setResult(false);
|
job->setResult(false);
|
||||||
MUSTTAIL return complete(job, context);
|
MUSTTAIL return complete(job, context);
|
||||||
}
|
}
|
||||||
job->continuation = done_left_side_iter;
|
MUSTTAIL return done_left_side_iter(job, context);
|
||||||
MUSTTAIL return job->continuation(job, context);
|
|
||||||
}
|
}
|
||||||
auto c = getFirstChildExists(n);
|
auto c = getFirstChildExists(n);
|
||||||
job->n = c;
|
job->n = c;
|
||||||
|
Reference in New Issue
Block a user