OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 RecordSafepoint(Safepoint::kNoLazyDeopt); | 208 RecordSafepoint(Safepoint::kNoLazyDeopt); |
209 // Context is returned in rax. It replaces the context passed to us. | 209 // Context is returned in rax. It replaces the context passed to us. |
210 // It's saved in the stack and kept live in rsi. | 210 // It's saved in the stack and kept live in rsi. |
211 __ movp(rsi, rax); | 211 __ movp(rsi, rax); |
212 __ movp(Operand(rbp, StandardFrameConstants::kContextOffset), rax); | 212 __ movp(Operand(rbp, StandardFrameConstants::kContextOffset), rax); |
213 | 213 |
214 // Copy any necessary parameters into the context. | 214 // Copy any necessary parameters into the context. |
215 int num_parameters = scope()->num_parameters(); | 215 int num_parameters = scope()->num_parameters(); |
216 int first_parameter = scope()->has_this_declaration() ? -1 : 0; | 216 int first_parameter = scope()->has_this_declaration() ? -1 : 0; |
217 for (int i = first_parameter; i < num_parameters; i++) { | 217 for (int i = first_parameter; i < num_parameters; i++) { |
218 Variable* var = (i == -1) ? scope()->receiver() : scope()->parameter(i); | 218 Variable* var = |
| 219 (i == -1) ? scope()->receiver() : scope()->parameter_var(i); |
219 if (var->IsContextSlot()) { | 220 if (var->IsContextSlot()) { |
220 int parameter_offset = StandardFrameConstants::kCallerSPOffset + | 221 int parameter_offset = StandardFrameConstants::kCallerSPOffset + |
221 (num_parameters - 1 - i) * kPointerSize; | 222 (num_parameters - 1 - i) * kPointerSize; |
222 // Load parameter from stack. | 223 // Load parameter from stack. |
223 __ movp(rax, Operand(rbp, parameter_offset)); | 224 __ movp(rax, Operand(rbp, parameter_offset)); |
224 // Store it in the context. | 225 // Store it in the context. |
225 int context_offset = Context::SlotOffset(var->index()); | 226 int context_offset = Context::SlotOffset(var->index()); |
226 __ movp(Operand(rsi, context_offset), rax); | 227 __ movp(Operand(rsi, context_offset), rax); |
227 // Update the write barrier. This clobbers rax and rbx. | 228 // Update the write barrier. This clobbers rax and rbx. |
228 if (need_write_barrier) { | 229 if (need_write_barrier) { |
(...skipping 5754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5983 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5984 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5984 } | 5985 } |
5985 | 5986 |
5986 | 5987 |
5987 #undef __ | 5988 #undef __ |
5988 | 5989 |
5989 } // namespace internal | 5990 } // namespace internal |
5990 } // namespace v8 | 5991 } // namespace v8 |
5991 | 5992 |
5992 #endif // V8_TARGET_ARCH_X64 | 5993 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |