| 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/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 bool need_write_barrier = true; | 170 bool need_write_barrier = true; |
| 171 // Argument to NewContext is the function, which is in r3. | 171 // Argument to NewContext is the function, which is in r3. |
| 172 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 172 int slots = info()->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
| 173 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; | 173 Safepoint::DeoptMode deopt_mode = Safepoint::kNoLazyDeopt; |
| 174 if (info()->scope()->is_script_scope()) { | 174 if (info()->scope()->is_script_scope()) { |
| 175 __ push(r3); | 175 __ push(r3); |
| 176 __ Push(info()->scope()->scope_info()); | 176 __ Push(info()->scope()->scope_info()); |
| 177 __ CallRuntime(Runtime::kNewScriptContext); | 177 __ CallRuntime(Runtime::kNewScriptContext); |
| 178 deopt_mode = Safepoint::kLazyDeopt; | 178 deopt_mode = Safepoint::kLazyDeopt; |
| 179 } else { | 179 } else { |
| 180 if (slots <= FastNewFunctionContextStub::kMaximumSlots) { | 180 if (slots <= FastNewFunctionContextStub::MaximumSlots()) { |
| 181 FastNewFunctionContextStub stub(isolate()); | 181 FastNewFunctionContextStub stub(isolate(), |
| 182 info()->scope()->scope_type()); |
| 182 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), | 183 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), |
| 183 Operand(slots)); | 184 Operand(slots)); |
| 184 __ CallStub(&stub); | 185 __ CallStub(&stub); |
| 185 // Result of FastNewFunctionContextStub is always in new space. | 186 // Result of FastNewFunctionContextStub is always in new space. |
| 186 need_write_barrier = false; | 187 need_write_barrier = false; |
| 187 } else { | 188 } else { |
| 188 __ push(r3); | 189 __ push(r3); |
| 190 __ Push(Smi::FromInt(info()->scope()->scope_type())); |
| 189 __ CallRuntime(Runtime::kNewFunctionContext); | 191 __ CallRuntime(Runtime::kNewFunctionContext); |
| 190 } | 192 } |
| 191 } | 193 } |
| 192 RecordSafepoint(deopt_mode); | 194 RecordSafepoint(deopt_mode); |
| 193 | 195 |
| 194 // Context is returned in both r2 and cp. It replaces the context | 196 // Context is returned in both r2 and cp. It replaces the context |
| 195 // passed to us. It's saved in the stack and kept live in cp. | 197 // passed to us. It's saved in the stack and kept live in cp. |
| 196 __ LoadRR(cp, r2); | 198 __ LoadRR(cp, r2); |
| 197 __ StoreP(r2, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 199 __ StoreP(r2, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 198 // Copy any necessary parameters into the context. | 200 // Copy any necessary parameters into the context. |
| (...skipping 5338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5537 __ LoadP(result, | 5539 __ LoadP(result, |
| 5538 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); | 5540 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); |
| 5539 __ bind(deferred->exit()); | 5541 __ bind(deferred->exit()); |
| 5540 __ bind(&done); | 5542 __ bind(&done); |
| 5541 } | 5543 } |
| 5542 | 5544 |
| 5543 #undef __ | 5545 #undef __ |
| 5544 | 5546 |
| 5545 } // namespace internal | 5547 } // namespace internal |
| 5546 } // namespace v8 | 5548 } // namespace v8 |
| OLD | NEW |