Index: src/builtins/arm/builtins-arm.cc |
diff --git a/src/builtins/arm/builtins-arm.cc b/src/builtins/arm/builtins-arm.cc |
index 610397178724bac176e0c15a84392d83e28d6416..b1b41f974d89f0a382e5d324225491a25498ef1e 100644 |
--- a/src/builtins/arm/builtins-arm.cc |
+++ b/src/builtins/arm/builtins-arm.cc |
@@ -790,14 +790,15 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { |
__ bind(&done_loop); |
} |
- // Dispatch on the kind of generator object. |
- Label old_generator; |
- __ ldr(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); |
- __ ldr(r3, FieldMemOperand(r3, SharedFunctionInfo::kFunctionDataOffset)); |
- __ CompareObjectType(r3, r3, r3, BYTECODE_ARRAY_TYPE); |
- __ b(ne, &old_generator); |
+ // Underlying function needs to have bytecode available. |
+ if (FLAG_debug_code) { |
+ __ ldr(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); |
+ __ ldr(r3, FieldMemOperand(r3, SharedFunctionInfo::kFunctionDataOffset)); |
+ __ CompareObjectType(r3, r3, r3, BYTECODE_ARRAY_TYPE); |
+ __ Assert(eq, kMissingBytecodeArray); |
+ } |
- // New-style (ignition/turbofan) generator object |
+ // Resume (Ignition/TurboFan) generator object. |
{ |
__ ldr(r0, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); |
__ ldr(r0, FieldMemOperand( |
@@ -812,49 +813,6 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { |
__ Jump(r5); |
} |
- // 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. |
- DCHECK(!FLAG_enable_embedded_constant_pool); |
- FrameScope scope(masm, StackFrame::MANUAL); |
- __ Push(lr, fp); |
- __ Move(fp, sp); |
- __ Push(cp, r4); |
- |
- // Restore the operand stack. |
- __ ldr(r0, FieldMemOperand(r1, JSGeneratorObject::kOperandStackOffset)); |
- __ ldr(r3, FieldMemOperand(r0, FixedArray::kLengthOffset)); |
- __ add(r0, r0, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
- __ add(r3, r0, Operand(r3, LSL, kPointerSizeLog2 - 1)); |
- { |
- Label done_loop, loop; |
- __ bind(&loop); |
- __ cmp(r0, r3); |
- __ b(eq, &done_loop); |
- __ ldr(ip, MemOperand(r0, kPointerSize, PostIndex)); |
- __ Push(ip); |
- __ b(&loop); |
- __ bind(&done_loop); |
- } |
- |
- // Reset operand stack so we don't leak. |
- __ LoadRoot(ip, Heap::kEmptyFixedArrayRootIndex); |
- __ str(ip, FieldMemOperand(r1, JSGeneratorObject::kOperandStackOffset)); |
- |
- // Resume the generator function at the continuation. |
- __ ldr(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); |
- __ ldr(r3, FieldMemOperand(r3, SharedFunctionInfo::kCodeOffset)); |
- __ add(r3, r3, Operand(Code::kHeaderSize - kHeapObjectTag)); |
- __ ldr(r2, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset)); |
- __ add(r3, r3, Operand(r2, ASR, 1)); |
- __ mov(r2, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting))); |
- __ str(r2, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset)); |
- __ Move(r0, r1); // Continuation expects generator object in r0. |
- __ Jump(r3); |
- } |
- |
__ bind(&prepare_step_in_if_stepping); |
{ |
FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |