| 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 } | 257 } |
| 258 | 258 |
| 259 | 259 |
| 260 static bool AlwaysFullCompiler(Isolate* isolate) { | 260 static bool AlwaysFullCompiler(Isolate* isolate) { |
| 261 return FLAG_always_full_compiler || IsDebuggerActive(isolate); | 261 return FLAG_always_full_compiler || IsDebuggerActive(isolate); |
| 262 } | 262 } |
| 263 | 263 |
| 264 | 264 |
| 265 void OptimizingCompiler::RecordOptimizationStats() { | 265 void OptimizingCompiler::RecordOptimizationStats() { |
| 266 Handle<JSFunction> function = info()->closure(); | 266 Handle<JSFunction> function = info()->closure(); |
| 267 int opt_count = function->shared()->opt_count(); | 267 if (!function->IsOptimized()) { |
| 268 function->shared()->set_opt_count(opt_count + 1); | 268 // Concurrent recompilation and OSR may race. Increment only once. |
| 269 int opt_count = function->shared()->opt_count(); |
| 270 function->shared()->set_opt_count(opt_count + 1); |
| 271 } |
| 269 double ms_creategraph = | 272 double ms_creategraph = |
| 270 static_cast<double>(time_taken_to_create_graph_) / 1000; | 273 static_cast<double>(time_taken_to_create_graph_) / 1000; |
| 271 double ms_optimize = static_cast<double>(time_taken_to_optimize_) / 1000; | 274 double ms_optimize = static_cast<double>(time_taken_to_optimize_) / 1000; |
| 272 double ms_codegen = static_cast<double>(time_taken_to_codegen_) / 1000; | 275 double ms_codegen = static_cast<double>(time_taken_to_codegen_) / 1000; |
| 273 if (FLAG_trace_opt) { | 276 if (FLAG_trace_opt) { |
| 274 PrintF("[optimizing "); | 277 PrintF("[optimizing "); |
| 275 function->ShortPrint(); | 278 function->ShortPrint(); |
| 276 PrintF(" - took %0.3f, %0.3f, %0.3f ms]\n", ms_creategraph, ms_optimize, | 279 PrintF(" - took %0.3f, %0.3f, %0.3f ms]\n", ms_creategraph, ms_optimize, |
| 277 ms_codegen); | 280 ms_codegen); |
| 278 } | 281 } |
| (...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1266 // Trace if the appropriate trace flag is set and the phase name's first | 1269 // Trace if the appropriate trace flag is set and the phase name's first |
| 1267 // character is in the FLAG_trace_phase command line parameter. | 1270 // character is in the FLAG_trace_phase command line parameter. |
| 1268 bool tracing_on = info()->IsStub() ? | 1271 bool tracing_on = info()->IsStub() ? |
| 1269 FLAG_trace_hydrogen_stubs : | 1272 FLAG_trace_hydrogen_stubs : |
| 1270 FLAG_trace_hydrogen; | 1273 FLAG_trace_hydrogen; |
| 1271 return (tracing_on && | 1274 return (tracing_on && |
| 1272 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1275 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
| 1273 } | 1276 } |
| 1274 | 1277 |
| 1275 } } // namespace v8::internal | 1278 } } // namespace v8::internal |
| OLD | NEW |