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

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

Issue 2435023002: Use a different map to distinguish eval contexts (Closed)
Patch Set: Changes from review Created 4 years 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/contexts-inl.h ('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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 bool need_write_barrier = true; 157 bool need_write_barrier = true;
158 // Argument to NewContext is the function, which is in r1. 158 // Argument to NewContext is the function, which is in r1.
159 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; 159 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
160 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; 160 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt;
161 if (info()->scope()->is_script_scope()) { 161 if (info()->scope()->is_script_scope()) {
162 __ push(r1); 162 __ push(r1);
163 __ Push(info()->scope()->scope_info()); 163 __ Push(info()->scope()->scope_info());
164 __ CallRuntime(Runtime::kNewScriptContext); 164 __ CallRuntime(Runtime::kNewScriptContext);
165 deopt_mode = Safepoint::kLazyDeopt; 165 deopt_mode = Safepoint::kLazyDeopt;
166 } else { 166 } else {
167 if (slots <= FastNewFunctionContextStub::kMaximumSlots) { 167 if (slots <= FastNewFunctionContextStub::MaximumSlots()) {
168 FastNewFunctionContextStub stub(isolate()); 168 FastNewFunctionContextStub stub(isolate(),
169 info()->scope()->scope_type());
169 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), 170 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
170 Operand(slots)); 171 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 } else {
175 __ push(r1); 176 __ push(r1);
177 __ Push(Smi::FromInt(info()->scope()->scope_type()));
176 __ CallRuntime(Runtime::kNewFunctionContext); 178 __ CallRuntime(Runtime::kNewFunctionContext);
177 } 179 }
178 } 180 }
179 RecordSafepoint(deopt_mode); 181 RecordSafepoint(deopt_mode);
180 182
181 // Context is returned in both r0 and cp. It replaces the context 183 // Context is returned in both r0 and cp. It replaces the context
182 // passed to us. It's saved in the stack and kept live in cp. 184 // passed to us. It's saved in the stack and kept live in cp.
183 __ mov(cp, r0); 185 __ mov(cp, r0);
184 __ str(r0, MemOperand(fp, StandardFrameConstants::kContextOffset)); 186 __ str(r0, MemOperand(fp, StandardFrameConstants::kContextOffset));
185 // Copy any necessary parameters into the context. 187 // Copy any necessary parameters into the context.
(...skipping 5196 matching lines...) Expand 10 before | Expand all | Expand 10 after
5382 __ ldr(result, FieldMemOperand(scratch, 5384 __ ldr(result, FieldMemOperand(scratch,
5383 FixedArray::kHeaderSize - kPointerSize)); 5385 FixedArray::kHeaderSize - kPointerSize));
5384 __ bind(deferred->exit()); 5386 __ bind(deferred->exit());
5385 __ bind(&done); 5387 __ bind(&done);
5386 } 5388 }
5387 5389
5388 #undef __ 5390 #undef __
5389 5391
5390 } // namespace internal 5392 } // namespace internal
5391 } // namespace v8 5393 } // namespace v8
OLDNEW
« no previous file with comments | « src/contexts-inl.h ('k') | src/crankshaft/arm64/lithium-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698