| 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 name_buffer_->AppendBytes(ComputeMarker(code)); | 205 name_buffer_->AppendBytes(ComputeMarker(code)); |
| 206 name_buffer_->AppendName(name); | 206 name_buffer_->AppendName(name); |
| 207 LogRecordedBuffer(code, shared, name_buffer_->get(), name_buffer_->size()); | 207 LogRecordedBuffer(code, shared, name_buffer_->get(), name_buffer_->size()); |
| 208 } | 208 } |
| 209 | 209 |
| 210 | 210 |
| 211 void CodeEventLogger::CodeCreateEvent(Logger::LogEventsAndTags tag, | 211 void CodeEventLogger::CodeCreateEvent(Logger::LogEventsAndTags tag, |
| 212 Code* code, | 212 Code* code, |
| 213 SharedFunctionInfo* shared, | 213 SharedFunctionInfo* shared, |
| 214 CompilationInfo* info, | 214 CompilationInfo* info, |
| 215 Name* source, int line) { | 215 Name* source, int line, int column) { |
| 216 name_buffer_->Init(tag); | 216 name_buffer_->Init(tag); |
| 217 name_buffer_->AppendBytes(ComputeMarker(code)); | 217 name_buffer_->AppendBytes(ComputeMarker(code)); |
| 218 name_buffer_->AppendString(shared->DebugName()); | 218 name_buffer_->AppendString(shared->DebugName()); |
| 219 name_buffer_->AppendByte(' '); | 219 name_buffer_->AppendByte(' '); |
| 220 if (source->IsString()) { | 220 if (source->IsString()) { |
| 221 name_buffer_->AppendString(String::cast(source)); | 221 name_buffer_->AppendString(String::cast(source)); |
| 222 } else { | 222 } else { |
| 223 name_buffer_->AppendBytes("symbol(hash "); | 223 name_buffer_->AppendBytes("symbol(hash "); |
| 224 name_buffer_->AppendHex(Name::cast(source)->Hash()); | 224 name_buffer_->AppendHex(Name::cast(source)->Hash()); |
| 225 name_buffer_->AppendByte(')'); | 225 name_buffer_->AppendByte(')'); |
| (...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1225 | 1225 |
| 1226 | 1226 |
| 1227 // Although, it is possible to extract source and line from | 1227 // Although, it is possible to extract source and line from |
| 1228 // the SharedFunctionInfo object, we left it to caller | 1228 // the SharedFunctionInfo object, we left it to caller |
| 1229 // to leave logging functions free from heap allocations. | 1229 // to leave logging functions free from heap allocations. |
| 1230 void Logger::CodeCreateEvent(LogEventsAndTags tag, | 1230 void Logger::CodeCreateEvent(LogEventsAndTags tag, |
| 1231 Code* code, | 1231 Code* code, |
| 1232 SharedFunctionInfo* shared, | 1232 SharedFunctionInfo* shared, |
| 1233 CompilationInfo* info, | 1233 CompilationInfo* info, |
| 1234 Name* source, int line, int column) { | 1234 Name* source, int line, int column) { |
| 1235 PROFILER_LOG(CodeCreateEvent(tag, code, shared, info, source, line)); | 1235 PROFILER_LOG(CodeCreateEvent(tag, code, shared, info, source, line, column)); |
| 1236 | 1236 |
| 1237 if (!is_logging_code_events()) return; | 1237 if (!is_logging_code_events()) return; |
| 1238 CALL_LISTENERS(CodeCreateEvent(tag, code, shared, info, source, line)); | 1238 CALL_LISTENERS(CodeCreateEvent(tag, code, shared, info, source, line, |
| 1239 column)); |
| 1239 | 1240 |
| 1240 if (!FLAG_log_code || !log_->IsEnabled()) return; | 1241 if (!FLAG_log_code || !log_->IsEnabled()) return; |
| 1241 Log::MessageBuilder msg(log_); | 1242 Log::MessageBuilder msg(log_); |
| 1242 AppendCodeCreateHeader(&msg, tag, code); | 1243 AppendCodeCreateHeader(&msg, tag, code); |
| 1243 SmartArrayPointer<char> name = | 1244 SmartArrayPointer<char> name = |
| 1244 shared->DebugName()->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); | 1245 shared->DebugName()->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); |
| 1245 msg.Append("\"%s ", *name); | 1246 msg.Append("\"%s ", *name); |
| 1246 if (source->IsString()) { | 1247 if (source->IsString()) { |
| 1247 SmartArrayPointer<char> sourcestr = | 1248 SmartArrayPointer<char> sourcestr = |
| 1248 String::cast(source)->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); | 1249 String::cast(source)->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1914 if (jit_logger_) { | 1915 if (jit_logger_) { |
| 1915 removeCodeEventListener(jit_logger_); | 1916 removeCodeEventListener(jit_logger_); |
| 1916 delete jit_logger_; | 1917 delete jit_logger_; |
| 1917 jit_logger_ = NULL; | 1918 jit_logger_ = NULL; |
| 1918 } | 1919 } |
| 1919 | 1920 |
| 1920 return log_->Close(); | 1921 return log_->Close(); |
| 1921 } | 1922 } |
| 1922 | 1923 |
| 1923 } } // namespace v8::internal | 1924 } } // namespace v8::internal |
| OLD | NEW |