OLD | NEW |
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 Loading... |
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 FastNewFunctionContextStub stub(isolate()); | 167 if (slots <= FastNewFunctionContextStub::kMaximumSlots) { |
168 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), Operand(slots)); | 168 FastNewFunctionContextStub stub(isolate()); |
169 __ CallStub(&stub); | 169 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), |
170 // Result of FastNewFunctionContextStub is always in new space. | 170 Operand(slots)); |
171 need_write_barrier = false; | 171 __ CallStub(&stub); |
| 172 // Result of FastNewFunctionContextStub is always in new space. |
| 173 need_write_barrier = false; |
| 174 } else { |
| 175 __ push(r1); |
| 176 __ CallRuntime(Runtime::kNewFunctionContext); |
| 177 } |
172 } | 178 } |
173 RecordSafepoint(deopt_mode); | 179 RecordSafepoint(deopt_mode); |
174 | 180 |
175 // Context is returned in both r0 and cp. It replaces the context | 181 // Context is returned in both r0 and cp. It replaces the context |
176 // passed to us. It's saved in the stack and kept live in cp. | 182 // passed to us. It's saved in the stack and kept live in cp. |
177 __ mov(cp, r0); | 183 __ mov(cp, r0); |
178 __ str(r0, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 184 __ str(r0, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
179 // Copy any necessary parameters into the context. | 185 // Copy any necessary parameters into the context. |
180 int num_parameters = info()->scope()->num_parameters(); | 186 int num_parameters = info()->scope()->num_parameters(); |
181 int first_parameter = info()->scope()->has_this_declaration() ? -1 : 0; | 187 int first_parameter = info()->scope()->has_this_declaration() ? -1 : 0; |
(...skipping 5219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5401 __ ldr(result, FieldMemOperand(scratch, | 5407 __ ldr(result, FieldMemOperand(scratch, |
5402 FixedArray::kHeaderSize - kPointerSize)); | 5408 FixedArray::kHeaderSize - kPointerSize)); |
5403 __ bind(deferred->exit()); | 5409 __ bind(deferred->exit()); |
5404 __ bind(&done); | 5410 __ bind(&done); |
5405 } | 5411 } |
5406 | 5412 |
5407 #undef __ | 5413 #undef __ |
5408 | 5414 |
5409 } // namespace internal | 5415 } // namespace internal |
5410 } // namespace v8 | 5416 } // namespace v8 |
OLD | NEW |