Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1414)

Side by Side Diff: src/factory.cc

Issue 59823002: Reset opt count on optimized code map lookup failure. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/compiler.cc ('k') | src/heap.cc » ('j') | src/heap.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/heap.cc » ('j') | src/heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698