| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 void Logger::SetterCallbackEvent(String* name, Address entry_point) { | 728 void Logger::SetterCallbackEvent(String* name, Address entry_point) { |
| 729 #ifdef ENABLE_LOGGING_AND_PROFILING | 729 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 730 if (!log_->IsEnabled() || !FLAG_log_code) return; | 730 if (!log_->IsEnabled() || !FLAG_log_code) return; |
| 731 SmartPointer<char> str = | 731 SmartPointer<char> str = |
| 732 name->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); | 732 name->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); |
| 733 CallbackEventInternal("set ", *str, entry_point); | 733 CallbackEventInternal("set ", *str, entry_point); |
| 734 #endif | 734 #endif |
| 735 } | 735 } |
| 736 | 736 |
| 737 | 737 |
| 738 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 738 static const char* ComputeMarker(Code* code) { | 739 static const char* ComputeMarker(Code* code) { |
| 739 switch (code->kind()) { | 740 switch (code->kind()) { |
| 740 case Code::FUNCTION: return code->optimizable() ? "~" : ""; | 741 case Code::FUNCTION: return code->optimizable() ? "~" : ""; |
| 741 case Code::OPTIMIZED_FUNCTION: return "*"; | 742 case Code::OPTIMIZED_FUNCTION: return "*"; |
| 742 default: return ""; | 743 default: return ""; |
| 743 } | 744 } |
| 744 } | 745 } |
| 746 #endif |
| 745 | 747 |
| 746 | 748 |
| 747 void Logger::CodeCreateEvent(LogEventsAndTags tag, | 749 void Logger::CodeCreateEvent(LogEventsAndTags tag, |
| 748 Code* code, | 750 Code* code, |
| 749 const char* comment) { | 751 const char* comment) { |
| 750 #ifdef ENABLE_LOGGING_AND_PROFILING | 752 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 751 if (!log_->IsEnabled() || !FLAG_log_code) return; | 753 if (!log_->IsEnabled() || !FLAG_log_code) return; |
| 752 LogMessageBuilder msg(this); | 754 LogMessageBuilder msg(this); |
| 753 msg.Append("%s,%s,", | 755 msg.Append("%s,%s,", |
| 754 kLogEventsNames[CODE_CREATION_EVENT], | 756 kLogEventsNames[CODE_CREATION_EVENT], |
| (...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1547 #endif | 1549 #endif |
| 1548 } | 1550 } |
| 1549 | 1551 |
| 1550 | 1552 |
| 1551 Sampler* Logger::sampler() { | 1553 Sampler* Logger::sampler() { |
| 1552 return ticker_; | 1554 return ticker_; |
| 1553 } | 1555 } |
| 1554 | 1556 |
| 1555 | 1557 |
| 1556 void Logger::EnsureTickerStarted() { | 1558 void Logger::EnsureTickerStarted() { |
| 1559 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 1557 ASSERT(ticker_ != NULL); | 1560 ASSERT(ticker_ != NULL); |
| 1558 if (!ticker_->IsActive()) ticker_->Start(); | 1561 if (!ticker_->IsActive()) ticker_->Start(); |
| 1562 #endif |
| 1559 } | 1563 } |
| 1560 | 1564 |
| 1561 | 1565 |
| 1562 void Logger::EnsureTickerStopped() { | 1566 void Logger::EnsureTickerStopped() { |
| 1567 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 1563 if (ticker_ != NULL && ticker_->IsActive()) ticker_->Stop(); | 1568 if (ticker_ != NULL && ticker_->IsActive()) ticker_->Stop(); |
| 1569 #endif |
| 1564 } | 1570 } |
| 1565 | 1571 |
| 1566 | 1572 |
| 1567 void Logger::TearDown() { | 1573 void Logger::TearDown() { |
| 1568 #ifdef ENABLE_LOGGING_AND_PROFILING | 1574 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 1569 if (!is_initialized_) return; | 1575 if (!is_initialized_) return; |
| 1570 is_initialized_ = false; | 1576 is_initialized_ = false; |
| 1571 | 1577 |
| 1572 // Stop the profiler before closing the file. | 1578 // Stop the profiler before closing the file. |
| 1573 if (profiler_ != NULL) { | 1579 if (profiler_ != NULL) { |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1651 void SamplerRegistry::RemoveActiveSampler(Sampler* sampler) { | 1657 void SamplerRegistry::RemoveActiveSampler(Sampler* sampler) { |
| 1652 ASSERT(sampler->IsActive()); | 1658 ASSERT(sampler->IsActive()); |
| 1653 ScopedLock lock(mutex_); | 1659 ScopedLock lock(mutex_); |
| 1654 ASSERT(active_samplers_ != NULL); | 1660 ASSERT(active_samplers_ != NULL); |
| 1655 bool removed = active_samplers_->RemoveElement(sampler); | 1661 bool removed = active_samplers_->RemoveElement(sampler); |
| 1656 ASSERT(removed); | 1662 ASSERT(removed); |
| 1657 USE(removed); | 1663 USE(removed); |
| 1658 } | 1664 } |
| 1659 | 1665 |
| 1660 } } // namespace v8::internal | 1666 } } // namespace v8::internal |
| OLD | NEW |