Index: src/builtins/x87/builtins-x87.cc |
diff --git a/src/builtins/x87/builtins-x87.cc b/src/builtins/x87/builtins-x87.cc |
index a0d2650cf4f8485fd0430dc0f4b5c0f43e0ffd65..e766023c67cf90690b936e57cc1b7dc80ce6d6f2 100644 |
--- a/src/builtins/x87/builtins-x87.cc |
+++ b/src/builtins/x87/builtins-x87.cc |
@@ -438,14 +438,15 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { |
__ bind(&done_loop); |
} |
- // Dispatch on the kind of generator object. |
- Label old_generator; |
- __ mov(ecx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
- __ mov(ecx, FieldOperand(ecx, SharedFunctionInfo::kFunctionDataOffset)); |
- __ CmpObjectType(ecx, BYTECODE_ARRAY_TYPE, ecx); |
- __ j(not_equal, &old_generator); |
+ // Underlying function needs to have bytecode available. |
+ if (FLAG_debug_code) { |
+ __ mov(ecx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
+ __ mov(ecx, FieldOperand(ecx, SharedFunctionInfo::kFunctionDataOffset)); |
+ __ CmpObjectType(ecx, BYTECODE_ARRAY_TYPE, ecx); |
+ __ Assert(equal, kMissingBytecodeArray); |
+ } |
- // New-style (ignition/turbofan) generator object |
+ // Resume (Ignition/TurboFan) generator object. |
{ |
__ PushReturnAddressFrom(eax); |
__ mov(eax, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
@@ -458,49 +459,6 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { |
__ jmp(FieldOperand(edi, JSFunction::kCodeEntryOffset)); |
} |
- // Old-style (full-codegen) generator object |
- __ bind(&old_generator); |
- { |
- // Enter a new JavaScript frame, and initialize its slots as they were when |
- // the generator was suspended. |
- FrameScope scope(masm, StackFrame::MANUAL); |
- __ PushReturnAddressFrom(eax); // Return address. |
- __ Push(ebp); // Caller's frame pointer. |
- __ Move(ebp, esp); |
- __ Push(esi); // Callee's context. |
- __ Push(edi); // Callee's JS Function. |
- |
- // Restore the operand stack. |
- __ mov(eax, FieldOperand(ebx, JSGeneratorObject::kOperandStackOffset)); |
- { |
- Label done_loop, loop; |
- __ Move(ecx, Smi::kZero); |
- __ bind(&loop); |
- __ cmp(ecx, FieldOperand(eax, FixedArray::kLengthOffset)); |
- __ j(equal, &done_loop, Label::kNear); |
- __ Push(FieldOperand(eax, ecx, times_half_pointer_size, |
- FixedArray::kHeaderSize)); |
- __ add(ecx, Immediate(Smi::FromInt(1))); |
- __ jmp(&loop); |
- __ bind(&done_loop); |
- } |
- |
- // Reset operand stack so we don't leak. |
- __ mov(FieldOperand(ebx, JSGeneratorObject::kOperandStackOffset), |
- Immediate(masm->isolate()->factory()->empty_fixed_array())); |
- |
- // Resume the generator function at the continuation. |
- __ mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
- __ mov(edx, FieldOperand(edx, SharedFunctionInfo::kCodeOffset)); |
- __ mov(ecx, FieldOperand(ebx, JSGeneratorObject::kContinuationOffset)); |
- __ SmiUntag(ecx); |
- __ lea(edx, FieldOperand(edx, ecx, times_1, Code::kHeaderSize)); |
- __ mov(FieldOperand(ebx, JSGeneratorObject::kContinuationOffset), |
- Immediate(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting))); |
- __ mov(eax, ebx); // Continuation expects generator object in eax. |
- __ jmp(edx); |
- } |
- |
__ bind(&prepare_step_in_if_stepping); |
{ |
FrameScope scope(masm, StackFrame::INTERNAL); |