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

Unified Diff: src/full-codegen/mips64/full-codegen-mips64.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/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/mips64/full-codegen-mips64.cc
diff --git a/src/full-codegen/mips64/full-codegen-mips64.cc b/src/full-codegen/mips64/full-codegen-mips64.cc
index 5bef9c769221fab90dee905ff0300cd26a231c9f..a99842eaf29e84e8d453846a7247d80149da889f 100644
--- a/src/full-codegen/mips64/full-codegen-mips64.cc
+++ b/src/full-codegen/mips64/full-codegen-mips64.cc
@@ -1977,115 +1977,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;
- Register load_receiver = LoadDescriptor::ReceiverRegister();
- Register load_name = LoadDescriptor::NameRegister();
-
- // Initial send value is undefined.
- __ LoadRoot(a0, Heap::kUndefinedValueRootIndex);
- __ Branch(&l_next);
-
- // catch (e) { receiver = iter; f = 'throw'; arg = e; goto l_call; }
- __ bind(&l_catch);
- __ mov(a0, v0);
- __ LoadRoot(a2, Heap::kthrow_stringRootIndex); // "throw"
- __ ld(a3, MemOperand(sp, 1 * kPointerSize)); // iter
- __ Push(a2, a3, a0); // "throw", iter, except
- __ 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(a0); // result
- int handler_index = NewHandlerTableEntry();
- EnterTryBlock(handler_index, &l_catch);
- const int try_block_size = TryCatch::kElementCount * kPointerSize;
- __ push(a0); // result
-
- __ jmp(&l_suspend);
- __ bind(&l_continuation);
- __ RecordGeneratorContinuation();
- __ mov(a0, v0);
- __ jmp(&l_resume);
-
- __ bind(&l_suspend);
- const int generator_object_depth = kPointerSize + try_block_size;
- __ ld(a0, MemOperand(sp, generator_object_depth));
- __ push(a0); // g
- __ Push(Smi::FromInt(handler_index)); // handler-index
- DCHECK(l_continuation.pos() > 0 && Smi::IsValid(l_continuation.pos()));
- __ li(a1, Operand(Smi::FromInt(l_continuation.pos())));
- __ sd(a1, FieldMemOperand(a0, JSGeneratorObject::kContinuationOffset));
- __ sd(cp, FieldMemOperand(a0, JSGeneratorObject::kContextOffset));
- __ mov(a1, cp);
- __ RecordWriteField(a0, JSGeneratorObject::kContextOffset, a1, a2,
- kRAHasBeenSaved, kDontSaveFPRegs);
- __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 2);
- __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
- __ pop(v0); // result
- EmitReturnSequence();
- __ mov(a0, v0);
- __ bind(&l_resume); // received in a0
- ExitTryBlock(handler_index);
-
- // receiver = iter; f = 'next'; arg = received;
- __ bind(&l_next);
- __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next"
- __ ld(a3, MemOperand(sp, 1 * kPointerSize)); // iter
- __ Push(load_name, a3, a0); // "next", iter, received
-
- // result = receiver[f](arg);
- __ bind(&l_call);
- __ ld(load_receiver, MemOperand(sp, kPointerSize));
- __ ld(load_name, MemOperand(sp, 2 * kPointerSize));
- __ li(LoadDescriptor::SlotRegister(),
- Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot())));
- Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), SLOPPY).code();
- CallIC(ic, TypeFeedbackId::None());
- __ mov(a0, v0);
- __ mov(a1, a0);
- __ sd(a1, MemOperand(sp, 2 * kPointerSize));
- SetCallPosition(expr);
- __ li(a0, Operand(1));
- __ Call(
- isolate()->builtins()->Call(ConvertReceiverMode::kNotNullOrUndefined),
- RelocInfo::CODE_TARGET);
-
- __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
- __ Drop(1); // The function is still on the stack; drop it.
-
- // if (!result.done) goto l_try;
- __ Move(load_receiver, v0);
-
- __ push(load_receiver); // save result
- __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done"
- __ li(LoadDescriptor::SlotRegister(),
- Operand(SmiFromSlot(expr->DoneFeedbackSlot())));
- CallLoadIC(NOT_INSIDE_TYPEOF); // v0=result.done
- __ mov(a0, v0);
- Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate());
- CallIC(bool_ic);
- __ LoadRoot(at, Heap::kTrueValueRootIndex);
- __ Branch(&l_try, ne, result_register(), Operand(at));
-
- // result.value
- __ pop(load_receiver); // result
- __ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value"
- __ li(LoadDescriptor::SlotRegister(),
- Operand(SmiFromSlot(expr->ValueFeedbackSlot())));
- CallLoadIC(NOT_INSIDE_TYPEOF); // v0=result.value
- context()->DropAndPlug(2, v0); // drop iter and g
- break;
- }
+ case Yield::kDelegating:
+ UNREACHABLE();
}
}
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698