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

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

Issue 7309002: Fix a bug in with and catch context allocation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/mips/full-codegen-mips.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4184 matching lines...) Expand 10 before | Expand all | Expand 10 after
4195 __ mov(Operand(ebp, frame_offset), value); 4195 __ mov(Operand(ebp, frame_offset), value);
4196 } 4196 }
4197 4197
4198 4198
4199 void FullCodeGenerator::LoadContextField(Register dst, int context_index) { 4199 void FullCodeGenerator::LoadContextField(Register dst, int context_index) {
4200 __ mov(dst, ContextOperand(esi, context_index)); 4200 __ mov(dst, ContextOperand(esi, context_index));
4201 } 4201 }
4202 4202
4203 4203
4204 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { 4204 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() {
4205 if (scope()->is_global_scope()) { 4205 Scope* declaration_scope = scope()->DeclarationScope();
4206 if (declaration_scope->is_global_scope()) {
4206 // Contexts nested in the global context have a canonical empty function 4207 // Contexts nested in the global context have a canonical empty function
4207 // as their closure, not the anonymous closure containing the global 4208 // as their closure, not the anonymous closure containing the global
4208 // code. Pass a smi sentinel and let the runtime look up the empty 4209 // code. Pass a smi sentinel and let the runtime look up the empty
4209 // function. 4210 // function.
4210 __ push(Immediate(Smi::FromInt(0))); 4211 __ push(Immediate(Smi::FromInt(0)));
4211 } else if (scope()->is_eval_scope()) { 4212 } else if (declaration_scope->is_eval_scope()) {
4212 // Contexts created by a call to eval have the same closure as the 4213 // Contexts nested inside eval code have the same closure as the context
4213 // context calling eval, not the anonymous closure containing the eval 4214 // calling eval, not the anonymous closure containing the eval code.
4214 // code. Fetch it from the context. 4215 // Fetch it from the context.
4215 __ push(ContextOperand(esi, Context::CLOSURE_INDEX)); 4216 __ push(ContextOperand(esi, Context::CLOSURE_INDEX));
4216 } else { 4217 } else {
4217 ASSERT(scope()->is_function_scope() || scope()->is_catch_scope()); 4218 ASSERT(declaration_scope->is_function_scope());
4218 __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); 4219 __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
4219 } 4220 }
4220 } 4221 }
4221 4222
4222 4223
4223 // ---------------------------------------------------------------------------- 4224 // ----------------------------------------------------------------------------
4224 // Non-local control flow support. 4225 // Non-local control flow support.
4225 4226
4226 void FullCodeGenerator::EnterFinallyBlock() { 4227 void FullCodeGenerator::EnterFinallyBlock() {
4227 // Cook return address on top of stack (smi encoded Code* delta) 4228 // Cook return address on top of stack (smi encoded Code* delta)
(...skipping 18 matching lines...) Expand all
4246 __ add(Operand(edx), Immediate(masm_->CodeObject())); 4247 __ add(Operand(edx), Immediate(masm_->CodeObject()));
4247 __ jmp(Operand(edx)); 4248 __ jmp(Operand(edx));
4248 } 4249 }
4249 4250
4250 4251
4251 #undef __ 4252 #undef __
4252 4253
4253 } } // namespace v8::internal 4254 } } // namespace v8::internal
4254 4255
4255 #endif // V8_TARGET_ARCH_IA32 4256 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698