Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: src/arm/full-codegen-arm.cc

Issue 14158006: Capture receiver in generator object (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Rebase on master, fix for ARM Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1980 matching lines...) Expand 10 before | Expand all | Expand 10 after
1991 __ ldr(r3, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset)); 1991 __ ldr(r3, FieldMemOperand(r1, JSGeneratorObject::kContinuationOffset));
1992 STATIC_ASSERT(JSGeneratorObject::kGeneratorExecuting <= 0); 1992 STATIC_ASSERT(JSGeneratorObject::kGeneratorExecuting <= 0);
1993 STATIC_ASSERT(JSGeneratorObject::kGeneratorClosed <= 0); 1993 STATIC_ASSERT(JSGeneratorObject::kGeneratorClosed <= 0);
1994 __ cmp(r3, Operand(Smi::FromInt(0))); 1994 __ cmp(r3, Operand(Smi::FromInt(0)));
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 // Load receiver and store as the first argument.
2002 __ ldr(r2, FieldMemOperand(r1, JSGeneratorObject::kReceiverOffset));
2003 __ push(r2);
2004
2005 // Push holes for the rest of the arguments to the generator function.
2002 __ ldr(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset)); 2006 __ ldr(r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset));
2003 __ ldr(r3, 2007 __ ldr(r3,
2004 FieldMemOperand(r3, SharedFunctionInfo::kFormalParameterCountOffset)); 2008 FieldMemOperand(r3, SharedFunctionInfo::kFormalParameterCountOffset));
2005 __ LoadRoot(r2, Heap::kTheHoleValueRootIndex); 2009 __ LoadRoot(r2, Heap::kTheHoleValueRootIndex);
2006 Label push_argument_holes; 2010 Label push_argument_holes, push_frame;
2007 __ bind(&push_argument_holes); 2011 __ bind(&push_argument_holes);
2012 __ sub(r3, r3, Operand(1), SetCC);
2013 __ b(mi, &push_frame);
2008 __ push(r2); 2014 __ push(r2);
2009 __ sub(r3, r3, Operand(1), SetCC); 2015 __ jmp(&push_argument_holes);
2010 __ b(pl, &push_argument_holes);
2011 2016
2012 // Enter a new JavaScript frame, and initialize its slots as they were when 2017 // Enter a new JavaScript frame, and initialize its slots as they were when
2013 // the generator was suspended. 2018 // the generator was suspended.
2014 Label push_frame, resume_frame; 2019 Label resume_frame;
2015 __ bind(&push_frame); 2020 __ bind(&push_frame);
2016 __ bl(&resume_frame); 2021 __ bl(&resume_frame);
2017 __ jmp(&done); 2022 __ jmp(&done);
2018 __ bind(&resume_frame); 2023 __ bind(&resume_frame);
2019 __ push(lr); // Return address. 2024 __ push(lr); // Return address.
2020 __ push(fp); // Caller's frame pointer. 2025 __ push(fp); // Caller's frame pointer.
2021 __ mov(fp, sp); 2026 __ mov(fp, sp);
2022 __ push(cp); // Callee's context. 2027 __ push(cp); // Callee's context.
2023 __ push(r4); // Callee's JS Function. 2028 __ push(r4); // Callee's JS Function.
2024 2029
(...skipping 2672 matching lines...) Expand 10 before | Expand all | Expand 10 after
4697 *context_length = 0; 4702 *context_length = 0;
4698 return previous_; 4703 return previous_;
4699 } 4704 }
4700 4705
4701 4706
4702 #undef __ 4707 #undef __
4703 4708
4704 } } // namespace v8::internal 4709 } } // namespace v8::internal
4705 4710
4706 #endif // V8_TARGET_ARCH_ARM 4711 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698