| 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 8644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8655 succeeded = false; | 8655 succeeded = false; |
| 8656 } | 8656 } |
| 8657 } | 8657 } |
| 8658 | 8658 |
| 8659 // Revert to the original interrupt calls in the original unoptimized code. | 8659 // Revert to the original interrupt calls in the original unoptimized code. |
| 8660 if (FLAG_trace_osr) { | 8660 if (FLAG_trace_osr) { |
| 8661 PrintF("[restoring original interrupt calls in "); | 8661 PrintF("[restoring original interrupt calls in "); |
| 8662 function->PrintName(); | 8662 function->PrintName(); |
| 8663 PrintF("]\n"); | 8663 PrintF("]\n"); |
| 8664 } | 8664 } |
| 8665 InterruptStub interrupt_stub; | 8665 Deoptimizer::RevertInterruptCode(isolate, *unoptimized); |
| 8666 Handle<Code> interrupt_code = interrupt_stub.GetCode(isolate); | |
| 8667 Handle<Code> replacement_code = isolate->builtins()->OnStackReplacement(); | |
| 8668 Deoptimizer::RevertInterruptCode(*unoptimized, | |
| 8669 *interrupt_code, | |
| 8670 *replacement_code); | |
| 8671 | 8666 |
| 8672 // If the optimization attempt succeeded, return the AST id tagged as a | 8667 // If the optimization attempt succeeded, return the AST id tagged as a |
| 8673 // smi. This tells the builtin that we need to translate the unoptimized | 8668 // smi. This tells the builtin that we need to translate the unoptimized |
| 8674 // frame to an optimized one. | 8669 // frame to an optimized one. |
| 8675 if (succeeded) { | 8670 if (succeeded) { |
| 8676 ASSERT(function->code()->kind() == Code::OPTIMIZED_FUNCTION); | 8671 ASSERT(function->code()->kind() == Code::OPTIMIZED_FUNCTION); |
| 8677 return Smi::FromInt(ast_id.ToInt()); | 8672 return Smi::FromInt(ast_id.ToInt()); |
| 8678 } else { | 8673 } else { |
| 8679 if (function->IsMarkedForLazyRecompilation()) { | 8674 if (function->IsMarkedForLazyRecompilation()) { |
| 8680 function->ReplaceCode(function->shared()->code()); | 8675 function->ReplaceCode(function->shared()->code()); |
| (...skipping 6019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14700 // Handle last resort GC and make sure to allow future allocations | 14695 // Handle last resort GC and make sure to allow future allocations |
| 14701 // to grow the heap without causing GCs (if possible). | 14696 // to grow the heap without causing GCs (if possible). |
| 14702 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14697 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 14703 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14698 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 14704 "Runtime::PerformGC"); | 14699 "Runtime::PerformGC"); |
| 14705 } | 14700 } |
| 14706 } | 14701 } |
| 14707 | 14702 |
| 14708 | 14703 |
| 14709 } } // namespace v8::internal | 14704 } } // namespace v8::internal |
| OLD | NEW |