| 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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 } | 559 } |
| 560 | 560 |
| 561 __ pushad(); | 561 __ pushad(); |
| 562 | 562 |
| 563 const int kSavedRegistersAreaSize = kNumberOfRegisters * kPointerSize + | 563 const int kSavedRegistersAreaSize = kNumberOfRegisters * kPointerSize + |
| 564 kDoubleRegsSize; | 564 kDoubleRegsSize; |
| 565 | 565 |
| 566 // Get the bailout id from the stack. | 566 // Get the bailout id from the stack. |
| 567 __ mov(ebx, Operand(esp, kSavedRegistersAreaSize)); | 567 __ mov(ebx, Operand(esp, kSavedRegistersAreaSize)); |
| 568 | 568 |
| 569 // Get the address of the location in the code object if possible | 569 // Get the address of the location in the code object |
| 570 // and compute the fp-to-sp delta in register edx. | 570 // and compute the fp-to-sp delta in register edx. |
| 571 if (type() == EAGER || type() == SOFT) { | 571 __ mov(ecx, Operand(esp, kSavedRegistersAreaSize + 1 * kPointerSize)); |
| 572 __ Set(ecx, Immediate(0)); | 572 __ lea(edx, Operand(esp, kSavedRegistersAreaSize + 2 * kPointerSize)); |
| 573 __ lea(edx, Operand(esp, kSavedRegistersAreaSize + 1 * kPointerSize)); | 573 |
| 574 } else { | |
| 575 __ mov(ecx, Operand(esp, kSavedRegistersAreaSize + 1 * kPointerSize)); | |
| 576 __ lea(edx, Operand(esp, kSavedRegistersAreaSize + 2 * kPointerSize)); | |
| 577 } | |
| 578 __ sub(edx, ebp); | 574 __ sub(edx, ebp); |
| 579 __ neg(edx); | 575 __ neg(edx); |
| 580 | 576 |
| 581 // Allocate a new deoptimizer object. | 577 // Allocate a new deoptimizer object. |
| 582 __ PrepareCallCFunction(6, eax); | 578 __ PrepareCallCFunction(6, eax); |
| 583 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 579 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
| 584 __ mov(Operand(esp, 0 * kPointerSize), eax); // Function. | 580 __ mov(Operand(esp, 0 * kPointerSize), eax); // Function. |
| 585 __ mov(Operand(esp, 1 * kPointerSize), Immediate(type())); // Bailout type. | 581 __ mov(Operand(esp, 1 * kPointerSize), Immediate(type())); // Bailout type. |
| 586 __ mov(Operand(esp, 2 * kPointerSize), ebx); // Bailout id. | 582 __ mov(Operand(esp, 2 * kPointerSize), ebx); // Bailout id. |
| 587 __ mov(Operand(esp, 3 * kPointerSize), ecx); // Code address or 0. | 583 __ mov(Operand(esp, 3 * kPointerSize), ecx); // Code address or 0. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 613 __ movdbl(xmm0, Operand(esp, src_offset)); | 609 __ movdbl(xmm0, Operand(esp, src_offset)); |
| 614 __ movdbl(Operand(ebx, dst_offset), xmm0); | 610 __ movdbl(Operand(ebx, dst_offset), xmm0); |
| 615 } | 611 } |
| 616 } | 612 } |
| 617 | 613 |
| 618 // Clear FPU all exceptions. | 614 // Clear FPU all exceptions. |
| 619 // TODO(ulan): Find out why the TOP register is not zero here in some cases, | 615 // TODO(ulan): Find out why the TOP register is not zero here in some cases, |
| 620 // and check that the generated code never deoptimizes with unbalanced stack. | 616 // and check that the generated code never deoptimizes with unbalanced stack. |
| 621 __ fnclex(); | 617 __ fnclex(); |
| 622 | 618 |
| 623 // Remove the bailout id and the double registers from the stack. | 619 // Remove the bailout id, return address and the double registers. |
| 624 if (type() == EAGER || type() == SOFT) { | 620 __ add(esp, Immediate(kDoubleRegsSize + 2 * kPointerSize)); |
| 625 __ add(esp, Immediate(kDoubleRegsSize + kPointerSize)); | |
| 626 } else { | |
| 627 __ add(esp, Immediate(kDoubleRegsSize + 2 * kPointerSize)); | |
| 628 } | |
| 629 | 621 |
| 630 // Compute a pointer to the unwinding limit in register ecx; that is | 622 // Compute a pointer to the unwinding limit in register ecx; that is |
| 631 // the first stack slot not part of the input frame. | 623 // the first stack slot not part of the input frame. |
| 632 __ mov(ecx, Operand(ebx, FrameDescription::frame_size_offset())); | 624 __ mov(ecx, Operand(ebx, FrameDescription::frame_size_offset())); |
| 633 __ add(ecx, esp); | 625 __ add(ecx, esp); |
| 634 | 626 |
| 635 // Unwind the stack down to - but not including - the unwinding | 627 // Unwind the stack down to - but not including - the unwinding |
| 636 // limit and copy the contents of the activation frame to the input | 628 // limit and copy the contents of the activation frame to the input |
| 637 // frame description. | 629 // frame description. |
| 638 __ lea(edx, Operand(ebx, FrameDescription::frame_content_offset())); | 630 __ lea(edx, Operand(ebx, FrameDescription::frame_content_offset())); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 } | 740 } |
| 749 __ bind(&done); | 741 __ bind(&done); |
| 750 } | 742 } |
| 751 | 743 |
| 752 #undef __ | 744 #undef __ |
| 753 | 745 |
| 754 | 746 |
| 755 } } // namespace v8::internal | 747 } } // namespace v8::internal |
| 756 | 748 |
| 757 #endif // V8_TARGET_ARCH_IA32 | 749 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |