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

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

Issue 7837023: Fix a bug in abrupt exit from with or catch inside finally. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Removed platform-specific code from platform-independent files. Created 9 years, 3 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/ia32/full-codegen-ia32.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 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 Comment cmnt(masm_, "[ Throw"); 1347 Comment cmnt(masm_, "[ Throw");
1348 // Throw has no effect on the stack height or the current expression context. 1348 // Throw has no effect on the stack height or the current expression context.
1349 // Usually the expression context is null, because throw is a statement. 1349 // Usually the expression context is null, because throw is a statement.
1350 VisitForStackValue(expr->exception()); 1350 VisitForStackValue(expr->exception());
1351 __ CallRuntime(Runtime::kThrow, 1); 1351 __ CallRuntime(Runtime::kThrow, 1);
1352 decrement_stack_height(); 1352 decrement_stack_height();
1353 // Never returns here. 1353 // Never returns here.
1354 } 1354 }
1355 1355
1356 1356
1357 FullCodeGenerator::NestedStatement* FullCodeGenerator::TryFinally::Exit(
1358 int* stack_depth,
1359 int* context_length) {
1360 // The macros used here must preserve the result register.
1361 __ Drop(*stack_depth);
1362 __ PopTryHandler();
1363 *stack_depth = 0;
1364
1365 Register context = FullCodeGenerator::context_register();
1366 while (*context_length > 0) {
1367 codegen_->LoadContextField(context, Context::PREVIOUS_INDEX);
1368 --(*context_length);
1369 }
1370
1371 __ Call(finally_entry_);
1372 return previous_;
1373 }
1374
1375
1376 FullCodeGenerator::NestedStatement* FullCodeGenerator::TryCatch::Exit( 1357 FullCodeGenerator::NestedStatement* FullCodeGenerator::TryCatch::Exit(
1377 int* stack_depth, 1358 int* stack_depth,
1378 int* context_length) { 1359 int* context_length) {
1379 // The macros used here must preserve the result register. 1360 // The macros used here must preserve the result register.
1380 __ Drop(*stack_depth); 1361 __ Drop(*stack_depth);
1381 __ PopTryHandler(); 1362 __ PopTryHandler();
1382 *stack_depth = 0; 1363 *stack_depth = 0;
1383 return previous_; 1364 return previous_;
1384 } 1365 }
1385 1366
(...skipping 15 matching lines...) Expand all
1401 } 1382 }
1402 1383
1403 return false; 1384 return false;
1404 } 1385 }
1405 1386
1406 1387
1407 #undef __ 1388 #undef __
1408 1389
1409 1390
1410 } } // namespace v8::internal 1391 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698