| 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 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1652 __ CallRuntime(Runtime::kCompileForOnStackReplacement, 1); | 1652 __ CallRuntime(Runtime::kCompileForOnStackReplacement, 1); |
| 1653 } | 1653 } |
| 1654 | 1654 |
| 1655 // If the result was -1 it means that we couldn't optimize the | 1655 // If the result was -1 it means that we couldn't optimize the |
| 1656 // function. Just return and continue in the unoptimized version. | 1656 // function. Just return and continue in the unoptimized version. |
| 1657 Label skip; | 1657 Label skip; |
| 1658 __ cmp(eax, Immediate(Smi::FromInt(-1))); | 1658 __ cmp(eax, Immediate(Smi::FromInt(-1))); |
| 1659 __ j(not_equal, &skip, Label::kNear); | 1659 __ j(not_equal, &skip, Label::kNear); |
| 1660 __ ret(0); | 1660 __ ret(0); |
| 1661 | 1661 |
| 1662 // If we decide not to perform on-stack replacement we perform a | 1662 // Insert a stack guard check so that if we decide not to perform |
| 1663 // stack guard check to enable interrupts. | 1663 // on-stack replacement right away, the function calling this stub can |
| 1664 // still be interrupted. |
| 1664 __ bind(&stack_check); | 1665 __ bind(&stack_check); |
| 1665 Label ok; | 1666 Label ok; |
| 1666 ExternalReference stack_limit = | 1667 ExternalReference stack_limit = |
| 1667 ExternalReference::address_of_stack_limit(masm->isolate()); | 1668 ExternalReference::address_of_stack_limit(masm->isolate()); |
| 1668 __ cmp(esp, Operand::StaticVariable(stack_limit)); | 1669 __ cmp(esp, Operand::StaticVariable(stack_limit)); |
| 1669 __ j(above_equal, &ok, Label::kNear); | 1670 __ j(above_equal, &ok, Label::kNear); |
| 1670 StackCheckStub stub; | 1671 StackCheckStub stub; |
| 1671 __ TailCallStub(&stub); | 1672 __ TailCallStub(&stub); |
| 1672 if (FLAG_debug_code) { | 1673 if (FLAG_debug_code) { |
| 1673 __ Abort("Unreachable code: returned from tail call."); | 1674 __ Abort("Unreachable code: returned from tail call."); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1685 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); | 1686 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); |
| 1686 generator.Generate(); | 1687 generator.Generate(); |
| 1687 } | 1688 } |
| 1688 | 1689 |
| 1689 | 1690 |
| 1690 #undef __ | 1691 #undef __ |
| 1691 } | 1692 } |
| 1692 } // namespace v8::internal | 1693 } // namespace v8::internal |
| 1693 | 1694 |
| 1694 #endif // V8_TARGET_ARCH_IA32 | 1695 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |