| 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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 6 | 6 |
| 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" | 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 need_write_barrier = false; | 187 need_write_barrier = false; |
| 188 } | 188 } |
| 189 RecordSafepoint(deopt_mode); | 189 RecordSafepoint(deopt_mode); |
| 190 | 190 |
| 191 // Context is returned in eax. It replaces the context passed to us. | 191 // Context is returned in eax. It replaces the context passed to us. |
| 192 // It's saved in the stack and kept live in esi. | 192 // It's saved in the stack and kept live in esi. |
| 193 __ mov(esi, eax); | 193 __ mov(esi, eax); |
| 194 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), eax); | 194 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), eax); |
| 195 | 195 |
| 196 // Copy parameters into context if necessary. | 196 // Copy parameters into context if necessary. |
| 197 int num_parameters = scope()->num_parameters(); | 197 int num_parameters = info()->scope()->num_parameters(); |
| 198 int first_parameter = scope()->has_this_declaration() ? -1 : 0; | 198 int first_parameter = info()->scope()->has_this_declaration() ? -1 : 0; |
| 199 for (int i = first_parameter; i < num_parameters; i++) { | 199 for (int i = first_parameter; i < num_parameters; i++) { |
| 200 Variable* var = (i == -1) ? scope()->receiver() : scope()->parameter(i); | 200 Variable* var = (i == -1) ? info()->scope()->receiver() |
| 201 : info()->scope()->parameter(i); |
| 201 if (var->IsContextSlot()) { | 202 if (var->IsContextSlot()) { |
| 202 int parameter_offset = StandardFrameConstants::kCallerSPOffset + | 203 int parameter_offset = StandardFrameConstants::kCallerSPOffset + |
| 203 (num_parameters - 1 - i) * kPointerSize; | 204 (num_parameters - 1 - i) * kPointerSize; |
| 204 // Load parameter from stack. | 205 // Load parameter from stack. |
| 205 __ mov(eax, Operand(ebp, parameter_offset)); | 206 __ mov(eax, Operand(ebp, parameter_offset)); |
| 206 // Store it in the context. | 207 // Store it in the context. |
| 207 int context_offset = Context::SlotOffset(var->index()); | 208 int context_offset = Context::SlotOffset(var->index()); |
| 208 __ mov(Operand(esi, context_offset), eax); | 209 __ mov(Operand(esi, context_offset), eax); |
| 209 // Update the write barrier. This clobbers eax and ebx. | 210 // Update the write barrier. This clobbers eax and ebx. |
| 210 if (need_write_barrier) { | 211 if (need_write_barrier) { |
| (...skipping 5071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5282 __ bind(deferred->exit()); | 5283 __ bind(deferred->exit()); |
| 5283 __ bind(&done); | 5284 __ bind(&done); |
| 5284 } | 5285 } |
| 5285 | 5286 |
| 5286 #undef __ | 5287 #undef __ |
| 5287 | 5288 |
| 5288 } // namespace internal | 5289 } // namespace internal |
| 5289 } // namespace v8 | 5290 } // namespace v8 |
| 5290 | 5291 |
| 5291 #endif // V8_TARGET_ARCH_IA32 | 5292 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |