Revision: 12318
Author: [email protected]
Date: Thu Aug 16 04:40:03 2012
Log: Change the maximum optimization count into a commandline flag.
This is needed for some unit tests, which otherwise do not test what people
think they do. ;-)
Review URL: https://chromiumcodereview.appspot.com/10823362
http://code.google.com/p/v8/source/detail?r=12318
Modified:
/branches/bleeding_edge/src/compiler.cc
/branches/bleeding_edge/src/compiler.h
/branches/bleeding_edge/src/flag-definitions.h
/branches/bleeding_edge/src/hydrogen.cc
/branches/bleeding_edge/src/objects.cc
/branches/bleeding_edge/src/runtime-profiler.cc
=======================================
--- /branches/bleeding_edge/src/compiler.cc Tue Aug 7 07:47:36 2012
+++ /branches/bleeding_edge/src/compiler.cc Thu Aug 16 04:40:03 2012
@@ -240,7 +240,7 @@
// Limit the number of times we re-compile a functions with
// the optimizing compiler.
const int kMaxOptCount =
- FLAG_deopt_every_n_times == 0 ? Compiler::kDefaultMaxOptCount : 1000;
+ FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000;
if (info()->shared_info()->opt_count() > kMaxOptCount) {
return AbortOptimization();
}
=======================================
--- /branches/bleeding_edge/src/compiler.h Mon Aug 6 07:13:09 2012
+++ /branches/bleeding_edge/src/compiler.h Thu Aug 16 04:40:03 2012
@@ -410,10 +410,6 @@
class Compiler : public AllStatic {
public:
- // Default maximum number of function optimization attempts before we
- // give up.
- static const int kDefaultMaxOptCount = 10;
-
static const int kMaxInliningLevels = 3;
// Call count before primitive functions trigger their own optimization.
=======================================
--- /branches/bleeding_edge/src/flag-definitions.h Tue Aug 14 02:22:34 2012
+++ /branches/bleeding_edge/src/flag-definitions.h Thu Aug 16 04:40:03 2012
@@ -324,6 +324,8 @@
"try to use the dedicated run-once backend for all code")
DEFINE_bool(trace_bailout, false,
"print reasons for falling back to using the classic V8
backend")
+DEFINE_int(max_opt_count, 10,
+ "maximum number of optimization attempts before giving up.")
// compilation-cache.cc
DEFINE_bool(compilation_cache, true, "enable compilation cache")
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc Thu Aug 16 03:35:39 2012
+++ /branches/bleeding_edge/src/hydrogen.cc Thu Aug 16 04:40:03 2012
@@ -2029,7 +2029,7 @@
bool HGlobalValueNumberer::AllowCodeMotion() {
- return info()->shared_info()->opt_count() + 1 <
Compiler::kDefaultMaxOptCount;
+ return info()->shared_info()->opt_count() + 1 < FLAG_max_opt_count;
}
=======================================
--- /branches/bleeding_edge/src/objects.cc Mon Aug 13 01:43:16 2012
+++ /branches/bleeding_edge/src/objects.cc Thu Aug 16 04:40:03 2012
@@ -7935,7 +7935,7 @@
if (code()->kind() == Code::FUNCTION) {
code()->set_profiler_ticks(0);
if (optimization_disabled() &&
- opt_count() >= Compiler::kDefaultMaxOptCount) {
+ opt_count() >= FLAG_max_opt_count) {
// Re-enable optimizations if they were disabled due to opt_count
limit.
set_optimization_disabled(false);
code()->set_optimizable(true);
=======================================
--- /branches/bleeding_edge/src/runtime-profiler.cc Wed Jul 25 06:51:29 2012
+++ /branches/bleeding_edge/src/runtime-profiler.cc Thu Aug 16 04:40:03 2012
@@ -304,7 +304,7 @@
// Do not record non-optimizable functions.
if (shared->optimization_disabled()) {
- if (shared->deopt_count() >= Compiler::kDefaultMaxOptCount) {
+ if (shared->deopt_count() >= FLAG_max_opt_count) {
// If optimization was disabled due to many deoptimizations,
// then check if the function is hot and try to reenable
optimization.
int ticks = shared_code->profiler_ticks();
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev