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