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

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

Issue 1475383002: [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: Remove WithExpression from messages.h 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 | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/messages.h » ('j') | 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_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/debug/debug.h" 10 #include "src/debug/debug.h"
(...skipping 4713 matching lines...) Expand 10 before | Expand all | Expand 10 after
4724 __ movp(dst, ContextOperand(rsi, context_index)); 4724 __ movp(dst, ContextOperand(rsi, context_index));
4725 } 4725 }
4726 4726
4727 4727
4728 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { 4728 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() {
4729 Scope* closure_scope = scope()->ClosureScope(); 4729 Scope* closure_scope = scope()->ClosureScope();
4730 if (closure_scope->is_script_scope() || 4730 if (closure_scope->is_script_scope() ||
4731 closure_scope->is_module_scope()) { 4731 closure_scope->is_module_scope()) {
4732 // Contexts nested in the native context have a canonical empty function 4732 // Contexts nested in the native context have a canonical empty function
4733 // as their closure, not the anonymous closure containing the global 4733 // as their closure, not the anonymous closure containing the global
4734 // code. Pass a smi sentinel and let the runtime look up the empty 4734 // code.
4735 // function. 4735 __ movp(rax, GlobalObjectOperand());
4736 __ Push(Smi::FromInt(0)); 4736 __ movp(rax, FieldOperand(rax, JSGlobalObject::kNativeContextOffset));
4737 __ Push(ContextOperand(rax, Context::CLOSURE_INDEX));
4737 } else if (closure_scope->is_eval_scope()) { 4738 } else if (closure_scope->is_eval_scope()) {
4738 // Contexts created by a call to eval have the same closure as the 4739 // Contexts created by a call to eval have the same closure as the
4739 // context calling eval, not the anonymous closure containing the eval 4740 // context calling eval, not the anonymous closure containing the eval
4740 // code. Fetch it from the context. 4741 // code. Fetch it from the context.
4741 __ Push(ContextOperand(rsi, Context::CLOSURE_INDEX)); 4742 __ Push(ContextOperand(rsi, Context::CLOSURE_INDEX));
4742 } else { 4743 } else {
4743 DCHECK(closure_scope->is_function_scope()); 4744 DCHECK(closure_scope->is_function_scope());
4744 __ Push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); 4745 __ Push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
4745 } 4746 }
4746 } 4747 }
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
4886 Assembler::target_address_at(call_target_address, 4887 Assembler::target_address_at(call_target_address,
4887 unoptimized_code)); 4888 unoptimized_code));
4888 return OSR_AFTER_STACK_CHECK; 4889 return OSR_AFTER_STACK_CHECK;
4889 } 4890 }
4890 4891
4891 4892
4892 } // namespace internal 4893 } // namespace internal
4893 } // namespace v8 4894 } // namespace v8
4894 4895
4895 #endif // V8_TARGET_ARCH_X64 4896 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698