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

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

Issue 1250423002: Find right scope associated with prologue (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 months 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/ppc/full-codegen-ppc.cc ('k') | src/full-codegen/x87/full-codegen-x87.cc » ('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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 5188 matching lines...) Expand 10 before | Expand all | Expand 10 after
5199 __ movp(Operand(rbp, frame_offset), value); 5199 __ movp(Operand(rbp, frame_offset), value);
5200 } 5200 }
5201 5201
5202 5202
5203 void FullCodeGenerator::LoadContextField(Register dst, int context_index) { 5203 void FullCodeGenerator::LoadContextField(Register dst, int context_index) {
5204 __ movp(dst, ContextOperand(rsi, context_index)); 5204 __ movp(dst, ContextOperand(rsi, context_index));
5205 } 5205 }
5206 5206
5207 5207
5208 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { 5208 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() {
5209 Scope* declaration_scope = scope()->DeclarationScope(); 5209 Scope* closure_scope = scope()->ClosureScope();
5210 if (declaration_scope->is_script_scope() || 5210 if (closure_scope->is_script_scope() ||
5211 declaration_scope->is_module_scope()) { 5211 closure_scope->is_module_scope()) {
5212 // Contexts nested in the native context have a canonical empty function 5212 // Contexts nested in the native context have a canonical empty function
5213 // as their closure, not the anonymous closure containing the global 5213 // as their closure, not the anonymous closure containing the global
5214 // code. Pass a smi sentinel and let the runtime look up the empty 5214 // code. Pass a smi sentinel and let the runtime look up the empty
5215 // function. 5215 // function.
5216 __ Push(Smi::FromInt(0)); 5216 __ Push(Smi::FromInt(0));
5217 } else if (declaration_scope->is_eval_scope()) { 5217 } else if (closure_scope->is_eval_scope()) {
5218 // Contexts created by a call to eval have the same closure as the 5218 // Contexts created by a call to eval have the same closure as the
5219 // context calling eval, not the anonymous closure containing the eval 5219 // context calling eval, not the anonymous closure containing the eval
5220 // code. Fetch it from the context. 5220 // code. Fetch it from the context.
5221 __ Push(ContextOperand(rsi, Context::CLOSURE_INDEX)); 5221 __ Push(ContextOperand(rsi, Context::CLOSURE_INDEX));
5222 } else { 5222 } else {
5223 DCHECK(declaration_scope->is_function_scope()); 5223 DCHECK(closure_scope->is_function_scope());
5224 __ Push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); 5224 __ Push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
5225 } 5225 }
5226 } 5226 }
5227 5227
5228 5228
5229 // ---------------------------------------------------------------------------- 5229 // ----------------------------------------------------------------------------
5230 // Non-local control flow support. 5230 // Non-local control flow support.
5231 5231
5232 5232
5233 void FullCodeGenerator::EnterFinallyBlock() { 5233 void FullCodeGenerator::EnterFinallyBlock() {
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
5366 Assembler::target_address_at(call_target_address, 5366 Assembler::target_address_at(call_target_address,
5367 unoptimized_code)); 5367 unoptimized_code));
5368 return OSR_AFTER_STACK_CHECK; 5368 return OSR_AFTER_STACK_CHECK;
5369 } 5369 }
5370 5370
5371 5371
5372 } // namespace internal 5372 } // namespace internal
5373 } // namespace v8 5373 } // namespace v8
5374 5374
5375 #endif // V8_TARGET_ARCH_X64 5375 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/full-codegen/ppc/full-codegen-ppc.cc ('k') | src/full-codegen/x87/full-codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698