| 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 1747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1758 } | 1758 } |
| 1759 Address setter_entry = v8::ToCData<Address>(ai->setter()); | 1759 Address setter_entry = v8::ToCData<Address>(ai->setter()); |
| 1760 if (setter_entry != 0) { | 1760 if (setter_entry != 0) { |
| 1761 PROFILE(isolate_, SetterCallbackEvent(name, setter_entry)); | 1761 PROFILE(isolate_, SetterCallbackEvent(name, setter_entry)); |
| 1762 } | 1762 } |
| 1763 } | 1763 } |
| 1764 } | 1764 } |
| 1765 | 1765 |
| 1766 | 1766 |
| 1767 static void AddIsolateIdIfNeeded(Isolate* isolate, StringStream* stream) { | 1767 static void AddIsolateIdIfNeeded(Isolate* isolate, StringStream* stream) { |
| 1768 if (isolate->IsDefaultIsolate()) return; | 1768 if (isolate->IsDefaultIsolate() || !FLAG_logfile_per_isolate) return; |
| 1769 stream->Add("isolate-%p-", isolate); | 1769 stream->Add("isolate-%p-", isolate); |
| 1770 } | 1770 } |
| 1771 | 1771 |
| 1772 | 1772 |
| 1773 static SmartArrayPointer<const char> PrepareLogFileName( | 1773 static SmartArrayPointer<const char> PrepareLogFileName( |
| 1774 Isolate* isolate, const char* file_name) { | 1774 Isolate* isolate, const char* file_name) { |
| 1775 if (strchr(file_name, '%') != NULL || | 1775 if (strchr(file_name, '%') != NULL || !isolate->IsDefaultIsolate()) { |
| 1776 !isolate->IsDefaultIsolate()) { | |
| 1777 // If there's a '%' in the log file name we have to expand | 1776 // If there's a '%' in the log file name we have to expand |
| 1778 // placeholders. | 1777 // placeholders. |
| 1779 HeapStringAllocator allocator; | 1778 HeapStringAllocator allocator; |
| 1780 StringStream stream(&allocator); | 1779 StringStream stream(&allocator); |
| 1781 AddIsolateIdIfNeeded(isolate, &stream); | 1780 AddIsolateIdIfNeeded(isolate, &stream); |
| 1782 for (const char* p = file_name; *p; p++) { | 1781 for (const char* p = file_name; *p; p++) { |
| 1783 if (*p == '%') { | 1782 if (*p == '%') { |
| 1784 p++; | 1783 p++; |
| 1785 switch (*p) { | 1784 switch (*p) { |
| 1786 case '\0': | 1785 case '\0': |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1906 if (jit_logger_) { | 1905 if (jit_logger_) { |
| 1907 removeCodeEventListener(jit_logger_); | 1906 removeCodeEventListener(jit_logger_); |
| 1908 delete jit_logger_; | 1907 delete jit_logger_; |
| 1909 jit_logger_ = NULL; | 1908 jit_logger_ = NULL; |
| 1910 } | 1909 } |
| 1911 | 1910 |
| 1912 return log_->Close(); | 1911 return log_->Close(); |
| 1913 } | 1912 } |
| 1914 | 1913 |
| 1915 } } // namespace v8::internal | 1914 } } // namespace v8::internal |
| OLD | NEW |