| 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 1983 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1994   Label wrong_state, done; |  1994   Label wrong_state, done; | 
|  1995   __ lw(a3, FieldMemOperand(a1, JSGeneratorObject::kContinuationOffset)); |  1995   __ lw(a3, FieldMemOperand(a1, JSGeneratorObject::kContinuationOffset)); | 
|  1996   STATIC_ASSERT(JSGeneratorObject::kGeneratorExecuting <= 0); |  1996   STATIC_ASSERT(JSGeneratorObject::kGeneratorExecuting <= 0); | 
|  1997   STATIC_ASSERT(JSGeneratorObject::kGeneratorClosed <= 0); |  1997   STATIC_ASSERT(JSGeneratorObject::kGeneratorClosed <= 0); | 
|  1998   __ Branch(&wrong_state, le, a3, Operand(zero_reg)); |  1998   __ Branch(&wrong_state, le, a3, Operand(zero_reg)); | 
|  1999  |  1999  | 
|  2000   // Load suspended function and context. |  2000   // Load suspended function and context. | 
|  2001   __ lw(cp, FieldMemOperand(a1, JSGeneratorObject::kContextOffset)); |  2001   __ lw(cp, FieldMemOperand(a1, JSGeneratorObject::kContextOffset)); | 
|  2002   __ lw(t0, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset)); |  2002   __ lw(t0, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset)); | 
|  2003  |  2003  | 
|  2004   // Push holes for arguments to generator function. |  2004   // Load receiver and store as the first argument. | 
 |  2005   __ lw(a2, FieldMemOperand(a1, JSGeneratorObject::kReceiverOffset)); | 
 |  2006   __ push(a2); | 
 |  2007  | 
 |  2008   // Push holes for the rest of the arguments to the generator function. | 
|  2005   __ lw(a3, FieldMemOperand(t0, JSFunction::kSharedFunctionInfoOffset)); |  2009   __ lw(a3, FieldMemOperand(t0, JSFunction::kSharedFunctionInfoOffset)); | 
|  2006   __ lw(a3, |  2010   __ lw(a3, | 
|  2007         FieldMemOperand(a3, SharedFunctionInfo::kFormalParameterCountOffset)); |  2011         FieldMemOperand(a3, SharedFunctionInfo::kFormalParameterCountOffset)); | 
|  2008   __ LoadRoot(a2, Heap::kTheHoleValueRootIndex); |  2012   __ LoadRoot(a2, Heap::kTheHoleValueRootIndex); | 
|  2009   Label push_argument_holes; |  2013   Label push_argument_holes, push_frame; | 
|  2010   __ bind(&push_argument_holes); |  2014   __ bind(&push_argument_holes); | 
 |  2015   __ Subu(a3, a3, Operand(1)); | 
 |  2016   __ Branch(&push_frame, lt, a3, Operand(zero_reg)); | 
|  2011   __ push(a2); |  2017   __ push(a2); | 
|  2012   __ Subu(a3, a3, Operand(1)); |  2018   __ jmp(&push_argument_holes); | 
|  2013   __ Branch(&push_argument_holes, ge, a3, Operand(zero_reg)); |  | 
|  2014  |  2019  | 
|  2015   // Enter a new JavaScript frame, and initialize its slots as they were when |  2020   // Enter a new JavaScript frame, and initialize its slots as they were when | 
|  2016   // the generator was suspended. |  2021   // the generator was suspended. | 
|  2017   Label push_frame, resume_frame; |  2022   Label resume_frame; | 
|  2018   __ bind(&push_frame); |  2023   __ bind(&push_frame); | 
|  2019   __ Call(&resume_frame); |  2024   __ Call(&resume_frame); | 
|  2020   __ jmp(&done); |  2025   __ jmp(&done); | 
|  2021   __ bind(&resume_frame); |  2026   __ bind(&resume_frame); | 
|  2022   __ push(ra);  // Return address. |  2027   __ push(ra);  // Return address. | 
|  2023   __ push(fp);  // Caller's frame pointer. |  2028   __ push(fp);  // Caller's frame pointer. | 
|  2024   __ mov(fp, sp); |  2029   __ mov(fp, sp); | 
|  2025   __ push(cp);  // Callee's context. |  2030   __ push(cp);  // Callee's context. | 
|  2026   __ push(t0);  // Callee's JS Function. |  2031   __ push(t0);  // Callee's JS Function. | 
|  2027  |  2032  | 
| (...skipping 2682 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  4710   *context_length = 0; |  4715   *context_length = 0; | 
|  4711   return previous_; |  4716   return previous_; | 
|  4712 } |  4717 } | 
|  4713  |  4718  | 
|  4714  |  4719  | 
|  4715 #undef __ |  4720 #undef __ | 
|  4716  |  4721  | 
|  4717 } }  // namespace v8::internal |  4722 } }  // namespace v8::internal | 
|  4718  |  4723  | 
|  4719 #endif  // V8_TARGET_ARCH_MIPS |  4724 #endif  // V8_TARGET_ARCH_MIPS | 
| OLD | NEW |