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/code-factory.h" | 8 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
9 #include "src/crankshaft/hydrogen-osr.h" | 10 #include "src/crankshaft/hydrogen-osr.h" |
10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" | 11 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" |
11 #include "src/ic/ic.h" | 12 #include "src/ic/ic.h" |
12 #include "src/ic/stub-cache.h" | 13 #include "src/ic/stub-cache.h" |
13 | 14 |
14 namespace v8 { | 15 namespace v8 { |
15 namespace internal { | 16 namespace internal { |
16 | 17 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 bool need_write_barrier = true; | 172 bool need_write_barrier = true; |
172 // Argument to NewContext is the function, which is in a1. | 173 // Argument to NewContext is the function, which is in a1. |
173 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 174 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
174 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; | 175 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; |
175 if (info()->scope()->is_script_scope()) { | 176 if (info()->scope()->is_script_scope()) { |
176 __ push(a1); | 177 __ push(a1); |
177 __ Push(info()->scope()->scope_info()); | 178 __ Push(info()->scope()->scope_info()); |
178 __ CallRuntime(Runtime::kNewScriptContext); | 179 __ CallRuntime(Runtime::kNewScriptContext); |
179 deopt_mode = Safepoint::kLazyDeopt; | 180 deopt_mode = Safepoint::kLazyDeopt; |
180 } else { | 181 } else { |
181 if (slots <= FastNewFunctionContextStub::MaximumSlots()) { | 182 if (slots <= |
182 FastNewFunctionContextStub stub(isolate(), | 183 ConstructorBuiltinsAssembler::MaximumFunctionContextSlots()) { |
183 info()->scope()->scope_type()); | 184 Callable callable = CodeFactory::FastNewFunctionContext( |
| 185 isolate(), info()->scope()->scope_type()); |
184 __ li(FastNewFunctionContextDescriptor::SlotsRegister(), | 186 __ li(FastNewFunctionContextDescriptor::SlotsRegister(), |
185 Operand(slots)); | 187 Operand(slots)); |
186 __ CallStub(&stub); | 188 __ Call(callable.code(), RelocInfo::CODE_TARGET); |
187 // Result of FastNewFunctionContextStub is always in new space. | 189 // Result of the FastNewFunctionContext builtin is always in new space. |
188 need_write_barrier = false; | 190 need_write_barrier = false; |
189 } else { | 191 } else { |
190 __ push(a1); | 192 __ push(a1); |
191 __ Push(Smi::FromInt(info()->scope()->scope_type())); | 193 __ Push(Smi::FromInt(info()->scope()->scope_type())); |
192 __ CallRuntime(Runtime::kNewFunctionContext); | 194 __ CallRuntime(Runtime::kNewFunctionContext); |
193 } | 195 } |
194 } | 196 } |
195 RecordSafepoint(deopt_mode); | 197 RecordSafepoint(deopt_mode); |
196 | 198 |
197 // Context is returned in both v0. It replaces the context passed to us. | 199 // Context is returned in both v0. It replaces the context passed to us. |
(...skipping 5424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5622 __ ld(result, FieldMemOperand(scratch, | 5624 __ ld(result, FieldMemOperand(scratch, |
5623 FixedArray::kHeaderSize - kPointerSize)); | 5625 FixedArray::kHeaderSize - kPointerSize)); |
5624 __ bind(deferred->exit()); | 5626 __ bind(deferred->exit()); |
5625 __ bind(&done); | 5627 __ bind(&done); |
5626 } | 5628 } |
5627 | 5629 |
5628 #undef __ | 5630 #undef __ |
5629 | 5631 |
5630 } // namespace internal | 5632 } // namespace internal |
5631 } // namespace v8 | 5633 } // namespace v8 |
OLD | NEW |