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/builtins/builtins-constructor.h" | 8 #include "src/builtins/builtins-constructor.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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 bool need_write_barrier = true; | 180 bool need_write_barrier = true; |
181 // Argument to NewContext is the function, which is in r4. | 181 // Argument to NewContext is the function, which is in r4. |
182 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 182 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
183 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; | 183 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; |
184 if (info()->scope()->is_script_scope()) { | 184 if (info()->scope()->is_script_scope()) { |
185 __ push(r4); | 185 __ push(r4); |
186 __ Push(info()->scope()->scope_info()); | 186 __ Push(info()->scope()->scope_info()); |
187 __ CallRuntime(Runtime::kNewScriptContext); | 187 __ CallRuntime(Runtime::kNewScriptContext); |
188 deopt_mode = Safepoint::kLazyDeopt; | 188 deopt_mode = Safepoint::kLazyDeopt; |
189 } else { | 189 } else { |
190 if (slots <= | 190 if (slots <= ConstructorBuiltins::MaximumFunctionContextSlots()) { |
191 ConstructorBuiltinsAssembler::MaximumFunctionContextSlots()) { | |
192 Callable callable = CodeFactory::FastNewFunctionContext( | 191 Callable callable = CodeFactory::FastNewFunctionContext( |
193 isolate(), info()->scope()->scope_type()); | 192 isolate(), info()->scope()->scope_type()); |
194 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), | 193 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), |
195 Operand(slots)); | 194 Operand(slots)); |
196 __ Call(callable.code(), RelocInfo::CODE_TARGET); | 195 __ Call(callable.code(), RelocInfo::CODE_TARGET); |
197 // Result of the FastNewFunctionContext builtin is always in new space. | 196 // Result of the FastNewFunctionContext builtin is always in new space. |
198 need_write_barrier = false; | 197 need_write_barrier = false; |
199 } else { | 198 } else { |
200 __ push(r4); | 199 __ push(r4); |
201 __ Push(Smi::FromInt(info()->scope()->scope_type())); | 200 __ Push(Smi::FromInt(info()->scope()->scope_type())); |
(...skipping 5420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5622 __ LoadP(result, | 5621 __ LoadP(result, |
5623 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); | 5622 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); |
5624 __ bind(deferred->exit()); | 5623 __ bind(deferred->exit()); |
5625 __ bind(&done); | 5624 __ bind(&done); |
5626 } | 5625 } |
5627 | 5626 |
5628 #undef __ | 5627 #undef __ |
5629 | 5628 |
5630 } // namespace internal | 5629 } // namespace internal |
5631 } // namespace v8 | 5630 } // namespace v8 |
OLD | NEW |