Index: src/full-codegen/arm64/full-codegen-arm64.cc |
diff --git a/src/full-codegen/arm64/full-codegen-arm64.cc b/src/full-codegen/arm64/full-codegen-arm64.cc |
index f12656b9d26d61fa57ca20cc7d2f1bcfa72d2e91..dc389852dd96c4609a724dcd25ad71b4791c00b2 100644 |
--- a/src/full-codegen/arm64/full-codegen-arm64.cc |
+++ b/src/full-codegen/arm64/full-codegen-arm64.cc |
@@ -4385,116 +4385,8 @@ void FullCodeGenerator::VisitYield(Yield* expr) { |
break; |
} |
- case Yield::kDelegating: { |
- VisitForStackValue(expr->generator_object()); |
- |
- // Initial stack layout is as follows: |
- // [sp + 1 * kPointerSize] iter |
- // [sp + 0 * kPointerSize] g |
- |
- Label l_catch, l_try, l_suspend, l_continuation, l_resume; |
- Label l_next, l_call, l_loop; |
- Register load_receiver = LoadDescriptor::ReceiverRegister(); |
- Register load_name = LoadDescriptor::NameRegister(); |
- |
- // Initial send value is undefined. |
- __ LoadRoot(x0, Heap::kUndefinedValueRootIndex); |
- __ B(&l_next); |
- |
- // catch (e) { receiver = iter; f = 'throw'; arg = e; goto l_call; } |
- __ Bind(&l_catch); |
- __ LoadRoot(load_name, Heap::kthrow_stringRootIndex); // "throw" |
- __ Peek(x3, 1 * kPointerSize); // iter |
- __ Push(load_name, x3, x0); // "throw", iter, except |
- __ B(&l_call); |
- |
- // try { received = %yield result } |
- // Shuffle the received result above a try handler and yield it without |
- // re-boxing. |
- __ Bind(&l_try); |
- __ Pop(x0); // result |
- int handler_index = NewHandlerTableEntry(); |
- EnterTryBlock(handler_index, &l_catch); |
- const int try_block_size = TryCatch::kElementCount * kPointerSize; |
- __ Push(x0); // result |
- |
- __ B(&l_suspend); |
- // TODO(jbramley): This label is bound here because the following code |
- // looks at its pos(). Is it possible to do something more efficient here, |
- // perhaps using Adr? |
- __ Bind(&l_continuation); |
- __ RecordGeneratorContinuation(); |
- __ B(&l_resume); |
- |
- __ Bind(&l_suspend); |
- const int generator_object_depth = kPointerSize + try_block_size; |
- __ Peek(x0, generator_object_depth); |
- __ Push(x0); // g |
- __ Push(Smi::FromInt(handler_index)); // handler-index |
- DCHECK((l_continuation.pos() > 0) && Smi::IsValid(l_continuation.pos())); |
- __ Mov(x1, Smi::FromInt(l_continuation.pos())); |
- __ Str(x1, FieldMemOperand(x0, JSGeneratorObject::kContinuationOffset)); |
- __ Str(cp, FieldMemOperand(x0, JSGeneratorObject::kContextOffset)); |
- __ Mov(x1, cp); |
- __ RecordWriteField(x0, JSGeneratorObject::kContextOffset, x1, x2, |
- kLRHasBeenSaved, kDontSaveFPRegs); |
- __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 2); |
- __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
- __ Pop(x0); // result |
- EmitReturnSequence(); |
- __ Bind(&l_resume); // received in x0 |
- ExitTryBlock(handler_index); |
- |
- // receiver = iter; f = 'next'; arg = received; |
- __ Bind(&l_next); |
- |
- __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" |
- __ Peek(x3, 1 * kPointerSize); // iter |
- __ Push(load_name, x3, x0); // "next", iter, received |
- |
- // result = receiver[f](arg); |
- __ Bind(&l_call); |
- __ Peek(load_receiver, 1 * kPointerSize); |
- __ Peek(load_name, 2 * kPointerSize); |
- __ Mov(LoadDescriptor::SlotRegister(), |
- SmiFromSlot(expr->KeyedLoadFeedbackSlot())); |
- Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), SLOPPY).code(); |
- CallIC(ic, TypeFeedbackId::None()); |
- __ Mov(x1, x0); |
- __ Poke(x1, 2 * kPointerSize); |
- SetCallPosition(expr); |
- __ Mov(x0, 1); |
- __ Call( |
- isolate()->builtins()->Call(ConvertReceiverMode::kNotNullOrUndefined), |
- RelocInfo::CODE_TARGET); |
- |
- __ Ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
- __ Drop(1); // The function is still on the stack; drop it. |
- |
- // if (!result.done) goto l_try; |
- __ Bind(&l_loop); |
- __ Move(load_receiver, x0); |
- |
- __ Push(load_receiver); // save result |
- __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done" |
- __ Mov(LoadDescriptor::SlotRegister(), |
- SmiFromSlot(expr->DoneFeedbackSlot())); |
- CallLoadIC(NOT_INSIDE_TYPEOF); // x0=result.done |
- // The ToBooleanStub argument (result.done) is in x0. |
- Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); |
- CallIC(bool_ic); |
- __ CompareRoot(result_register(), Heap::kTrueValueRootIndex); |
- __ B(ne, &l_try); |
- |
- // result.value |
- __ Pop(load_receiver); // result |
- __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value" |
- __ Mov(LoadDescriptor::SlotRegister(), |
- SmiFromSlot(expr->ValueFeedbackSlot())); |
- CallLoadIC(NOT_INSIDE_TYPEOF); // x0=result.value |
- context()->DropAndPlug(2, x0); // drop iter and g |
- break; |
- } |
+ case Yield::kDelegating: |
+ UNREACHABLE(); |
} |
} |