OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1995 __ b(le, &wrong_state); | 1995 __ b(le, &wrong_state); |
1996 | 1996 |
1997 // Load suspended function and context. | 1997 // Load suspended function and context. |
1998 __ ldr(cp, FieldMemOperand(r1, JSGeneratorObject::kContextOffset)); | 1998 __ ldr(cp, FieldMemOperand(r1, JSGeneratorObject::kContextOffset)); |
1999 __ ldr(r4, FieldMemOperand(r1, JSGeneratorObject::kFunctionOffset)); | 1999 __ ldr(r4, FieldMemOperand(r1, JSGeneratorObject::kFunctionOffset)); |
2000 | 2000 |
2001 // Push holes for arguments to generator function. | 2001 // Push holes for arguments to generator function. |
2002 __ ldr(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); | 2002 __ ldr(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); |
2003 __ ldr(r3, | 2003 __ ldr(r3, |
2004 FieldMemOperand(r3, SharedFunctionInfo::kFormalParameterCountOffset)); | 2004 FieldMemOperand(r3, SharedFunctionInfo::kFormalParameterCountOffset)); |
2005 __ Move(r2, isolate()->factory()->the_hole_value()); | 2005 __ LoadRoot(r2, Heap::kTheHoleValueRootIndex); |
2006 Label push_argument_holes; | 2006 Label push_argument_holes; |
2007 __ bind(&push_argument_holes); | 2007 __ bind(&push_argument_holes); |
2008 __ push(r2); | 2008 __ push(r2); |
2009 __ sub(r3, r3, Operand(1)); | 2009 __ sub(r3, r3, Operand(1), SetCC); |
2010 __ b(vc, &push_argument_holes); | 2010 __ b(pl, &push_argument_holes); |
2011 | 2011 |
2012 // Enter a new JavaScript frame, and initialize its slots as they were when | 2012 // Enter a new JavaScript frame, and initialize its slots as they were when |
2013 // the generator was suspended. | 2013 // the generator was suspended. |
2014 Label push_frame, resume_frame; | 2014 Label push_frame, resume_frame; |
2015 __ bind(&push_frame); | 2015 __ bind(&push_frame); |
2016 __ bl(&resume_frame); | 2016 __ bl(&resume_frame); |
2017 __ jmp(&done); | 2017 __ jmp(&done); |
2018 __ bind(&resume_frame); | 2018 __ bind(&resume_frame); |
| 2019 __ push(lr); // Return address. |
2019 __ push(fp); // Caller's frame pointer. | 2020 __ push(fp); // Caller's frame pointer. |
2020 __ mov(fp, sp); | 2021 __ mov(fp, sp); |
2021 __ push(cp); // Callee's context. | 2022 __ push(cp); // Callee's context. |
2022 __ push(r4); // Callee's JS Function. | 2023 __ push(r4); // Callee's JS Function. |
2023 | 2024 |
2024 // Load the operand stack size. | 2025 // Load the operand stack size. |
2025 __ ldr(r3, FieldMemOperand(r1, JSGeneratorObject::kOperandStackOffset)); | 2026 __ ldr(r3, FieldMemOperand(r1, JSGeneratorObject::kOperandStackOffset)); |
2026 __ ldr(r3, FieldMemOperand(r3, FixedArray::kLengthOffset)); | 2027 __ ldr(r3, FieldMemOperand(r3, FixedArray::kLengthOffset)); |
2027 __ SmiUntag(r3); | 2028 __ SmiUntag(r3); |
2028 | 2029 |
(...skipping 10 matching lines...) Expand all Loading... |
2039 __ mov(r2, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting))); | 2040 __ mov(r2, Operand(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting))); |
2040 __ str(r2, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset)); | 2041 __ str(r2, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset)); |
2041 __ Jump(r3); | 2042 __ Jump(r3); |
2042 __ bind(&slow_resume); | 2043 __ bind(&slow_resume); |
2043 } | 2044 } |
2044 | 2045 |
2045 // Otherwise, we push holes for the operand stack and call the runtime to fix | 2046 // Otherwise, we push holes for the operand stack and call the runtime to fix |
2046 // up the stack and the handlers. | 2047 // up the stack and the handlers. |
2047 Label push_operand_holes, call_resume; | 2048 Label push_operand_holes, call_resume; |
2048 __ bind(&push_operand_holes); | 2049 __ bind(&push_operand_holes); |
2049 __ sub(r3, r3, Operand(1)); | 2050 __ sub(r3, r3, Operand(1), SetCC); |
2050 __ b(vs, &call_resume); | 2051 __ b(mi, &call_resume); |
2051 __ push(r2); | 2052 __ push(r2); |
2052 __ b(&push_operand_holes); | 2053 __ b(&push_operand_holes); |
2053 __ bind(&call_resume); | 2054 __ bind(&call_resume); |
2054 __ push(r1); | 2055 __ push(r1); |
2055 __ push(result_register()); | 2056 __ push(result_register()); |
2056 __ Push(Smi::FromInt(resume_mode)); | 2057 __ Push(Smi::FromInt(resume_mode)); |
2057 __ CallRuntime(Runtime::kResumeJSGeneratorObject, 3); | 2058 __ CallRuntime(Runtime::kResumeJSGeneratorObject, 3); |
2058 // Not reached: the runtime call returns elsewhere. | 2059 // Not reached: the runtime call returns elsewhere. |
2059 __ stop("not-reached"); | 2060 __ stop("not-reached"); |
2060 | 2061 |
(...skipping 2635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4696 *context_length = 0; | 4697 *context_length = 0; |
4697 return previous_; | 4698 return previous_; |
4698 } | 4699 } |
4699 | 4700 |
4700 | 4701 |
4701 #undef __ | 4702 #undef __ |
4702 | 4703 |
4703 } } // namespace v8::internal | 4704 } } // namespace v8::internal |
4704 | 4705 |
4705 #endif // V8_TARGET_ARCH_ARM | 4706 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |