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

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

Issue 1806293002: [generators] Add some explanation on forcing context allocation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 1805 matching lines...) Expand 10 before | Expand all | Expand 10 after
1816 __ RecordWriteField(ebx, JSGeneratorObject::kInputOffset, ecx, edx, 1816 __ RecordWriteField(ebx, JSGeneratorObject::kInputOffset, ecx, edx,
1817 kDontSaveFPRegs); 1817 kDontSaveFPRegs);
1818 1818
1819 // Load suspended function and context. 1819 // Load suspended function and context.
1820 __ mov(esi, FieldOperand(ebx, JSGeneratorObject::kContextOffset)); 1820 __ mov(esi, FieldOperand(ebx, JSGeneratorObject::kContextOffset));
1821 __ mov(edi, FieldOperand(ebx, JSGeneratorObject::kFunctionOffset)); 1821 __ mov(edi, FieldOperand(ebx, JSGeneratorObject::kFunctionOffset));
1822 1822
1823 // Push receiver. 1823 // Push receiver.
1824 __ push(FieldOperand(ebx, JSGeneratorObject::kReceiverOffset)); 1824 __ push(FieldOperand(ebx, JSGeneratorObject::kReceiverOffset));
1825 1825
1826 // Push holes for arguments to generator function. 1826 // Push holes for arguments to generator function. Since the parser forced
1827 // context allocation for any variables in generators, the actual argument
1828 // values have already been copied into the context and these dummy values
1829 // will never be used.
1827 __ mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); 1830 __ mov(edx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
1828 __ mov(edx, 1831 __ mov(edx,
1829 FieldOperand(edx, SharedFunctionInfo::kFormalParameterCountOffset)); 1832 FieldOperand(edx, SharedFunctionInfo::kFormalParameterCountOffset));
1830 __ mov(ecx, isolate()->factory()->the_hole_value()); 1833 __ mov(ecx, isolate()->factory()->the_hole_value());
1831 Label push_argument_holes, push_frame; 1834 Label push_argument_holes, push_frame;
1832 __ bind(&push_argument_holes); 1835 __ bind(&push_argument_holes);
1833 __ sub(edx, Immediate(Smi::FromInt(1))); 1836 __ sub(edx, Immediate(Smi::FromInt(1)));
1834 __ j(carry, &push_frame); 1837 __ j(carry, &push_frame);
1835 __ push(ecx); 1838 __ push(ecx);
1836 __ jmp(&push_argument_holes); 1839 __ jmp(&push_argument_holes);
(...skipping 2160 matching lines...) Expand 10 before | Expand all | Expand 10 after
3997 isolate->builtins()->OnStackReplacement()->entry(), 4000 isolate->builtins()->OnStackReplacement()->entry(),
3998 Assembler::target_address_at(call_target_address, unoptimized_code)); 4001 Assembler::target_address_at(call_target_address, unoptimized_code));
3999 return ON_STACK_REPLACEMENT; 4002 return ON_STACK_REPLACEMENT;
4000 } 4003 }
4001 4004
4002 4005
4003 } // namespace internal 4006 } // namespace internal
4004 } // namespace v8 4007 } // namespace v8
4005 4008
4006 #endif // V8_TARGET_ARCH_IA32 4009 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698