| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1371 if (!log_->IsEnabled()) return; | 1371 if (!log_->IsEnabled()) return; |
| 1372 if (profiler_ != NULL) { | 1372 if (profiler_ != NULL) { |
| 1373 // It is OK to have negative nesting. | 1373 // It is OK to have negative nesting. |
| 1374 if (--cpu_profiler_nesting_ == 0) { | 1374 if (--cpu_profiler_nesting_ == 0) { |
| 1375 profiler_->pause(); | 1375 profiler_->pause(); |
| 1376 if (FLAG_prof_lazy) { | 1376 if (FLAG_prof_lazy) { |
| 1377 if (!FLAG_sliding_state_window && !RuntimeProfiler::IsEnabled()) { | 1377 if (!FLAG_sliding_state_window && !RuntimeProfiler::IsEnabled()) { |
| 1378 ticker_->Stop(); | 1378 ticker_->Stop(); |
| 1379 } | 1379 } |
| 1380 FLAG_log_code = false; | 1380 FLAG_log_code = false; |
| 1381 // Must be the same message as Log::kDynamicBufferSeal. | |
| 1382 LOG(ISOLATE, UncheckedStringEvent("profiler", "pause")); | 1381 LOG(ISOLATE, UncheckedStringEvent("profiler", "pause")); |
| 1383 } | 1382 } |
| 1384 --logging_nesting_; | 1383 --logging_nesting_; |
| 1385 } | 1384 } |
| 1386 } | 1385 } |
| 1387 } | 1386 } |
| 1388 | 1387 |
| 1389 | 1388 |
| 1390 void Logger::ResumeProfiler() { | 1389 void Logger::ResumeProfiler() { |
| 1391 if (!log_->IsEnabled()) return; | 1390 if (!log_->IsEnabled()) return; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1413 void Logger::LogFailure() { | 1412 void Logger::LogFailure() { |
| 1414 PauseProfiler(); | 1413 PauseProfiler(); |
| 1415 } | 1414 } |
| 1416 | 1415 |
| 1417 | 1416 |
| 1418 bool Logger::IsProfilerSamplerActive() { | 1417 bool Logger::IsProfilerSamplerActive() { |
| 1419 return ticker_->IsActive(); | 1418 return ticker_->IsActive(); |
| 1420 } | 1419 } |
| 1421 | 1420 |
| 1422 | 1421 |
| 1423 int Logger::GetLogLines(int from_pos, char* dest_buf, int max_size) { | |
| 1424 return log_->GetLogLines(from_pos, dest_buf, max_size); | |
| 1425 } | |
| 1426 | |
| 1427 | |
| 1428 class EnumerateOptimizedFunctionsVisitor: public OptimizedFunctionVisitor { | 1422 class EnumerateOptimizedFunctionsVisitor: public OptimizedFunctionVisitor { |
| 1429 public: | 1423 public: |
| 1430 EnumerateOptimizedFunctionsVisitor(Handle<SharedFunctionInfo>* sfis, | 1424 EnumerateOptimizedFunctionsVisitor(Handle<SharedFunctionInfo>* sfis, |
| 1431 Handle<Code>* code_objects, | 1425 Handle<Code>* code_objects, |
| 1432 int* count) | 1426 int* count) |
| 1433 : sfis_(sfis), code_objects_(code_objects), count_(count) { } | 1427 : sfis_(sfis), code_objects_(code_objects), count_(count) { } |
| 1434 | 1428 |
| 1435 virtual void EnterContext(Context* context) {} | 1429 virtual void EnterContext(Context* context) {} |
| 1436 virtual void LeaveContext(Context* context) {} | 1430 virtual void LeaveContext(Context* context) {} |
| 1437 | 1431 |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1886 void SamplerRegistry::RemoveActiveSampler(Sampler* sampler) { | 1880 void SamplerRegistry::RemoveActiveSampler(Sampler* sampler) { |
| 1887 ASSERT(sampler->IsActive()); | 1881 ASSERT(sampler->IsActive()); |
| 1888 ScopedLock lock(mutex_); | 1882 ScopedLock lock(mutex_); |
| 1889 ASSERT(active_samplers_ != NULL); | 1883 ASSERT(active_samplers_ != NULL); |
| 1890 bool removed = active_samplers_->RemoveElement(sampler); | 1884 bool removed = active_samplers_->RemoveElement(sampler); |
| 1891 ASSERT(removed); | 1885 ASSERT(removed); |
| 1892 USE(removed); | 1886 USE(removed); |
| 1893 } | 1887 } |
| 1894 | 1888 |
| 1895 } } // namespace v8::internal | 1889 } } // namespace v8::internal |
| OLD | NEW |