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 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 void Logger::SetterCallbackEvent(String* name, Address entry_point) { | 702 void Logger::SetterCallbackEvent(String* name, Address entry_point) { |
703 #ifdef ENABLE_LOGGING_AND_PROFILING | 703 #ifdef ENABLE_LOGGING_AND_PROFILING |
704 if (!Log::IsEnabled() || !FLAG_log_code) return; | 704 if (!Log::IsEnabled() || !FLAG_log_code) return; |
705 SmartPointer<char> str = | 705 SmartPointer<char> str = |
706 name->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); | 706 name->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); |
707 CallbackEventInternal("set ", *str, entry_point); | 707 CallbackEventInternal("set ", *str, entry_point); |
708 #endif | 708 #endif |
709 } | 709 } |
710 | 710 |
711 | 711 |
| 712 #ifdef ENABLE_LOGGING_AND_PROFILING |
712 static const char* ComputeMarker(Code* code) { | 713 static const char* ComputeMarker(Code* code) { |
713 switch (code->kind()) { | 714 switch (code->kind()) { |
714 case Code::FUNCTION: return code->optimizable() ? "~" : ""; | 715 case Code::FUNCTION: return code->optimizable() ? "~" : ""; |
715 case Code::OPTIMIZED_FUNCTION: return "*"; | 716 case Code::OPTIMIZED_FUNCTION: return "*"; |
716 default: return ""; | 717 default: return ""; |
717 } | 718 } |
718 } | 719 } |
| 720 #endif |
719 | 721 |
720 | 722 |
721 void Logger::CodeCreateEvent(LogEventsAndTags tag, | 723 void Logger::CodeCreateEvent(LogEventsAndTags tag, |
722 Code* code, | 724 Code* code, |
723 const char* comment) { | 725 const char* comment) { |
724 #ifdef ENABLE_LOGGING_AND_PROFILING | 726 #ifdef ENABLE_LOGGING_AND_PROFILING |
725 if (!Log::IsEnabled() || !FLAG_log_code) return; | 727 if (!Log::IsEnabled() || !FLAG_log_code) return; |
726 LogMessageBuilder msg; | 728 LogMessageBuilder msg; |
727 msg.Append("%s,%s,", | 729 msg.Append("%s,%s,", |
728 kLogEventsNames[CODE_CREATION_EVENT], | 730 kLogEventsNames[CODE_CREATION_EVENT], |
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1570 LogMessageBuilder::set_write_failure_handler(StopLoggingAndProfiling); | 1572 LogMessageBuilder::set_write_failure_handler(StopLoggingAndProfiling); |
1571 return true; | 1573 return true; |
1572 | 1574 |
1573 #else | 1575 #else |
1574 return false; | 1576 return false; |
1575 #endif | 1577 #endif |
1576 } | 1578 } |
1577 | 1579 |
1578 | 1580 |
1579 void Logger::EnsureTickerStarted() { | 1581 void Logger::EnsureTickerStarted() { |
| 1582 #ifdef ENABLE_LOGGING_AND_PROFILING |
1580 ASSERT(ticker_ != NULL); | 1583 ASSERT(ticker_ != NULL); |
1581 if (!ticker_->IsActive()) ticker_->Start(); | 1584 if (!ticker_->IsActive()) ticker_->Start(); |
| 1585 #endif |
1582 } | 1586 } |
1583 | 1587 |
1584 | 1588 |
1585 void Logger::EnsureTickerStopped() { | 1589 void Logger::EnsureTickerStopped() { |
| 1590 #ifdef ENABLE_LOGGING_AND_PROFILING |
1586 if (ticker_ != NULL && ticker_->IsActive()) ticker_->Stop(); | 1591 if (ticker_ != NULL && ticker_->IsActive()) ticker_->Stop(); |
| 1592 #endif |
1587 } | 1593 } |
1588 | 1594 |
1589 | 1595 |
1590 void Logger::TearDown() { | 1596 void Logger::TearDown() { |
1591 #ifdef ENABLE_LOGGING_AND_PROFILING | 1597 #ifdef ENABLE_LOGGING_AND_PROFILING |
1592 LogMessageBuilder::set_write_failure_handler(NULL); | 1598 LogMessageBuilder::set_write_failure_handler(NULL); |
1593 | 1599 |
1594 // Stop the profiler before closing the file. | 1600 // Stop the profiler before closing the file. |
1595 if (profiler_ != NULL) { | 1601 if (profiler_ != NULL) { |
1596 profiler_->Disengage(); | 1602 profiler_->Disengage(); |
(...skipping 24 matching lines...) Expand all Loading... |
1621 } | 1627 } |
1622 // Otherwise, if the sliding state window computation has not been | 1628 // Otherwise, if the sliding state window computation has not been |
1623 // started we do it now. | 1629 // started we do it now. |
1624 if (sliding_state_window_ == NULL) { | 1630 if (sliding_state_window_ == NULL) { |
1625 sliding_state_window_ = new SlidingStateWindow(); | 1631 sliding_state_window_ = new SlidingStateWindow(); |
1626 } | 1632 } |
1627 #endif | 1633 #endif |
1628 } | 1634 } |
1629 | 1635 |
1630 } } // namespace v8::internal | 1636 } } // namespace v8::internal |
OLD | NEW |