Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: src/full-codegen/x87/full-codegen-x87.cc

Issue 1474243002: X87: [compiler] Always pass closure argument to with, catch and block context creation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698