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

Side by Side Diff: src/crankshaft/s390/lithium-codegen-s390.cc

Issue 2445703002: Don't call FastNewFunctionContextStub if context is bigger than kMaxRegularHeapObjectSize. (Closed)
Patch Set: Created 4 years, 1 month 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/crankshaft/ppc/lithium-codegen-ppc.cc ('k') | src/crankshaft/x64/lithium-codegen-x64.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // 2 //
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 5
6 #include "src/crankshaft/s390/lithium-codegen-s390.h" 6 #include "src/crankshaft/s390/lithium-codegen-s390.h"
7 7
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 bool need_write_barrier = true; 153 bool need_write_barrier = true;
154 // Argument to NewContext is the function, which is in r3. 154 // Argument to NewContext is the function, which is in r3.
155 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; 155 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
156 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; 156 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt;
157 if (info()->scope()->is_script_scope()) { 157 if (info()->scope()->is_script_scope()) {
158 __ push(r3); 158 __ push(r3);
159 __ Push(info()->scope()->scope_info()); 159 __ Push(info()->scope()->scope_info());
160 __ CallRuntime(Runtime::kNewScriptContext); 160 __ CallRuntime(Runtime::kNewScriptContext);
161 deopt_mode = Safepoint::kLazyDeopt; 161 deopt_mode = Safepoint::kLazyDeopt;
162 } else { 162 } else {
163 FastNewFunctionContextStub stub(isolate()); 163 if (slots <= FastNewFunctionContextStub::kMaximumSlots) {
164 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), Operand(slots)); 164 FastNewFunctionContextStub stub(isolate());
165 __ CallStub(&stub); 165 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
166 // Result of FastNewFunctionContextStub is always in new space. 166 Operand(slots));
167 need_write_barrier = false; 167 __ CallStub(&stub);
168 // Result of FastNewFunctionContextStub is always in new space.
169 need_write_barrier = false;
170 } else {
171 __ push(r3);
172 __ CallRuntime(Runtime::kNewFunctionContext);
173 }
168 } 174 }
169 RecordSafepoint(deopt_mode); 175 RecordSafepoint(deopt_mode);
170 176
171 // Context is returned in both r2 and cp. It replaces the context 177 // Context is returned in both r2 and cp. It replaces the context
172 // passed to us. It's saved in the stack and kept live in cp. 178 // passed to us. It's saved in the stack and kept live in cp.
173 __ LoadRR(cp, r2); 179 __ LoadRR(cp, r2);
174 __ StoreP(r2, MemOperand(fp, StandardFrameConstants::kContextOffset)); 180 __ StoreP(r2, MemOperand(fp, StandardFrameConstants::kContextOffset));
175 // Copy any necessary parameters into the context. 181 // Copy any necessary parameters into the context.
176 int num_parameters = info()->scope()->num_parameters(); 182 int num_parameters = info()->scope()->num_parameters();
177 int first_parameter = info()->scope()->has_this_declaration() ? -1 : 0; 183 int first_parameter = info()->scope()->has_this_declaration() ? -1 : 0;
(...skipping 5376 matching lines...) Expand 10 before | Expand all | Expand 10 after
5554 __ LoadP(result, 5560 __ LoadP(result,
5555 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); 5561 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize));
5556 __ bind(deferred->exit()); 5562 __ bind(deferred->exit());
5557 __ bind(&done); 5563 __ bind(&done);
5558 } 5564 }
5559 5565
5560 #undef __ 5566 #undef __
5561 5567
5562 } // namespace internal 5568 } // namespace internal
5563 } // namespace v8 5569 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/ppc/lithium-codegen-ppc.cc ('k') | src/crankshaft/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698