Index: src/builtins/ia32/builtins-ia32.cc |
diff --git a/src/builtins/ia32/builtins-ia32.cc b/src/builtins/ia32/builtins-ia32.cc |
index 8758732b6bc96a95182879e013f34715efa6d179..1cc7ba0b3c922ed755c747dfcdfeacb70430facd 100644 |
--- a/src/builtins/ia32/builtins-ia32.cc |
+++ b/src/builtins/ia32/builtins-ia32.cc |
@@ -437,19 +437,20 @@ 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)); |
__ mov(eax, |
- FieldOperand(ecx, SharedFunctionInfo::kFormalParameterCountOffset)); |
+ FieldOperand(eax, SharedFunctionInfo::kFormalParameterCountOffset)); |
// We abuse new.target both to indicate that this is a resume call and to |
// pass in the generator object. In ordinary calls, new.target is always |
// undefined because generator functions are non-constructable. |
@@ -457,49 +458,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); |