[promise] Remove support for moving-from an already started sequence or join (#37145)

I added this support about a year ago experimentally, but we don't need it. Removing it results in much simpler codegen.

Closes #37145

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37145 from ctiller:movie 086620ecc9
PiperOrigin-RevId: 653353272
pull/37244/head
Craig Tiller 4 months ago committed by Copybara-Service
parent 73a5382c98
commit 695f017db3
  1. 296
      src/core/lib/promise/detail/join_state.h
  2. 621
      src/core/lib/promise/detail/seq_state.h
  3. 9
      tools/codegen/core/gen_join.py
  4. 21
      tools/codegen/core/gen_seq.py

@ -65,18 +65,10 @@ struct JoinState<Traits, P0, P1> {
}
JoinState& operator=(const JoinState& other) = delete;
JoinState& operator=(JoinState&& other) = delete;
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION JoinState(JoinState&& other) noexcept
: ready(other.ready) {
if (ready.is_set(0)) {
Construct(&result0, std::move(other.result0));
} else {
Construct(&promise0, std::move(other.promise0));
}
if (ready.is_set(1)) {
Construct(&result1, std::move(other.result1));
} else {
Construct(&promise1, std::move(other.promise1));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION JoinState(JoinState&& other) noexcept {
DCHECK(other.ready.none());
Construct(&promise0, std::move(other.promise0));
Construct(&promise1, std::move(other.promise1));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION ~JoinState() {
if (ready.is_set(0)) {
@ -180,23 +172,11 @@ struct JoinState<Traits, P0, P1, P2> {
}
JoinState& operator=(const JoinState& other) = delete;
JoinState& operator=(JoinState&& other) = delete;
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION JoinState(JoinState&& other) noexcept
: ready(other.ready) {
if (ready.is_set(0)) {
Construct(&result0, std::move(other.result0));
} else {
Construct(&promise0, std::move(other.promise0));
}
if (ready.is_set(1)) {
Construct(&result1, std::move(other.result1));
} else {
Construct(&promise1, std::move(other.promise1));
}
if (ready.is_set(2)) {
Construct(&result2, std::move(other.result2));
} else {
Construct(&promise2, std::move(other.promise2));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION JoinState(JoinState&& other) noexcept {
DCHECK(other.ready.none());
Construct(&promise0, std::move(other.promise0));
Construct(&promise1, std::move(other.promise1));
Construct(&promise2, std::move(other.promise2));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION ~JoinState() {
if (ready.is_set(0)) {
@ -337,28 +317,12 @@ struct JoinState<Traits, P0, P1, P2, P3> {
}
JoinState& operator=(const JoinState& other) = delete;
JoinState& operator=(JoinState&& other) = delete;
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION JoinState(JoinState&& other) noexcept
: ready(other.ready) {
if (ready.is_set(0)) {
Construct(&result0, std::move(other.result0));
} else {
Construct(&promise0, std::move(other.promise0));
}
if (ready.is_set(1)) {
Construct(&result1, std::move(other.result1));
} else {
Construct(&promise1, std::move(other.promise1));
}
if (ready.is_set(2)) {
Construct(&result2, std::move(other.result2));
} else {
Construct(&promise2, std::move(other.promise2));
}
if (ready.is_set(3)) {
Construct(&result3, std::move(other.result3));
} else {
Construct(&promise3, std::move(other.promise3));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION JoinState(JoinState&& other) noexcept {
DCHECK(other.ready.none());
Construct(&promise0, std::move(other.promise0));
Construct(&promise1, std::move(other.promise1));
Construct(&promise2, std::move(other.promise2));
Construct(&promise3, std::move(other.promise3));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION ~JoinState() {
if (ready.is_set(0)) {
@ -535,33 +499,13 @@ struct JoinState<Traits, P0, P1, P2, P3, P4> {
}
JoinState& operator=(const JoinState& other) = delete;
JoinState& operator=(JoinState&& other) = delete;
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION JoinState(JoinState&& other) noexcept
: ready(other.ready) {
if (ready.is_set(0)) {
Construct(&result0, std::move(other.result0));
} else {
Construct(&promise0, std::move(other.promise0));
}
if (ready.is_set(1)) {
Construct(&result1, std::move(other.result1));
} else {
Construct(&promise1, std::move(other.promise1));
}
if (ready.is_set(2)) {
Construct(&result2, std::move(other.result2));
} else {
Construct(&promise2, std::move(other.promise2));
}
if (ready.is_set(3)) {
Construct(&result3, std::move(other.result3));
} else {
Construct(&promise3, std::move(other.promise3));
}
if (ready.is_set(4)) {
Construct(&result4, std::move(other.result4));
} else {
Construct(&promise4, std::move(other.promise4));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION JoinState(JoinState&& other) noexcept {
DCHECK(other.ready.none());
Construct(&promise0, std::move(other.promise0));
Construct(&promise1, std::move(other.promise1));
Construct(&promise2, std::move(other.promise2));
Construct(&promise3, std::move(other.promise3));
Construct(&promise4, std::move(other.promise4));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION ~JoinState() {
if (ready.is_set(0)) {
@ -774,38 +718,14 @@ struct JoinState<Traits, P0, P1, P2, P3, P4, P5> {
}
JoinState& operator=(const JoinState& other) = delete;
JoinState& operator=(JoinState&& other) = delete;
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION JoinState(JoinState&& other) noexcept
: ready(other.ready) {
if (ready.is_set(0)) {
Construct(&result0, std::move(other.result0));
} else {
Construct(&promise0, std::move(other.promise0));
}
if (ready.is_set(1)) {
Construct(&result1, std::move(other.result1));
} else {
Construct(&promise1, std::move(other.promise1));
}
if (ready.is_set(2)) {
Construct(&result2, std::move(other.result2));
} else {
Construct(&promise2, std::move(other.promise2));
}
if (ready.is_set(3)) {
Construct(&result3, std::move(other.result3));
} else {
Construct(&promise3, std::move(other.promise3));
}
if (ready.is_set(4)) {
Construct(&result4, std::move(other.result4));
} else {
Construct(&promise4, std::move(other.promise4));
}
if (ready.is_set(5)) {
Construct(&result5, std::move(other.result5));
} else {
Construct(&promise5, std::move(other.promise5));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION JoinState(JoinState&& other) noexcept {
DCHECK(other.ready.none());
Construct(&promise0, std::move(other.promise0));
Construct(&promise1, std::move(other.promise1));
Construct(&promise2, std::move(other.promise2));
Construct(&promise3, std::move(other.promise3));
Construct(&promise4, std::move(other.promise4));
Construct(&promise5, std::move(other.promise5));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION ~JoinState() {
if (ready.is_set(0)) {
@ -1054,43 +974,15 @@ struct JoinState<Traits, P0, P1, P2, P3, P4, P5, P6> {
}
JoinState& operator=(const JoinState& other) = delete;
JoinState& operator=(JoinState&& other) = delete;
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION JoinState(JoinState&& other) noexcept
: ready(other.ready) {
if (ready.is_set(0)) {
Construct(&result0, std::move(other.result0));
} else {
Construct(&promise0, std::move(other.promise0));
}
if (ready.is_set(1)) {
Construct(&result1, std::move(other.result1));
} else {
Construct(&promise1, std::move(other.promise1));
}
if (ready.is_set(2)) {
Construct(&result2, std::move(other.result2));
} else {
Construct(&promise2, std::move(other.promise2));
}
if (ready.is_set(3)) {
Construct(&result3, std::move(other.result3));
} else {
Construct(&promise3, std::move(other.promise3));
}
if (ready.is_set(4)) {
Construct(&result4, std::move(other.result4));
} else {
Construct(&promise4, std::move(other.promise4));
}
if (ready.is_set(5)) {
Construct(&result5, std::move(other.result5));
} else {
Construct(&promise5, std::move(other.promise5));
}
if (ready.is_set(6)) {
Construct(&result6, std::move(other.result6));
} else {
Construct(&promise6, std::move(other.promise6));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION JoinState(JoinState&& other) noexcept {
DCHECK(other.ready.none());
Construct(&promise0, std::move(other.promise0));
Construct(&promise1, std::move(other.promise1));
Construct(&promise2, std::move(other.promise2));
Construct(&promise3, std::move(other.promise3));
Construct(&promise4, std::move(other.promise4));
Construct(&promise5, std::move(other.promise5));
Construct(&promise6, std::move(other.promise6));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION ~JoinState() {
if (ready.is_set(0)) {
@ -1375,48 +1267,16 @@ struct JoinState<Traits, P0, P1, P2, P3, P4, P5, P6, P7> {
}
JoinState& operator=(const JoinState& other) = delete;
JoinState& operator=(JoinState&& other) = delete;
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION JoinState(JoinState&& other) noexcept
: ready(other.ready) {
if (ready.is_set(0)) {
Construct(&result0, std::move(other.result0));
} else {
Construct(&promise0, std::move(other.promise0));
}
if (ready.is_set(1)) {
Construct(&result1, std::move(other.result1));
} else {
Construct(&promise1, std::move(other.promise1));
}
if (ready.is_set(2)) {
Construct(&result2, std::move(other.result2));
} else {
Construct(&promise2, std::move(other.promise2));
}
if (ready.is_set(3)) {
Construct(&result3, std::move(other.result3));
} else {
Construct(&promise3, std::move(other.promise3));
}
if (ready.is_set(4)) {
Construct(&result4, std::move(other.result4));
} else {
Construct(&promise4, std::move(other.promise4));
}
if (ready.is_set(5)) {
Construct(&result5, std::move(other.result5));
} else {
Construct(&promise5, std::move(other.promise5));
}
if (ready.is_set(6)) {
Construct(&result6, std::move(other.result6));
} else {
Construct(&promise6, std::move(other.promise6));
}
if (ready.is_set(7)) {
Construct(&result7, std::move(other.result7));
} else {
Construct(&promise7, std::move(other.promise7));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION JoinState(JoinState&& other) noexcept {
DCHECK(other.ready.none());
Construct(&promise0, std::move(other.promise0));
Construct(&promise1, std::move(other.promise1));
Construct(&promise2, std::move(other.promise2));
Construct(&promise3, std::move(other.promise3));
Construct(&promise4, std::move(other.promise4));
Construct(&promise5, std::move(other.promise5));
Construct(&promise6, std::move(other.promise6));
Construct(&promise7, std::move(other.promise7));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION ~JoinState() {
if (ready.is_set(0)) {
@ -1736,53 +1596,17 @@ struct JoinState<Traits, P0, P1, P2, P3, P4, P5, P6, P7, P8> {
}
JoinState& operator=(const JoinState& other) = delete;
JoinState& operator=(JoinState&& other) = delete;
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION JoinState(JoinState&& other) noexcept
: ready(other.ready) {
if (ready.is_set(0)) {
Construct(&result0, std::move(other.result0));
} else {
Construct(&promise0, std::move(other.promise0));
}
if (ready.is_set(1)) {
Construct(&result1, std::move(other.result1));
} else {
Construct(&promise1, std::move(other.promise1));
}
if (ready.is_set(2)) {
Construct(&result2, std::move(other.result2));
} else {
Construct(&promise2, std::move(other.promise2));
}
if (ready.is_set(3)) {
Construct(&result3, std::move(other.result3));
} else {
Construct(&promise3, std::move(other.promise3));
}
if (ready.is_set(4)) {
Construct(&result4, std::move(other.result4));
} else {
Construct(&promise4, std::move(other.promise4));
}
if (ready.is_set(5)) {
Construct(&result5, std::move(other.result5));
} else {
Construct(&promise5, std::move(other.promise5));
}
if (ready.is_set(6)) {
Construct(&result6, std::move(other.result6));
} else {
Construct(&promise6, std::move(other.promise6));
}
if (ready.is_set(7)) {
Construct(&result7, std::move(other.result7));
} else {
Construct(&promise7, std::move(other.promise7));
}
if (ready.is_set(8)) {
Construct(&result8, std::move(other.result8));
} else {
Construct(&promise8, std::move(other.promise8));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION JoinState(JoinState&& other) noexcept {
DCHECK(other.ready.none());
Construct(&promise0, std::move(other.promise0));
Construct(&promise1, std::move(other.promise1));
Construct(&promise2, std::move(other.promise2));
Construct(&promise3, std::move(other.promise3));
Construct(&promise4, std::move(other.promise4));
Construct(&promise5, std::move(other.promise5));
Construct(&promise6, std::move(other.promise6));
Construct(&promise7, std::move(other.promise7));
Construct(&promise8, std::move(other.promise8));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION ~JoinState() {
if (ready.is_set(0)) {

@ -122,23 +122,15 @@ struct SeqState<Traits, P, F0> {
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(const SeqState& other) noexcept
: state(other.state), whence(other.whence) {
CHECK(state == State::kState0);
DCHECK(state == State::kState0);
Construct(&prior.current_promise, other.prior.current_promise);
Construct(&prior.next_factory, other.prior.next_factory);
}
SeqState& operator=(const SeqState& other) = delete;
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(SeqState&& other) noexcept
: state(other.state), whence(other.whence) {
switch (state) {
case State::kState0:
Construct(&prior.current_promise,
std::move(other.prior.current_promise));
goto tail0;
case State::kState1:
Construct(&current_promise, std::move(other.current_promise));
return;
}
tail0:
DCHECK(state == State::kState0);
Construct(&prior.current_promise, std::move(other.prior.current_promise));
Construct(&prior.next_factory, std::move(other.prior.next_factory));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState& operator=(SeqState&& other) =
@ -259,31 +251,19 @@ struct SeqState<Traits, P, F0, F1> {
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(const SeqState& other) noexcept
: state(other.state), whence(other.whence) {
CHECK(state == State::kState0);
Construct(&prior.current_promise, other.prior.current_promise);
DCHECK(state == State::kState0);
Construct(&prior.prior.current_promise, other.prior.prior.current_promise);
Construct(&prior.prior.next_factory, other.prior.prior.next_factory);
Construct(&prior.next_factory, other.prior.next_factory);
}
SeqState& operator=(const SeqState& other) = delete;
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(SeqState&& other) noexcept
: state(other.state), whence(other.whence) {
switch (state) {
case State::kState0:
Construct(&prior.prior.current_promise,
std::move(other.prior.prior.current_promise));
goto tail0;
case State::kState1:
Construct(&prior.current_promise,
std::move(other.prior.current_promise));
goto tail1;
case State::kState2:
Construct(&current_promise, std::move(other.current_promise));
return;
}
tail0:
DCHECK(state == State::kState0);
Construct(&prior.prior.current_promise,
std::move(other.prior.prior.current_promise));
Construct(&prior.prior.next_factory,
std::move(other.prior.prior.next_factory));
tail1:
Construct(&prior.next_factory, std::move(other.prior.next_factory));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState& operator=(SeqState&& other) =
@ -455,8 +435,9 @@ struct SeqState<Traits, P, F0, F1, F2> {
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(const SeqState& other) noexcept
: state(other.state), whence(other.whence) {
CHECK(state == State::kState0);
Construct(&prior.current_promise, other.prior.current_promise);
DCHECK(state == State::kState0);
Construct(&prior.prior.prior.current_promise,
other.prior.prior.prior.current_promise);
Construct(&prior.prior.prior.next_factory,
other.prior.prior.prior.next_factory);
Construct(&prior.prior.next_factory, other.prior.prior.next_factory);
@ -465,30 +446,13 @@ struct SeqState<Traits, P, F0, F1, F2> {
SeqState& operator=(const SeqState& other) = delete;
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(SeqState&& other) noexcept
: state(other.state), whence(other.whence) {
switch (state) {
case State::kState0:
Construct(&prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.current_promise));
goto tail0;
case State::kState1:
Construct(&prior.prior.current_promise,
std::move(other.prior.prior.current_promise));
goto tail1;
case State::kState2:
Construct(&prior.current_promise,
std::move(other.prior.current_promise));
goto tail2;
case State::kState3:
Construct(&current_promise, std::move(other.current_promise));
return;
}
tail0:
DCHECK(state == State::kState0);
Construct(&prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.current_promise));
Construct(&prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.next_factory));
tail1:
Construct(&prior.prior.next_factory,
std::move(other.prior.prior.next_factory));
tail2:
Construct(&prior.next_factory, std::move(other.prior.next_factory));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState& operator=(SeqState&& other) =
@ -710,8 +674,9 @@ struct SeqState<Traits, P, F0, F1, F2, F3> {
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(const SeqState& other) noexcept
: state(other.state), whence(other.whence) {
CHECK(state == State::kState0);
Construct(&prior.current_promise, other.prior.current_promise);
DCHECK(state == State::kState0);
Construct(&prior.prior.prior.prior.current_promise,
other.prior.prior.prior.prior.current_promise);
Construct(&prior.prior.prior.prior.next_factory,
other.prior.prior.prior.prior.next_factory);
Construct(&prior.prior.prior.next_factory,
@ -722,37 +687,15 @@ struct SeqState<Traits, P, F0, F1, F2, F3> {
SeqState& operator=(const SeqState& other) = delete;
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(SeqState&& other) noexcept
: state(other.state), whence(other.whence) {
switch (state) {
case State::kState0:
Construct(&prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.current_promise));
goto tail0;
case State::kState1:
Construct(&prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.current_promise));
goto tail1;
case State::kState2:
Construct(&prior.prior.current_promise,
std::move(other.prior.prior.current_promise));
goto tail2;
case State::kState3:
Construct(&prior.current_promise,
std::move(other.prior.current_promise));
goto tail3;
case State::kState4:
Construct(&current_promise, std::move(other.current_promise));
return;
}
tail0:
DCHECK(state == State::kState0);
Construct(&prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.current_promise));
Construct(&prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.next_factory));
tail1:
Construct(&prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.next_factory));
tail2:
Construct(&prior.prior.next_factory,
std::move(other.prior.prior.next_factory));
tail3:
Construct(&prior.next_factory, std::move(other.prior.next_factory));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState& operator=(SeqState&& other) =
@ -1033,8 +976,9 @@ struct SeqState<Traits, P, F0, F1, F2, F3, F4> {
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(const SeqState& other) noexcept
: state(other.state), whence(other.whence) {
CHECK(state == State::kState0);
Construct(&prior.current_promise, other.prior.current_promise);
DCHECK(state == State::kState0);
Construct(&prior.prior.prior.prior.prior.current_promise,
other.prior.prior.prior.prior.prior.current_promise);
Construct(&prior.prior.prior.prior.prior.next_factory,
other.prior.prior.prior.prior.prior.next_factory);
Construct(&prior.prior.prior.prior.next_factory,
@ -1047,45 +991,17 @@ struct SeqState<Traits, P, F0, F1, F2, F3, F4> {
SeqState& operator=(const SeqState& other) = delete;
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(SeqState&& other) noexcept
: state(other.state), whence(other.whence) {
switch (state) {
case State::kState0:
Construct(
&prior.prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.current_promise));
goto tail0;
case State::kState1:
Construct(&prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.current_promise));
goto tail1;
case State::kState2:
Construct(&prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.current_promise));
goto tail2;
case State::kState3:
Construct(&prior.prior.current_promise,
std::move(other.prior.prior.current_promise));
goto tail3;
case State::kState4:
Construct(&prior.current_promise,
std::move(other.prior.current_promise));
goto tail4;
case State::kState5:
Construct(&current_promise, std::move(other.current_promise));
return;
}
tail0:
DCHECK(state == State::kState0);
Construct(&prior.prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.current_promise));
Construct(&prior.prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.prior.next_factory));
tail1:
Construct(&prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.next_factory));
tail2:
Construct(&prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.next_factory));
tail3:
Construct(&prior.prior.next_factory,
std::move(other.prior.prior.next_factory));
tail4:
Construct(&prior.next_factory, std::move(other.prior.next_factory));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState& operator=(SeqState&& other) =
@ -1420,8 +1336,9 @@ struct SeqState<Traits, P, F0, F1, F2, F3, F4, F5> {
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(const SeqState& other) noexcept
: state(other.state), whence(other.whence) {
CHECK(state == State::kState0);
Construct(&prior.current_promise, other.prior.current_promise);
DCHECK(state == State::kState0);
Construct(&prior.prior.prior.prior.prior.prior.current_promise,
other.prior.prior.prior.prior.prior.prior.current_promise);
Construct(&prior.prior.prior.prior.prior.prior.next_factory,
other.prior.prior.prior.prior.prior.prior.next_factory);
Construct(&prior.prior.prior.prior.prior.next_factory,
@ -1436,55 +1353,21 @@ struct SeqState<Traits, P, F0, F1, F2, F3, F4, F5> {
SeqState& operator=(const SeqState& other) = delete;
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(SeqState&& other) noexcept
: state(other.state), whence(other.whence) {
switch (state) {
case State::kState0:
Construct(
&prior.prior.prior.prior.prior.prior.current_promise,
std::move(
other.prior.prior.prior.prior.prior.prior.current_promise));
goto tail0;
case State::kState1:
Construct(
&prior.prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.current_promise));
goto tail1;
case State::kState2:
Construct(&prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.current_promise));
goto tail2;
case State::kState3:
Construct(&prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.current_promise));
goto tail3;
case State::kState4:
Construct(&prior.prior.current_promise,
std::move(other.prior.prior.current_promise));
goto tail4;
case State::kState5:
Construct(&prior.current_promise,
std::move(other.prior.current_promise));
goto tail5;
case State::kState6:
Construct(&current_promise, std::move(other.current_promise));
return;
}
tail0:
DCHECK(state == State::kState0);
Construct(
&prior.prior.prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.current_promise));
Construct(
&prior.prior.prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.prior.prior.next_factory));
tail1:
Construct(&prior.prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.prior.next_factory));
tail2:
Construct(&prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.next_factory));
tail3:
Construct(&prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.next_factory));
tail4:
Construct(&prior.prior.next_factory,
std::move(other.prior.prior.next_factory));
tail5:
Construct(&prior.next_factory, std::move(other.prior.next_factory));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState& operator=(SeqState&& other) =
@ -1873,8 +1756,9 @@ struct SeqState<Traits, P, F0, F1, F2, F3, F4, F5, F6> {
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(const SeqState& other) noexcept
: state(other.state), whence(other.whence) {
CHECK(state == State::kState0);
Construct(&prior.current_promise, other.prior.current_promise);
DCHECK(state == State::kState0);
Construct(&prior.prior.prior.prior.prior.prior.prior.current_promise,
other.prior.prior.prior.prior.prior.prior.prior.current_promise);
Construct(&prior.prior.prior.prior.prior.prior.prior.next_factory,
other.prior.prior.prior.prior.prior.prior.prior.next_factory);
Construct(&prior.prior.prior.prior.prior.prior.next_factory,
@ -1891,65 +1775,26 @@ struct SeqState<Traits, P, F0, F1, F2, F3, F4, F5, F6> {
SeqState& operator=(const SeqState& other) = delete;
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(SeqState&& other) noexcept
: state(other.state), whence(other.whence) {
switch (state) {
case State::kState0:
Construct(&prior.prior.prior.prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior
.current_promise));
goto tail0;
case State::kState1:
Construct(
&prior.prior.prior.prior.prior.prior.current_promise,
std::move(
other.prior.prior.prior.prior.prior.prior.current_promise));
goto tail1;
case State::kState2:
Construct(
&prior.prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.current_promise));
goto tail2;
case State::kState3:
Construct(&prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.current_promise));
goto tail3;
case State::kState4:
Construct(&prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.current_promise));
goto tail4;
case State::kState5:
Construct(&prior.prior.current_promise,
std::move(other.prior.prior.current_promise));
goto tail5;
case State::kState6:
Construct(&prior.current_promise,
std::move(other.prior.current_promise));
goto tail6;
case State::kState7:
Construct(&current_promise, std::move(other.current_promise));
return;
}
tail0:
DCHECK(state == State::kState0);
Construct(
&prior.prior.prior.prior.prior.prior.prior.current_promise,
std::move(
other.prior.prior.prior.prior.prior.prior.prior.current_promise));
Construct(
&prior.prior.prior.prior.prior.prior.prior.next_factory,
std::move(
other.prior.prior.prior.prior.prior.prior.prior.next_factory));
tail1:
Construct(
&prior.prior.prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.prior.prior.next_factory));
tail2:
Construct(&prior.prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.prior.next_factory));
tail3:
Construct(&prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.next_factory));
tail4:
Construct(&prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.next_factory));
tail5:
Construct(&prior.prior.next_factory,
std::move(other.prior.prior.next_factory));
tail6:
Construct(&prior.next_factory, std::move(other.prior.next_factory));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState& operator=(SeqState&& other) =
@ -2394,8 +2239,10 @@ struct SeqState<Traits, P, F0, F1, F2, F3, F4, F5, F6, F7> {
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(const SeqState& other) noexcept
: state(other.state), whence(other.whence) {
CHECK(state == State::kState0);
Construct(&prior.current_promise, other.prior.current_promise);
DCHECK(state == State::kState0);
Construct(
&prior.prior.prior.prior.prior.prior.prior.prior.current_promise,
other.prior.prior.prior.prior.prior.prior.prior.prior.current_promise);
Construct(
&prior.prior.prior.prior.prior.prior.prior.prior.next_factory,
other.prior.prior.prior.prior.prior.prior.prior.prior.next_factory);
@ -2415,75 +2262,28 @@ struct SeqState<Traits, P, F0, F1, F2, F3, F4, F5, F6, F7> {
SeqState& operator=(const SeqState& other) = delete;
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(SeqState&& other) noexcept
: state(other.state), whence(other.whence) {
switch (state) {
case State::kState0:
Construct(
&prior.prior.prior.prior.prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior
.current_promise));
goto tail0;
case State::kState1:
Construct(&prior.prior.prior.prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior
.current_promise));
goto tail1;
case State::kState2:
Construct(
&prior.prior.prior.prior.prior.prior.current_promise,
std::move(
other.prior.prior.prior.prior.prior.prior.current_promise));
goto tail2;
case State::kState3:
Construct(
&prior.prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.current_promise));
goto tail3;
case State::kState4:
Construct(&prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.current_promise));
goto tail4;
case State::kState5:
Construct(&prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.current_promise));
goto tail5;
case State::kState6:
Construct(&prior.prior.current_promise,
std::move(other.prior.prior.current_promise));
goto tail6;
case State::kState7:
Construct(&prior.current_promise,
std::move(other.prior.current_promise));
goto tail7;
case State::kState8:
Construct(&current_promise, std::move(other.current_promise));
return;
}
tail0:
DCHECK(state == State::kState0);
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior
.current_promise));
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior
.next_factory));
tail1:
Construct(
&prior.prior.prior.prior.prior.prior.prior.next_factory,
std::move(
other.prior.prior.prior.prior.prior.prior.prior.next_factory));
tail2:
Construct(
&prior.prior.prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.prior.prior.next_factory));
tail3:
Construct(&prior.prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.prior.next_factory));
tail4:
Construct(&prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.next_factory));
tail5:
Construct(&prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.next_factory));
tail6:
Construct(&prior.prior.next_factory,
std::move(other.prior.prior.next_factory));
tail7:
Construct(&prior.next_factory, std::move(other.prior.next_factory));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState& operator=(SeqState&& other) =
@ -2989,8 +2789,11 @@ struct SeqState<Traits, P, F0, F1, F2, F3, F4, F5, F6, F7, F8> {
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(const SeqState& other) noexcept
: state(other.state), whence(other.whence) {
CHECK(state == State::kState0);
Construct(&prior.current_promise, other.prior.current_promise);
DCHECK(state == State::kState0);
Construct(
&prior.prior.prior.prior.prior.prior.prior.prior.prior.current_promise,
other.prior.prior.prior.prior.prior.prior.prior.prior.prior
.current_promise);
Construct(
&prior.prior.prior.prior.prior.prior.prior.prior.prior.next_factory,
other.prior.prior.prior.prior.prior.prior.prior.prior.prior
@ -3014,86 +2817,33 @@ struct SeqState<Traits, P, F0, F1, F2, F3, F4, F5, F6, F7, F8> {
SeqState& operator=(const SeqState& other) = delete;
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(SeqState&& other) noexcept
: state(other.state), whence(other.whence) {
switch (state) {
case State::kState0:
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior
.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior
.prior.prior.current_promise));
goto tail0;
case State::kState1:
Construct(
&prior.prior.prior.prior.prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior
.current_promise));
goto tail1;
case State::kState2:
Construct(&prior.prior.prior.prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior
.current_promise));
goto tail2;
case State::kState3:
Construct(
&prior.prior.prior.prior.prior.prior.current_promise,
std::move(
other.prior.prior.prior.prior.prior.prior.current_promise));
goto tail3;
case State::kState4:
Construct(
&prior.prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.current_promise));
goto tail4;
case State::kState5:
Construct(&prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.current_promise));
goto tail5;
case State::kState6:
Construct(&prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.current_promise));
goto tail6;
case State::kState7:
Construct(&prior.prior.current_promise,
std::move(other.prior.prior.current_promise));
goto tail7;
case State::kState8:
Construct(&prior.current_promise,
std::move(other.prior.current_promise));
goto tail8;
case State::kState9:
Construct(&current_promise, std::move(other.current_promise));
return;
}
tail0:
DCHECK(state == State::kState0);
Construct(
&prior.prior.prior.prior.prior.prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior.prior
.current_promise));
Construct(
&prior.prior.prior.prior.prior.prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior.prior
.next_factory));
tail1:
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior
.next_factory));
tail2:
Construct(
&prior.prior.prior.prior.prior.prior.prior.next_factory,
std::move(
other.prior.prior.prior.prior.prior.prior.prior.next_factory));
tail3:
Construct(
&prior.prior.prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.prior.prior.next_factory));
tail4:
Construct(&prior.prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.prior.next_factory));
tail5:
Construct(&prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.next_factory));
tail6:
Construct(&prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.next_factory));
tail7:
Construct(&prior.prior.next_factory,
std::move(other.prior.prior.next_factory));
tail8:
Construct(&prior.next_factory, std::move(other.prior.next_factory));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState& operator=(SeqState&& other) =
@ -3660,8 +3410,11 @@ struct SeqState<Traits, P, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9> {
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(const SeqState& other) noexcept
: state(other.state), whence(other.whence) {
CHECK(state == State::kState0);
Construct(&prior.current_promise, other.prior.current_promise);
DCHECK(state == State::kState0);
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
.current_promise,
other.prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
.current_promise);
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
.next_factory,
other.prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
@ -3689,97 +3442,37 @@ struct SeqState<Traits, P, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9> {
SeqState& operator=(const SeqState& other) = delete;
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(SeqState&& other) noexcept
: state(other.state), whence(other.whence) {
switch (state) {
case State::kState0:
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior
.prior.prior.prior.current_promise));
goto tail0;
case State::kState1:
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior
.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior
.prior.prior.current_promise));
goto tail1;
case State::kState2:
Construct(
&prior.prior.prior.prior.prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior
.current_promise));
goto tail2;
case State::kState3:
Construct(&prior.prior.prior.prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior
.current_promise));
goto tail3;
case State::kState4:
Construct(
&prior.prior.prior.prior.prior.prior.current_promise,
std::move(
other.prior.prior.prior.prior.prior.prior.current_promise));
goto tail4;
case State::kState5:
Construct(
&prior.prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.current_promise));
goto tail5;
case State::kState6:
Construct(&prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.current_promise));
goto tail6;
case State::kState7:
Construct(&prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.current_promise));
goto tail7;
case State::kState8:
Construct(&prior.prior.current_promise,
std::move(other.prior.prior.current_promise));
goto tail8;
case State::kState9:
Construct(&prior.current_promise,
std::move(other.prior.current_promise));
goto tail9;
case State::kState10:
Construct(&current_promise, std::move(other.current_promise));
return;
}
tail0:
DCHECK(state == State::kState0);
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior
.prior.prior.current_promise));
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
.next_factory,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior
.prior.prior.next_factory));
tail1:
Construct(
&prior.prior.prior.prior.prior.prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior.prior
.next_factory));
tail2:
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior
.next_factory));
tail3:
Construct(
&prior.prior.prior.prior.prior.prior.prior.next_factory,
std::move(
other.prior.prior.prior.prior.prior.prior.prior.next_factory));
tail4:
Construct(
&prior.prior.prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.prior.prior.next_factory));
tail5:
Construct(&prior.prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.prior.next_factory));
tail6:
Construct(&prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.next_factory));
tail7:
Construct(&prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.next_factory));
tail8:
Construct(&prior.prior.next_factory,
std::move(other.prior.prior.next_factory));
tail9:
Construct(&prior.next_factory, std::move(other.prior.next_factory));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState& operator=(SeqState&& other) =
@ -4408,8 +4101,11 @@ struct SeqState<Traits, P, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10> {
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(const SeqState& other) noexcept
: state(other.state), whence(other.whence) {
CHECK(state == State::kState0);
Construct(&prior.current_promise, other.prior.current_promise);
DCHECK(state == State::kState0);
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
.current_promise,
other.prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
.prior.current_promise);
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
.next_factory,
other.prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
@ -4441,108 +4137,41 @@ struct SeqState<Traits, P, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10> {
SeqState& operator=(const SeqState& other) = delete;
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(SeqState&& other) noexcept
: state(other.state), whence(other.whence) {
switch (state) {
case State::kState0:
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior
.prior.prior.prior.prior.current_promise));
goto tail0;
case State::kState1:
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior
.prior.prior.prior.current_promise));
goto tail1;
case State::kState2:
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior
.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior
.prior.prior.current_promise));
goto tail2;
case State::kState3:
Construct(
&prior.prior.prior.prior.prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior
.current_promise));
goto tail3;
case State::kState4:
Construct(&prior.prior.prior.prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior
.current_promise));
goto tail4;
case State::kState5:
Construct(
&prior.prior.prior.prior.prior.prior.current_promise,
std::move(
other.prior.prior.prior.prior.prior.prior.current_promise));
goto tail5;
case State::kState6:
Construct(
&prior.prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.current_promise));
goto tail6;
case State::kState7:
Construct(&prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.current_promise));
goto tail7;
case State::kState8:
Construct(&prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.current_promise));
goto tail8;
case State::kState9:
Construct(&prior.prior.current_promise,
std::move(other.prior.prior.current_promise));
goto tail9;
case State::kState10:
Construct(&prior.current_promise,
std::move(other.prior.current_promise));
goto tail10;
case State::kState11:
Construct(&current_promise, std::move(other.current_promise));
return;
}
tail0:
DCHECK(state == State::kState0);
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior
.prior.prior.prior.current_promise));
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
.next_factory,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior
.prior.prior.prior.next_factory));
tail1:
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
.next_factory,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior
.prior.prior.next_factory));
tail2:
Construct(
&prior.prior.prior.prior.prior.prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior.prior
.next_factory));
tail3:
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior
.next_factory));
tail4:
Construct(
&prior.prior.prior.prior.prior.prior.prior.next_factory,
std::move(
other.prior.prior.prior.prior.prior.prior.prior.next_factory));
tail5:
Construct(
&prior.prior.prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.prior.prior.next_factory));
tail6:
Construct(&prior.prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.prior.next_factory));
tail7:
Construct(&prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.next_factory));
tail8:
Construct(&prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.next_factory));
tail9:
Construct(&prior.prior.next_factory,
std::move(other.prior.prior.next_factory));
tail10:
Construct(&prior.next_factory, std::move(other.prior.next_factory));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState& operator=(SeqState&& other) =
@ -5235,8 +4864,11 @@ struct SeqState<Traits, P, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11> {
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(const SeqState& other) noexcept
: state(other.state), whence(other.whence) {
CHECK(state == State::kState0);
Construct(&prior.current_promise, other.prior.current_promise);
DCHECK(state == State::kState0);
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
.prior.current_promise,
other.prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
.prior.prior.current_promise);
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
.prior.next_factory,
other.prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
@ -5272,120 +4904,45 @@ struct SeqState<Traits, P, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11> {
SeqState& operator=(const SeqState& other) = delete;
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(SeqState&& other) noexcept
: state(other.state), whence(other.whence) {
switch (state) {
case State::kState0:
Construct(
&prior.prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior
.prior.prior.prior.prior.current_promise));
goto tail0;
case State::kState1:
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior
.prior.prior.prior.prior.current_promise));
goto tail1;
case State::kState2:
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior
.prior.prior.prior.current_promise));
goto tail2;
case State::kState3:
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior
.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior
.prior.prior.current_promise));
goto tail3;
case State::kState4:
Construct(
&prior.prior.prior.prior.prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior
.current_promise));
goto tail4;
case State::kState5:
Construct(&prior.prior.prior.prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior
.current_promise));
goto tail5;
case State::kState6:
Construct(
&prior.prior.prior.prior.prior.prior.current_promise,
std::move(
other.prior.prior.prior.prior.prior.prior.current_promise));
goto tail6;
case State::kState7:
Construct(
&prior.prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.current_promise));
goto tail7;
case State::kState8:
Construct(&prior.prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.prior.current_promise));
goto tail8;
case State::kState9:
Construct(&prior.prior.prior.current_promise,
std::move(other.prior.prior.prior.current_promise));
goto tail9;
case State::kState10:
Construct(&prior.prior.current_promise,
std::move(other.prior.prior.current_promise));
goto tail10;
case State::kState11:
Construct(&prior.current_promise,
std::move(other.prior.current_promise));
goto tail11;
case State::kState12:
Construct(&current_promise, std::move(other.current_promise));
return;
}
tail0:
DCHECK(state == State::kState0);
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
.prior.current_promise,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior
.prior.prior.prior.prior.current_promise));
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
.prior.next_factory,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior
.prior.prior.prior.prior.next_factory));
tail1:
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
.next_factory,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior
.prior.prior.prior.next_factory));
tail2:
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.prior.prior
.next_factory,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior
.prior.prior.next_factory));
tail3:
Construct(
&prior.prior.prior.prior.prior.prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior.prior
.next_factory));
tail4:
Construct(&prior.prior.prior.prior.prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.prior.prior.prior.prior
.next_factory));
tail5:
Construct(
&prior.prior.prior.prior.prior.prior.prior.next_factory,
std::move(
other.prior.prior.prior.prior.prior.prior.prior.next_factory));
tail6:
Construct(
&prior.prior.prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.prior.prior.next_factory));
tail7:
Construct(&prior.prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.prior.next_factory));
tail8:
Construct(&prior.prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.prior.next_factory));
tail9:
Construct(&prior.prior.prior.next_factory,
std::move(other.prior.prior.prior.next_factory));
tail10:
Construct(&prior.prior.next_factory,
std::move(other.prior.prior.next_factory));
tail11:
Construct(&prior.next_factory, std::move(other.prior.next_factory));
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState& operator=(SeqState&& other) =

@ -46,13 +46,10 @@ struct JoinState<Traits, ${",".join(f"P{i}" for i in range(0,n))}> {
}
JoinState& operator=(const JoinState& other) = delete;
JoinState& operator=(JoinState&& other) = delete;
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION JoinState(JoinState&& other) noexcept : ready(other.ready) {
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION JoinState(JoinState&& other) noexcept {
DCHECK(other.ready.none());
% for i in range(0,n):
if (ready.is_set(${i})) {
Construct(&result${i}, std::move(other.result${i}));
} else {
Construct(&promise${i}, std::move(other.promise${i}));
}
Construct(&promise${i}, std::move(other.promise${i}));
% endfor
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION ~JoinState() {

@ -110,9 +110,9 @@ tail${i}:
% endfor
}
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(const SeqState& other) noexcept : state(other.state), whence(other.whence) {
CHECK(state == State::kState0);
Construct(&${"prior."*(n-1-i)}current_promise,
other.${"prior."*(n-1-i)}current_promise);
DCHECK(state == State::kState0);
Construct(&${"prior."*(n-1)}current_promise,
other.${"prior."*(n-1)}current_promise);
% for i in range(0,n-1):
Construct(&${"prior."*(n-1-i)}next_factory,
other.${"prior."*(n-1-i)}next_factory);
@ -120,19 +120,10 @@ tail${i}:
}
SeqState& operator=(const SeqState& other) = delete;
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION SeqState(SeqState&& other) noexcept : state(other.state), whence(other.whence) {
switch (state) {
DCHECK(state == State::kState0);
Construct(&${"prior."*(n-1)}current_promise,
std::move(other.${"prior."*(n-1)}current_promise));
% for i in range(0,n-1):
case State::kState${i}:
Construct(&${"prior."*(n-1-i)}current_promise,
std::move(other.${"prior."*(n-1-i)}current_promise));
goto tail${i};
% endfor
case State::kState${n-1}:
Construct(&current_promise, std::move(other.current_promise));
return;
}
% for i in range(0,n-1):
tail${i}:
Construct(&${"prior."*(n-1-i)}next_factory,
std::move(other.${"prior."*(n-1-i)}next_factory));
% endfor

Loading…
Cancel
Save