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 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 void Logger::LogRuntime(Vector<const char> format, | 967 void Logger::LogRuntime(Vector<const char> format, |
968 JSArray* args) { | 968 JSArray* args) { |
969 if (!log_->IsEnabled() || !FLAG_log_runtime) return; | 969 if (!log_->IsEnabled() || !FLAG_log_runtime) return; |
970 HandleScope scope(isolate_); | 970 HandleScope scope(isolate_); |
971 Log::MessageBuilder msg(log_); | 971 Log::MessageBuilder msg(log_); |
972 for (int i = 0; i < format.length(); i++) { | 972 for (int i = 0; i < format.length(); i++) { |
973 char c = format[i]; | 973 char c = format[i]; |
974 if (c == '%' && i <= format.length() - 2) { | 974 if (c == '%' && i <= format.length() - 2) { |
975 i++; | 975 i++; |
976 ASSERT('0' <= format[i] && format[i] <= '9'); | 976 ASSERT('0' <= format[i] && format[i] <= '9'); |
977 MaybeObject* maybe = args->GetElement(format[i] - '0'); | 977 MaybeObject* maybe = args->GetElement(isolate_, format[i] - '0'); |
978 Object* obj; | 978 Object* obj; |
979 if (!maybe->ToObject(&obj)) { | 979 if (!maybe->ToObject(&obj)) { |
980 msg.Append("<exception>"); | 980 msg.Append("<exception>"); |
981 continue; | 981 continue; |
982 } | 982 } |
983 i++; | 983 i++; |
984 switch (format[i]) { | 984 switch (format[i]) { |
985 case 's': | 985 case 's': |
986 msg.AppendDetailed(String::cast(obj), false); | 986 msg.AppendDetailed(String::cast(obj), false); |
987 break; | 987 break; |
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1906 if (jit_logger_) { | 1906 if (jit_logger_) { |
1907 removeCodeEventListener(jit_logger_); | 1907 removeCodeEventListener(jit_logger_); |
1908 delete jit_logger_; | 1908 delete jit_logger_; |
1909 jit_logger_ = NULL; | 1909 jit_logger_ = NULL; |
1910 } | 1910 } |
1911 | 1911 |
1912 return log_->Close(); | 1912 return log_->Close(); |
1913 } | 1913 } |
1914 | 1914 |
1915 } } // namespace v8::internal | 1915 } } // namespace v8::internal |
OLD | NEW |