Commit 7325ed03 authored by Kenton Varda's avatar Kenton Varda

I{REQUIRE,ASSERT} -> {REQUIRE,ASSERT} since these aren't inline anymore.

parent 31976bad
...@@ -312,7 +312,7 @@ bool PromiseNode::atomicOnReady(EventLoop::Event*& onReadyEvent, EventLoop::Even ...@@ -312,7 +312,7 @@ bool PromiseNode::atomicOnReady(EventLoop::Event*& onReadyEvent, EventLoop::Even
} else { } else {
// `onReadyEvent` is not null. If it is _kJ_ALREADY_READY then this promise was fulfilled // `onReadyEvent` is not null. If it is _kJ_ALREADY_READY then this promise was fulfilled
// before any dependent existed, otherwise there is already a different dependent. // before any dependent existed, otherwise there is already a different dependent.
KJ_IREQUIRE(oldEvent == _kJ_ALREADY_READY, "onReady() can only be called once."); KJ_REQUIRE(oldEvent == _kJ_ALREADY_READY, "onReady() can only be called once.");
return true; return true;
} }
} }
...@@ -361,7 +361,7 @@ Maybe<const EventLoop&> TransformPromiseNodeBase::getSafeEventLoop() noexcept { ...@@ -361,7 +361,7 @@ Maybe<const EventLoop&> TransformPromiseNodeBase::getSafeEventLoop() noexcept {
ChainPromiseNode::ChainPromiseNode(const EventLoop& loop, Own<PromiseNode> inner) ChainPromiseNode::ChainPromiseNode(const EventLoop& loop, Own<PromiseNode> inner)
: Event(loop), state(PRE_STEP1), inner(kj::mv(inner)) { : Event(loop), state(PRE_STEP1), inner(kj::mv(inner)) {
KJ_IREQUIRE(this->inner->isSafeEventLoop(loop)); KJ_DREQUIRE(this->inner->isSafeEventLoop(loop));
arm(); arm();
} }
...@@ -373,7 +373,7 @@ bool ChainPromiseNode::onReady(EventLoop::Event& event) noexcept { ...@@ -373,7 +373,7 @@ bool ChainPromiseNode::onReady(EventLoop::Event& event) noexcept {
switch (state) { switch (state) {
case PRE_STEP1: case PRE_STEP1:
case STEP1: case STEP1:
KJ_IREQUIRE(onReadyEvent == nullptr, "onReady() can only be called once."); KJ_REQUIRE(onReadyEvent == nullptr, "onReady() can only be called once.");
onReadyEvent = &event; onReadyEvent = &event;
return false; return false;
case STEP2: case STEP2:
...@@ -383,7 +383,7 @@ bool ChainPromiseNode::onReady(EventLoop::Event& event) noexcept { ...@@ -383,7 +383,7 @@ bool ChainPromiseNode::onReady(EventLoop::Event& event) noexcept {
} }
void ChainPromiseNode::get(ExceptionOrValue& output) noexcept { void ChainPromiseNode::get(ExceptionOrValue& output) noexcept {
KJ_IREQUIRE(state == STEP2); KJ_REQUIRE(state == STEP2);
return inner->get(output); return inner->get(output);
} }
...@@ -397,7 +397,7 @@ void ChainPromiseNode::fire() { ...@@ -397,7 +397,7 @@ void ChainPromiseNode::fire() {
return; return;
} }
KJ_IREQUIRE(state != STEP2); KJ_REQUIRE(state != STEP2);
static_assert(sizeof(Promise<int>) == sizeof(PromiseBase), static_assert(sizeof(Promise<int>) == sizeof(PromiseBase),
"This code assumes Promise<T> does not add any new members to PromiseBase."); "This code assumes Promise<T> does not add any new members to PromiseBase.");
...@@ -423,7 +423,7 @@ void ChainPromiseNode::fire() { ...@@ -423,7 +423,7 @@ void ChainPromiseNode::fire() {
} else { } else {
// We can only get here if inner->get() returned neither an exception nor a // We can only get here if inner->get() returned neither an exception nor a
// value, which never actually happens. // value, which never actually happens.
KJ_IASSERT(false, "Inner node returned empty value."); KJ_FAIL_ASSERT("Inner node returned empty value.");
} }
state = STEP2; state = STEP2;
...@@ -437,7 +437,7 @@ void ChainPromiseNode::fire() { ...@@ -437,7 +437,7 @@ void ChainPromiseNode::fire() {
CrossThreadPromiseNodeBase::CrossThreadPromiseNodeBase( CrossThreadPromiseNodeBase::CrossThreadPromiseNodeBase(
const EventLoop& loop, Own<PromiseNode>&& dependent, ExceptionOrValue& resultRef) const EventLoop& loop, Own<PromiseNode>&& dependent, ExceptionOrValue& resultRef)
: Event(loop), dependent(kj::mv(dependent)), resultRef(resultRef) { : Event(loop), dependent(kj::mv(dependent)), resultRef(resultRef) {
KJ_IREQUIRE(this->dependent->isSafeEventLoop(loop)); KJ_DREQUIRE(this->dependent->isSafeEventLoop(loop));
// The constructor may be called from any thread, so before we can even call onReady() we need // The constructor may be called from any thread, so before we can even call onReady() we need
// to switch threads. // to switch threads.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment