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/full-codegen/full-codegen.h" | 7 #include "src/full-codegen/full-codegen.h" |
8 #include "src/ast/compile-time-value.h" | 8 #include "src/ast/compile-time-value.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 __ CallRuntime(Runtime::kNewScriptContext); | 183 __ CallRuntime(Runtime::kNewScriptContext); |
184 PrepareForBailoutForId(BailoutId::ScriptContext(), | 184 PrepareForBailoutForId(BailoutId::ScriptContext(), |
185 BailoutState::TOS_REGISTER); | 185 BailoutState::TOS_REGISTER); |
186 // The new target value is not used, clobbering is safe. | 186 // The new target value is not used, clobbering is safe. |
187 DCHECK_NULL(info->scope()->new_target_var()); | 187 DCHECK_NULL(info->scope()->new_target_var()); |
188 } else { | 188 } else { |
189 if (info->scope()->new_target_var() != nullptr) { | 189 if (info->scope()->new_target_var() != nullptr) { |
190 __ push(edx); // Preserve new target. | 190 __ push(edx); // Preserve new target. |
191 } | 191 } |
192 if (slots <= FastNewFunctionContextStub::kMaximumSlots) { | 192 if (slots <= FastNewFunctionContextStub::kMaximumSlots) { |
193 FastNewFunctionContextStub stub(isolate()); | 193 if (info->scope()->is_eval_scope()) { |
194 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), | 194 FastNewEvalContextStub stub(isolate()); |
195 Immediate(slots)); | 195 __ Set(FastNewEvalContextDescriptor::SlotsRegister(), slots); |
196 __ CallStub(&stub); | 196 __ CallStub(&stub); |
| 197 } else { |
| 198 FastNewFunctionContextStub stub(isolate()); |
| 199 __ Set(FastNewFunctionContextDescriptor::SlotsRegister(), slots); |
| 200 __ CallStub(&stub); |
| 201 } |
197 // Result of FastNewFunctionContextStub is always in new space. | 202 // Result of FastNewFunctionContextStub is always in new space. |
198 need_write_barrier = false; | 203 need_write_barrier = false; |
199 } else { | 204 } else { |
200 __ push(edi); | 205 __ Push(edi); |
201 __ CallRuntime(Runtime::kNewFunctionContext); | 206 __ CallRuntime(info->scope()->is_eval_scope() |
| 207 ? Runtime::kNewEvalContext |
| 208 : Runtime::kNewFunctionContext); |
202 } | 209 } |
203 if (info->scope()->new_target_var() != nullptr) { | 210 if (info->scope()->new_target_var() != nullptr) { |
204 __ pop(edx); // Restore new target. | 211 __ pop(edx); // Restore new target. |
205 } | 212 } |
206 } | 213 } |
207 function_in_register = false; | 214 function_in_register = false; |
208 // Context is returned in eax. It replaces the context passed to us. | 215 // Context is returned in eax. It replaces the context passed to us. |
209 // It's saved in the stack and kept live in esi. | 216 // It's saved in the stack and kept live in esi. |
210 __ mov(esi, eax); | 217 __ mov(esi, eax); |
211 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), eax); | 218 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), eax); |
(...skipping 3313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3525 isolate->builtins()->OnStackReplacement()->entry(), | 3532 isolate->builtins()->OnStackReplacement()->entry(), |
3526 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3533 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3527 return ON_STACK_REPLACEMENT; | 3534 return ON_STACK_REPLACEMENT; |
3528 } | 3535 } |
3529 | 3536 |
3530 | 3537 |
3531 } // namespace internal | 3538 } // namespace internal |
3532 } // namespace v8 | 3539 } // namespace v8 |
3533 | 3540 |
3534 #endif // V8_TARGET_ARCH_IA32 | 3541 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |