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

Side by Side Diff: src/mips/full-codegen-mips.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/ia32/full-codegen-ia32.cc ('k') | src/parser.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 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 4208 matching lines...) Expand 10 before | Expand all | Expand 10 after
4219 __ sw(value, MemOperand(fp, frame_offset)); 4219 __ sw(value, MemOperand(fp, frame_offset));
4220 } 4220 }
4221 4221
4222 4222
4223 void FullCodeGenerator::LoadContextField(Register dst, int context_index) { 4223 void FullCodeGenerator::LoadContextField(Register dst, int context_index) {
4224 __ lw(dst, ContextOperand(cp, context_index)); 4224 __ lw(dst, ContextOperand(cp, context_index));
4225 } 4225 }
4226 4226
4227 4227
4228 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { 4228 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() {
4229 if (scope()->is_global_scope()) { 4229 Scope* declaration_scope = scope()->DeclarationScope();
4230 if (declaration_scope->is_global_scope()) {
4230 // Contexts nested in the global context have a canonical empty function 4231 // Contexts nested in the global context have a canonical empty function
4231 // as their closure, not the anonymous closure containing the global 4232 // as their closure, not the anonymous closure containing the global
4232 // code. Pass a smi sentinel and let the runtime look up the empty 4233 // code. Pass a smi sentinel and let the runtime look up the empty
4233 // function. 4234 // function.
4234 __ li(at, Operand(Smi::FromInt(0))); 4235 __ li(at, Operand(Smi::FromInt(0)));
4235 } else if (scope()->is_eval_scope()) { 4236 } else if (declaration_scope->is_eval_scope()) {
4236 // Contexts created by a call to eval have the same closure as the 4237 // Contexts created by a call to eval have the same closure as the
4237 // context calling eval, not the anonymous closure containing the eval 4238 // context calling eval, not the anonymous closure containing the eval
4238 // code. Fetch it from the context. 4239 // code. Fetch it from the context.
4239 __ lw(at, ContextOperand(cp, Context::CLOSURE_INDEX)); 4240 __ lw(at, ContextOperand(cp, Context::CLOSURE_INDEX));
4240 } else { 4241 } else {
4241 ASSERT(scope()->is_function_scope()); 4242 ASSERT(declaration_scope->is_function_scope());
4242 __ lw(at, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 4243 __ lw(at, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
4243 } 4244 }
4244 __ push(at); 4245 __ push(at);
4245 } 4246 }
4246 4247
4247 4248
4248 // ---------------------------------------------------------------------------- 4249 // ----------------------------------------------------------------------------
4249 // Non-local control flow support. 4250 // Non-local control flow support.
4250 4251
4251 void FullCodeGenerator::EnterFinallyBlock() { 4252 void FullCodeGenerator::EnterFinallyBlock() {
(...skipping 20 matching lines...) Expand all
4272 __ Addu(at, a1, Operand(masm_->CodeObject())); 4273 __ Addu(at, a1, Operand(masm_->CodeObject()));
4273 __ Jump(at); 4274 __ Jump(at);
4274 } 4275 }
4275 4276
4276 4277
4277 #undef __ 4278 #undef __
4278 4279
4279 } } // namespace v8::internal 4280 } } // namespace v8::internal
4280 4281
4281 #endif // V8_TARGET_ARCH_MIPS 4282 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698