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 4474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 ExternalReference has_pending_message = | |
4504 ExternalReference::address_of_has_pending_message(isolate()); | |
4505 __ mov(edx, Operand::StaticVariable(has_pending_message)); | |
4506 __ push(edx); | |
4507 | |
4508 ExternalReference pending_message_script = | |
4509 ExternalReference::address_of_pending_message_script(isolate()); | |
4510 __ mov(edx, Operand::StaticVariable(pending_message_script)); | |
4511 __ push(edx); | |
4512 } | |
4513 | |
4514 | |
4515 void FullCodeGenerator::RestorePendingMessage() { | |
4516 ASSERT(!result_register().is(edx)); | |
4517 // Restore pending message. | |
4518 __ pop(edx); | |
4519 ExternalReference pending_message_script = | |
4520 ExternalReference::address_of_pending_message_script(isolate()); | |
4521 __ mov(Operand::StaticVariable(pending_message_script), edx); | |
4522 | |
4523 __ pop(edx); | |
4524 ExternalReference has_pending_message = | |
4525 ExternalReference::address_of_has_pending_message(isolate()); | |
4526 __ mov(Operand::StaticVariable(has_pending_message), edx); | |
4527 | |
4528 __ pop(edx); | |
4529 ExternalReference pending_message_obj = | |
4530 ExternalReference::address_of_pending_message_obj(isolate()); | |
4531 __ mov(Operand::StaticVariable(pending_message_obj), edx); | |
4532 } | |
4533 | |
4534 | |
4535 #undef __ | 4495 #undef __ |
4536 | 4496 |
4537 #define __ ACCESS_MASM(masm()) | 4497 #define __ ACCESS_MASM(masm()) |
4538 | 4498 |
4539 FullCodeGenerator::NestedStatement* FullCodeGenerator::TryFinally::Exit( | 4499 FullCodeGenerator::NestedStatement* FullCodeGenerator::TryFinally::Exit( |
4540 int* stack_depth, | 4500 int* stack_depth, |
4541 int* context_length) { | 4501 int* context_length) { |
4542 // The macros used here must preserve the result register. | 4502 // The macros used here must preserve the result register. |
4543 | 4503 |
4544 // Because the handler block contains the context of the finally | 4504 // Because the handler block contains the context of the finally |
(...skipping 13 matching lines...) Expand all Loading... |
4558 *context_length = 0; | 4518 *context_length = 0; |
4559 return previous_; | 4519 return previous_; |
4560 } | 4520 } |
4561 | 4521 |
4562 | 4522 |
4563 #undef __ | 4523 #undef __ |
4564 | 4524 |
4565 } } // namespace v8::internal | 4525 } } // namespace v8::internal |
4566 | 4526 |
4567 #endif // V8_TARGET_ARCH_IA32 | 4527 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |