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

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

Issue 2177273002: Make FastNewFunctionContextStub take slots parameter (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased Created 4 years, 4 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 | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/ia32/interface-descriptors-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 // 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 __ Push(info->scope()->GetScopeInfo(info->isolate())); 167 __ Push(info->scope()->GetScopeInfo(info->isolate()));
168 __ CallRuntime(Runtime::kNewScriptContext); 168 __ CallRuntime(Runtime::kNewScriptContext);
169 PrepareForBailoutForId(BailoutId::ScriptContext(), 169 PrepareForBailoutForId(BailoutId::ScriptContext(),
170 BailoutState::TOS_REGISTER); 170 BailoutState::TOS_REGISTER);
171 // The new target value is not used, clobbering is safe. 171 // The new target value is not used, clobbering is safe.
172 DCHECK_NULL(info->scope()->new_target_var()); 172 DCHECK_NULL(info->scope()->new_target_var());
173 } else { 173 } else {
174 if (info->scope()->new_target_var() != nullptr) { 174 if (info->scope()->new_target_var() != nullptr) {
175 __ Push(rdx); // Preserve new target. 175 __ Push(rdx); // Preserve new target.
176 } 176 }
177 if (slots <= FastNewFunctionContextStub::kMaximumSlots) { 177 FastNewFunctionContextStub stub(isolate());
178 FastNewFunctionContextStub stub(isolate(), slots); 178 __ Set(FastNewFunctionContextDescriptor::SlotsRegister(), slots);
179 __ CallStub(&stub); 179 __ CallStub(&stub);
180 // Result of FastNewFunctionContextStub is always in new space. 180 // Result of FastNewFunctionContextStub is always in new space.
181 need_write_barrier = false; 181 need_write_barrier = false;
182 } else {
183 __ Push(rdi);
184 __ CallRuntime(Runtime::kNewFunctionContext);
185 }
186 if (info->scope()->new_target_var() != nullptr) { 182 if (info->scope()->new_target_var() != nullptr) {
187 __ Pop(rdx); // Restore new target. 183 __ Pop(rdx); // Restore new target.
188 } 184 }
189 } 185 }
190 function_in_register = false; 186 function_in_register = false;
191 // Context is returned in rax. It replaces the context passed to us. 187 // Context is returned in rax. It replaces the context passed to us.
192 // It's saved in the stack and kept live in rsi. 188 // It's saved in the stack and kept live in rsi.
193 __ movp(rsi, rax); 189 __ movp(rsi, rax);
194 __ movp(Operand(rbp, StandardFrameConstants::kContextOffset), rax); 190 __ movp(Operand(rbp, StandardFrameConstants::kContextOffset), rax);
195 191
(...skipping 3466 matching lines...) Expand 10 before | Expand all | Expand 10 after
3662 DCHECK_EQ( 3658 DCHECK_EQ(
3663 isolate->builtins()->OnStackReplacement()->entry(), 3659 isolate->builtins()->OnStackReplacement()->entry(),
3664 Assembler::target_address_at(call_target_address, unoptimized_code)); 3660 Assembler::target_address_at(call_target_address, unoptimized_code));
3665 return ON_STACK_REPLACEMENT; 3661 return ON_STACK_REPLACEMENT;
3666 } 3662 }
3667 3663
3668 } // namespace internal 3664 } // namespace internal
3669 } // namespace v8 3665 } // namespace v8
3670 3666
3671 #endif // V8_TARGET_ARCH_X64 3667 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/ia32/interface-descriptors-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698