OLD | NEW |
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 4459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4470 __ pop(result_register()); | 4470 __ pop(result_register()); |
4471 // Uncook return address. | 4471 // Uncook return address. |
4472 __ pop(rdx); | 4472 __ pop(rdx); |
4473 __ SmiToInteger32(rdx, rdx); | 4473 __ SmiToInteger32(rdx, rdx); |
4474 __ Move(rcx, masm_->CodeObject()); | 4474 __ Move(rcx, masm_->CodeObject()); |
4475 __ addq(rdx, rcx); | 4475 __ addq(rdx, rcx); |
4476 __ jmp(rdx); | 4476 __ jmp(rdx); |
4477 } | 4477 } |
4478 | 4478 |
4479 | 4479 |
| 4480 void FullCodeGenerator::SavePendingMessage() { |
| 4481 ASSERT(!result_register().is(rdx)); |
| 4482 // Store pending message while executing finally block upon exception. |
| 4483 ExternalReference pending_message_obj = |
| 4484 ExternalReference::address_of_pending_message_obj(isolate()); |
| 4485 __ Load(rdx, pending_message_obj); |
| 4486 __ push(rdx); |
| 4487 } |
| 4488 |
| 4489 |
| 4490 void FullCodeGenerator::RestorePendingMessage() { |
| 4491 ASSERT(!result_register().is(rdx)); |
| 4492 // Restore pending message if cleared by executing the finally block. |
| 4493 __ pop(rdx); |
| 4494 ExternalReference pending_message_obj = |
| 4495 ExternalReference::address_of_pending_message_obj(isolate()); |
| 4496 __ Store(pending_message_obj, rdx); |
| 4497 } |
| 4498 |
| 4499 |
4480 #undef __ | 4500 #undef __ |
4481 | 4501 |
4482 #define __ ACCESS_MASM(masm()) | 4502 #define __ ACCESS_MASM(masm()) |
4483 | 4503 |
4484 FullCodeGenerator::NestedStatement* FullCodeGenerator::TryFinally::Exit( | 4504 FullCodeGenerator::NestedStatement* FullCodeGenerator::TryFinally::Exit( |
4485 int* stack_depth, | 4505 int* stack_depth, |
4486 int* context_length) { | 4506 int* context_length) { |
4487 // The macros used here must preserve the result register. | 4507 // The macros used here must preserve the result register. |
4488 | 4508 |
4489 // Because the handler block contains the context of the finally | 4509 // Because the handler block contains the context of the finally |
(...skipping 13 matching lines...) Expand all Loading... |
4503 *context_length = 0; | 4523 *context_length = 0; |
4504 return previous_; | 4524 return previous_; |
4505 } | 4525 } |
4506 | 4526 |
4507 | 4527 |
4508 #undef __ | 4528 #undef __ |
4509 | 4529 |
4510 } } // namespace v8::internal | 4530 } } // namespace v8::internal |
4511 | 4531 |
4512 #endif // V8_TARGET_ARCH_X64 | 4532 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |