| OLD | NEW |
| 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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 ScopedLock sl(mutex_); | 581 ScopedLock sl(mutex_); |
| 582 SmartPointer<char> str = | 582 SmartPointer<char> str = |
| 583 name->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); | 583 name->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); |
| 584 fprintf(logfile_, "code-creation,%s,0x%x,%d,\"%s\"\n", tag, | 584 fprintf(logfile_, "code-creation,%s,0x%x,%d,\"%s\"\n", tag, |
| 585 reinterpret_cast<unsigned int>(code->address()), | 585 reinterpret_cast<unsigned int>(code->address()), |
| 586 code->instruction_size(), *str); | 586 code->instruction_size(), *str); |
| 587 #endif | 587 #endif |
| 588 } | 588 } |
| 589 | 589 |
| 590 | 590 |
| 591 void Logger::CodeCreateEvent(const char* tag, Code* code, String* name, |
| 592 String* source, int line) { |
| 593 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 594 if (logfile_ == NULL || !FLAG_log_code) return; |
| 595 ScopedLock sl(mutex_); |
| 596 SmartPointer<char> str = |
| 597 name->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); |
| 598 SmartPointer<char> sourcestr = |
| 599 source->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); |
| 600 fprintf(logfile_, "code-creation,%s,0x%x,%d,\"%s %s:%d\"\n", tag, |
| 601 reinterpret_cast<unsigned int>(code->address()), |
| 602 code->instruction_size(), *str, *sourcestr, line); |
| 603 #endif |
| 604 } |
| 605 |
| 606 |
| 591 void Logger::CodeCreateEvent(const char* tag, Code* code, int args_count) { | 607 void Logger::CodeCreateEvent(const char* tag, Code* code, int args_count) { |
| 592 #ifdef ENABLE_LOGGING_AND_PROFILING | 608 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 593 if (logfile_ == NULL || !FLAG_log_code) return; | 609 if (logfile_ == NULL || !FLAG_log_code) return; |
| 594 ScopedLock sl(mutex_); | 610 ScopedLock sl(mutex_); |
| 595 | 611 |
| 596 fprintf(logfile_, "code-creation,%s,0x%x,%d,\"args_count: %d\"\n", tag, | 612 fprintf(logfile_, "code-creation,%s,0x%x,%d,\"args_count: %d\"\n", tag, |
| 597 reinterpret_cast<unsigned int>(code->address()), | 613 reinterpret_cast<unsigned int>(code->address()), |
| 598 code->instruction_size(), | 614 code->instruction_size(), |
| 599 args_count); | 615 args_count); |
| 600 #endif | 616 #endif |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 if (FLAG_log_state_changes) { | 963 if (FLAG_log_state_changes) { |
| 948 LOG(StringEvent("Leaving", StateToString(state_))); | 964 LOG(StringEvent("Leaving", StateToString(state_))); |
| 949 if (previous_) { | 965 if (previous_) { |
| 950 LOG(StringEvent("To", StateToString(previous_->state_))); | 966 LOG(StringEvent("To", StateToString(previous_->state_))); |
| 951 } | 967 } |
| 952 } | 968 } |
| 953 } | 969 } |
| 954 #endif | 970 #endif |
| 955 | 971 |
| 956 } } // namespace v8::internal | 972 } } // namespace v8::internal |
| OLD | NEW |