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

Unified Diff: src/full-codegen/arm/full-codegen-arm.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/ast/ast.h ('k') | src/full-codegen/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/arm/full-codegen-arm.cc
diff --git a/src/full-codegen/arm/full-codegen-arm.cc b/src/full-codegen/arm/full-codegen-arm.cc
index caa50e8272ca6c4e0908ab58587292e440481430..1412ac25695cbaa9ee1dac9c3274b8a16954b45e 100644
--- a/src/full-codegen/arm/full-codegen-arm.cc
+++ b/src/full-codegen/arm/full-codegen-arm.cc
@@ -1979,112 +1979,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(r0, 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"
- __ ldr(r3, MemOperand(sp, 1 * kPointerSize)); // iter
- __ Push(load_name, r3, r0); // "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(r0); // result
- int handler_index = NewHandlerTableEntry();
- EnterTryBlock(handler_index, &l_catch);
- const int try_block_size = TryCatch::kElementCount * kPointerSize;
- __ push(r0); // result
-
- __ jmp(&l_suspend);
- __ bind(&l_continuation);
- __ RecordGeneratorContinuation();
- __ jmp(&l_resume);
-
- __ bind(&l_suspend);
- const int generator_object_depth = kPointerSize + try_block_size;
- __ ldr(r0, MemOperand(sp, generator_object_depth));
- __ push(r0); // g
- __ Push(Smi::FromInt(handler_index)); // handler-index
- DCHECK(l_continuation.pos() > 0 && Smi::IsValid(l_continuation.pos()));
- __ mov(r1, Operand(Smi::FromInt(l_continuation.pos())));
- __ str(r1, FieldMemOperand(r0, JSGeneratorObject::kContinuationOffset));
- __ str(cp, FieldMemOperand(r0, JSGeneratorObject::kContextOffset));
- __ mov(r1, cp);
- __ RecordWriteField(r0, JSGeneratorObject::kContextOffset, r1, r2,
- kLRHasBeenSaved, kDontSaveFPRegs);
- __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 2);
- __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
- __ pop(r0); // result
- EmitReturnSequence();
- __ bind(&l_resume); // received in r0
- ExitTryBlock(handler_index);
-
- // receiver = iter; f = 'next'; arg = received;
- __ bind(&l_next);
-
- __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next"
- __ ldr(r3, MemOperand(sp, 1 * kPointerSize)); // iter
- __ Push(load_name, r3, r0); // "next", iter, received
-
- // result = receiver[f](arg);
- __ bind(&l_call);
- __ ldr(load_receiver, MemOperand(sp, kPointerSize));
- __ ldr(load_name, MemOperand(sp, 2 * kPointerSize));
- __ mov(LoadDescriptor::SlotRegister(),
- Operand(SmiFromSlot(expr->KeyedLoadFeedbackSlot())));
- Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), SLOPPY).code();
- CallIC(ic, TypeFeedbackId::None());
- __ mov(r1, r0);
- __ str(r1, MemOperand(sp, 2 * kPointerSize));
- SetCallPosition(expr);
- __ mov(r0, Operand(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, r0);
-
- __ push(load_receiver); // save result
- __ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done"
- __ mov(LoadDescriptor::SlotRegister(),
- Operand(SmiFromSlot(expr->DoneFeedbackSlot())));
- CallLoadIC(NOT_INSIDE_TYPEOF); // r0=result.done
- 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(),
- Operand(SmiFromSlot(expr->ValueFeedbackSlot())));
- CallLoadIC(NOT_INSIDE_TYPEOF); // r0=result.value
- context()->DropAndPlug(2, r0); // drop iter and g
- break;
- }
+ case Yield::kDelegating:
+ UNREACHABLE();
}
}
« no previous file with comments | « src/ast/ast.h ('k') | src/full-codegen/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698