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 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1201 void Logger::LogRuntime(Vector<const char> format, | 1201 void Logger::LogRuntime(Vector<const char> format, |
1202 Handle<JSArray> args) { | 1202 Handle<JSArray> args) { |
1203 if (!log_->IsEnabled() || !FLAG_log_runtime) return; | 1203 if (!log_->IsEnabled() || !FLAG_log_runtime) return; |
1204 Log::MessageBuilder msg(log_); | 1204 Log::MessageBuilder msg(log_); |
1205 for (int i = 0; i < format.length(); i++) { | 1205 for (int i = 0; i < format.length(); i++) { |
1206 char c = format[i]; | 1206 char c = format[i]; |
1207 if (c == '%' && i <= format.length() - 2) { | 1207 if (c == '%' && i <= format.length() - 2) { |
1208 i++; | 1208 i++; |
1209 ASSERT('0' <= format[i] && format[i] <= '9'); | 1209 ASSERT('0' <= format[i] && format[i] <= '9'); |
1210 // No exception expected when getting an element from an array literal. | 1210 // No exception expected when getting an element from an array literal. |
1211 Handle<Object> obj = | 1211 Handle<Object> obj = Object::GetElement( |
1212 Object::GetElementNoExceptionThrown(isolate_, args, format[i] - '0'); | 1212 isolate_, args, format[i] - '0').ToHandleChecked(); |
1213 i++; | 1213 i++; |
1214 switch (format[i]) { | 1214 switch (format[i]) { |
1215 case 's': | 1215 case 's': |
1216 msg.AppendDetailed(String::cast(*obj), false); | 1216 msg.AppendDetailed(String::cast(*obj), false); |
1217 break; | 1217 break; |
1218 case 'S': | 1218 case 'S': |
1219 msg.AppendDetailed(String::cast(*obj), true); | 1219 msg.AppendDetailed(String::cast(*obj), true); |
1220 break; | 1220 break; |
1221 case 'r': | 1221 case 'r': |
1222 Logger::LogRegExpSource(Handle<JSRegExp>::cast(obj)); | 1222 Logger::LogRegExpSource(Handle<JSRegExp>::cast(obj)); |
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2156 if (jit_logger_) { | 2156 if (jit_logger_) { |
2157 removeCodeEventListener(jit_logger_); | 2157 removeCodeEventListener(jit_logger_); |
2158 delete jit_logger_; | 2158 delete jit_logger_; |
2159 jit_logger_ = NULL; | 2159 jit_logger_ = NULL; |
2160 } | 2160 } |
2161 | 2161 |
2162 return log_->Close(); | 2162 return log_->Close(); |
2163 } | 2163 } |
2164 | 2164 |
2165 } } // namespace v8::internal | 2165 } } // namespace v8::internal |
OLD | NEW |