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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 4692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4703 __ mov(dst, ContextOperand(esi, context_index)); | 4703 __ mov(dst, ContextOperand(esi, context_index)); |
4704 } | 4704 } |
4705 | 4705 |
4706 | 4706 |
4707 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { | 4707 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { |
4708 Scope* closure_scope = scope()->ClosureScope(); | 4708 Scope* closure_scope = scope()->ClosureScope(); |
4709 if (closure_scope->is_script_scope() || | 4709 if (closure_scope->is_script_scope() || |
4710 closure_scope->is_module_scope()) { | 4710 closure_scope->is_module_scope()) { |
4711 // Contexts nested in the native context have a canonical empty function | 4711 // Contexts nested in the native context have a canonical empty function |
4712 // as their closure, not the anonymous closure containing the global | 4712 // as their closure, not the anonymous closure containing the global |
4713 // code. Pass a smi sentinel and let the runtime look up the empty | 4713 // code. |
4714 // function. | 4714 __ mov(eax, GlobalObjectOperand()); |
4715 __ push(Immediate(Smi::FromInt(0))); | 4715 __ mov(eax, FieldOperand(eax, JSGlobalObject::kNativeContextOffset)); |
| 4716 __ push(ContextOperand(eax, Context::CLOSURE_INDEX)); |
4716 } else if (closure_scope->is_eval_scope()) { | 4717 } else if (closure_scope->is_eval_scope()) { |
4717 // Contexts nested inside eval code have the same closure as the context | 4718 // Contexts nested inside eval code have the same closure as the context |
4718 // calling eval, not the anonymous closure containing the eval code. | 4719 // calling eval, not the anonymous closure containing the eval code. |
4719 // Fetch it from the context. | 4720 // Fetch it from the context. |
4720 __ push(ContextOperand(esi, Context::CLOSURE_INDEX)); | 4721 __ push(ContextOperand(esi, Context::CLOSURE_INDEX)); |
4721 } else { | 4722 } else { |
4722 DCHECK(closure_scope->is_function_scope()); | 4723 DCHECK(closure_scope->is_function_scope()); |
4723 __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 4724 __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
4724 } | 4725 } |
4725 } | 4726 } |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4863 Assembler::target_address_at(call_target_address, | 4864 Assembler::target_address_at(call_target_address, |
4864 unoptimized_code)); | 4865 unoptimized_code)); |
4865 return OSR_AFTER_STACK_CHECK; | 4866 return OSR_AFTER_STACK_CHECK; |
4866 } | 4867 } |
4867 | 4868 |
4868 | 4869 |
4869 } // namespace internal | 4870 } // namespace internal |
4870 } // namespace v8 | 4871 } // namespace v8 |
4871 | 4872 |
4872 #endif // V8_TARGET_ARCH_X87 | 4873 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |