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 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 msg.Append("%s,%d\n", name, value); | 624 msg.Append("%s,%d\n", name, value); |
625 msg.WriteToLogFile(); | 625 msg.WriteToLogFile(); |
626 #endif | 626 #endif |
627 } | 627 } |
628 | 628 |
629 | 629 |
630 void Logger::HandleEvent(const char* name, Object** location) { | 630 void Logger::HandleEvent(const char* name, Object** location) { |
631 #ifdef ENABLE_LOGGING_AND_PROFILING | 631 #ifdef ENABLE_LOGGING_AND_PROFILING |
632 if (!Log::is_enabled() || !FLAG_log_handles) return; | 632 if (!Log::is_enabled() || !FLAG_log_handles) return; |
633 LogMessageBuilder msg; | 633 LogMessageBuilder msg; |
634 msg.Append("%s,0x%%" V8PRIxPTR "\n", name, location); | 634 msg.Append("%s,0x%" V8PRIxPTR "\n", name, location); |
635 msg.WriteToLogFile(); | 635 msg.WriteToLogFile(); |
636 #endif | 636 #endif |
637 } | 637 } |
638 | 638 |
639 | 639 |
640 #ifdef ENABLE_LOGGING_AND_PROFILING | 640 #ifdef ENABLE_LOGGING_AND_PROFILING |
641 // ApiEvent is private so all the calls come from the Logger class. It is the | 641 // ApiEvent is private so all the calls come from the Logger class. It is the |
642 // caller's responsibility to ensure that log is enabled and that | 642 // caller's responsibility to ensure that log is enabled and that |
643 // FLAG_log_api is true. | 643 // FLAG_log_api is true. |
644 void Logger::ApiEvent(const char* format, ...) { | 644 void Logger::ApiEvent(const char* format, ...) { |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 if (!Log::is_enabled() || !FLAG_log_api) return; | 843 if (!Log::is_enabled() || !FLAG_log_api) return; |
844 Logger::ApiEvent("api,%s\n", name); | 844 Logger::ApiEvent("api,%s\n", name); |
845 #endif | 845 #endif |
846 } | 846 } |
847 | 847 |
848 | 848 |
849 void Logger::NewEvent(const char* name, void* object, size_t size) { | 849 void Logger::NewEvent(const char* name, void* object, size_t size) { |
850 #ifdef ENABLE_LOGGING_AND_PROFILING | 850 #ifdef ENABLE_LOGGING_AND_PROFILING |
851 if (!Log::is_enabled() || !FLAG_log) return; | 851 if (!Log::is_enabled() || !FLAG_log) return; |
852 LogMessageBuilder msg; | 852 LogMessageBuilder msg; |
853 msg.Append("new,%s,0x%%" V8PRIxPTR ",%u\n", name, object, | 853 msg.Append("new,%s,0x%" V8PRIxPTR ",%u\n", name, object, |
854 static_cast<unsigned int>(size)); | 854 static_cast<unsigned int>(size)); |
855 msg.WriteToLogFile(); | 855 msg.WriteToLogFile(); |
856 #endif | 856 #endif |
857 } | 857 } |
858 | 858 |
859 | 859 |
860 void Logger::DeleteEvent(const char* name, void* object) { | 860 void Logger::DeleteEvent(const char* name, void* object) { |
861 #ifdef ENABLE_LOGGING_AND_PROFILING | 861 #ifdef ENABLE_LOGGING_AND_PROFILING |
862 if (!Log::is_enabled() || !FLAG_log) return; | 862 if (!Log::is_enabled() || !FLAG_log) return; |
863 LogMessageBuilder msg; | 863 LogMessageBuilder msg; |
864 msg.Append("delete,%s,0x%%" V8PRIxPTR "\n", name, object); | 864 msg.Append("delete,%s,0x%" V8PRIxPTR "\n", name, object); |
865 msg.WriteToLogFile(); | 865 msg.WriteToLogFile(); |
866 #endif | 866 #endif |
867 } | 867 } |
868 | 868 |
869 | 869 |
870 void Logger::CodeCreateEvent(const char* tag, Code* code, const char* comment) { | 870 void Logger::CodeCreateEvent(const char* tag, Code* code, const char* comment) { |
871 #ifdef ENABLE_LOGGING_AND_PROFILING | 871 #ifdef ENABLE_LOGGING_AND_PROFILING |
872 if (!Log::is_enabled() || !FLAG_log_code) return; | 872 if (!Log::is_enabled() || !FLAG_log_code) return; |
873 LogMessageBuilder msg; | 873 LogMessageBuilder msg; |
874 msg.Append("code-creation,%s,0x%" V8PRIxPTR ",%d,\"", tag, code->address(), | 874 msg.Append("code-creation,%s,0x%" V8PRIxPTR ",%d,\"", tag, code->address(), |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 } else if (previous_->state_ == EXTERNAL) { | 1316 } else if (previous_->state_ == EXTERNAL) { |
1317 // We are leaving V8. | 1317 // We are leaving V8. |
1318 Heap::Protect(); | 1318 Heap::Protect(); |
1319 } | 1319 } |
1320 } | 1320 } |
1321 #endif | 1321 #endif |
1322 } | 1322 } |
1323 #endif | 1323 #endif |
1324 | 1324 |
1325 } } // namespace v8::internal | 1325 } } // namespace v8::internal |
OLD | NEW |