OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 if (FLAG_prof) FLAG_log_code = true; | 73 if (FLAG_prof) FLAG_log_code = true; |
74 | 74 |
75 // --prof_lazy controls --log-code, implies --noprof_auto. | 75 // --prof_lazy controls --log-code, implies --noprof_auto. |
76 if (FLAG_prof_lazy) { | 76 if (FLAG_prof_lazy) { |
77 FLAG_log_code = false; | 77 FLAG_log_code = false; |
78 FLAG_prof_auto = false; | 78 FLAG_prof_auto = false; |
79 } | 79 } |
80 | 80 |
81 bool open_log_file = FLAG_log || FLAG_log_runtime || FLAG_log_api | 81 bool open_log_file = FLAG_log || FLAG_log_runtime || FLAG_log_api |
82 || FLAG_log_code || FLAG_log_gc || FLAG_log_handles || FLAG_log_suspect | 82 || FLAG_log_code || FLAG_log_gc || FLAG_log_handles || FLAG_log_suspect |
83 || FLAG_log_regexp || FLAG_log_state_changes || FLAG_ll_prof; | 83 || FLAG_log_regexp || FLAG_log_state_changes || FLAG_ll_prof |
| 84 || FLAG_log_timer_events; |
84 | 85 |
85 // If we're logging anything, we need to open the log file. | 86 // If we're logging anything, we need to open the log file. |
86 if (open_log_file) { | 87 if (open_log_file) { |
87 if (strcmp(FLAG_logfile, "-") == 0) { | 88 if (strcmp(FLAG_logfile, "-") == 0) { |
88 OpenStdout(); | 89 OpenStdout(); |
89 } else if (strcmp(FLAG_logfile, kLogToTemporaryFile) == 0) { | 90 } else if (strcmp(FLAG_logfile, kLogToTemporaryFile) == 0) { |
90 OpenTemporaryFile(); | 91 OpenTemporaryFile(); |
91 } else { | 92 } else { |
92 if (strchr(FLAG_logfile, '%') != NULL || | 93 if (strchr(FLAG_logfile, '%') != NULL || |
93 !Isolate::Current()->IsDefaultIsolate()) { | 94 !Isolate::Current()->IsDefaultIsolate()) { |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 ASSERT(pos_ <= Log::kMessageBufferSize); | 302 ASSERT(pos_ <= Log::kMessageBufferSize); |
302 const int written = log_->WriteToFile(log_->message_buffer_, pos_); | 303 const int written = log_->WriteToFile(log_->message_buffer_, pos_); |
303 if (written != pos_) { | 304 if (written != pos_) { |
304 log_->stop(); | 305 log_->stop(); |
305 log_->logger_->LogFailure(); | 306 log_->logger_->LogFailure(); |
306 } | 307 } |
307 } | 308 } |
308 | 309 |
309 | 310 |
310 } } // namespace v8::internal | 311 } } // namespace v8::internal |
OLD | NEW |