diff --git a/src/builtins/builtins-async-generator-gen.cc b/src/builtins/builtins-async-generator-gen.cc index d962bc8fc2..2ed7e8c83e 100644 --- a/src/builtins/builtins-async-generator-gen.cc +++ b/src/builtins/builtins-async-generator-gen.cc @@ -23,146 +23,142 @@ class AsyncGeneratorBuiltinsAssembler : public AsyncBuiltinsAssembler { explicit AsyncGeneratorBuiltinsAssembler(CodeAssemblerState* state) : AsyncBuiltinsAssembler(state) {} - inline Node* TaggedIsAsyncGenerator(Node* tagged_object) { - TNode if_notsmi = TaggedIsNotSmi(tagged_object); - return Select( - if_notsmi, - [=] { - return HasInstanceType(tagged_object, JS_ASYNC_GENERATOR_OBJECT_TYPE); - }, - [=] { return if_notsmi; }); - } - inline Node* LoadGeneratorState(Node* const generator) { - return LoadObjectField(generator, JSGeneratorObject::kContinuationOffset); + inline TNode LoadGeneratorState( + const TNode generator) { + return LoadObjectField(generator, + JSGeneratorObject::kContinuationOffset); } - inline TNode IsGeneratorStateClosed(SloppyTNode const state) { + inline TNode IsGeneratorStateClosed(const TNode state) { return SmiEqual(state, SmiConstant(JSGeneratorObject::kGeneratorClosed)); } - inline TNode IsGeneratorClosed(Node* const generator) { + inline TNode IsGeneratorClosed( + const TNode generator) { return IsGeneratorStateClosed(LoadGeneratorState(generator)); } - inline TNode IsGeneratorStateSuspended(SloppyTNode const state) { + inline TNode IsGeneratorStateSuspended(const TNode state) { return SmiGreaterThanOrEqual(state, SmiConstant(0)); } - inline TNode IsGeneratorSuspended(Node* const generator) { + inline TNode IsGeneratorSuspended( + const TNode generator) { return IsGeneratorStateSuspended(LoadGeneratorState(generator)); } - inline TNode IsGeneratorStateSuspendedAtStart( - SloppyTNode const state) { + inline TNode IsGeneratorStateSuspendedAtStart(const TNode state) { return SmiEqual(state, SmiConstant(0)); } - inline TNode IsGeneratorStateNotExecuting( - SloppyTNode const state) { + inline TNode IsGeneratorStateNotExecuting(const TNode state) { return SmiNotEqual(state, SmiConstant(JSGeneratorObject::kGeneratorExecuting)); } - inline TNode IsGeneratorNotExecuting(Node* const generator) { + inline TNode IsGeneratorNotExecuting( + const TNode generator) { return IsGeneratorStateNotExecuting(LoadGeneratorState(generator)); } - inline TNode IsGeneratorAwaiting(Node* const generator) { + inline TNode IsGeneratorAwaiting( + const TNode generator) { TNode is_generator_awaiting = LoadObjectField(generator, JSAsyncGeneratorObject::kIsAwaitingOffset); return TaggedEqual(is_generator_awaiting, SmiConstant(1)); } - inline void SetGeneratorAwaiting(Node* const generator) { + inline void SetGeneratorAwaiting(const TNode generator) { CSA_ASSERT(this, Word32BinaryNot(IsGeneratorAwaiting(generator))); StoreObjectFieldNoWriteBarrier( generator, JSAsyncGeneratorObject::kIsAwaitingOffset, SmiConstant(1)); CSA_ASSERT(this, IsGeneratorAwaiting(generator)); } - inline void SetGeneratorNotAwaiting(Node* const generator) { + inline void SetGeneratorNotAwaiting( + const TNode generator) { CSA_ASSERT(this, IsGeneratorAwaiting(generator)); StoreObjectFieldNoWriteBarrier( generator, JSAsyncGeneratorObject::kIsAwaitingOffset, SmiConstant(0)); CSA_ASSERT(this, Word32BinaryNot(IsGeneratorAwaiting(generator))); } - inline void CloseGenerator(Node* const generator) { + inline void CloseGenerator(const TNode generator) { StoreObjectFieldNoWriteBarrier( generator, JSGeneratorObject::kContinuationOffset, SmiConstant(JSGeneratorObject::kGeneratorClosed)); } - inline Node* IsFastJSIterResult(Node* const value, Node* const context) { - CSA_ASSERT(this, TaggedIsNotSmi(value)); - TNode const native_context = LoadNativeContext(context); - return TaggedEqual( - LoadMap(value), - LoadContextElement(native_context, Context::ITERATOR_RESULT_MAP_INDEX)); + inline TNode LoadFirstAsyncGeneratorRequestFromQueue( + const TNode generator) { + return LoadObjectField(generator, + JSAsyncGeneratorObject::kQueueOffset); } - inline Node* LoadFirstAsyncGeneratorRequestFromQueue(Node* const generator) { - return LoadObjectField(generator, JSAsyncGeneratorObject::kQueueOffset); + inline TNode LoadResumeTypeFromAsyncGeneratorRequest( + const TNode request) { + return LoadObjectField(request, + AsyncGeneratorRequest::kResumeModeOffset); } - inline Node* LoadResumeTypeFromAsyncGeneratorRequest(Node* const request) { - return LoadObjectField(request, AsyncGeneratorRequest::kResumeModeOffset); + inline TNode LoadPromiseFromAsyncGeneratorRequest( + const TNode request) { + return LoadObjectField(request, + AsyncGeneratorRequest::kPromiseOffset); } - inline Node* LoadPromiseFromAsyncGeneratorRequest(Node* const request) { - return LoadObjectField(request, AsyncGeneratorRequest::kPromiseOffset); - } - - inline Node* LoadValueFromAsyncGeneratorRequest(Node* const request) { + inline TNode LoadValueFromAsyncGeneratorRequest( + const TNode request) { return LoadObjectField(request, AsyncGeneratorRequest::kValueOffset); } - inline TNode IsAbruptResumeType(SloppyTNode const resume_type) { + inline TNode IsAbruptResumeType(const TNode resume_type) { return SmiNotEqual(resume_type, SmiConstant(JSGeneratorObject::kNext)); } - void AsyncGeneratorEnqueue(CodeStubArguments* args, Node* context, - Node* generator, Node* value, + void AsyncGeneratorEnqueue(CodeStubArguments* args, TNode context, + TNode receiver, TNode value, JSAsyncGeneratorObject::ResumeMode resume_mode, const char* method_name); - Node* TakeFirstAsyncGeneratorRequestFromQueue(Node* generator); - Node* TakeFirstAsyncGeneratorRequestFromQueueIfPresent(Node* generator, - Label* if_not_present); - void AddAsyncGeneratorRequestToQueue(Node* generator, Node* request); + TNode TakeFirstAsyncGeneratorRequestFromQueue( + TNode generator); + void AddAsyncGeneratorRequestToQueue(TNode generator, + TNode request); - Node* AllocateAsyncGeneratorRequest( - JSAsyncGeneratorObject::ResumeMode resume_mode, Node* resume_value, - Node* promise); + TNode AllocateAsyncGeneratorRequest( + JSAsyncGeneratorObject::ResumeMode resume_mode, + TNode resume_value, TNode promise); // Shared implementation of the catchable and uncatchable variations of Await // for AsyncGenerators. template void AsyncGeneratorAwait(bool is_catchable); void AsyncGeneratorAwaitResumeClosure( - Node* context, Node* value, + TNode context, TNode value, JSAsyncGeneratorObject::ResumeMode resume_mode); }; // Shared implementation for the 3 Async Iterator protocol methods of Async // Generators. void AsyncGeneratorBuiltinsAssembler::AsyncGeneratorEnqueue( - CodeStubArguments* args, Node* context, Node* generator, Node* value, - JSAsyncGeneratorObject::ResumeMode resume_mode, const char* method_name) { + CodeStubArguments* args, TNode context, TNode receiver, + TNode value, JSAsyncGeneratorObject::ResumeMode resume_mode, + const char* method_name) { // AsyncGeneratorEnqueue produces a new Promise, and appends it to the list // of async generator requests to be executed. If the generator is not // presently executing, then this method will loop through, processing each // request from front to back. // This loop resides in AsyncGeneratorResumeNext. - TNode promise = AllocateAndInitJSPromise(CAST(context)); + TNode promise = AllocateAndInitJSPromise(context); - Label enqueue(this), if_receiverisincompatible(this, Label::kDeferred); + Label if_receiverisincompatible(this, Label::kDeferred); + GotoIf(TaggedIsSmi(receiver), &if_receiverisincompatible); + GotoIfNot(HasInstanceType(CAST(receiver), JS_ASYNC_GENERATOR_OBJECT_TYPE), + &if_receiverisincompatible); - Branch(TaggedIsAsyncGenerator(generator), &enqueue, - &if_receiverisincompatible); - - BIND(&enqueue); { Label done(this); - Node* const req = + const TNode generator = CAST(receiver); + const TNode req = AllocateAsyncGeneratorRequest(resume_mode, value, promise); AddAsyncGeneratorRequestToQueue(generator, req); @@ -171,7 +167,7 @@ void AsyncGeneratorBuiltinsAssembler::AsyncGeneratorEnqueue( // If state is not "executing", then // Perform AsyncGeneratorResumeNext(Generator) // Check if the {receiver} is running or already closed. - TNode continuation = CAST(LoadGeneratorState(generator)); + TNode continuation = LoadGeneratorState(generator); GotoIf(SmiEqual(continuation, SmiConstant(JSAsyncGeneratorObject::kGeneratorExecuting)), @@ -186,20 +182,18 @@ void AsyncGeneratorBuiltinsAssembler::AsyncGeneratorEnqueue( BIND(&if_receiverisincompatible); { - Node* const error = - MakeTypeError(MessageTemplate::kIncompatibleMethodReceiver, context, - StringConstant(method_name), generator); - - CallBuiltin(Builtins::kRejectPromise, context, promise, error, + CallBuiltin(Builtins::kRejectPromise, context, promise, + MakeTypeError(MessageTemplate::kIncompatibleMethodReceiver, + context, StringConstant(method_name), receiver), TrueConstant()); args->PopAndReturn(promise); } } -Node* AsyncGeneratorBuiltinsAssembler::AllocateAsyncGeneratorRequest( - JSAsyncGeneratorObject::ResumeMode resume_mode, Node* resume_value, - Node* promise) { - CSA_SLOW_ASSERT(this, HasInstanceType(promise, JS_PROMISE_TYPE)); +TNode +AsyncGeneratorBuiltinsAssembler::AllocateAsyncGeneratorRequest( + JSAsyncGeneratorObject::ResumeMode resume_mode, TNode resume_value, + TNode promise) { TNode request = Allocate(AsyncGeneratorRequest::kSize); StoreMapNoWriteBarrier(request, RootIndex::kAsyncGeneratorRequestMap); StoreObjectFieldNoWriteBarrier(request, AsyncGeneratorRequest::kNextOffset, @@ -213,15 +207,14 @@ Node* AsyncGeneratorBuiltinsAssembler::AllocateAsyncGeneratorRequest( promise); StoreObjectFieldRoot(request, AsyncGeneratorRequest::kNextOffset, RootIndex::kUndefinedValue); - return request; + return CAST(request); } void AsyncGeneratorBuiltinsAssembler::AsyncGeneratorAwaitResumeClosure( - Node* context, Node* value, + TNode context, TNode value, JSAsyncGeneratorObject::ResumeMode resume_mode) { - TNode const generator = - LoadContextElement(context, Context::EXTENSION_INDEX); - CSA_SLOW_ASSERT(this, TaggedIsAsyncGenerator(generator)); + const TNode generator = + CAST(LoadContextElement(context, Context::EXTENSION_INDEX)); SetGeneratorNotAwaiting(generator); @@ -259,12 +252,13 @@ void AsyncGeneratorBuiltinsAssembler::AsyncGeneratorAwait(bool is_catchable) { } void AsyncGeneratorBuiltinsAssembler::AddAsyncGeneratorRequestToQueue( - Node* generator, Node* request) { - VARIABLE(var_current, MachineRepresentation::kTagged); + TNode generator, + TNode request) { + TVARIABLE(HeapObject, var_current); Label empty(this), loop(this, &var_current), done(this); - var_current.Bind( - LoadObjectField(generator, JSAsyncGeneratorObject::kQueueOffset)); + var_current = LoadObjectField( + generator, JSAsyncGeneratorObject::kQueueOffset); Branch(IsUndefined(var_current.value()), &empty, &loop); BIND(&empty); @@ -276,9 +270,9 @@ void AsyncGeneratorBuiltinsAssembler::AddAsyncGeneratorRequestToQueue( BIND(&loop); { Label loop_next(this), next_empty(this); - Node* current = var_current.value(); - TNode next = - LoadObjectField(current, AsyncGeneratorRequest::kNextOffset); + TNode current = CAST(var_current.value()); + TNode next = LoadObjectField( + current, AsyncGeneratorRequest::kNextOffset); Branch(IsUndefined(next), &next_empty, &loop_next); BIND(&next_empty); @@ -289,20 +283,20 @@ void AsyncGeneratorBuiltinsAssembler::AddAsyncGeneratorRequestToQueue( BIND(&loop_next); { - var_current.Bind(next); + var_current = next; Goto(&loop); } } BIND(&done); } -Node* AsyncGeneratorBuiltinsAssembler::TakeFirstAsyncGeneratorRequestFromQueue( - Node* generator) { +TNode +AsyncGeneratorBuiltinsAssembler::TakeFirstAsyncGeneratorRequestFromQueue( + TNode generator) { // Removes and returns the first AsyncGeneratorRequest from a // JSAsyncGeneratorObject's queue. Asserts that the queue is not empty. - CSA_ASSERT(this, TaggedIsAsyncGenerator(generator)); - TNode request = - CAST(LoadObjectField(generator, JSAsyncGeneratorObject::kQueueOffset)); + TNode request = LoadObjectField( + generator, JSAsyncGeneratorObject::kQueueOffset); TNode next = LoadObjectField(request, AsyncGeneratorRequest::kNextOffset); @@ -323,7 +317,7 @@ TF_BUILTIN(AsyncGeneratorPrototypeNext, AsyncGeneratorBuiltinsAssembler) { TNode generator = args.GetReceiver(); TNode value = args.GetOptionalArgumentValue(kValueArg); - Node* context = Parameter(Descriptor::kContext); + TNode context = CAST(Parameter(Descriptor::kContext)); AsyncGeneratorEnqueue(&args, context, generator, value, JSAsyncGeneratorObject::kNext, @@ -341,7 +335,7 @@ TF_BUILTIN(AsyncGeneratorPrototypeReturn, AsyncGeneratorBuiltinsAssembler) { TNode generator = args.GetReceiver(); TNode value = args.GetOptionalArgumentValue(kValueArg); - Node* context = Parameter(Descriptor::kContext); + TNode context = CAST(Parameter(Descriptor::kContext)); AsyncGeneratorEnqueue(&args, context, generator, value, JSAsyncGeneratorObject::kReturn, @@ -359,7 +353,7 @@ TF_BUILTIN(AsyncGeneratorPrototypeThrow, AsyncGeneratorBuiltinsAssembler) { TNode generator = args.GetReceiver(); TNode value = args.GetOptionalArgumentValue(kValueArg); - Node* context = Parameter(Descriptor::kContext); + TNode context = CAST(Parameter(Descriptor::kContext)); AsyncGeneratorEnqueue(&args, context, generator, value, JSAsyncGeneratorObject::kThrow, @@ -367,15 +361,15 @@ TF_BUILTIN(AsyncGeneratorPrototypeThrow, AsyncGeneratorBuiltinsAssembler) { } TF_BUILTIN(AsyncGeneratorAwaitResolveClosure, AsyncGeneratorBuiltinsAssembler) { - Node* value = Parameter(Descriptor::kValue); - Node* context = Parameter(Descriptor::kContext); + TNode value = CAST(Parameter(Descriptor::kValue)); + TNode context = CAST(Parameter(Descriptor::kContext)); AsyncGeneratorAwaitResumeClosure(context, value, JSAsyncGeneratorObject::kNext); } TF_BUILTIN(AsyncGeneratorAwaitRejectClosure, AsyncGeneratorBuiltinsAssembler) { - Node* value = Parameter(Descriptor::kValue); - Node* context = Parameter(Descriptor::kContext); + TNode value = CAST(Parameter(Descriptor::kValue)); + TNode context = CAST(Parameter(Descriptor::kContext)); AsyncGeneratorAwaitResumeClosure(context, value, JSAsyncGeneratorObject::kThrow); } @@ -392,8 +386,9 @@ TF_BUILTIN(AsyncGeneratorAwaitCaught, AsyncGeneratorBuiltinsAssembler) { TF_BUILTIN(AsyncGeneratorResumeNext, AsyncGeneratorBuiltinsAssembler) { using Descriptor = AsyncGeneratorResumeNextDescriptor; - Node* const generator = Parameter(Descriptor::kGenerator); - Node* const context = Parameter(Descriptor::kContext); + const TNode generator = + CAST(Parameter(Descriptor::kGenerator)); + const TNode context = CAST(Parameter(Descriptor::kContext)); // The penultimate step of proposal-async-iteration/#sec-asyncgeneratorresolve // and proposal-async-iteration/#sec-asyncgeneratorreject both recursively @@ -403,12 +398,10 @@ TF_BUILTIN(AsyncGeneratorResumeNext, AsyncGeneratorBuiltinsAssembler) { // performs a loop in AsyncGeneratorResumeNext, which continues as long as // there is an AsyncGeneratorRequest in the queue, and as long as the // generator is not suspended due to an AwaitExpression. - VARIABLE(var_state, MachineRepresentation::kTaggedSigned, - LoadGeneratorState(generator)); - VARIABLE(var_next, MachineRepresentation::kTagged, - LoadFirstAsyncGeneratorRequestFromQueue(generator)); - Variable* loop_variables[] = {&var_state, &var_next}; - Label start(this, 2, loop_variables); + TVARIABLE(Smi, var_state, LoadGeneratorState(generator)); + TVARIABLE(HeapObject, var_next, + LoadFirstAsyncGeneratorRequestFromQueue(generator)); + Label start(this, {&var_state, &var_next}); Goto(&start); BIND(&start); @@ -420,9 +413,8 @@ TF_BUILTIN(AsyncGeneratorResumeNext, AsyncGeneratorBuiltinsAssembler) { // Stop resuming if request queue is empty. ReturnIf(IsUndefined(var_next.value()), UndefinedConstant()); - Node* const next = var_next.value(); - TNode const resume_type = - CAST(LoadResumeTypeFromAsyncGeneratorRequest(next)); + const TNode next = CAST(var_next.value()); + const TNode resume_type = LoadResumeTypeFromAsyncGeneratorRequest(next); Label if_abrupt(this), if_normal(this), resume_generator(this); Branch(IsAbruptResumeType(resume_type), &if_abrupt, &if_normal); @@ -432,11 +424,11 @@ TF_BUILTIN(AsyncGeneratorResumeNext, AsyncGeneratorBuiltinsAssembler) { GotoIfNot(IsGeneratorStateSuspendedAtStart(var_state.value()), &settle_promise); CloseGenerator(generator); - var_state.Bind(SmiConstant(JSGeneratorObject::kGeneratorClosed)); + var_state = SmiConstant(JSGeneratorObject::kGeneratorClosed); Goto(&settle_promise); BIND(&settle_promise); - Node* next_value = LoadValueFromAsyncGeneratorRequest(next); + TNode next_value = LoadValueFromAsyncGeneratorRequest(next); Branch(SmiEqual(resume_type, SmiConstant(JSGeneratorObject::kReturn)), &if_return, &if_throw); @@ -457,7 +449,7 @@ TF_BUILTIN(AsyncGeneratorResumeNext, AsyncGeneratorBuiltinsAssembler) { GotoIfNot(IsGeneratorStateClosed(var_state.value()), &resume_generator); CallBuiltin(Builtins::kAsyncGeneratorReject, context, generator, next_value); - var_next.Bind(LoadFirstAsyncGeneratorRequestFromQueue(generator)); + var_next = LoadFirstAsyncGeneratorRequestFromQueue(generator); Goto(&start); } @@ -466,8 +458,8 @@ TF_BUILTIN(AsyncGeneratorResumeNext, AsyncGeneratorBuiltinsAssembler) { GotoIfNot(IsGeneratorStateClosed(var_state.value()), &resume_generator); CallBuiltin(Builtins::kAsyncGeneratorResolve, context, generator, UndefinedConstant(), TrueConstant()); - var_state.Bind(LoadGeneratorState(generator)); - var_next.Bind(LoadFirstAsyncGeneratorRequestFromQueue(generator)); + var_state = LoadGeneratorState(generator); + var_next = LoadFirstAsyncGeneratorRequestFromQueue(generator); Goto(&start); } @@ -478,19 +470,19 @@ TF_BUILTIN(AsyncGeneratorResumeNext, AsyncGeneratorBuiltinsAssembler) { generator, JSGeneratorObject::kResumeModeOffset, resume_type); CallStub(CodeFactory::ResumeGenerator(isolate()), context, LoadValueFromAsyncGeneratorRequest(next), generator); - var_state.Bind(LoadGeneratorState(generator)); - var_next.Bind(LoadFirstAsyncGeneratorRequestFromQueue(generator)); + var_state = LoadGeneratorState(generator); + var_next = LoadFirstAsyncGeneratorRequestFromQueue(generator); Goto(&start); } } TF_BUILTIN(AsyncGeneratorResolve, AsyncGeneratorBuiltinsAssembler) { - Node* const generator = Parameter(Descriptor::kGenerator); - Node* const value = Parameter(Descriptor::kValue); - Node* const done = Parameter(Descriptor::kDone); - Node* const context = Parameter(Descriptor::kContext); + const TNode generator = + CAST(Parameter(Descriptor::kGenerator)); + const TNode value = CAST(Parameter(Descriptor::kValue)); + const TNode done = CAST(Parameter(Descriptor::kDone)); + const TNode context = CAST(Parameter(Descriptor::kContext)); - CSA_SLOW_ASSERT(this, TaggedIsAsyncGenerator(generator)); CSA_ASSERT(this, Word32BinaryNot(IsGeneratorAwaiting(generator))); // This operation should be called only when the `value` parameter has been @@ -499,11 +491,12 @@ TF_BUILTIN(AsyncGeneratorResolve, AsyncGeneratorBuiltinsAssembler) { // non-callable value. This can't be checked with assertions due to being // observable, but keep it in mind. - Node* const next = TakeFirstAsyncGeneratorRequestFromQueue(generator); - Node* const promise = LoadPromiseFromAsyncGeneratorRequest(next); + const TNode next = + TakeFirstAsyncGeneratorRequestFromQueue(generator); + const TNode promise = LoadPromiseFromAsyncGeneratorRequest(next); // Let iteratorResult be CreateIterResultObject(value, done). - TNode const iter_result = Allocate(JSIteratorResult::kSize); + const TNode iter_result = Allocate(JSIteratorResult::kSize); { TNode map = LoadContextElement(LoadNativeContext(context), Context::ITERATOR_RESULT_MAP_INDEX); @@ -555,12 +548,14 @@ TF_BUILTIN(AsyncGeneratorResolve, AsyncGeneratorBuiltinsAssembler) { TF_BUILTIN(AsyncGeneratorReject, AsyncGeneratorBuiltinsAssembler) { using Descriptor = AsyncGeneratorRejectDescriptor; - Node* const generator = Parameter(Descriptor::kGenerator); - Node* const value = Parameter(Descriptor::kValue); - Node* const context = Parameter(Descriptor::kContext); + const TNode generator = + CAST(Parameter(Descriptor::kGenerator)); + const TNode value = CAST(Parameter(Descriptor::kValue)); + const TNode context = CAST(Parameter(Descriptor::kContext)); - Node* const next = TakeFirstAsyncGeneratorRequestFromQueue(generator); - Node* const promise = LoadPromiseFromAsyncGeneratorRequest(next); + TNode next = + TakeFirstAsyncGeneratorRequestFromQueue(generator); + TNode promise = LoadPromiseFromAsyncGeneratorRequest(next); Return(CallBuiltin(Builtins::kRejectPromise, context, promise, value, TrueConstant())); @@ -573,9 +568,10 @@ TF_BUILTIN(AsyncGeneratorYield, AsyncGeneratorBuiltinsAssembler) { const TNode is_caught = CAST(Parameter(Descriptor::kIsCaught)); const TNode context = CAST(Parameter(Descriptor::kContext)); - Node* const request = LoadFirstAsyncGeneratorRequestFromQueue(generator); + const TNode request = + CAST(LoadFirstAsyncGeneratorRequestFromQueue(generator)); const TNode outer_promise = - CAST(LoadPromiseFromAsyncGeneratorRequest(request)); + LoadPromiseFromAsyncGeneratorRequest(request); const int on_resolve = Context::ASYNC_GENERATOR_YIELD_RESOLVE_SHARED_FUN; const int on_reject = Context::ASYNC_GENERATOR_AWAIT_REJECT_SHARED_FUN; @@ -587,10 +583,10 @@ TF_BUILTIN(AsyncGeneratorYield, AsyncGeneratorBuiltinsAssembler) { } TF_BUILTIN(AsyncGeneratorYieldResolveClosure, AsyncGeneratorBuiltinsAssembler) { - Node* const context = Parameter(Descriptor::kContext); - Node* const value = Parameter(Descriptor::kValue); - TNode const generator = - LoadContextElement(context, Context::EXTENSION_INDEX); + const TNode context = CAST(Parameter(Descriptor::kContext)); + const TNode value = CAST(Parameter(Descriptor::kValue)); + const TNode generator = + CAST(LoadContextElement(context, Context::EXTENSION_INDEX)); SetGeneratorNotAwaiting(generator); @@ -623,8 +619,8 @@ TF_BUILTIN(AsyncGeneratorReturn, AsyncGeneratorBuiltinsAssembler) { CAST(Parameter(Descriptor::kGenerator)); const TNode value = CAST(Parameter(Descriptor::kValue)); const TNode is_caught = CAST(Parameter(Descriptor::kIsCaught)); - Node* const req = LoadFirstAsyncGeneratorRequestFromQueue(generator); - CSA_ASSERT(this, IsNotUndefined(req)); + const TNode req = + CAST(LoadFirstAsyncGeneratorRequestFromQueue(generator)); Label perform_await(this); TVARIABLE(IntPtrT, var_on_resolve, @@ -634,7 +630,7 @@ TF_BUILTIN(AsyncGeneratorReturn, AsyncGeneratorBuiltinsAssembler) { IntPtrT, var_on_reject, IntPtrConstant(Context::ASYNC_GENERATOR_RETURN_CLOSED_REJECT_SHARED_FUN)); - Node* const state = LoadGeneratorState(generator); + const TNode state = LoadGeneratorState(generator); GotoIf(IsGeneratorStateClosed(state), &perform_await); var_on_resolve = IntPtrConstant(Context::ASYNC_GENERATOR_RETURN_RESOLVE_SHARED_FUN); @@ -647,7 +643,7 @@ TF_BUILTIN(AsyncGeneratorReturn, AsyncGeneratorBuiltinsAssembler) { SetGeneratorAwaiting(generator); TNode context = CAST(Parameter(Descriptor::kContext)); const TNode outer_promise = - CAST(LoadPromiseFromAsyncGeneratorRequest(req)); + LoadPromiseFromAsyncGeneratorRequest(req); Await(context, generator, value, outer_promise, var_on_resolve.value(), var_on_reject.value(), is_caught); @@ -660,8 +656,8 @@ TF_BUILTIN(AsyncGeneratorReturn, AsyncGeneratorBuiltinsAssembler) { // proposal-async-iteration/#sec-asyncgeneratoryield step 8.e TF_BUILTIN(AsyncGeneratorReturnResolveClosure, AsyncGeneratorBuiltinsAssembler) { - Node* const context = Parameter(Descriptor::kContext); - Node* const value = Parameter(Descriptor::kValue); + const TNode context = CAST(Parameter(Descriptor::kContext)); + const TNode value = CAST(Parameter(Descriptor::kValue)); AsyncGeneratorAwaitResumeClosure(context, value, JSGeneratorObject::kReturn); } @@ -670,10 +666,10 @@ TF_BUILTIN(AsyncGeneratorReturnResolveClosure, // AsyncGeneratorResumeNext. TF_BUILTIN(AsyncGeneratorReturnClosedResolveClosure, AsyncGeneratorBuiltinsAssembler) { - Node* const context = Parameter(Descriptor::kContext); - Node* const value = Parameter(Descriptor::kValue); - TNode const generator = - LoadContextElement(context, Context::EXTENSION_INDEX); + const TNode context = CAST(Parameter(Descriptor::kContext)); + const TNode value = CAST(Parameter(Descriptor::kValue)); + const TNode generator = + CAST(LoadContextElement(context, Context::EXTENSION_INDEX)); SetGeneratorNotAwaiting(generator); @@ -688,10 +684,10 @@ TF_BUILTIN(AsyncGeneratorReturnClosedResolveClosure, TF_BUILTIN(AsyncGeneratorReturnClosedRejectClosure, AsyncGeneratorBuiltinsAssembler) { - Node* const context = Parameter(Descriptor::kContext); - Node* const value = Parameter(Descriptor::kValue); - TNode const generator = - LoadContextElement(context, Context::EXTENSION_INDEX); + const TNode context = CAST(Parameter(Descriptor::kContext)); + const TNode value = CAST(Parameter(Descriptor::kValue)); + const TNode generator = + CAST(LoadContextElement(context, Context::EXTENSION_INDEX)); SetGeneratorNotAwaiting(generator);