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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 // Result of FastNewFunctionContextStub is always in new space. | 169 // Result of FastNewFunctionContextStub is always in new space. |
170 need_write_barrier = false; | 170 need_write_barrier = false; |
171 } | 171 } |
172 RecordSafepoint(deopt_mode); | 172 RecordSafepoint(deopt_mode); |
173 | 173 |
174 // Context is returned in both r2 and cp. It replaces the context | 174 // Context is returned in both r2 and cp. It replaces the context |
175 // passed to us. It's saved in the stack and kept live in cp. | 175 // passed to us. It's saved in the stack and kept live in cp. |
176 __ LoadRR(cp, r2); | 176 __ LoadRR(cp, r2); |
177 __ StoreP(r2, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 177 __ StoreP(r2, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
178 // Copy any necessary parameters into the context. | 178 // Copy any necessary parameters into the context. |
179 int num_parameters = scope()->num_parameters(); | 179 int num_parameters = info()->scope()->num_parameters(); |
180 int first_parameter = scope()->has_this_declaration() ? -1 : 0; | 180 int first_parameter = info()->scope()->has_this_declaration() ? -1 : 0; |
181 for (int i = first_parameter; i < num_parameters; i++) { | 181 for (int i = first_parameter; i < num_parameters; i++) { |
182 Variable* var = (i == -1) ? scope()->receiver() : scope()->parameter(i); | 182 Variable* var = (i == -1) ? info()->scope()->receiver() |
| 183 : info()->scope()->parameter(i); |
183 if (var->IsContextSlot()) { | 184 if (var->IsContextSlot()) { |
184 int parameter_offset = StandardFrameConstants::kCallerSPOffset + | 185 int parameter_offset = StandardFrameConstants::kCallerSPOffset + |
185 (num_parameters - 1 - i) * kPointerSize; | 186 (num_parameters - 1 - i) * kPointerSize; |
186 // Load parameter from stack. | 187 // Load parameter from stack. |
187 __ LoadP(r2, MemOperand(fp, parameter_offset)); | 188 __ LoadP(r2, MemOperand(fp, parameter_offset)); |
188 // Store it in the context. | 189 // Store it in the context. |
189 MemOperand target = ContextMemOperand(cp, var->index()); | 190 MemOperand target = ContextMemOperand(cp, var->index()); |
190 __ StoreP(r2, target); | 191 __ StoreP(r2, target); |
191 // Update the write barrier. This clobbers r5 and r2. | 192 // Update the write barrier. This clobbers r5 and r2. |
192 if (need_write_barrier) { | 193 if (need_write_barrier) { |
(...skipping 5475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5668 __ LoadP(result, | 5669 __ LoadP(result, |
5669 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); | 5670 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); |
5670 __ bind(deferred->exit()); | 5671 __ bind(deferred->exit()); |
5671 __ bind(&done); | 5672 __ bind(&done); |
5672 } | 5673 } |
5673 | 5674 |
5674 #undef __ | 5675 #undef __ |
5675 | 5676 |
5676 } // namespace internal | 5677 } // namespace internal |
5677 } // namespace v8 | 5678 } // namespace v8 |
OLD | NEW |