Index: src/x64/full-codegen-x64.cc |
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc |
index e35fb796a1dd47b9c5ca344874a8c1ca01ded194..a3e42eb50595b98292b299bcb65cb3568728953a 100644 |
--- a/src/x64/full-codegen-x64.cc |
+++ b/src/x64/full-codegen-x64.cc |
@@ -4460,15 +4460,50 @@ void FullCodeGenerator::EnterFinallyBlock() { |
__ subq(rdx, rcx); |
__ Integer32ToSmi(rdx, rdx); |
__ push(rdx); |
+ |
// Store result register while executing finally block. |
__ push(result_register()); |
+ |
+ // Store pending message while executing finally block. |
+ ExternalReference pending_message_obj = |
+ ExternalReference::address_of_pending_message_obj(isolate()); |
+ __ Load(rdx, pending_message_obj); |
+ __ push(rdx); |
+ |
+ ExternalReference has_pending_message = |
+ ExternalReference::address_of_has_pending_message(isolate()); |
+ __ Load(rdx, has_pending_message); |
+ __ push(rdx); |
+ |
+ ExternalReference pending_message_script = |
+ ExternalReference::address_of_pending_message_script(isolate()); |
+ __ Load(rdx, pending_message_script); |
+ __ push(rdx); |
} |
void FullCodeGenerator::ExitFinallyBlock() { |
ASSERT(!result_register().is(rdx)); |
ASSERT(!result_register().is(rcx)); |
+ // Restore pending message from stack. |
+ __ pop(rdx); |
+ ExternalReference pending_message_script = |
+ ExternalReference::address_of_pending_message_script(isolate()); |
+ __ Store(pending_message_script, rdx); |
+ |
+ __ pop(rdx); |
+ ExternalReference has_pending_message = |
+ ExternalReference::address_of_has_pending_message(isolate()); |
+ __ Store(has_pending_message, rdx); |
+ |
+ __ pop(rdx); |
+ ExternalReference pending_message_obj = |
+ ExternalReference::address_of_pending_message_obj(isolate()); |
+ __ Store(pending_message_obj, rdx); |
+ |
+ // Restore result register from stack. |
__ pop(result_register()); |
+ |
// Uncook return address. |
__ pop(rdx); |
__ SmiToInteger32(rdx, rdx); |