OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // | 2 // |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 #include "src/crankshaft/s390/lithium-codegen-s390.h" | 6 #include "src/crankshaft/s390/lithium-codegen-s390.h" |
7 | 7 |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
| 9 #include "src/builtins/builtins-constructor.h" |
9 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 11 #include "src/code-stubs.h" |
11 #include "src/crankshaft/hydrogen-osr.h" | 12 #include "src/crankshaft/hydrogen-osr.h" |
12 #include "src/crankshaft/s390/lithium-gap-resolver-s390.h" | 13 #include "src/crankshaft/s390/lithium-gap-resolver-s390.h" |
13 #include "src/ic/ic.h" | 14 #include "src/ic/ic.h" |
14 #include "src/ic/stub-cache.h" | 15 #include "src/ic/stub-cache.h" |
15 | 16 |
16 namespace v8 { | 17 namespace v8 { |
17 namespace internal { | 18 namespace internal { |
18 | 19 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 bool need_write_barrier = true; | 171 bool need_write_barrier = true; |
171 // Argument to NewContext is the function, which is in r3. | 172 // Argument to NewContext is the function, which is in r3. |
172 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 173 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
173 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; | 174 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; |
174 if (info()->scope()->is_script_scope()) { | 175 if (info()->scope()->is_script_scope()) { |
175 __ push(r3); | 176 __ push(r3); |
176 __ Push(info()->scope()->scope_info()); | 177 __ Push(info()->scope()->scope_info()); |
177 __ CallRuntime(Runtime::kNewScriptContext); | 178 __ CallRuntime(Runtime::kNewScriptContext); |
178 deopt_mode = Safepoint::kLazyDeopt; | 179 deopt_mode = Safepoint::kLazyDeopt; |
179 } else { | 180 } else { |
180 if (slots <= FastNewFunctionContextStub::MaximumSlots()) { | 181 if (slots <= |
181 FastNewFunctionContextStub stub(isolate(), | 182 ConstructorBuiltinsAssembler::MaximumFunctionContextSlots()) { |
182 info()->scope()->scope_type()); | 183 Callable callable = CodeFactory::FastNewFunctionContext( |
| 184 isolate(), info()->scope()->scope_type()); |
183 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), | 185 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), |
184 Operand(slots)); | 186 Operand(slots)); |
185 __ CallStub(&stub); | 187 __ Call(callable.code(), RelocInfo::CODE_TARGET); |
186 // Result of FastNewFunctionContextStub is always in new space. | 188 // Result of the FastNewFunctionContext builtin is always in new space. |
187 need_write_barrier = false; | 189 need_write_barrier = false; |
188 } else { | 190 } else { |
189 __ push(r3); | 191 __ push(r3); |
190 __ Push(Smi::FromInt(info()->scope()->scope_type())); | 192 __ Push(Smi::FromInt(info()->scope()->scope_type())); |
191 __ CallRuntime(Runtime::kNewFunctionContext); | 193 __ CallRuntime(Runtime::kNewFunctionContext); |
192 } | 194 } |
193 } | 195 } |
194 RecordSafepoint(deopt_mode); | 196 RecordSafepoint(deopt_mode); |
195 | 197 |
196 // Context is returned in both r2 and cp. It replaces the context | 198 // Context is returned in both r2 and cp. It replaces the context |
(...skipping 5374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5571 __ LoadP(result, | 5573 __ LoadP(result, |
5572 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); | 5574 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); |
5573 __ bind(deferred->exit()); | 5575 __ bind(deferred->exit()); |
5574 __ bind(&done); | 5576 __ bind(&done); |
5575 } | 5577 } |
5576 | 5578 |
5577 #undef __ | 5579 #undef __ |
5578 | 5580 |
5579 } // namespace internal | 5581 } // namespace internal |
5580 } // namespace v8 | 5582 } // namespace v8 |
OLD | NEW |