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

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
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 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 literals->set(JSFunction::kLiteralNativeContextIndex, 704 literals->set(JSFunction::kLiteralNativeContextIndex,
705 context->native_context()); 705 context->native_context());
706 } 706 }
707 result->set_literals(*literals); 707 result->set_literals(*literals);
708 } 708 }
709 709
710 if (index > 0) { 710 if (index > 0) {
711 // Caching of optimized code enabled and optimized code found. 711 // Caching of optimized code enabled and optimized code found.
712 function_info->InstallFromOptimizedCodeMap(*result, index); 712 function_info->InstallFromOptimizedCodeMap(*result, index);
713 return result; 713 return result;
714 } else {
715 // The optimization count should be tied to the context, similar to the
716 // optimized code map. But for simplicity's sake we just reset the opt
717 // count whenever the optimized code map lookup fails. This happens
718 // only when the function has never been optimized for the current context.
719 function_info->set_opt_count(0);
714 } 720 }
715 721
716 if (isolate()->use_crankshaft() && 722 if (isolate()->use_crankshaft() &&
717 FLAG_always_opt && 723 FLAG_always_opt &&
718 result->is_compiled() && 724 result->is_compiled() &&
719 !function_info->is_toplevel() && 725 !function_info->is_toplevel() &&
720 function_info->allows_lazy_compilation() && 726 function_info->allows_lazy_compilation() &&
721 !function_info->optimization_disabled() && 727 !function_info->optimization_disabled() &&
722 !isolate()->DebuggerHasBreakPoints()) { 728 !isolate()->DebuggerHasBreakPoints()) {
723 result->MarkForLazyRecompilation(); 729 result->MarkForLazyRecompilation();
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after
1758 return Handle<Object>::null(); 1764 return Handle<Object>::null();
1759 } 1765 }
1760 1766
1761 1767
1762 Handle<Object> Factory::ToBoolean(bool value) { 1768 Handle<Object> Factory::ToBoolean(bool value) {
1763 return value ? true_value() : false_value(); 1769 return value ? true_value() : false_value();
1764 } 1770 }
1765 1771
1766 1772
1767 } } // namespace v8::internal 1773 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698