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 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/crankshaft/x87/lithium-codegen-x87.h" | 7 #include "src/crankshaft/x87/lithium-codegen-x87.h" |
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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 need_write_barrier = false; | 157 need_write_barrier = false; |
158 } | 158 } |
159 RecordSafepoint(deopt_mode); | 159 RecordSafepoint(deopt_mode); |
160 | 160 |
161 // Context is returned in eax. It replaces the context passed to us. | 161 // Context is returned in eax. It replaces the context passed to us. |
162 // It's saved in the stack and kept live in esi. | 162 // It's saved in the stack and kept live in esi. |
163 __ mov(esi, eax); | 163 __ mov(esi, eax); |
164 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), eax); | 164 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), eax); |
165 | 165 |
166 // Copy parameters into context if necessary. | 166 // Copy parameters into context if necessary. |
167 int num_parameters = scope()->num_parameters(); | 167 int num_parameters = info()->scope()->num_parameters(); |
168 int first_parameter = scope()->has_this_declaration() ? -1 : 0; | 168 int first_parameter = info()->scope()->has_this_declaration() ? -1 : 0; |
169 for (int i = first_parameter; i < num_parameters; i++) { | 169 for (int i = first_parameter; i < num_parameters; i++) { |
170 Variable* var = (i == -1) ? scope()->receiver() : scope()->parameter(i); | 170 Variable* var = (i == -1) ? info()->scope()->receiver() |
| 171 : info()->scope()->parameter(i); |
171 if (var->IsContextSlot()) { | 172 if (var->IsContextSlot()) { |
172 int parameter_offset = StandardFrameConstants::kCallerSPOffset + | 173 int parameter_offset = StandardFrameConstants::kCallerSPOffset + |
173 (num_parameters - 1 - i) * kPointerSize; | 174 (num_parameters - 1 - i) * kPointerSize; |
174 // Load parameter from stack. | 175 // Load parameter from stack. |
175 __ mov(eax, Operand(ebp, parameter_offset)); | 176 __ mov(eax, Operand(ebp, parameter_offset)); |
176 // Store it in the context. | 177 // Store it in the context. |
177 int context_offset = Context::SlotOffset(var->index()); | 178 int context_offset = Context::SlotOffset(var->index()); |
178 __ mov(Operand(esi, context_offset), eax); | 179 __ mov(Operand(esi, context_offset), eax); |
179 // Update the write barrier. This clobbers eax and ebx. | 180 // Update the write barrier. This clobbers eax and ebx. |
180 if (need_write_barrier) { | 181 if (need_write_barrier) { |
(...skipping 5590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5771 __ bind(deferred->exit()); | 5772 __ bind(deferred->exit()); |
5772 __ bind(&done); | 5773 __ bind(&done); |
5773 } | 5774 } |
5774 | 5775 |
5775 #undef __ | 5776 #undef __ |
5776 | 5777 |
5777 } // namespace internal | 5778 } // namespace internal |
5778 } // namespace v8 | 5779 } // namespace v8 |
5779 | 5780 |
5780 #endif // V8_TARGET_ARCH_X87 | 5781 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |