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 4490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4501 // Restore result register from stack. | 4501 // Restore result register from stack. |
4502 __ pop(r1); | 4502 __ pop(r1); |
4503 // Uncook return address and return. | 4503 // Uncook return address and return. |
4504 __ pop(result_register()); | 4504 __ pop(result_register()); |
4505 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); | 4505 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); |
4506 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. | 4506 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. |
4507 __ add(pc, r1, Operand(masm_->CodeObject())); | 4507 __ add(pc, r1, Operand(masm_->CodeObject())); |
4508 } | 4508 } |
4509 | 4509 |
4510 | 4510 |
4511 void FullCodeGenerator::SavePendingMessage() { | |
4512 ASSERT(!result_register().is(r1)); | |
4513 // Store pending message while executing finally block upon exception. | |
4514 ExternalReference pending_message_obj = | |
4515 ExternalReference::address_of_pending_message_obj(isolate()); | |
4516 __ mov(ip, Operand(pending_message_obj)); | |
4517 __ ldr(r1, MemOperand(ip)); | |
4518 __ push(r1); | |
4519 | |
4520 ExternalReference has_pending_message = | |
4521 ExternalReference::address_of_has_pending_message(isolate()); | |
4522 __ mov(ip, Operand(has_pending_message)); | |
4523 __ ldr(r1, MemOperand(ip)); | |
4524 __ push(r1); | |
4525 | |
4526 ExternalReference pending_message_script = | |
4527 ExternalReference::address_of_pending_message_script(isolate()); | |
4528 __ mov(ip, Operand(pending_message_script)); | |
4529 __ ldr(r1, MemOperand(ip)); | |
4530 __ push(r1); | |
4531 } | |
4532 | |
4533 | |
4534 void FullCodeGenerator::RestorePendingMessage() { | |
4535 ASSERT(!result_register().is(r1)); | |
4536 // Restore pending message. | |
4537 __ pop(r1); | |
4538 ExternalReference pending_message_script = | |
4539 ExternalReference::address_of_pending_message_script(isolate()); | |
4540 __ mov(ip, Operand(pending_message_script)); | |
4541 __ str(r1, MemOperand(ip)); | |
4542 | |
4543 __ pop(r1); | |
4544 ExternalReference has_pending_message = | |
4545 ExternalReference::address_of_has_pending_message(isolate()); | |
4546 __ mov(ip, Operand(has_pending_message)); | |
4547 __ str(r1, MemOperand(ip)); | |
4548 | |
4549 __ pop(r1); | |
4550 ExternalReference pending_message_obj = | |
4551 ExternalReference::address_of_pending_message_obj(isolate()); | |
4552 __ mov(ip, Operand(pending_message_obj)); | |
4553 __ str(r1, MemOperand(ip)); | |
4554 } | |
4555 | |
4556 | |
4557 #undef __ | 4511 #undef __ |
4558 | 4512 |
4559 #define __ ACCESS_MASM(masm()) | 4513 #define __ ACCESS_MASM(masm()) |
4560 | 4514 |
4561 FullCodeGenerator::NestedStatement* FullCodeGenerator::TryFinally::Exit( | 4515 FullCodeGenerator::NestedStatement* FullCodeGenerator::TryFinally::Exit( |
4562 int* stack_depth, | 4516 int* stack_depth, |
4563 int* context_length) { | 4517 int* context_length) { |
4564 // The macros used here must preserve the result register. | 4518 // The macros used here must preserve the result register. |
4565 | 4519 |
4566 // Because the handler block contains the context of the finally | 4520 // Because the handler block contains the context of the finally |
(...skipping 13 matching lines...) Expand all Loading... |
4580 *context_length = 0; | 4534 *context_length = 0; |
4581 return previous_; | 4535 return previous_; |
4582 } | 4536 } |
4583 | 4537 |
4584 | 4538 |
4585 #undef __ | 4539 #undef __ |
4586 | 4540 |
4587 } } // namespace v8::internal | 4541 } } // namespace v8::internal |
4588 | 4542 |
4589 #endif // V8_TARGET_ARCH_ARM | 4543 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |