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

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

Issue 10537078: Preserve error message during finally block in try..finally. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 6 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/full-codegen.cc ('k') | src/isolate.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 4474 matching lines...) Expand 10 before | Expand all | Expand 10 after
4485 ASSERT(!result_register().is(edx)); 4485 ASSERT(!result_register().is(edx));
4486 __ pop(result_register()); 4486 __ pop(result_register());
4487 // Uncook return address. 4487 // Uncook return address.
4488 __ pop(edx); 4488 __ pop(edx);
4489 __ SmiUntag(edx); 4489 __ SmiUntag(edx);
4490 __ add(edx, Immediate(masm_->CodeObject())); 4490 __ add(edx, Immediate(masm_->CodeObject()));
4491 __ jmp(edx); 4491 __ jmp(edx);
4492 } 4492 }
4493 4493
4494 4494
4495 void FullCodeGenerator::SavePendingMessage() {
4496 ASSERT(!result_register().is(edx));
4497 // Store pending message while executing finally block upon exception.
4498 ExternalReference pending_message_obj =
4499 ExternalReference::address_of_pending_message_obj(isolate());
4500 __ mov(edx, Operand::StaticVariable(pending_message_obj));
4501 __ push(edx);
4502 }
4503
4504
4505 void FullCodeGenerator::RestorePendingMessage() {
4506 ASSERT(!result_register().is(edx));
4507 // Restore pending message if cleared by executing the finally block.
4508 __ pop(edx);
4509 ExternalReference pending_message_obj =
4510 ExternalReference::address_of_pending_message_obj(isolate());
4511 __ mov(Operand::StaticVariable(pending_message_obj), edx);
4512 }
4513
4514
4495 #undef __ 4515 #undef __
4496 4516
4497 #define __ ACCESS_MASM(masm()) 4517 #define __ ACCESS_MASM(masm())
4498 4518
4499 FullCodeGenerator::NestedStatement* FullCodeGenerator::TryFinally::Exit( 4519 FullCodeGenerator::NestedStatement* FullCodeGenerator::TryFinally::Exit(
4500 int* stack_depth, 4520 int* stack_depth,
4501 int* context_length) { 4521 int* context_length) {
4502 // The macros used here must preserve the result register. 4522 // The macros used here must preserve the result register.
4503 4523
4504 // Because the handler block contains the context of the finally 4524 // Because the handler block contains the context of the finally
(...skipping 13 matching lines...) Expand all
4518 *context_length = 0; 4538 *context_length = 0;
4519 return previous_; 4539 return previous_;
4520 } 4540 }
4521 4541
4522 4542
4523 #undef __ 4543 #undef __
4524 4544
4525 } } // namespace v8::internal 4545 } } // namespace v8::internal
4526 4546
4527 #endif // V8_TARGET_ARCH_IA32 4547 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/full-codegen.cc ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698