| Index: src/compiler.cc
|
| diff --git a/src/compiler.cc b/src/compiler.cc
|
| index 47634ec22b285d3ea0485ec9748ebe564b09220e..1aa3776bde9c535c95fad2a1f556a759d57875f3 100644
|
| --- a/src/compiler.cc
|
| +++ b/src/compiler.cc
|
| @@ -262,8 +262,11 @@ static bool AlwaysFullCompiler(Isolate* isolate) {
|
|
|
| void OptimizingCompiler::RecordOptimizationStats() {
|
| Handle<JSFunction> function = info()->closure();
|
| - int opt_count = function->shared()->opt_count();
|
| - function->shared()->set_opt_count(opt_count + 1);
|
| + if (!function->IsOptimized()) {
|
| + // Concurrent recompilation and OSR may race. Increment only once.
|
| + int opt_count = function->shared()->opt_count();
|
| + function->shared()->set_opt_count(opt_count + 1);
|
| + }
|
| double ms_creategraph = time_taken_to_create_graph_.InMillisecondsF();
|
| double ms_optimize = time_taken_to_optimize_.InMillisecondsF();
|
| double ms_codegen = time_taken_to_codegen_.InMillisecondsF();
|
|
|