| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 | 855 |
| 856 | 856 |
| 857 void Logger::DeleteEventStatic(const char* name, void* object) { | 857 void Logger::DeleteEventStatic(const char* name, void* object) { |
| 858 Isolate::Current()->logger()->DeleteEvent(name, object); | 858 Isolate::Current()->logger()->DeleteEvent(name, object); |
| 859 } | 859 } |
| 860 | 860 |
| 861 void Logger::CallbackEventInternal(const char* prefix, Name* name, | 861 void Logger::CallbackEventInternal(const char* prefix, Name* name, |
| 862 Address entry_point) { | 862 Address entry_point) { |
| 863 if (!log_->IsEnabled() || !FLAG_log_code) return; | 863 if (!log_->IsEnabled() || !FLAG_log_code) return; |
| 864 LogMessageBuilder msg(this); | 864 LogMessageBuilder msg(this); |
| 865 msg.Append("%s,%s,-3,", | 865 msg.Append("%s,%s,-2,", |
| 866 kLogEventsNames[CODE_CREATION_EVENT], | 866 kLogEventsNames[CODE_CREATION_EVENT], |
| 867 kLogEventsNames[CALLBACK_TAG]); | 867 kLogEventsNames[CALLBACK_TAG]); |
| 868 msg.AppendAddress(entry_point); | 868 msg.AppendAddress(entry_point); |
| 869 if (name->IsString()) { | 869 if (name->IsString()) { |
| 870 SmartArrayPointer<char> str = | 870 SmartArrayPointer<char> str = |
| 871 String::cast(name)->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); | 871 String::cast(name)->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); |
| 872 msg.Append(",1,\"%s%s\"", prefix, *str); | 872 msg.Append(",1,\"%s%s\"", prefix, *str); |
| 873 } else { | 873 } else { |
| 874 Symbol* symbol = Symbol::cast(name); | 874 Symbol* symbol = Symbol::cast(name); |
| 875 if (symbol->name()->IsUndefined()) { | 875 if (symbol->name()->IsUndefined()) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 if (!log_->IsEnabled()) return; | 940 if (!log_->IsEnabled()) return; |
| 941 if (FLAG_ll_prof) { | 941 if (FLAG_ll_prof) { |
| 942 LowLevelCodeCreateEvent(code, name_buffer_->get(), name_buffer_->size()); | 942 LowLevelCodeCreateEvent(code, name_buffer_->get(), name_buffer_->size()); |
| 943 } | 943 } |
| 944 if (Serializer::enabled()) { | 944 if (Serializer::enabled()) { |
| 945 RegisterSnapshotCodeName(code, name_buffer_->get(), name_buffer_->size()); | 945 RegisterSnapshotCodeName(code, name_buffer_->get(), name_buffer_->size()); |
| 946 } | 946 } |
| 947 } | 947 } |
| 948 | 948 |
| 949 | 949 |
| 950 void Logger::AppendCodeCreateHeader(LogMessageBuilder* msg, |
| 951 LogEventsAndTags tag, |
| 952 Code* code) { |
| 953 ASSERT(msg); |
| 954 msg->Append("%s,%s,%d,", |
| 955 kLogEventsNames[CODE_CREATION_EVENT], |
| 956 kLogEventsNames[tag], |
| 957 code->kind()); |
| 958 msg->AppendAddress(code->address()); |
| 959 msg->Append(",%d,", code->ExecutableSize()); |
| 960 } |
| 961 |
| 962 |
| 963 void Logger::AppendSymbolName(LogMessageBuilder* msg, |
| 964 Symbol* symbol) { |
| 965 ASSERT(symbol); |
| 966 msg->Append("symbol("); |
| 967 if (!symbol->name()->IsUndefined()) { |
| 968 msg->Append("\""); |
| 969 msg->AppendDetailed(String::cast(symbol->name()), false); |
| 970 msg->Append("\" "); |
| 971 } |
| 972 msg->Append("hash %x)", symbol->Hash()); |
| 973 } |
| 974 |
| 975 |
| 950 void Logger::CodeCreateEvent(LogEventsAndTags tag, | 976 void Logger::CodeCreateEvent(LogEventsAndTags tag, |
| 951 Code* code, | 977 Code* code, |
| 952 const char* comment) { | 978 const char* comment) { |
| 953 if (!is_logging_code_events()) return; | 979 if (!is_logging_code_events()) return; |
| 954 if (FLAG_ll_prof || Serializer::enabled() || code_event_handler_ != NULL) { | 980 if (FLAG_ll_prof || Serializer::enabled() || code_event_handler_ != NULL) { |
| 955 InitNameBuffer(tag); | 981 InitNameBuffer(tag); |
| 956 name_buffer_->AppendBytes(comment); | 982 name_buffer_->AppendBytes(comment); |
| 957 LogRecordedBuffer(code, NULL); | 983 LogRecordedBuffer(code, NULL); |
| 958 } | 984 } |
| 959 | 985 |
| 960 if (!FLAG_log_code || !log_->IsEnabled()) return; | 986 if (!FLAG_log_code || !log_->IsEnabled()) return; |
| 961 LogMessageBuilder msg(this); | 987 LogMessageBuilder msg(this); |
| 962 msg.Append("%s,%s,%d,", | 988 AppendCodeCreateHeader(&msg, tag, code); |
| 963 kLogEventsNames[CODE_CREATION_EVENT], | 989 msg.AppendDoubleQuotedString(comment); |
| 964 kLogEventsNames[tag], | |
| 965 code->kind()); | |
| 966 msg.AppendAddress(code->address()); | |
| 967 msg.Append(",%d,\"", code->ExecutableSize()); | |
| 968 for (const char* p = comment; *p != '\0'; p++) { | |
| 969 if (*p == '"') { | |
| 970 msg.Append('\\'); | |
| 971 } | |
| 972 msg.Append(*p); | |
| 973 } | |
| 974 msg.Append('"'); | |
| 975 msg.Append('\n'); | 990 msg.Append('\n'); |
| 976 msg.WriteToLogFile(); | 991 msg.WriteToLogFile(); |
| 977 } | 992 } |
| 978 | 993 |
| 979 | 994 |
| 980 void Logger::CodeCreateEvent(LogEventsAndTags tag, | 995 void Logger::CodeCreateEvent(LogEventsAndTags tag, |
| 981 Code* code, | 996 Code* code, |
| 982 Name* name) { | 997 Name* name) { |
| 983 if (!is_logging_code_events()) return; | 998 if (!is_logging_code_events()) return; |
| 984 if (FLAG_ll_prof || Serializer::enabled() || code_event_handler_ != NULL) { | 999 if (FLAG_ll_prof || Serializer::enabled() || code_event_handler_ != NULL) { |
| 985 InitNameBuffer(tag); | 1000 InitNameBuffer(tag); |
| 986 AppendName(name); | 1001 AppendName(name); |
| 987 LogRecordedBuffer(code, NULL); | 1002 LogRecordedBuffer(code, NULL); |
| 988 } | 1003 } |
| 989 | 1004 |
| 990 if (!FLAG_log_code || !log_->IsEnabled()) return; | 1005 if (!FLAG_log_code || !log_->IsEnabled()) return; |
| 991 LogMessageBuilder msg(this); | 1006 LogMessageBuilder msg(this); |
| 992 msg.Append("%s,%s,%d,", | 1007 AppendCodeCreateHeader(&msg, tag, code); |
| 993 kLogEventsNames[CODE_CREATION_EVENT], | |
| 994 kLogEventsNames[tag], | |
| 995 code->kind()); | |
| 996 msg.AppendAddress(code->address()); | |
| 997 msg.Append(",%d,", code->ExecutableSize()); | |
| 998 if (name->IsString()) { | 1008 if (name->IsString()) { |
| 999 msg.Append('"'); | 1009 msg.Append('"'); |
| 1000 msg.AppendDetailed(String::cast(name), false); | 1010 msg.AppendDetailed(String::cast(name), false); |
| 1001 msg.Append('"'); | 1011 msg.Append('"'); |
| 1002 } else { | 1012 } else { |
| 1003 Symbol* symbol = Symbol::cast(name); | 1013 AppendSymbolName(&msg, Symbol::cast(name)); |
| 1004 msg.Append("symbol("); | |
| 1005 if (!symbol->name()->IsUndefined()) { | |
| 1006 msg.Append("\""); | |
| 1007 msg.AppendDetailed(String::cast(symbol->name()), false); | |
| 1008 msg.Append("\" "); | |
| 1009 } | |
| 1010 msg.Append("hash %x)", symbol->Hash()); | |
| 1011 } | 1014 } |
| 1012 msg.Append('\n'); | 1015 msg.Append('\n'); |
| 1013 msg.WriteToLogFile(); | 1016 msg.WriteToLogFile(); |
| 1014 } | 1017 } |
| 1015 | 1018 |
| 1016 | 1019 |
| 1017 // ComputeMarker must only be used when SharedFunctionInfo is known. | 1020 // ComputeMarker must only be used when SharedFunctionInfo is known. |
| 1018 static const char* ComputeMarker(Code* code) { | 1021 static const char* ComputeMarker(Code* code) { |
| 1019 switch (code->kind()) { | 1022 switch (code->kind()) { |
| 1020 case Code::FUNCTION: return code->optimizable() ? "~" : ""; | 1023 case Code::FUNCTION: return code->optimizable() ? "~" : ""; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1036 AppendName(name); | 1039 AppendName(name); |
| 1037 LogRecordedBuffer(code, shared); | 1040 LogRecordedBuffer(code, shared); |
| 1038 } | 1041 } |
| 1039 | 1042 |
| 1040 if (!FLAG_log_code || !log_->IsEnabled()) return; | 1043 if (!FLAG_log_code || !log_->IsEnabled()) return; |
| 1041 if (code == Isolate::Current()->builtins()->builtin( | 1044 if (code == Isolate::Current()->builtins()->builtin( |
| 1042 Builtins::kLazyCompile)) | 1045 Builtins::kLazyCompile)) |
| 1043 return; | 1046 return; |
| 1044 | 1047 |
| 1045 LogMessageBuilder msg(this); | 1048 LogMessageBuilder msg(this); |
| 1046 msg.Append("%s,%s,%d,", | 1049 AppendCodeCreateHeader(&msg, tag, code); |
| 1047 kLogEventsNames[CODE_CREATION_EVENT], | |
| 1048 kLogEventsNames[tag], | |
| 1049 code->kind()); | |
| 1050 msg.AppendAddress(code->address()); | |
| 1051 msg.Append(",%d,", code->ExecutableSize()); | |
| 1052 if (name->IsString()) { | 1050 if (name->IsString()) { |
| 1053 SmartArrayPointer<char> str = | 1051 SmartArrayPointer<char> str = |
| 1054 String::cast(name)->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); | 1052 String::cast(name)->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); |
| 1055 msg.Append("\"%s\"", *str); | 1053 msg.Append("\"%s\"", *str); |
| 1056 } else { | 1054 } else { |
| 1057 Symbol* symbol = Symbol::cast(name); | 1055 AppendSymbolName(&msg, Symbol::cast(name)); |
| 1058 msg.Append("symbol("); | |
| 1059 if (!symbol->name()->IsUndefined()) { | |
| 1060 msg.Append("\""); | |
| 1061 msg.AppendDetailed(String::cast(symbol->name()), false); | |
| 1062 msg.Append("\" "); | |
| 1063 } | |
| 1064 msg.Append("hash %x)", symbol->Hash()); | |
| 1065 } | 1056 } |
| 1066 msg.Append(','); | 1057 msg.Append(','); |
| 1067 msg.AppendAddress(shared->address()); | 1058 msg.AppendAddress(shared->address()); |
| 1068 msg.Append(",%s", ComputeMarker(code)); | 1059 msg.Append(",%s", ComputeMarker(code)); |
| 1069 msg.Append('\n'); | 1060 msg.Append('\n'); |
| 1070 msg.WriteToLogFile(); | 1061 msg.WriteToLogFile(); |
| 1071 } | 1062 } |
| 1072 | 1063 |
| 1073 | 1064 |
| 1074 // Although, it is possible to extract source and line from | 1065 // Although, it is possible to extract source and line from |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1092 name_buffer_->AppendHex(Name::cast(source)->Hash()); | 1083 name_buffer_->AppendHex(Name::cast(source)->Hash()); |
| 1093 name_buffer_->AppendByte(')'); | 1084 name_buffer_->AppendByte(')'); |
| 1094 } | 1085 } |
| 1095 name_buffer_->AppendByte(':'); | 1086 name_buffer_->AppendByte(':'); |
| 1096 name_buffer_->AppendInt(line); | 1087 name_buffer_->AppendInt(line); |
| 1097 LogRecordedBuffer(code, shared); | 1088 LogRecordedBuffer(code, shared); |
| 1098 } | 1089 } |
| 1099 | 1090 |
| 1100 if (!FLAG_log_code || !log_->IsEnabled()) return; | 1091 if (!FLAG_log_code || !log_->IsEnabled()) return; |
| 1101 LogMessageBuilder msg(this); | 1092 LogMessageBuilder msg(this); |
| 1093 AppendCodeCreateHeader(&msg, tag, code); |
| 1102 SmartArrayPointer<char> name = | 1094 SmartArrayPointer<char> name = |
| 1103 shared->DebugName()->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); | 1095 shared->DebugName()->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); |
| 1104 msg.Append("%s,%s,%d,", | 1096 msg.Append("\"%s ", *name); |
| 1105 kLogEventsNames[CODE_CREATION_EVENT], | |
| 1106 kLogEventsNames[tag], | |
| 1107 code->kind()); | |
| 1108 msg.AppendAddress(code->address()); | |
| 1109 msg.Append(",%d,\"%s ", code->ExecutableSize(), *name); | |
| 1110 if (source->IsString()) { | 1097 if (source->IsString()) { |
| 1111 SmartArrayPointer<char> sourcestr = | 1098 SmartArrayPointer<char> sourcestr = |
| 1112 String::cast(source)->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); | 1099 String::cast(source)->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); |
| 1113 msg.Append("%s", *sourcestr); | 1100 msg.Append("%s", *sourcestr); |
| 1114 } else { | 1101 } else { |
| 1115 Symbol* symbol = Symbol::cast(source); | 1102 AppendSymbolName(&msg, Symbol::cast(source)); |
| 1116 msg.Append("symbol("); | |
| 1117 if (!symbol->name()->IsUndefined()) { | |
| 1118 msg.Append("\""); | |
| 1119 msg.AppendDetailed(String::cast(symbol->name()), false); | |
| 1120 msg.Append("\" "); | |
| 1121 } | |
| 1122 msg.Append("hash %x)", symbol->Hash()); | |
| 1123 } | 1103 } |
| 1124 msg.Append(":%d\",", line); | 1104 msg.Append(":%d\",", line); |
| 1125 msg.AppendAddress(shared->address()); | 1105 msg.AppendAddress(shared->address()); |
| 1126 msg.Append(",%s", ComputeMarker(code)); | 1106 msg.Append(",%s", ComputeMarker(code)); |
| 1127 msg.Append('\n'); | 1107 msg.Append('\n'); |
| 1128 msg.WriteToLogFile(); | 1108 msg.WriteToLogFile(); |
| 1129 } | 1109 } |
| 1130 | 1110 |
| 1131 | 1111 |
| 1132 void Logger::CodeCreateEvent(LogEventsAndTags tag, Code* code, int args_count) { | 1112 void Logger::CodeCreateEvent(LogEventsAndTags tag, Code* code, int args_count) { |
| 1133 if (!is_logging_code_events()) return; | 1113 if (!is_logging_code_events()) return; |
| 1134 if (FLAG_ll_prof || Serializer::enabled() || code_event_handler_ != NULL) { | 1114 if (FLAG_ll_prof || Serializer::enabled() || code_event_handler_ != NULL) { |
| 1135 InitNameBuffer(tag); | 1115 InitNameBuffer(tag); |
| 1136 name_buffer_->AppendInt(args_count); | 1116 name_buffer_->AppendInt(args_count); |
| 1137 LogRecordedBuffer(code, NULL); | 1117 LogRecordedBuffer(code, NULL); |
| 1138 } | 1118 } |
| 1139 | 1119 |
| 1140 if (!FLAG_log_code || !log_->IsEnabled()) return; | 1120 if (!FLAG_log_code || !log_->IsEnabled()) return; |
| 1141 LogMessageBuilder msg(this); | 1121 LogMessageBuilder msg(this); |
| 1142 msg.Append("%s,%s,%d,", | 1122 AppendCodeCreateHeader(&msg, tag, code); |
| 1143 kLogEventsNames[CODE_CREATION_EVENT], | 1123 msg.Append("\"args_count: %d\"", args_count); |
| 1144 kLogEventsNames[tag], | |
| 1145 code->kind()); | |
| 1146 msg.AppendAddress(code->address()); | |
| 1147 msg.Append(",%d,\"args_count: %d\"", code->ExecutableSize(), args_count); | |
| 1148 msg.Append('\n'); | 1124 msg.Append('\n'); |
| 1149 msg.WriteToLogFile(); | 1125 msg.WriteToLogFile(); |
| 1150 } | 1126 } |
| 1151 | 1127 |
| 1152 | 1128 |
| 1153 void Logger::CodeMovingGCEvent() { | 1129 void Logger::CodeMovingGCEvent() { |
| 1154 if (!log_->IsEnabled() || !FLAG_ll_prof) return; | 1130 if (!log_->IsEnabled() || !FLAG_ll_prof) return; |
| 1155 LowLevelLogWriteBytes(&kCodeMovingGCTag, sizeof(kCodeMovingGCTag)); | 1131 LowLevelLogWriteBytes(&kCodeMovingGCTag, sizeof(kCodeMovingGCTag)); |
| 1156 OS::SignalCodeMovingGC(); | 1132 OS::SignalCodeMovingGC(); |
| 1157 } | 1133 } |
| 1158 | 1134 |
| 1159 | 1135 |
| 1160 void Logger::RegExpCodeCreateEvent(Code* code, String* source) { | 1136 void Logger::RegExpCodeCreateEvent(Code* code, String* source) { |
| 1161 if (!is_logging_code_events()) return; | 1137 if (!is_logging_code_events()) return; |
| 1162 if (FLAG_ll_prof || Serializer::enabled() || code_event_handler_ != NULL) { | 1138 if (FLAG_ll_prof || Serializer::enabled() || code_event_handler_ != NULL) { |
| 1163 InitNameBuffer(REG_EXP_TAG); | 1139 InitNameBuffer(REG_EXP_TAG); |
| 1164 name_buffer_->AppendString(source); | 1140 name_buffer_->AppendString(source); |
| 1165 LogRecordedBuffer(code, NULL); | 1141 LogRecordedBuffer(code, NULL); |
| 1166 } | 1142 } |
| 1167 | 1143 |
| 1168 if (!FLAG_log_code || !log_->IsEnabled()) return; | 1144 if (!FLAG_log_code || !log_->IsEnabled()) return; |
| 1169 LogMessageBuilder msg(this); | 1145 LogMessageBuilder msg(this); |
| 1170 msg.Append("%s,%s,-2,", | 1146 AppendCodeCreateHeader(&msg, REG_EXP_TAG, code); |
| 1171 kLogEventsNames[CODE_CREATION_EVENT], | 1147 msg.Append('"'); |
| 1172 kLogEventsNames[REG_EXP_TAG]); | |
| 1173 msg.AppendAddress(code->address()); | |
| 1174 msg.Append(",%d,\"", code->ExecutableSize()); | |
| 1175 msg.AppendDetailed(source, false); | 1148 msg.AppendDetailed(source, false); |
| 1176 msg.Append('\"'); | 1149 msg.Append('"'); |
| 1177 msg.Append('\n'); | 1150 msg.Append('\n'); |
| 1178 msg.WriteToLogFile(); | 1151 msg.WriteToLogFile(); |
| 1179 } | 1152 } |
| 1180 | 1153 |
| 1181 | 1154 |
| 1182 void Logger::CodeMoveEvent(Address from, Address to) { | 1155 void Logger::CodeMoveEvent(Address from, Address to) { |
| 1183 if (code_event_handler_ != NULL) IssueCodeMovedEvent(from, to); | 1156 if (code_event_handler_ != NULL) IssueCodeMovedEvent(from, to); |
| 1184 if (!log_->IsEnabled()) return; | 1157 if (!log_->IsEnabled()) return; |
| 1185 if (FLAG_ll_prof) LowLevelCodeMoveEvent(from, to); | 1158 if (FLAG_ll_prof) LowLevelCodeMoveEvent(from, to); |
| 1186 if (Serializer::enabled() && address_to_name_map_ != NULL) { | 1159 if (Serializer::enabled() && address_to_name_map_ != NULL) { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1235 } | 1208 } |
| 1236 } | 1209 } |
| 1237 | 1210 |
| 1238 void Logger::SnapshotPositionEvent(Address addr, int pos) { | 1211 void Logger::SnapshotPositionEvent(Address addr, int pos) { |
| 1239 if (!log_->IsEnabled()) return; | 1212 if (!log_->IsEnabled()) return; |
| 1240 if (FLAG_ll_prof) LowLevelSnapshotPositionEvent(addr, pos); | 1213 if (FLAG_ll_prof) LowLevelSnapshotPositionEvent(addr, pos); |
| 1241 if (Serializer::enabled() && address_to_name_map_ != NULL) { | 1214 if (Serializer::enabled() && address_to_name_map_ != NULL) { |
| 1242 const char* code_name = address_to_name_map_->Lookup(addr); | 1215 const char* code_name = address_to_name_map_->Lookup(addr); |
| 1243 if (code_name == NULL) return; // Not a code object. | 1216 if (code_name == NULL) return; // Not a code object. |
| 1244 LogMessageBuilder msg(this); | 1217 LogMessageBuilder msg(this); |
| 1245 msg.Append("%s,%d,\"", kLogEventsNames[SNAPSHOT_CODE_NAME_EVENT], pos); | 1218 msg.Append("%s,%d,", kLogEventsNames[SNAPSHOT_CODE_NAME_EVENT], pos); |
| 1246 for (const char* p = code_name; *p != '\0'; ++p) { | 1219 msg.AppendDoubleQuotedString(code_name); |
| 1247 if (*p == '"') msg.Append('\\'); | 1220 msg.Append("\n"); |
| 1248 msg.Append(*p); | |
| 1249 } | |
| 1250 msg.Append("\"\n"); | |
| 1251 msg.WriteToLogFile(); | 1221 msg.WriteToLogFile(); |
| 1252 } | 1222 } |
| 1253 if (!FLAG_log_snapshot_positions) return; | 1223 if (!FLAG_log_snapshot_positions) return; |
| 1254 LogMessageBuilder msg(this); | 1224 LogMessageBuilder msg(this); |
| 1255 msg.Append("%s,", kLogEventsNames[SNAPSHOT_POSITION_EVENT]); | 1225 msg.Append("%s,", kLogEventsNames[SNAPSHOT_POSITION_EVENT]); |
| 1256 msg.AppendAddress(addr); | 1226 msg.AppendAddress(addr); |
| 1257 msg.Append(",%d", pos); | 1227 msg.Append(",%d", pos); |
| 1258 msg.Append('\n'); | 1228 msg.Append('\n'); |
| 1259 msg.WriteToLogFile(); | 1229 msg.WriteToLogFile(); |
| 1260 } | 1230 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1312 ? JSObject::cast(obj)->class_name() | 1282 ? JSObject::cast(obj)->class_name() |
| 1313 : isolate_->heap()->empty_string(); | 1283 : isolate_->heap()->empty_string(); |
| 1314 msg.Append("suspect-read,"); | 1284 msg.Append("suspect-read,"); |
| 1315 msg.Append(class_name); | 1285 msg.Append(class_name); |
| 1316 msg.Append(','); | 1286 msg.Append(','); |
| 1317 if (name->IsString()) { | 1287 if (name->IsString()) { |
| 1318 msg.Append('"'); | 1288 msg.Append('"'); |
| 1319 msg.Append(String::cast(name)); | 1289 msg.Append(String::cast(name)); |
| 1320 msg.Append('"'); | 1290 msg.Append('"'); |
| 1321 } else { | 1291 } else { |
| 1322 Symbol* symbol = Symbol::cast(name); | 1292 AppendSymbolName(&msg, Symbol::cast(name)); |
| 1323 msg.Append("symbol("); | |
| 1324 if (!symbol->name()->IsUndefined()) { | |
| 1325 msg.Append("\""); | |
| 1326 msg.AppendDetailed(String::cast(symbol->name()), false); | |
| 1327 msg.Append("\" "); | |
| 1328 } | |
| 1329 msg.Append("hash %x)", symbol->Hash()); | |
| 1330 } | 1293 } |
| 1331 msg.Append('\n'); | 1294 msg.Append('\n'); |
| 1332 msg.WriteToLogFile(); | 1295 msg.WriteToLogFile(); |
| 1333 } | 1296 } |
| 1334 | 1297 |
| 1335 | 1298 |
| 1336 void Logger::HeapSampleBeginEvent(const char* space, const char* kind) { | 1299 void Logger::HeapSampleBeginEvent(const char* space, const char* kind) { |
| 1337 if (!log_->IsEnabled() || !FLAG_log_gc) return; | 1300 if (!log_->IsEnabled() || !FLAG_log_gc) return; |
| 1338 LogMessageBuilder msg(this); | 1301 LogMessageBuilder msg(this); |
| 1339 // Using non-relative system time in order to be able to synchronize with | 1302 // Using non-relative system time in order to be able to synchronize with |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1541 case Code::COMPARE_IC: // fall through | 1504 case Code::COMPARE_IC: // fall through |
| 1542 case Code::COMPARE_NIL_IC: // fall through | 1505 case Code::COMPARE_NIL_IC: // fall through |
| 1543 case Code::TO_BOOLEAN_IC: // fall through | 1506 case Code::TO_BOOLEAN_IC: // fall through |
| 1544 case Code::STUB: | 1507 case Code::STUB: |
| 1545 description = | 1508 description = |
| 1546 CodeStub::MajorName(CodeStub::GetMajorKey(code_object), true); | 1509 CodeStub::MajorName(CodeStub::GetMajorKey(code_object), true); |
| 1547 if (description == NULL) | 1510 if (description == NULL) |
| 1548 description = "A stub from the snapshot"; | 1511 description = "A stub from the snapshot"; |
| 1549 tag = Logger::STUB_TAG; | 1512 tag = Logger::STUB_TAG; |
| 1550 break; | 1513 break; |
| 1514 case Code::REGEXP: |
| 1515 description = "Regular expression code"; |
| 1516 tag = Logger::REG_EXP_TAG; |
| 1517 break; |
| 1551 case Code::BUILTIN: | 1518 case Code::BUILTIN: |
| 1552 description = "A builtin from the snapshot"; | 1519 description = "A builtin from the snapshot"; |
| 1553 tag = Logger::BUILTIN_TAG; | 1520 tag = Logger::BUILTIN_TAG; |
| 1554 break; | 1521 break; |
| 1555 case Code::KEYED_LOAD_IC: | 1522 case Code::KEYED_LOAD_IC: |
| 1556 description = "A keyed load IC from the snapshot"; | 1523 description = "A keyed load IC from the snapshot"; |
| 1557 tag = Logger::KEYED_LOAD_IC_TAG; | 1524 tag = Logger::KEYED_LOAD_IC_TAG; |
| 1558 break; | 1525 break; |
| 1559 case Code::LOAD_IC: | 1526 case Code::LOAD_IC: |
| 1560 description = "A load IC from the snapshot"; | 1527 description = "A load IC from the snapshot"; |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1832 profiler_ = NULL; | 1799 profiler_ = NULL; |
| 1833 } | 1800 } |
| 1834 | 1801 |
| 1835 delete ticker_; | 1802 delete ticker_; |
| 1836 ticker_ = NULL; | 1803 ticker_ = NULL; |
| 1837 | 1804 |
| 1838 return log_->Close(); | 1805 return log_->Close(); |
| 1839 } | 1806 } |
| 1840 | 1807 |
| 1841 } } // namespace v8::internal | 1808 } } // namespace v8::internal |
| OLD | NEW |