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

Side by Side Diff: src/full-codegen/ia32/full-codegen-ia32.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
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_IA32 5 #if V8_TARGET_ARCH_IA32
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 4700 matching lines...) Expand 10 before | Expand all | Expand 10 after
4711 __ mov(dst, ContextOperand(esi, context_index)); 4711 __ mov(dst, ContextOperand(esi, context_index));
4712 } 4712 }
4713 4713
4714 4714
4715 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { 4715 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() {
4716 Scope* closure_scope = scope()->ClosureScope(); 4716 Scope* closure_scope = scope()->ClosureScope();
4717 if (closure_scope->is_script_scope() || 4717 if (closure_scope->is_script_scope() ||
4718 closure_scope->is_module_scope()) { 4718 closure_scope->is_module_scope()) {
4719 // Contexts nested in the native context have a canonical empty function 4719 // Contexts nested in the native context have a canonical empty function
4720 // as their closure, not the anonymous closure containing the global 4720 // as their closure, not the anonymous closure containing the global
4721 // code. Pass a smi sentinel and let the runtime look up the empty 4721 // code.
4722 // function. 4722 __ mov(eax, GlobalObjectOperand());
4723 __ push(Immediate(Smi::FromInt(0))); 4723 __ mov(eax, FieldOperand(eax, JSGlobalObject::kNativeContextOffset));
4724 __ push(ContextOperand(eax, Context::CLOSURE_INDEX));
4724 } else if (closure_scope->is_eval_scope()) { 4725 } else if (closure_scope->is_eval_scope()) {
4725 // Contexts nested inside eval code have the same closure as the context 4726 // Contexts nested inside eval code have the same closure as the context
4726 // calling eval, not the anonymous closure containing the eval code. 4727 // calling eval, not the anonymous closure containing the eval code.
4727 // Fetch it from the context. 4728 // Fetch it from the context.
4728 __ push(ContextOperand(esi, Context::CLOSURE_INDEX)); 4729 __ push(ContextOperand(esi, Context::CLOSURE_INDEX));
4729 } else { 4730 } else {
4730 DCHECK(closure_scope->is_function_scope()); 4731 DCHECK(closure_scope->is_function_scope());
4731 __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); 4732 __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
4732 } 4733 }
4733 } 4734 }
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
4871 Assembler::target_address_at(call_target_address, 4872 Assembler::target_address_at(call_target_address,
4872 unoptimized_code)); 4873 unoptimized_code));
4873 return OSR_AFTER_STACK_CHECK; 4874 return OSR_AFTER_STACK_CHECK;
4874 } 4875 }
4875 4876
4876 4877
4877 } // namespace internal 4878 } // namespace internal
4878 } // namespace v8 4879 } // namespace v8
4879 4880
4880 #endif // V8_TARGET_ARCH_IA32 4881 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/full-codegen/arm64/full-codegen-arm64.cc ('k') | src/full-codegen/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698