| 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/mips64/lithium-codegen-mips64.h" | 5 #include "src/crankshaft/mips64/lithium-codegen-mips64.h" |
| 6 | 6 |
| 7 #include "src/builtins/builtins-constructor.h" | 7 #include "src/builtins/builtins-constructor.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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 bool need_write_barrier = true; | 172 bool need_write_barrier = true; |
| 173 // Argument to NewContext is the function, which is in a1. | 173 // Argument to NewContext is the function, which is in a1. |
| 174 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 174 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
| 175 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; | 175 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; |
| 176 if (info()->scope()->is_script_scope()) { | 176 if (info()->scope()->is_script_scope()) { |
| 177 __ push(a1); | 177 __ push(a1); |
| 178 __ Push(info()->scope()->scope_info()); | 178 __ Push(info()->scope()->scope_info()); |
| 179 __ CallRuntime(Runtime::kNewScriptContext); | 179 __ CallRuntime(Runtime::kNewScriptContext); |
| 180 deopt_mode = Safepoint::kLazyDeopt; | 180 deopt_mode = Safepoint::kLazyDeopt; |
| 181 } else { | 181 } else { |
| 182 if (slots <= | 182 if (slots <= ConstructorBuiltins::MaximumFunctionContextSlots()) { |
| 183 ConstructorBuiltinsAssembler::MaximumFunctionContextSlots()) { | |
| 184 Callable callable = CodeFactory::FastNewFunctionContext( | 183 Callable callable = CodeFactory::FastNewFunctionContext( |
| 185 isolate(), info()->scope()->scope_type()); | 184 isolate(), info()->scope()->scope_type()); |
| 186 __ li(FastNewFunctionContextDescriptor::SlotsRegister(), | 185 __ li(FastNewFunctionContextDescriptor::SlotsRegister(), |
| 187 Operand(slots)); | 186 Operand(slots)); |
| 188 __ Call(callable.code(), RelocInfo::CODE_TARGET); | 187 __ Call(callable.code(), RelocInfo::CODE_TARGET); |
| 189 // Result of the FastNewFunctionContext builtin is always in new space. | 188 // Result of the FastNewFunctionContext builtin is always in new space. |
| 190 need_write_barrier = false; | 189 need_write_barrier = false; |
| 191 } else { | 190 } else { |
| 192 __ push(a1); | 191 __ push(a1); |
| 193 __ Push(Smi::FromInt(info()->scope()->scope_type())); | 192 __ Push(Smi::FromInt(info()->scope()->scope_type())); |
| (...skipping 5350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5544 __ ld(result, FieldMemOperand(scratch, | 5543 __ ld(result, FieldMemOperand(scratch, |
| 5545 FixedArray::kHeaderSize - kPointerSize)); | 5544 FixedArray::kHeaderSize - kPointerSize)); |
| 5546 __ bind(deferred->exit()); | 5545 __ bind(deferred->exit()); |
| 5547 __ bind(&done); | 5546 __ bind(&done); |
| 5548 } | 5547 } |
| 5549 | 5548 |
| 5550 #undef __ | 5549 #undef __ |
| 5551 | 5550 |
| 5552 } // namespace internal | 5551 } // namespace internal |
| 5553 } // namespace v8 | 5552 } // namespace v8 |
| OLD | NEW |