Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Unified Diff: src/full-codegen/x64/full-codegen-x64.cc

Issue 1648773003: [generators] Remove full-codegen implementation of yield*. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@yield-star-with-return
Patch Set: Rebase Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/full-codegen/ppc/full-codegen-ppc.cc ('k') | src/full-codegen/x87/full-codegen-x87.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/x64/full-codegen-x64.cc
diff --git a/src/full-codegen/x64/full-codegen-x64.cc b/src/full-codegen/x64/full-codegen-x64.cc
index a5c3421223e84381f09bb77fbeca6e118ba17615..3b1d451a86fe423e0a6a048b72c6cc7415d08f61 100644
--- a/src/full-codegen/x64/full-codegen-x64.cc
+++ b/src/full-codegen/x64/full-codegen-x64.cc
@@ -1915,114 +1915,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(rax, Heap::kUndefinedValueRootIndex);
- __ jmp(&l_next);
-
- // catch (e) { receiver = iter; f = 'throw'; arg = e; goto l_call; }
- __ bind(&l_catch);
- __ LoadRoot(load_name, Heap::kthrow_stringRootIndex); // "throw"
- __ Push(load_name);
- __ Push(Operand(rsp, 2 * kPointerSize)); // iter
- __ Push(rax); // exception
- __ jmp(&l_call);
-
- // try { received = %yield result }
- // Shuffle the received result above a try handler and yield it without
- // re-boxing.
- __ bind(&l_try);
- __ Pop(rax); // result
- int handler_index = NewHandlerTableEntry();
- EnterTryBlock(handler_index, &l_catch);
- const int try_block_size = TryCatch::kElementCount * kPointerSize;
- __ Push(rax); // result
-
- __ jmp(&l_suspend);
- __ bind(&l_continuation);
- __ RecordGeneratorContinuation();
- __ jmp(&l_resume);
-
- __ bind(&l_suspend);
- const int generator_object_depth = kPointerSize + try_block_size;
- __ movp(rax, Operand(rsp, generator_object_depth));
- __ Push(rax); // g
- __ Push(Smi::FromInt(handler_index)); // handler-index
- DCHECK(l_continuation.pos() > 0 && Smi::IsValid(l_continuation.pos()));
- __ Move(FieldOperand(rax, JSGeneratorObject::kContinuationOffset),
- Smi::FromInt(l_continuation.pos()));
- __ movp(FieldOperand(rax, JSGeneratorObject::kContextOffset), rsi);
- __ movp(rcx, rsi);
- __ RecordWriteField(rax, JSGeneratorObject::kContextOffset, rcx, rdx,
- kDontSaveFPRegs);
- __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 2);
- __ movp(context_register(),
- Operand(rbp, StandardFrameConstants::kContextOffset));
- __ Pop(rax); // result
- EmitReturnSequence();
- __ bind(&l_resume); // received in rax
- ExitTryBlock(handler_index);
-
- // receiver = iter; f = 'next'; arg = received;
- __ bind(&l_next);
-
- __ LoadRoot(load_name, Heap::knext_stringRootIndex);
- __ Push(load_name); // "next"
- __ Push(Operand(rsp, 2 * kPointerSize)); // iter
- __ Push(rax); // received
-
- // result = receiver[f](arg);
- __ bind(&l_call);
- __ movp(load_receiver, Operand(rsp, kPointerSize));
- __ Move(LoadDescriptor::SlotRegister(),
- SmiFromSlot(expr->KeyedLoadFeedbackSlot()));
- Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), SLOPPY).code();
- CallIC(ic, TypeFeedbackId::None());
- __ movp(rdi, rax);
- __ movp(Operand(rsp, 2 * kPointerSize), rdi);
-
- SetCallPosition(expr);
- __ Set(rax, 1);
- __ Call(
- isolate()->builtins()->Call(ConvertReceiverMode::kNotNullOrUndefined),
- RelocInfo::CODE_TARGET);
-
- __ movp(rsi, Operand(rbp, 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, rax);
- __ Push(load_receiver); // save result
- __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done"
- __ Move(LoadDescriptor::SlotRegister(),
- SmiFromSlot(expr->DoneFeedbackSlot()));
- CallLoadIC(NOT_INSIDE_TYPEOF); // rax=result.done
- Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate());
- CallIC(bool_ic);
- __ CompareRoot(result_register(), Heap::kTrueValueRootIndex);
- __ j(not_equal, &l_try);
-
- // result.value
- __ Pop(load_receiver); // result
- __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value"
- __ Move(LoadDescriptor::SlotRegister(),
- SmiFromSlot(expr->ValueFeedbackSlot()));
- CallLoadIC(NOT_INSIDE_TYPEOF); // result.value in rax
- context()->DropAndPlug(2, rax); // drop iter and g
- break;
- }
+ case Yield::kDelegating:
+ UNREACHABLE();
}
}
« no previous file with comments | « src/full-codegen/ppc/full-codegen-ppc.cc ('k') | src/full-codegen/x87/full-codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698