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

Side by Side Diff: src/full-codegen/mips/full-codegen-mips.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_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
(...skipping 1885 matching lines...) Expand 10 before | Expand all | Expand 10 after
1896 kRAHasBeenSaved, kDontSaveFPRegs); 1896 kRAHasBeenSaved, kDontSaveFPRegs);
1897 1897
1898 // Load suspended function and context. 1898 // Load suspended function and context.
1899 __ lw(cp, FieldMemOperand(a1, JSGeneratorObject::kContextOffset)); 1899 __ lw(cp, FieldMemOperand(a1, JSGeneratorObject::kContextOffset));
1900 __ lw(t0, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset)); 1900 __ lw(t0, FieldMemOperand(a1, JSGeneratorObject::kFunctionOffset));
1901 1901
1902 // Load receiver and store as the first argument. 1902 // Load receiver and store as the first argument.
1903 __ lw(a2, FieldMemOperand(a1, JSGeneratorObject::kReceiverOffset)); 1903 __ lw(a2, FieldMemOperand(a1, JSGeneratorObject::kReceiverOffset));
1904 __ push(a2); 1904 __ push(a2);
1905 1905
1906 // Push holes for the rest of the arguments to the generator function. 1906 // Push holes for arguments to generator function. Since the parser forced
1907 // context allocation for any variables in generators, the actual argument
1908 // values have already been copied into the context and these dummy values
1909 // will never be used.
1907 __ lw(a3, FieldMemOperand(t0, JSFunction::kSharedFunctionInfoOffset)); 1910 __ lw(a3, FieldMemOperand(t0, JSFunction::kSharedFunctionInfoOffset));
1908 __ lw(a3, 1911 __ lw(a3,
1909 FieldMemOperand(a3, SharedFunctionInfo::kFormalParameterCountOffset)); 1912 FieldMemOperand(a3, SharedFunctionInfo::kFormalParameterCountOffset));
1910 __ LoadRoot(a2, Heap::kTheHoleValueRootIndex); 1913 __ LoadRoot(a2, Heap::kTheHoleValueRootIndex);
1911 Label push_argument_holes, push_frame; 1914 Label push_argument_holes, push_frame;
1912 __ bind(&push_argument_holes); 1915 __ bind(&push_argument_holes);
1913 __ Subu(a3, a3, Operand(Smi::FromInt(1))); 1916 __ Subu(a3, a3, Operand(Smi::FromInt(1)));
1914 __ Branch(&push_frame, lt, a3, Operand(zero_reg)); 1917 __ Branch(&push_frame, lt, a3, Operand(zero_reg));
1915 __ push(a2); 1918 __ push(a2);
1916 __ jmp(&push_argument_holes); 1919 __ jmp(&push_argument_holes);
(...skipping 2197 matching lines...) Expand 10 before | Expand all | Expand 10 after
4114 reinterpret_cast<uint32_t>( 4117 reinterpret_cast<uint32_t>(
4115 isolate->builtins()->OnStackReplacement()->entry())); 4118 isolate->builtins()->OnStackReplacement()->entry()));
4116 return ON_STACK_REPLACEMENT; 4119 return ON_STACK_REPLACEMENT;
4117 } 4120 }
4118 4121
4119 4122
4120 } // namespace internal 4123 } // namespace internal
4121 } // namespace v8 4124 } // namespace v8
4122 4125
4123 #endif // V8_TARGET_ARCH_MIPS 4126 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698