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

Side by Side Diff: src/full-codegen/ia32/full-codegen-ia32.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
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_IA32 7 #if V8_TARGET_ARCH_IA32
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 5171 matching lines...) Expand 10 before | Expand all | Expand 10 after
5182 __ mov(Operand(ebp, frame_offset), value); 5182 __ mov(Operand(ebp, frame_offset), value);
5183 } 5183 }
5184 5184
5185 5185
5186 void FullCodeGenerator::LoadContextField(Register dst, int context_index) { 5186 void FullCodeGenerator::LoadContextField(Register dst, int context_index) {
5187 __ mov(dst, ContextOperand(esi, context_index)); 5187 __ mov(dst, ContextOperand(esi, context_index));
5188 } 5188 }
5189 5189
5190 5190
5191 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { 5191 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() {
5192 Scope* declaration_scope = scope()->DeclarationScope(); 5192 Scope* closure_scope = scope()->ClosureScope();
5193 if (declaration_scope->is_script_scope() || 5193 if (closure_scope->is_script_scope() ||
5194 declaration_scope->is_module_scope()) { 5194 closure_scope->is_module_scope()) {
5195 // Contexts nested in the native context have a canonical empty function 5195 // Contexts nested in the native context have a canonical empty function
5196 // as their closure, not the anonymous closure containing the global 5196 // as their closure, not the anonymous closure containing the global
5197 // code. Pass a smi sentinel and let the runtime look up the empty 5197 // code. Pass a smi sentinel and let the runtime look up the empty
5198 // function. 5198 // function.
5199 __ push(Immediate(Smi::FromInt(0))); 5199 __ push(Immediate(Smi::FromInt(0)));
5200 } else if (declaration_scope->is_eval_scope()) { 5200 } else if (closure_scope->is_eval_scope()) {
5201 // Contexts nested inside eval code have the same closure as the context 5201 // Contexts nested inside eval code have the same closure as the context
5202 // calling eval, not the anonymous closure containing the eval code. 5202 // calling eval, not the anonymous closure containing the eval code.
5203 // Fetch it from the context. 5203 // Fetch it from the context.
5204 __ push(ContextOperand(esi, Context::CLOSURE_INDEX)); 5204 __ push(ContextOperand(esi, Context::CLOSURE_INDEX));
5205 } else { 5205 } else {
5206 DCHECK(declaration_scope->is_function_scope()); 5206 DCHECK(closure_scope->is_function_scope());
5207 __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); 5207 __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
5208 } 5208 }
5209 } 5209 }
5210 5210
5211 5211
5212 // ---------------------------------------------------------------------------- 5212 // ----------------------------------------------------------------------------
5213 // Non-local control flow support. 5213 // Non-local control flow support.
5214 5214
5215 void FullCodeGenerator::EnterFinallyBlock() { 5215 void FullCodeGenerator::EnterFinallyBlock() {
5216 // Cook return address on top of stack (smi encoded Code* delta) 5216 // Cook return address on top of stack (smi encoded Code* delta)
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
5347 Assembler::target_address_at(call_target_address, 5347 Assembler::target_address_at(call_target_address,
5348 unoptimized_code)); 5348 unoptimized_code));
5349 return OSR_AFTER_STACK_CHECK; 5349 return OSR_AFTER_STACK_CHECK;
5350 } 5350 }
5351 5351
5352 5352
5353 } // namespace internal 5353 } // namespace internal
5354 } // namespace v8 5354 } // namespace v8
5355 5355
5356 #endif // V8_TARGET_ARCH_IA32 5356 #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