Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: src/log.cc

Issue 13655: Make Logger::SuspectReadEvent extract the class name from the object. (Closed)
Patch Set: Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/log.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 if (OS::GetUserTime(&sec, &usec) != -1) { 586 if (OS::GetUserTime(&sec, &usec) != -1) {
587 fprintf(logfile_, "%d,%d,", sec, usec); 587 fprintf(logfile_, "%d,%d,", sec, usec);
588 } 588 }
589 fprintf(logfile_, "%.0f", OS::TimeCurrentMillis()); 589 fprintf(logfile_, "%.0f", OS::TimeCurrentMillis());
590 590
591 fprintf(logfile_, "\n"); 591 fprintf(logfile_, "\n");
592 #endif 592 #endif
593 } 593 }
594 594
595 595
596 void Logger::SuspectReadEvent(String* name, String* obj) { 596 void Logger::SuspectReadEvent(String* name, Object* obj) {
597 #ifdef ENABLE_LOGGING_AND_PROFILING 597 #ifdef ENABLE_LOGGING_AND_PROFILING
598 if (logfile_ == NULL || !FLAG_log_suspect) return; 598 if (logfile_ == NULL || !FLAG_log_suspect) return;
599 String* class_name = obj->IsJSObject()
600 ? JSObject::cast(obj)->class_name()
601 : Heap::empty_string();
599 ScopedLock sl(mutex_); 602 ScopedLock sl(mutex_);
600 fprintf(logfile_, "suspect-read,"); 603 fprintf(logfile_, "suspect-read,");
601 obj->PrintOn(logfile_); 604 class_name->PrintOn(logfile_);
602 fprintf(logfile_, ",\""); 605 fprintf(logfile_, ",\"");
603 name->PrintOn(logfile_); 606 name->PrintOn(logfile_);
604 fprintf(logfile_, "\"\n"); 607 fprintf(logfile_, "\"\n");
605 #endif 608 #endif
606 } 609 }
607 610
608 611
609 void Logger::HeapSampleBeginEvent(const char* space, const char* kind) { 612 void Logger::HeapSampleBeginEvent(const char* space, const char* kind) {
610 #ifdef ENABLE_LOGGING_AND_PROFILING 613 #ifdef ENABLE_LOGGING_AND_PROFILING
611 if (logfile_ == NULL || !FLAG_log_gc) return; 614 if (logfile_ == NULL || !FLAG_log_gc) return;
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 if (FLAG_log_state_changes) { 846 if (FLAG_log_state_changes) {
844 LOG(StringEvent("Leaving", StateToString(state_))); 847 LOG(StringEvent("Leaving", StateToString(state_)));
845 if (previous_) { 848 if (previous_) {
846 LOG(StringEvent("To", StateToString(previous_->state_))); 849 LOG(StringEvent("To", StateToString(previous_->state_)));
847 } 850 }
848 } 851 }
849 } 852 }
850 #endif 853 #endif
851 854
852 } } // namespace v8::internal 855 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/log.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698