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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 RecordSafepoint(Safepoint::kNoLazyDeopt); | 270 RecordSafepoint(Safepoint::kNoLazyDeopt); |
271 // Context is returned in eax. It replaces the context passed to us. | 271 // Context is returned in eax. It replaces the context passed to us. |
272 // It's saved in the stack and kept live in esi. | 272 // It's saved in the stack and kept live in esi. |
273 __ mov(esi, eax); | 273 __ mov(esi, eax); |
274 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), eax); | 274 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), eax); |
275 | 275 |
276 // Copy parameters into context if necessary. | 276 // Copy parameters into context if necessary. |
277 int num_parameters = scope()->num_parameters(); | 277 int num_parameters = scope()->num_parameters(); |
278 int first_parameter = scope()->has_this_declaration() ? -1 : 0; | 278 int first_parameter = scope()->has_this_declaration() ? -1 : 0; |
279 for (int i = first_parameter; i < num_parameters; i++) { | 279 for (int i = first_parameter; i < num_parameters; i++) { |
280 Variable* var = (i == -1) ? scope()->receiver() : scope()->parameter(i); | 280 Variable* var = |
| 281 (i == -1) ? scope()->receiver() : scope()->parameter_var(i); |
281 if (var->IsContextSlot()) { | 282 if (var->IsContextSlot()) { |
282 int parameter_offset = StandardFrameConstants::kCallerSPOffset + | 283 int parameter_offset = StandardFrameConstants::kCallerSPOffset + |
283 (num_parameters - 1 - i) * kPointerSize; | 284 (num_parameters - 1 - i) * kPointerSize; |
284 // Load parameter from stack. | 285 // Load parameter from stack. |
285 __ mov(eax, Operand(ebp, parameter_offset)); | 286 __ mov(eax, Operand(ebp, parameter_offset)); |
286 // Store it in the context. | 287 // Store it in the context. |
287 int context_offset = Context::SlotOffset(var->index()); | 288 int context_offset = Context::SlotOffset(var->index()); |
288 __ mov(Operand(esi, context_offset), eax); | 289 __ mov(Operand(esi, context_offset), eax); |
289 // Update the write barrier. This clobbers eax and ebx. | 290 // Update the write barrier. This clobbers eax and ebx. |
290 if (need_write_barrier) { | 291 if (need_write_barrier) { |
(...skipping 5492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5783 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5784 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5784 } | 5785 } |
5785 | 5786 |
5786 | 5787 |
5787 #undef __ | 5788 #undef __ |
5788 | 5789 |
5789 } // namespace internal | 5790 } // namespace internal |
5790 } // namespace v8 | 5791 } // namespace v8 |
5791 | 5792 |
5792 #endif // V8_TARGET_ARCH_IA32 | 5793 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |