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 4458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4469 | 4469 |
4470 void FullCodeGenerator::EnterFinallyBlock() { | 4470 void FullCodeGenerator::EnterFinallyBlock() { |
4471 // Cook return address on top of stack (smi encoded Code* delta) | 4471 // Cook return address on top of stack (smi encoded Code* delta) |
4472 ASSERT(!result_register().is(edx)); | 4472 ASSERT(!result_register().is(edx)); |
4473 __ pop(edx); | 4473 __ pop(edx); |
4474 __ sub(edx, Immediate(masm_->CodeObject())); | 4474 __ sub(edx, Immediate(masm_->CodeObject())); |
4475 STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 1); | 4475 STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 1); |
4476 STATIC_ASSERT(kSmiTag == 0); | 4476 STATIC_ASSERT(kSmiTag == 0); |
4477 __ SmiTag(edx); | 4477 __ SmiTag(edx); |
4478 __ push(edx); | 4478 __ push(edx); |
| 4479 |
4479 // Store result register while executing finally block. | 4480 // Store result register while executing finally block. |
4480 __ push(result_register()); | 4481 __ push(result_register()); |
| 4482 |
| 4483 // Store pending message while executing finally block. |
| 4484 ExternalReference pending_message_obj = |
| 4485 ExternalReference::address_of_pending_message_obj(isolate()); |
| 4486 __ mov(edx, Operand::StaticVariable(pending_message_obj)); |
| 4487 __ push(edx); |
| 4488 |
| 4489 ExternalReference has_pending_message = |
| 4490 ExternalReference::address_of_has_pending_message(isolate()); |
| 4491 __ mov(edx, Operand::StaticVariable(has_pending_message)); |
| 4492 __ push(edx); |
| 4493 |
| 4494 ExternalReference pending_message_script = |
| 4495 ExternalReference::address_of_pending_message_script(isolate()); |
| 4496 __ mov(edx, Operand::StaticVariable(pending_message_script)); |
| 4497 __ push(edx); |
4481 } | 4498 } |
4482 | 4499 |
4483 | 4500 |
4484 void FullCodeGenerator::ExitFinallyBlock() { | 4501 void FullCodeGenerator::ExitFinallyBlock() { |
4485 ASSERT(!result_register().is(edx)); | 4502 ASSERT(!result_register().is(edx)); |
| 4503 // Restore pending message from stack. |
| 4504 __ pop(edx); |
| 4505 ExternalReference pending_message_script = |
| 4506 ExternalReference::address_of_pending_message_script(isolate()); |
| 4507 __ mov(Operand::StaticVariable(pending_message_script), edx); |
| 4508 |
| 4509 __ pop(edx); |
| 4510 ExternalReference has_pending_message = |
| 4511 ExternalReference::address_of_has_pending_message(isolate()); |
| 4512 __ mov(Operand::StaticVariable(has_pending_message), edx); |
| 4513 |
| 4514 __ pop(edx); |
| 4515 ExternalReference pending_message_obj = |
| 4516 ExternalReference::address_of_pending_message_obj(isolate()); |
| 4517 __ mov(Operand::StaticVariable(pending_message_obj), edx); |
| 4518 |
| 4519 // Restore result register from stack. |
4486 __ pop(result_register()); | 4520 __ pop(result_register()); |
| 4521 |
4487 // Uncook return address. | 4522 // Uncook return address. |
4488 __ pop(edx); | 4523 __ pop(edx); |
4489 __ SmiUntag(edx); | 4524 __ SmiUntag(edx); |
4490 __ add(edx, Immediate(masm_->CodeObject())); | 4525 __ add(edx, Immediate(masm_->CodeObject())); |
4491 __ jmp(edx); | 4526 __ jmp(edx); |
4492 } | 4527 } |
4493 | 4528 |
4494 | 4529 |
4495 #undef __ | 4530 #undef __ |
4496 | 4531 |
(...skipping 21 matching lines...) Expand all Loading... |
4518 *context_length = 0; | 4553 *context_length = 0; |
4519 return previous_; | 4554 return previous_; |
4520 } | 4555 } |
4521 | 4556 |
4522 | 4557 |
4523 #undef __ | 4558 #undef __ |
4524 | 4559 |
4525 } } // namespace v8::internal | 4560 } } // namespace v8::internal |
4526 | 4561 |
4527 #endif // V8_TARGET_ARCH_IA32 | 4562 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |