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

Side by Side Diff: src/crankshaft/arm/lithium-codegen-arm.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/compiler/js-generic-lowering.cc ('k') | src/crankshaft/arm64/lithium-codegen-arm64.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 #include "src/crankshaft/arm/lithium-codegen-arm.h" 5 #include "src/crankshaft/arm/lithium-codegen-arm.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.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/crankshaft/arm/lithium-gap-resolver-arm.h" 10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 Comment(";;; Allocate local context"); 159 Comment(";;; Allocate local context");
160 bool need_write_barrier = true; 160 bool need_write_barrier = true;
161 // Argument to NewContext is the function, which is in r1. 161 // Argument to NewContext is the function, which is in r1.
162 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; 162 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
163 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; 163 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt;
164 if (info()->scope()->is_script_scope()) { 164 if (info()->scope()->is_script_scope()) {
165 __ push(r1); 165 __ push(r1);
166 __ Push(info()->scope()->GetScopeInfo(info()->isolate())); 166 __ Push(info()->scope()->GetScopeInfo(info()->isolate()));
167 __ CallRuntime(Runtime::kNewScriptContext); 167 __ CallRuntime(Runtime::kNewScriptContext);
168 deopt_mode = Safepoint::kLazyDeopt; 168 deopt_mode = Safepoint::kLazyDeopt;
169 } else if (slots <= FastNewFunctionContextStub::kMaximumSlots) { 169 } else {
170 FastNewFunctionContextStub stub(isolate(), slots); 170 FastNewFunctionContextStub stub(isolate());
171 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), Operand(slots));
171 __ CallStub(&stub); 172 __ CallStub(&stub);
172 // Result of FastNewFunctionContextStub is always in new space. 173 // Result of FastNewFunctionContextStub is always in new space.
173 need_write_barrier = false; 174 need_write_barrier = false;
174 } else {
175 __ push(r1);
176 __ CallRuntime(Runtime::kNewFunctionContext);
177 } 175 }
178 RecordSafepoint(deopt_mode); 176 RecordSafepoint(deopt_mode);
179 177
180 // Context is returned in both r0 and cp. It replaces the context 178 // Context is returned in both r0 and cp. It replaces the context
181 // passed to us. It's saved in the stack and kept live in cp. 179 // passed to us. It's saved in the stack and kept live in cp.
182 __ mov(cp, r0); 180 __ mov(cp, r0);
183 __ str(r0, MemOperand(fp, StandardFrameConstants::kContextOffset)); 181 __ str(r0, MemOperand(fp, StandardFrameConstants::kContextOffset));
184 // Copy any necessary parameters into the context. 182 // Copy any necessary parameters into the context.
185 int num_parameters = scope()->num_parameters(); 183 int num_parameters = scope()->num_parameters();
186 int first_parameter = scope()->has_this_declaration() ? -1 : 0; 184 int first_parameter = scope()->has_this_declaration() ? -1 : 0;
(...skipping 5341 matching lines...) Expand 10 before | Expand all | Expand 10 after
5528 __ ldr(result, FieldMemOperand(scratch, 5526 __ ldr(result, FieldMemOperand(scratch,
5529 FixedArray::kHeaderSize - kPointerSize)); 5527 FixedArray::kHeaderSize - kPointerSize));
5530 __ bind(deferred->exit()); 5528 __ bind(deferred->exit());
5531 __ bind(&done); 5529 __ bind(&done);
5532 } 5530 }
5533 5531
5534 #undef __ 5532 #undef __
5535 5533
5536 } // namespace internal 5534 } // namespace internal
5537 } // namespace v8 5535 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | src/crankshaft/arm64/lithium-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698