| Index: src/full-codegen/x87/full-codegen-x87.cc
|
| diff --git a/src/full-codegen/x87/full-codegen-x87.cc b/src/full-codegen/x87/full-codegen-x87.cc
|
| index 93e9a9977e47e51970cc40e8a7b555e84bb2b197..bc41e486e30419c55e580f7f6e108bdfc91ed00a 100644
|
| --- a/src/full-codegen/x87/full-codegen-x87.cc
|
| +++ b/src/full-codegen/x87/full-codegen-x87.cc
|
| @@ -1867,115 +1867,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.
|
| - __ mov(eax, isolate()->factory()->undefined_value());
|
| - __ jmp(&l_next);
|
| -
|
| - // catch (e) { receiver = iter; f = 'throw'; arg = e; goto l_call; }
|
| - __ bind(&l_catch);
|
| - __ mov(load_name, isolate()->factory()->throw_string()); // "throw"
|
| - __ push(load_name); // "throw"
|
| - __ push(Operand(esp, 2 * kPointerSize)); // iter
|
| - __ push(eax); // 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(eax); // result
|
| - int handler_index = NewHandlerTableEntry();
|
| - EnterTryBlock(handler_index, &l_catch);
|
| - const int try_block_size = TryCatch::kElementCount * kPointerSize;
|
| - __ push(eax); // result
|
| -
|
| - __ jmp(&l_suspend);
|
| - __ bind(&l_continuation);
|
| - __ RecordGeneratorContinuation();
|
| - __ jmp(&l_resume);
|
| -
|
| - __ bind(&l_suspend);
|
| - const int generator_object_depth = kPointerSize + try_block_size;
|
| - __ mov(eax, Operand(esp, generator_object_depth));
|
| - __ push(eax); // g
|
| - __ push(Immediate(Smi::FromInt(handler_index))); // handler-index
|
| - DCHECK(l_continuation.pos() > 0 && Smi::IsValid(l_continuation.pos()));
|
| - __ mov(FieldOperand(eax, JSGeneratorObject::kContinuationOffset),
|
| - Immediate(Smi::FromInt(l_continuation.pos())));
|
| - __ mov(FieldOperand(eax, JSGeneratorObject::kContextOffset), esi);
|
| - __ mov(ecx, esi);
|
| - __ RecordWriteField(eax, JSGeneratorObject::kContextOffset, ecx, edx,
|
| - kDontSaveFPRegs);
|
| - __ CallRuntime(Runtime::kSuspendJSGeneratorObject, 2);
|
| - __ mov(context_register(),
|
| - Operand(ebp, StandardFrameConstants::kContextOffset));
|
| - __ pop(eax); // result
|
| - EmitReturnSequence();
|
| - __ bind(&l_resume); // received in eax
|
| - ExitTryBlock(handler_index);
|
| -
|
| - // receiver = iter; f = iter.next; arg = received;
|
| - __ bind(&l_next);
|
| -
|
| - __ mov(load_name, isolate()->factory()->next_string());
|
| - __ push(load_name); // "next"
|
| - __ push(Operand(esp, 2 * kPointerSize)); // iter
|
| - __ push(eax); // received
|
| -
|
| - // result = receiver[f](arg);
|
| - __ bind(&l_call);
|
| - __ mov(load_receiver, Operand(esp, kPointerSize));
|
| - __ mov(LoadDescriptor::SlotRegister(),
|
| - Immediate(SmiFromSlot(expr->KeyedLoadFeedbackSlot())));
|
| - Handle<Code> ic = CodeFactory::KeyedLoadIC(isolate(), SLOPPY).code();
|
| - CallIC(ic, TypeFeedbackId::None());
|
| - __ mov(edi, eax);
|
| - __ mov(Operand(esp, 2 * kPointerSize), edi);
|
| - SetCallPosition(expr);
|
| - __ Set(eax, 1);
|
| - __ Call(
|
| - isolate()->builtins()->Call(ConvertReceiverMode::kNotNullOrUndefined),
|
| - RelocInfo::CODE_TARGET);
|
| -
|
| - __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
|
| - __ Drop(1); // The function is still on the stack; drop it.
|
| -
|
| - // if (!result.done) goto l_try;
|
| - __ bind(&l_loop);
|
| - __ push(eax); // save result
|
| - __ Move(load_receiver, eax); // result
|
| - __ mov(load_name,
|
| - isolate()->factory()->done_string()); // "done"
|
| - __ mov(LoadDescriptor::SlotRegister(),
|
| - Immediate(SmiFromSlot(expr->DoneFeedbackSlot())));
|
| - CallLoadIC(NOT_INSIDE_TYPEOF); // result.done in eax
|
| - 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
|
| - __ mov(load_name,
|
| - isolate()->factory()->value_string()); // "value"
|
| - __ mov(LoadDescriptor::SlotRegister(),
|
| - Immediate(SmiFromSlot(expr->ValueFeedbackSlot())));
|
| - CallLoadIC(NOT_INSIDE_TYPEOF); // result.value in eax
|
| - context()->DropAndPlug(2, eax); // drop iter and g
|
| - break;
|
| - }
|
| + case Yield::kDelegating:
|
| + UNREACHABLE();
|
| }
|
| }
|
|
|
|
|