| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 literals->set(JSFunction::kLiteralNativeContextIndex, | 726 literals->set(JSFunction::kLiteralNativeContextIndex, |
| 727 context->native_context()); | 727 context->native_context()); |
| 728 } | 728 } |
| 729 result->set_literals(*literals); | 729 result->set_literals(*literals); |
| 730 } | 730 } |
| 731 | 731 |
| 732 if (index > 0) { | 732 if (index > 0) { |
| 733 // Caching of optimized code enabled and optimized code found. | 733 // Caching of optimized code enabled and optimized code found. |
| 734 function_info->InstallFromOptimizedCodeMap(*result, index); | 734 function_info->InstallFromOptimizedCodeMap(*result, index); |
| 735 return result; | 735 return result; |
| 736 } else { |
| 737 // The optimization count should be tied to the context, similar to the |
| 738 // optimized code map. But for simplicity's sake we just reset the opt |
| 739 // count whenever the optimized code map lookup fails. This happens |
| 740 // only when the function has never been optimized for the current context. |
| 741 function_info->set_opt_count(0); |
| 736 } | 742 } |
| 737 | 743 |
| 738 if (isolate()->use_crankshaft() && | 744 if (isolate()->use_crankshaft() && |
| 739 FLAG_always_opt && | 745 FLAG_always_opt && |
| 740 result->is_compiled() && | 746 result->is_compiled() && |
| 741 !function_info->is_toplevel() && | 747 !function_info->is_toplevel() && |
| 742 function_info->allows_lazy_compilation() && | 748 function_info->allows_lazy_compilation() && |
| 743 !function_info->optimization_disabled() && | 749 !function_info->optimization_disabled() && |
| 744 !isolate()->DebuggerHasBreakPoints()) { | 750 !isolate()->DebuggerHasBreakPoints()) { |
| 745 result->MarkForLazyRecompilation(); | 751 result->MarkForLazyRecompilation(); |
| (...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1780 return Handle<Object>::null(); | 1786 return Handle<Object>::null(); |
| 1781 } | 1787 } |
| 1782 | 1788 |
| 1783 | 1789 |
| 1784 Handle<Object> Factory::ToBoolean(bool value) { | 1790 Handle<Object> Factory::ToBoolean(bool value) { |
| 1785 return value ? true_value() : false_value(); | 1791 return value ? true_value() : false_value(); |
| 1786 } | 1792 } |
| 1787 | 1793 |
| 1788 | 1794 |
| 1789 } } // namespace v8::internal | 1795 } } // namespace v8::internal |
| OLD | NEW |