OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 } | 255 } |
256 | 256 |
257 | 257 |
258 static bool AlwaysFullCompiler(Isolate* isolate) { | 258 static bool AlwaysFullCompiler(Isolate* isolate) { |
259 return FLAG_always_full_compiler || IsDebuggerActive(isolate); | 259 return FLAG_always_full_compiler || IsDebuggerActive(isolate); |
260 } | 260 } |
261 | 261 |
262 | 262 |
263 void RecompileJob::RecordOptimizationStats() { | 263 void RecompileJob::RecordOptimizationStats() { |
264 Handle<JSFunction> function = info()->closure(); | 264 Handle<JSFunction> function = info()->closure(); |
265 int opt_count = function->shared()->opt_count(); | 265 if (!function->IsOptimized()) { |
266 function->shared()->set_opt_count(opt_count + 1); | 266 // Concurrent recompilation and OSR may race. Increment only once. |
| 267 int opt_count = function->shared()->opt_count(); |
| 268 function->shared()->set_opt_count(opt_count + 1); |
| 269 } |
267 double ms_creategraph = time_taken_to_create_graph_.InMillisecondsF(); | 270 double ms_creategraph = time_taken_to_create_graph_.InMillisecondsF(); |
268 double ms_optimize = time_taken_to_optimize_.InMillisecondsF(); | 271 double ms_optimize = time_taken_to_optimize_.InMillisecondsF(); |
269 double ms_codegen = time_taken_to_codegen_.InMillisecondsF(); | 272 double ms_codegen = time_taken_to_codegen_.InMillisecondsF(); |
270 if (FLAG_trace_opt) { | 273 if (FLAG_trace_opt) { |
271 PrintF("[optimizing "); | 274 PrintF("[optimizing "); |
272 function->ShortPrint(); | 275 function->ShortPrint(); |
273 PrintF(" - took %0.3f, %0.3f, %0.3f ms]\n", ms_creategraph, ms_optimize, | 276 PrintF(" - took %0.3f, %0.3f, %0.3f ms]\n", ms_creategraph, ms_optimize, |
274 ms_codegen); | 277 ms_codegen); |
275 } | 278 } |
276 if (FLAG_trace_opt_stats) { | 279 if (FLAG_trace_opt_stats) { |
(...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1350 AllowHandleDereference allow_deref; | 1353 AllowHandleDereference allow_deref; |
1351 bool tracing_on = info()->IsStub() | 1354 bool tracing_on = info()->IsStub() |
1352 ? FLAG_trace_hydrogen_stubs | 1355 ? FLAG_trace_hydrogen_stubs |
1353 : (FLAG_trace_hydrogen && | 1356 : (FLAG_trace_hydrogen && |
1354 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1357 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
1355 return (tracing_on && | 1358 return (tracing_on && |
1356 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1359 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1357 } | 1360 } |
1358 | 1361 |
1359 } } // namespace v8::internal | 1362 } } // namespace v8::internal |
OLD | NEW |