| 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/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 function_in_register = false; | 201 function_in_register = false; |
| 202 // Context is returned in eax. It replaces the context passed to us. | 202 // Context is returned in eax. It replaces the context passed to us. |
| 203 // It's saved in the stack and kept live in esi. | 203 // It's saved in the stack and kept live in esi. |
| 204 __ mov(esi, eax); | 204 __ mov(esi, eax); |
| 205 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), eax); | 205 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), eax); |
| 206 | 206 |
| 207 // Copy parameters into context if necessary. | 207 // Copy parameters into context if necessary. |
| 208 int num_parameters = info->scope()->num_parameters(); | 208 int num_parameters = info->scope()->num_parameters(); |
| 209 int first_parameter = info->scope()->has_this_declaration() ? -1 : 0; | 209 int first_parameter = info->scope()->has_this_declaration() ? -1 : 0; |
| 210 for (int i = first_parameter; i < num_parameters; i++) { | 210 for (int i = first_parameter; i < num_parameters; i++) { |
| 211 Variable* var = (i == -1) ? scope()->receiver() : scope()->parameter(i); | 211 Variable* var = |
| 212 (i == -1) ? scope()->receiver() : scope()->parameter_var(i); |
| 212 if (var->IsContextSlot()) { | 213 if (var->IsContextSlot()) { |
| 213 int parameter_offset = StandardFrameConstants::kCallerSPOffset + | 214 int parameter_offset = StandardFrameConstants::kCallerSPOffset + |
| 214 (num_parameters - 1 - i) * kPointerSize; | 215 (num_parameters - 1 - i) * kPointerSize; |
| 215 // Load parameter from stack. | 216 // Load parameter from stack. |
| 216 __ mov(eax, Operand(ebp, parameter_offset)); | 217 __ mov(eax, Operand(ebp, parameter_offset)); |
| 217 // Store it in the context. | 218 // Store it in the context. |
| 218 int context_offset = Context::SlotOffset(var->index()); | 219 int context_offset = Context::SlotOffset(var->index()); |
| 219 __ mov(Operand(esi, context_offset), eax); | 220 __ mov(Operand(esi, context_offset), eax); |
| 220 // Update the write barrier. This clobbers eax and ebx. | 221 // Update the write barrier. This clobbers eax and ebx. |
| 221 if (need_write_barrier) { | 222 if (need_write_barrier) { |
| (...skipping 5260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5482 Assembler::target_address_at(call_target_address, | 5483 Assembler::target_address_at(call_target_address, |
| 5483 unoptimized_code)); | 5484 unoptimized_code)); |
| 5484 return OSR_AFTER_STACK_CHECK; | 5485 return OSR_AFTER_STACK_CHECK; |
| 5485 } | 5486 } |
| 5486 | 5487 |
| 5487 | 5488 |
| 5488 } // namespace internal | 5489 } // namespace internal |
| 5489 } // namespace v8 | 5490 } // namespace v8 |
| 5490 | 5491 |
| 5491 #endif // V8_TARGET_ARCH_IA32 | 5492 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |