| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 // Allocate a new deoptimizer object. | 636 // Allocate a new deoptimizer object. |
| 637 __ PrepareCallCFunction(5); | 637 __ PrepareCallCFunction(5); |
| 638 __ movq(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 638 __ movq(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
| 639 __ movq(arg1, rax); | 639 __ movq(arg1, rax); |
| 640 __ movq(arg2, Immediate(type())); | 640 __ movq(arg2, Immediate(type())); |
| 641 // Args 3 and 4 are already in the right registers. | 641 // Args 3 and 4 are already in the right registers. |
| 642 | 642 |
| 643 // On windows put the argument on the stack (PrepareCallCFunction have | 643 // On windows put the argument on the stack (PrepareCallCFunction have |
| 644 // created space for this). On linux pass the argument in r8. | 644 // created space for this). On linux pass the argument in r8. |
| 645 #ifdef _WIN64 | 645 #ifdef _WIN64 |
| 646 __ movq(Operand(rsp, 0 * kPointerSize), arg5); | 646 __ movq(Operand(rsp, 4 * kPointerSize), arg5); |
| 647 #else | 647 #else |
| 648 __ movq(r8, arg5); | 648 __ movq(r8, arg5); |
| 649 #endif | 649 #endif |
| 650 | 650 |
| 651 __ CallCFunction(ExternalReference::new_deoptimizer_function(), 5); | 651 __ CallCFunction(ExternalReference::new_deoptimizer_function(), 5); |
| 652 // Preserve deoptimizer object in register rax and get the input | 652 // Preserve deoptimizer object in register rax and get the input |
| 653 // frame descriptor pointer. | 653 // frame descriptor pointer. |
| 654 __ movq(rbx, Operand(rax, Deoptimizer::input_offset())); | 654 __ movq(rbx, Operand(rax, Deoptimizer::input_offset())); |
| 655 | 655 |
| 656 // Fill in the input registers. | 656 // Fill in the input registers. |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 // and overwrite this afterwards. | 745 // and overwrite this afterwards. |
| 746 if (r.is(rsp)) { | 746 if (r.is(rsp)) { |
| 747 ASSERT(i > 0); | 747 ASSERT(i > 0); |
| 748 r = Register::toRegister(i - 1); | 748 r = Register::toRegister(i - 1); |
| 749 } | 749 } |
| 750 __ pop(r); | 750 __ pop(r); |
| 751 } | 751 } |
| 752 | 752 |
| 753 // Set up the roots register. | 753 // Set up the roots register. |
| 754 ExternalReference roots_address = ExternalReference::roots_address(); | 754 ExternalReference roots_address = ExternalReference::roots_address(); |
| 755 __ movq(r13, roots_address); | 755 __ InitializeRootRegister(); |
| 756 | 756 __ InitializeSmiConstantRegister(); |
| 757 __ movq(kSmiConstantRegister, | |
| 758 reinterpret_cast<uint64_t>(Smi::FromInt(kSmiConstantRegisterValue)), | |
| 759 RelocInfo::NONE); | |
| 760 | 757 |
| 761 // Return to the continuation point. | 758 // Return to the continuation point. |
| 762 __ ret(0); | 759 __ ret(0); |
| 763 } | 760 } |
| 764 | 761 |
| 765 | 762 |
| 766 void Deoptimizer::TableEntryGenerator::GeneratePrologue() { | 763 void Deoptimizer::TableEntryGenerator::GeneratePrologue() { |
| 767 // Create a sequence of deoptimization entries. | 764 // Create a sequence of deoptimization entries. |
| 768 Label done; | 765 Label done; |
| 769 for (int i = 0; i < count(); i++) { | 766 for (int i = 0; i < count(); i++) { |
| 770 int start = masm()->pc_offset(); | 767 int start = masm()->pc_offset(); |
| 771 USE(start); | 768 USE(start); |
| 772 __ push_imm32(i); | 769 __ push_imm32(i); |
| 773 __ jmp(&done); | 770 __ jmp(&done); |
| 774 ASSERT(masm()->pc_offset() - start == table_entry_size_); | 771 ASSERT(masm()->pc_offset() - start == table_entry_size_); |
| 775 } | 772 } |
| 776 __ bind(&done); | 773 __ bind(&done); |
| 777 } | 774 } |
| 778 | 775 |
| 779 #undef __ | 776 #undef __ |
| 780 | 777 |
| 781 | 778 |
| 782 } } // namespace v8::internal | 779 } } // namespace v8::internal |
| 783 | 780 |
| 784 #endif // V8_TARGET_ARCH_X64 | 781 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |