Combine terminal down_left_spine paths
This commit is contained in:
@@ -2894,14 +2894,22 @@ PRESERVE_NONE void complete(CheckJob *job, CheckContext *context) {
|
||||
MUSTTAIL return keepGoing(job, context);
|
||||
}
|
||||
|
||||
PRESERVE_NONE void down_left_spine(CheckJob *job, CheckContext *context) {
|
||||
if (job->n->entryPresent) {
|
||||
job->setResult(job->n->entry.rangeVersion <= job->readVersion);
|
||||
MUSTTAIL return complete(job, context);
|
||||
}
|
||||
job->n = getFirstChildExists(job->n);
|
||||
__builtin_prefetch(job->n);
|
||||
MUSTTAIL return keepGoing(job, context);
|
||||
}
|
||||
|
||||
namespace check_point_read_state_machine {
|
||||
|
||||
PRESERVE_NONE void begin(CheckJob *, CheckContext *);
|
||||
|
||||
template <class NodeT> PRESERVE_NONE void iter(CheckJob *, CheckContext *);
|
||||
|
||||
PRESERVE_NONE void down_left_spine(CheckJob *, CheckContext *);
|
||||
|
||||
static Continuation iterTable[] = {iter<Node0>, iter<Node3>, iter<Node16>,
|
||||
iter<Node48>, iter<Node256>};
|
||||
|
||||
@@ -3022,16 +3030,6 @@ template <class NodeT> void iter(CheckJob *job, CheckContext *context) {
|
||||
MUSTTAIL return keepGoing(job, context);
|
||||
}
|
||||
|
||||
void down_left_spine(CheckJob *job, CheckContext *context) {
|
||||
if (job->n->entryPresent) {
|
||||
job->setResult(job->n->entry.rangeVersion <= job->readVersion);
|
||||
MUSTTAIL return complete(job, context);
|
||||
}
|
||||
job->n = getFirstChildExists(job->n);
|
||||
__builtin_prefetch(job->n);
|
||||
MUSTTAIL return keepGoing(job, context);
|
||||
}
|
||||
|
||||
} // namespace check_point_read_state_machine
|
||||
|
||||
namespace check_prefix_read_state_machine {
|
||||
@@ -3040,8 +3038,6 @@ PRESERVE_NONE void begin(CheckJob *, CheckContext *);
|
||||
|
||||
template <class NodeT> PRESERVE_NONE void iter(CheckJob *, CheckContext *);
|
||||
|
||||
PRESERVE_NONE void down_left_spine(CheckJob *, CheckContext *);
|
||||
|
||||
static Continuation iterTable[] = {iter<Node0>, iter<Node3>, iter<Node16>,
|
||||
iter<Node48>, iter<Node256>};
|
||||
|
||||
@@ -3157,16 +3153,6 @@ template <class NodeT> void iter(CheckJob *job, CheckContext *context) {
|
||||
MUSTTAIL return keepGoing(job, context);
|
||||
}
|
||||
|
||||
void down_left_spine(CheckJob *job, CheckContext *context) {
|
||||
if (job->n->entryPresent) {
|
||||
job->setResult(job->n->entry.rangeVersion <= job->readVersion);
|
||||
MUSTTAIL return complete(job, context);
|
||||
}
|
||||
job->n = getFirstChildExists(job->n);
|
||||
__builtin_prefetch(job->n);
|
||||
MUSTTAIL return keepGoing(job, context);
|
||||
}
|
||||
|
||||
} // namespace check_prefix_read_state_machine
|
||||
|
||||
namespace check_range_read_state_machine {
|
||||
@@ -3323,7 +3309,7 @@ PRESERVE_NONE void done_common_prefix_iter(CheckJob *job,
|
||||
auto c = getChildGeq(job->n, job->remaining[0]);
|
||||
if (c != nullptr) {
|
||||
job->n = c;
|
||||
job->continuation = check_point_read_state_machine::down_left_spine;
|
||||
job->continuation = down_left_spine;
|
||||
MUSTTAIL return job->continuation(job, context);
|
||||
} else {
|
||||
job->n = nextSibling(job->n);
|
||||
@@ -3331,7 +3317,7 @@ PRESERVE_NONE void done_common_prefix_iter(CheckJob *job,
|
||||
job->setResult(true);
|
||||
MUSTTAIL return complete(job, context);
|
||||
}
|
||||
job->continuation = check_point_read_state_machine::down_left_spine;
|
||||
job->continuation = down_left_spine;
|
||||
MUSTTAIL return job->continuation(job, context);
|
||||
}
|
||||
}
|
||||
@@ -3499,7 +3485,7 @@ PRESERVE_NONE void done_left_side_iter(CheckJob *job, CheckContext *context) {
|
||||
auto c = getChildGeq(job->n, job->remaining[0]);
|
||||
if (c != nullptr) {
|
||||
job->n = c;
|
||||
job->continuation = check_point_read_state_machine::down_left_spine;
|
||||
job->continuation = down_left_spine;
|
||||
MUSTTAIL return job->continuation(job, context);
|
||||
} else {
|
||||
job->n = nextSibling(job->n);
|
||||
@@ -3507,7 +3493,7 @@ PRESERVE_NONE void done_left_side_iter(CheckJob *job, CheckContext *context) {
|
||||
job->setResult(true);
|
||||
MUSTTAIL return complete(job, context);
|
||||
}
|
||||
job->continuation = check_point_read_state_machine::down_left_spine;
|
||||
job->continuation = down_left_spine;
|
||||
MUSTTAIL return job->continuation(job, context);
|
||||
}
|
||||
}
|
||||
@@ -3548,7 +3534,7 @@ PRESERVE_NONE void right_side_iter(CheckJob *job, CheckContext *context) {
|
||||
if (i < commonLen) {
|
||||
auto c = n->partialKey()[i] <=> job->remaining[i];
|
||||
if (c > 0) {
|
||||
job->continuation = check_point_read_state_machine::down_left_spine;
|
||||
job->continuation = down_left_spine;
|
||||
MUSTTAIL return job->continuation(job, context);
|
||||
} else {
|
||||
if ((n->parent != job->commonPrefixNode || i >= job->lcp) &&
|
||||
@@ -3566,7 +3552,7 @@ PRESERVE_NONE void right_side_iter(CheckJob *job, CheckContext *context) {
|
||||
job->setResult(true);
|
||||
MUSTTAIL return complete(job, context);
|
||||
}
|
||||
job->continuation = check_point_read_state_machine::down_left_spine;
|
||||
job->continuation = down_left_spine;
|
||||
MUSTTAIL return job->continuation(job, context);
|
||||
}
|
||||
}
|
||||
@@ -3575,7 +3561,7 @@ PRESERVE_NONE void right_side_iter(CheckJob *job, CheckContext *context) {
|
||||
job->remaining =
|
||||
job->remaining.subspan(commonLen, job->remaining.size() - commonLen);
|
||||
} else if (n->partialKeyLen > int(job->remaining.size())) {
|
||||
job->continuation = check_point_read_state_machine::down_left_spine;
|
||||
job->continuation = down_left_spine;
|
||||
MUSTTAIL return job->continuation(job, context);
|
||||
}
|
||||
}
|
||||
@@ -3583,7 +3569,7 @@ PRESERVE_NONE void right_side_iter(CheckJob *job, CheckContext *context) {
|
||||
++context->tls->range_read_iterations_accum;
|
||||
|
||||
if (job->remaining.size() == 0) {
|
||||
job->continuation = check_point_read_state_machine::down_left_spine;
|
||||
job->continuation = down_left_spine;
|
||||
MUSTTAIL return job->continuation(job, context);
|
||||
}
|
||||
|
||||
@@ -3605,7 +3591,7 @@ PRESERVE_NONE void right_side_iter(CheckJob *job, CheckContext *context) {
|
||||
auto c = getChildGeq(n, job->remaining[0]);
|
||||
if (c != nullptr) {
|
||||
job->n = c;
|
||||
job->continuation = check_point_read_state_machine::down_left_spine;
|
||||
job->continuation = down_left_spine;
|
||||
MUSTTAIL return job->continuation(job, context);
|
||||
} else {
|
||||
if (n != job->commonPrefixNode && maxVersion(n) > job->readVersion) {
|
||||
@@ -3617,7 +3603,7 @@ PRESERVE_NONE void right_side_iter(CheckJob *job, CheckContext *context) {
|
||||
job->setResult(true);
|
||||
MUSTTAIL return complete(job, context);
|
||||
}
|
||||
job->continuation = check_point_read_state_machine::down_left_spine;
|
||||
job->continuation = down_left_spine;
|
||||
MUSTTAIL return job->continuation(job, context);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user