| 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/assembler-inl.h" | 7 #include "src/assembler-inl.h" |
| 8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
| 9 #include "src/builtins/builtins-constructor.h" | 9 #include "src/builtins/builtins-constructor.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 bool need_write_barrier = true; | 160 bool need_write_barrier = true; |
| 161 // Argument to NewContext is the function, which is in r1. | 161 // Argument to NewContext is the function, which is in r1. |
| 162 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 162 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
| 163 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; | 163 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; |
| 164 if (info()->scope()->is_script_scope()) { | 164 if (info()->scope()->is_script_scope()) { |
| 165 __ push(r1); | 165 __ push(r1); |
| 166 __ Push(info()->scope()->scope_info()); | 166 __ Push(info()->scope()->scope_info()); |
| 167 __ CallRuntime(Runtime::kNewScriptContext); | 167 __ CallRuntime(Runtime::kNewScriptContext); |
| 168 deopt_mode = Safepoint::kLazyDeopt; | 168 deopt_mode = Safepoint::kLazyDeopt; |
| 169 } else { | 169 } else { |
| 170 if (slots <= | 170 if (slots <= ConstructorBuiltins::MaximumFunctionContextSlots()) { |
| 171 ConstructorBuiltinsAssembler::MaximumFunctionContextSlots()) { | |
| 172 Callable callable = CodeFactory::FastNewFunctionContext( | 171 Callable callable = CodeFactory::FastNewFunctionContext( |
| 173 isolate(), info()->scope()->scope_type()); | 172 isolate(), info()->scope()->scope_type()); |
| 174 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), | 173 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), |
| 175 Operand(slots)); | 174 Operand(slots)); |
| 176 __ Call(callable.code(), RelocInfo::CODE_TARGET); | 175 __ Call(callable.code(), RelocInfo::CODE_TARGET); |
| 177 // Result of the FastNewFunctionContext builtin is always in new space. | 176 // Result of the FastNewFunctionContext builtin is always in new space. |
| 178 need_write_barrier = false; | 177 need_write_barrier = false; |
| 179 } else { | 178 } else { |
| 180 __ push(r1); | 179 __ push(r1); |
| 181 __ Push(Smi::FromInt(info()->scope()->scope_type())); | 180 __ Push(Smi::FromInt(info()->scope()->scope_type())); |
| (...skipping 5144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5326 __ ldr(result, FieldMemOperand(scratch, | 5325 __ ldr(result, FieldMemOperand(scratch, |
| 5327 FixedArray::kHeaderSize - kPointerSize)); | 5326 FixedArray::kHeaderSize - kPointerSize)); |
| 5328 __ bind(deferred->exit()); | 5327 __ bind(deferred->exit()); |
| 5329 __ bind(&done); | 5328 __ bind(&done); |
| 5330 } | 5329 } |
| 5331 | 5330 |
| 5332 #undef __ | 5331 #undef __ |
| 5333 | 5332 |
| 5334 } // namespace internal | 5333 } // namespace internal |
| 5335 } // namespace v8 | 5334 } // namespace v8 |
| OLD | NEW |