OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/ppc/lithium-codegen-ppc.h" | 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.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/hydrogen-osr.h" | 10 #include "src/crankshaft/hydrogen-osr.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 bool need_write_barrier = true; | 179 bool need_write_barrier = true; |
180 // Argument to NewContext is the function, which is in r4. | 180 // Argument to NewContext is the function, which is in r4. |
181 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 181 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
182 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; | 182 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; |
183 if (info()->scope()->is_script_scope()) { | 183 if (info()->scope()->is_script_scope()) { |
184 __ push(r4); | 184 __ push(r4); |
185 __ Push(info()->scope()->scope_info()); | 185 __ Push(info()->scope()->scope_info()); |
186 __ CallRuntime(Runtime::kNewScriptContext); | 186 __ CallRuntime(Runtime::kNewScriptContext); |
187 deopt_mode = Safepoint::kLazyDeopt; | 187 deopt_mode = Safepoint::kLazyDeopt; |
188 } else { | 188 } else { |
189 if (slots <= FastNewFunctionContextStub::kMaximumSlots) { | 189 if (slots <= FastNewFunctionContextStub::MaximumSlots()) { |
190 FastNewFunctionContextStub stub(isolate()); | 190 FastNewFunctionContextStub stub(isolate(), |
| 191 info()->scope()->scope_type()); |
191 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), | 192 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), |
192 Operand(slots)); | 193 Operand(slots)); |
193 __ CallStub(&stub); | 194 __ CallStub(&stub); |
194 // Result of FastNewFunctionContextStub is always in new space. | 195 // Result of FastNewFunctionContextStub is always in new space. |
195 need_write_barrier = false; | 196 need_write_barrier = false; |
196 } else { | 197 } else { |
197 __ push(r4); | 198 __ push(r4); |
| 199 __ Push(Smi::FromInt(info()->scope()->scope_type())); |
198 __ CallRuntime(Runtime::kNewFunctionContext); | 200 __ CallRuntime(Runtime::kNewFunctionContext); |
199 } | 201 } |
200 } | 202 } |
201 RecordSafepoint(deopt_mode); | 203 RecordSafepoint(deopt_mode); |
202 | 204 |
203 // Context is returned in both r3 and cp. It replaces the context | 205 // Context is returned in both r3 and cp. It replaces the context |
204 // passed to us. It's saved in the stack and kept live in cp. | 206 // passed to us. It's saved in the stack and kept live in cp. |
205 __ mr(cp, r3); | 207 __ mr(cp, r3); |
206 __ StoreP(r3, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 208 __ StoreP(r3, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
207 // Copy any necessary parameters into the context. | 209 // Copy any necessary parameters into the context. |
(...skipping 5444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5652 __ LoadP(result, | 5654 __ LoadP(result, |
5653 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); | 5655 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); |
5654 __ bind(deferred->exit()); | 5656 __ bind(deferred->exit()); |
5655 __ bind(&done); | 5657 __ bind(&done); |
5656 } | 5658 } |
5657 | 5659 |
5658 #undef __ | 5660 #undef __ |
5659 | 5661 |
5660 } // namespace internal | 5662 } // namespace internal |
5661 } // namespace v8 | 5663 } // namespace v8 |
OLD | NEW |