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 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 } | 897 } |
898 | 898 |
899 | 899 |
900 void Logger::FunctionDeleteEvent(Address from) { | 900 void Logger::FunctionDeleteEvent(Address from) { |
901 #ifdef ENABLE_LOGGING_AND_PROFILING | 901 #ifdef ENABLE_LOGGING_AND_PROFILING |
902 DeleteEventInternal(FUNCTION_DELETE_EVENT, from); | 902 DeleteEventInternal(FUNCTION_DELETE_EVENT, from); |
903 #endif | 903 #endif |
904 } | 904 } |
905 | 905 |
906 | 906 |
| 907 #ifdef ENABLE_LOGGING_AND_PROFILING |
907 void Logger::MoveEventInternal(LogEventsAndTags event, | 908 void Logger::MoveEventInternal(LogEventsAndTags event, |
908 Address from, | 909 Address from, |
909 Address to) { | 910 Address to) { |
910 #ifdef ENABLE_LOGGING_AND_PROFILING | |
911 static Address prev_to_ = NULL; | 911 static Address prev_to_ = NULL; |
912 if (!Log::IsEnabled() || !FLAG_log_code) return; | 912 if (!Log::IsEnabled() || !FLAG_log_code) return; |
913 LogMessageBuilder msg; | 913 LogMessageBuilder msg; |
914 msg.Append("%s,", log_events_[event]); | 914 msg.Append("%s,", log_events_[event]); |
915 msg.AppendAddress(from); | 915 msg.AppendAddress(from); |
916 msg.Append(','); | 916 msg.Append(','); |
917 msg.AppendAddress(to, prev_to_); | 917 msg.AppendAddress(to, prev_to_); |
918 prev_to_ = to; | 918 prev_to_ = to; |
919 if (FLAG_compress_log) { | 919 if (FLAG_compress_log) { |
920 ASSERT(compression_helper_ != NULL); | 920 ASSERT(compression_helper_ != NULL); |
921 if (!compression_helper_->HandleMessage(&msg)) return; | 921 if (!compression_helper_->HandleMessage(&msg)) return; |
922 } | 922 } |
923 msg.Append('\n'); | 923 msg.Append('\n'); |
924 msg.WriteToLogFile(); | 924 msg.WriteToLogFile(); |
| 925 } |
925 #endif | 926 #endif |
926 } | |
927 | 927 |
928 | 928 |
| 929 #ifdef ENABLE_LOGGING_AND_PROFILING |
929 void Logger::DeleteEventInternal(LogEventsAndTags event, Address from) { | 930 void Logger::DeleteEventInternal(LogEventsAndTags event, Address from) { |
930 #ifdef ENABLE_LOGGING_AND_PROFILING | |
931 if (!Log::IsEnabled() || !FLAG_log_code) return; | 931 if (!Log::IsEnabled() || !FLAG_log_code) return; |
932 LogMessageBuilder msg; | 932 LogMessageBuilder msg; |
933 msg.Append("%s,", log_events_[event]); | 933 msg.Append("%s,", log_events_[event]); |
934 msg.AppendAddress(from); | 934 msg.AppendAddress(from); |
935 if (FLAG_compress_log) { | 935 if (FLAG_compress_log) { |
936 ASSERT(compression_helper_ != NULL); | 936 ASSERT(compression_helper_ != NULL); |
937 if (!compression_helper_->HandleMessage(&msg)) return; | 937 if (!compression_helper_->HandleMessage(&msg)) return; |
938 } | 938 } |
939 msg.Append('\n'); | 939 msg.Append('\n'); |
940 msg.WriteToLogFile(); | 940 msg.WriteToLogFile(); |
| 941 } |
941 #endif | 942 #endif |
942 } | |
943 | 943 |
944 | 944 |
945 void Logger::ResourceEvent(const char* name, const char* tag) { | 945 void Logger::ResourceEvent(const char* name, const char* tag) { |
946 #ifdef ENABLE_LOGGING_AND_PROFILING | 946 #ifdef ENABLE_LOGGING_AND_PROFILING |
947 if (!Log::IsEnabled() || !FLAG_log) return; | 947 if (!Log::IsEnabled() || !FLAG_log) return; |
948 LogMessageBuilder msg; | 948 LogMessageBuilder msg; |
949 msg.Append("%s,%s,", name, tag); | 949 msg.Append("%s,%s,", name, tag); |
950 | 950 |
951 uint32_t sec, usec; | 951 uint32_t sec, usec; |
952 if (OS::GetUserTime(&sec, &usec) != -1) { | 952 if (OS::GetUserTime(&sec, &usec) != -1) { |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1532 // Otherwise, if the sliding state window computation has not been | 1532 // Otherwise, if the sliding state window computation has not been |
1533 // started we do it now. | 1533 // started we do it now. |
1534 if (sliding_state_window_ == NULL) { | 1534 if (sliding_state_window_ == NULL) { |
1535 sliding_state_window_ = new SlidingStateWindow(); | 1535 sliding_state_window_ = new SlidingStateWindow(); |
1536 } | 1536 } |
1537 #endif | 1537 #endif |
1538 } | 1538 } |
1539 | 1539 |
1540 | 1540 |
1541 } } // namespace v8::internal | 1541 } } // namespace v8::internal |
OLD | NEW |