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

Side by Side Diff: src/full-codegen/x64/full-codegen-x64.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_X64 5 #if V8_TARGET_ARCH_X64
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 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after
1841 __ RecordWriteField(rbx, JSGeneratorObject::kInputOffset, rcx, rdx, 1841 __ RecordWriteField(rbx, JSGeneratorObject::kInputOffset, rcx, rdx,
1842 kDontSaveFPRegs); 1842 kDontSaveFPRegs);
1843 1843
1844 // Load suspended function and context. 1844 // Load suspended function and context.
1845 __ movp(rsi, FieldOperand(rbx, JSGeneratorObject::kContextOffset)); 1845 __ movp(rsi, FieldOperand(rbx, JSGeneratorObject::kContextOffset));
1846 __ movp(rdi, FieldOperand(rbx, JSGeneratorObject::kFunctionOffset)); 1846 __ movp(rdi, FieldOperand(rbx, JSGeneratorObject::kFunctionOffset));
1847 1847
1848 // Push receiver. 1848 // Push receiver.
1849 __ Push(FieldOperand(rbx, JSGeneratorObject::kReceiverOffset)); 1849 __ Push(FieldOperand(rbx, JSGeneratorObject::kReceiverOffset));
1850 1850
1851 // Push holes for arguments to generator function. 1851 // Push holes for arguments to generator function. Since the parser forced
1852 // context allocation for any variables in generators, the actual argument
1853 // values have already been copied into the context and these dummy values
1854 // will never be used.
1852 __ movp(rdx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); 1855 __ movp(rdx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset));
1853 __ LoadSharedFunctionInfoSpecialField(rdx, rdx, 1856 __ LoadSharedFunctionInfoSpecialField(rdx, rdx,
1854 SharedFunctionInfo::kFormalParameterCountOffset); 1857 SharedFunctionInfo::kFormalParameterCountOffset);
1855 __ LoadRoot(rcx, Heap::kTheHoleValueRootIndex); 1858 __ LoadRoot(rcx, Heap::kTheHoleValueRootIndex);
1856 Label push_argument_holes, push_frame; 1859 Label push_argument_holes, push_frame;
1857 __ bind(&push_argument_holes); 1860 __ bind(&push_argument_holes);
1858 __ subp(rdx, Immediate(1)); 1861 __ subp(rdx, Immediate(1));
1859 __ j(carry, &push_frame); 1862 __ j(carry, &push_frame);
1860 __ Push(rcx); 1863 __ Push(rcx);
1861 __ jmp(&push_argument_holes); 1864 __ jmp(&push_argument_holes);
(...skipping 2120 matching lines...) Expand 10 before | Expand all | Expand 10 after
3982 DCHECK_EQ( 3985 DCHECK_EQ(
3983 isolate->builtins()->OnStackReplacement()->entry(), 3986 isolate->builtins()->OnStackReplacement()->entry(),
3984 Assembler::target_address_at(call_target_address, unoptimized_code)); 3987 Assembler::target_address_at(call_target_address, unoptimized_code));
3985 return ON_STACK_REPLACEMENT; 3988 return ON_STACK_REPLACEMENT;
3986 } 3989 }
3987 3990
3988 } // namespace internal 3991 } // namespace internal
3989 } // namespace v8 3992 } // namespace v8
3990 3993
3991 #endif // V8_TARGET_ARCH_X64 3994 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698