| 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 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 void Logger::CodeDeleteEvent(Address from) { | 807 void Logger::CodeDeleteEvent(Address from) { |
| 808 #ifdef ENABLE_LOGGING_AND_PROFILING | 808 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 809 if (logfile_ == NULL || !FLAG_log_code) return; | 809 if (logfile_ == NULL || !FLAG_log_code) return; |
| 810 LogMessageBuilder msg; | 810 LogMessageBuilder msg; |
| 811 msg.Append("code-delete,0x%x\n", reinterpret_cast<unsigned int>(from)); | 811 msg.Append("code-delete,0x%x\n", reinterpret_cast<unsigned int>(from)); |
| 812 msg.WriteToLogFile(); | 812 msg.WriteToLogFile(); |
| 813 #endif | 813 #endif |
| 814 } | 814 } |
| 815 | 815 |
| 816 | 816 |
| 817 void Logger::BeginCodeRegionEvent(CodeRegion* region, | |
| 818 Assembler* masm, | |
| 819 const char* name) { | |
| 820 #ifdef ENABLE_LOGGING_AND_PROFILING | |
| 821 if (logfile_ == NULL || !FLAG_log_code) return; | |
| 822 LogMessageBuilder msg; | |
| 823 msg.Append("begin-code-region,0x%x,0x%x,0x%x,%s\n", | |
| 824 reinterpret_cast<unsigned int>(region), | |
| 825 reinterpret_cast<unsigned int>(masm), | |
| 826 masm->pc_offset(), | |
| 827 name); | |
| 828 msg.WriteToLogFile(); | |
| 829 #endif | |
| 830 } | |
| 831 | |
| 832 | |
| 833 void Logger::EndCodeRegionEvent(CodeRegion* region, Assembler* masm) { | |
| 834 #ifdef ENABLE_LOGGING_AND_PROFILING | |
| 835 if (logfile_ == NULL || !FLAG_log_code) return; | |
| 836 LogMessageBuilder msg; | |
| 837 msg.Append("end-code-region,0x%x,0x%x,0x%x\n", | |
| 838 reinterpret_cast<unsigned int>(region), | |
| 839 reinterpret_cast<unsigned int>(masm), | |
| 840 masm->pc_offset()); | |
| 841 msg.WriteToLogFile(); | |
| 842 #endif | |
| 843 } | |
| 844 | |
| 845 | |
| 846 void Logger::ResourceEvent(const char* name, const char* tag) { | 817 void Logger::ResourceEvent(const char* name, const char* tag) { |
| 847 #ifdef ENABLE_LOGGING_AND_PROFILING | 818 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 848 if (logfile_ == NULL || !FLAG_log) return; | 819 if (logfile_ == NULL || !FLAG_log) return; |
| 849 LogMessageBuilder msg; | 820 LogMessageBuilder msg; |
| 850 msg.Append("%s,%s,", name, tag); | 821 msg.Append("%s,%s,", name, tag); |
| 851 | 822 |
| 852 uint32_t sec, usec; | 823 uint32_t sec, usec; |
| 853 if (OS::GetUserTime(&sec, &usec) != -1) { | 824 if (OS::GetUserTime(&sec, &usec) != -1) { |
| 854 msg.Append("%d,%d,", sec, usec); | 825 msg.Append("%d,%d,", sec, usec); |
| 855 } | 826 } |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1184 } else if (previous_->state_ == EXTERNAL) { | 1155 } else if (previous_->state_ == EXTERNAL) { |
| 1185 // We are leaving V8. | 1156 // We are leaving V8. |
| 1186 Heap::Protect(); | 1157 Heap::Protect(); |
| 1187 } | 1158 } |
| 1188 } | 1159 } |
| 1189 #endif | 1160 #endif |
| 1190 } | 1161 } |
| 1191 #endif | 1162 #endif |
| 1192 | 1163 |
| 1193 } } // namespace v8::internal | 1164 } } // namespace v8::internal |
| OLD | NEW |