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 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1143 "V8.CompileFullCode"; | 1143 "V8.CompileFullCode"; |
1144 const char* Logger::TimerEventScope::v8_execute = "V8.Execute"; | 1144 const char* Logger::TimerEventScope::v8_execute = "V8.Execute"; |
1145 const char* Logger::TimerEventScope::v8_external = "V8.External"; | 1145 const char* Logger::TimerEventScope::v8_external = "V8.External"; |
1146 | 1146 |
1147 | 1147 |
1148 void Logger::LogRegExpSource(Handle<JSRegExp> regexp) { | 1148 void Logger::LogRegExpSource(Handle<JSRegExp> regexp) { |
1149 // Prints "/" + re.source + "/" + | 1149 // Prints "/" + re.source + "/" + |
1150 // (re.global?"g":"") + (re.ignorecase?"i":"") + (re.multiline?"m":"") | 1150 // (re.global?"g":"") + (re.ignorecase?"i":"") + (re.multiline?"m":"") |
1151 Log::MessageBuilder msg(log_); | 1151 Log::MessageBuilder msg(log_); |
1152 | 1152 |
1153 Handle<Object> source = GetProperty(regexp, "source"); | 1153 Handle<Object> source = GetProperty(regexp, "source").ToHandleChecked(); |
1154 if (!source->IsString()) { | 1154 if (!source->IsString()) { |
1155 msg.Append("no source"); | 1155 msg.Append("no source"); |
1156 return; | 1156 return; |
1157 } | 1157 } |
1158 | 1158 |
1159 switch (regexp->TypeTag()) { | 1159 switch (regexp->TypeTag()) { |
1160 case JSRegExp::ATOM: | 1160 case JSRegExp::ATOM: |
1161 msg.Append('a'); | 1161 msg.Append('a'); |
1162 break; | 1162 break; |
1163 default: | 1163 default: |
1164 break; | 1164 break; |
1165 } | 1165 } |
1166 msg.Append('/'); | 1166 msg.Append('/'); |
1167 msg.AppendDetailed(*Handle<String>::cast(source), false); | 1167 msg.AppendDetailed(*Handle<String>::cast(source), false); |
1168 msg.Append('/'); | 1168 msg.Append('/'); |
1169 | 1169 |
1170 // global flag | 1170 // global flag |
1171 Handle<Object> global = GetProperty(regexp, "global"); | 1171 Handle<Object> global = GetProperty(regexp, "global").ToHandleChecked(); |
1172 if (global->IsTrue()) { | 1172 if (global->IsTrue()) { |
1173 msg.Append('g'); | 1173 msg.Append('g'); |
1174 } | 1174 } |
1175 // ignorecase flag | 1175 // ignorecase flag |
1176 Handle<Object> ignorecase = GetProperty(regexp, "ignoreCase"); | 1176 Handle<Object> ignorecase = |
| 1177 GetProperty(regexp, "ignoreCase").ToHandleChecked(); |
1177 if (ignorecase->IsTrue()) { | 1178 if (ignorecase->IsTrue()) { |
1178 msg.Append('i'); | 1179 msg.Append('i'); |
1179 } | 1180 } |
1180 // multiline flag | 1181 // multiline flag |
1181 Handle<Object> multiline = GetProperty(regexp, "multiline"); | 1182 Handle<Object> multiline = GetProperty(regexp, "multiline").ToHandleChecked(); |
1182 if (multiline->IsTrue()) { | 1183 if (multiline->IsTrue()) { |
1183 msg.Append('m'); | 1184 msg.Append('m'); |
1184 } | 1185 } |
1185 | 1186 |
1186 msg.WriteToLogFile(); | 1187 msg.WriteToLogFile(); |
1187 } | 1188 } |
1188 | 1189 |
1189 | 1190 |
1190 void Logger::RegExpCompileEvent(Handle<JSRegExp> regexp, bool in_cache) { | 1191 void Logger::RegExpCompileEvent(Handle<JSRegExp> regexp, bool in_cache) { |
1191 if (!log_->IsEnabled() || !FLAG_log_regexp) return; | 1192 if (!log_->IsEnabled() || !FLAG_log_regexp) return; |
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2155 if (jit_logger_) { | 2156 if (jit_logger_) { |
2156 removeCodeEventListener(jit_logger_); | 2157 removeCodeEventListener(jit_logger_); |
2157 delete jit_logger_; | 2158 delete jit_logger_; |
2158 jit_logger_ = NULL; | 2159 jit_logger_ = NULL; |
2159 } | 2160 } |
2160 | 2161 |
2161 return log_->Close(); | 2162 return log_->Close(); |
2162 } | 2163 } |
2163 | 2164 |
2164 } } // namespace v8::internal | 2165 } } // namespace v8::internal |
OLD | NEW |