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 4442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4453 | 4453 |
4454 void FullCodeGenerator::EnterFinallyBlock() { | 4454 void FullCodeGenerator::EnterFinallyBlock() { |
4455 ASSERT(!result_register().is(rdx)); | 4455 ASSERT(!result_register().is(rdx)); |
4456 ASSERT(!result_register().is(rcx)); | 4456 ASSERT(!result_register().is(rcx)); |
4457 // Cook return address on top of stack (smi encoded Code* delta) | 4457 // Cook return address on top of stack (smi encoded Code* delta) |
4458 __ pop(rdx); | 4458 __ pop(rdx); |
4459 __ Move(rcx, masm_->CodeObject()); | 4459 __ Move(rcx, masm_->CodeObject()); |
4460 __ subq(rdx, rcx); | 4460 __ subq(rdx, rcx); |
4461 __ Integer32ToSmi(rdx, rdx); | 4461 __ Integer32ToSmi(rdx, rdx); |
4462 __ push(rdx); | 4462 __ push(rdx); |
| 4463 |
4463 // Store result register while executing finally block. | 4464 // Store result register while executing finally block. |
4464 __ push(result_register()); | 4465 __ push(result_register()); |
| 4466 |
| 4467 // Store pending message while executing finally block. |
| 4468 ExternalReference pending_message_obj = |
| 4469 ExternalReference::address_of_pending_message_obj(isolate()); |
| 4470 __ Load(rdx, pending_message_obj); |
| 4471 __ push(rdx); |
| 4472 |
| 4473 ExternalReference has_pending_message = |
| 4474 ExternalReference::address_of_has_pending_message(isolate()); |
| 4475 __ Load(rdx, has_pending_message); |
| 4476 __ push(rdx); |
| 4477 |
| 4478 ExternalReference pending_message_script = |
| 4479 ExternalReference::address_of_pending_message_script(isolate()); |
| 4480 __ Load(rdx, pending_message_script); |
| 4481 __ push(rdx); |
4465 } | 4482 } |
4466 | 4483 |
4467 | 4484 |
4468 void FullCodeGenerator::ExitFinallyBlock() { | 4485 void FullCodeGenerator::ExitFinallyBlock() { |
4469 ASSERT(!result_register().is(rdx)); | 4486 ASSERT(!result_register().is(rdx)); |
4470 ASSERT(!result_register().is(rcx)); | 4487 ASSERT(!result_register().is(rcx)); |
| 4488 // Restore pending message from stack. |
| 4489 __ pop(rdx); |
| 4490 ExternalReference pending_message_script = |
| 4491 ExternalReference::address_of_pending_message_script(isolate()); |
| 4492 __ Store(pending_message_script, rdx); |
| 4493 |
| 4494 __ pop(rdx); |
| 4495 ExternalReference has_pending_message = |
| 4496 ExternalReference::address_of_has_pending_message(isolate()); |
| 4497 __ Store(has_pending_message, rdx); |
| 4498 |
| 4499 __ pop(rdx); |
| 4500 ExternalReference pending_message_obj = |
| 4501 ExternalReference::address_of_pending_message_obj(isolate()); |
| 4502 __ Store(pending_message_obj, rdx); |
| 4503 |
| 4504 // Restore result register from stack. |
4471 __ pop(result_register()); | 4505 __ pop(result_register()); |
| 4506 |
4472 // Uncook return address. | 4507 // Uncook return address. |
4473 __ pop(rdx); | 4508 __ pop(rdx); |
4474 __ SmiToInteger32(rdx, rdx); | 4509 __ SmiToInteger32(rdx, rdx); |
4475 __ Move(rcx, masm_->CodeObject()); | 4510 __ Move(rcx, masm_->CodeObject()); |
4476 __ addq(rdx, rcx); | 4511 __ addq(rdx, rcx); |
4477 __ jmp(rdx); | 4512 __ jmp(rdx); |
4478 } | 4513 } |
4479 | 4514 |
4480 | 4515 |
4481 #undef __ | 4516 #undef __ |
(...skipping 22 matching lines...) Expand all Loading... |
4504 *context_length = 0; | 4539 *context_length = 0; |
4505 return previous_; | 4540 return previous_; |
4506 } | 4541 } |
4507 | 4542 |
4508 | 4543 |
4509 #undef __ | 4544 #undef __ |
4510 | 4545 |
4511 } } // namespace v8::internal | 4546 } } // namespace v8::internal |
4512 | 4547 |
4513 #endif // V8_TARGET_ARCH_X64 | 4548 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |