| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 169 |
| 170 void CpuProfiler::DeleteAllProfiles() { | 170 void CpuProfiler::DeleteAllProfiles() { |
| 171 if (is_profiling_) StopProcessor(); | 171 if (is_profiling_) StopProcessor(); |
| 172 ResetProfiles(); | 172 ResetProfiles(); |
| 173 } | 173 } |
| 174 | 174 |
| 175 | 175 |
| 176 void CpuProfiler::DeleteProfile(CpuProfile* profile) { | 176 void CpuProfiler::DeleteProfile(CpuProfile* profile) { |
| 177 profiles_->RemoveProfile(profile); | 177 profiles_->RemoveProfile(profile); |
| 178 delete profile; | 178 delete profile; |
| 179 if (profiles_->profiles()->is_empty() && !is_profiling_) { |
| 180 // If this was the last profile, clean up all accessory data as well. |
| 181 ResetProfiles(); |
| 182 } |
| 179 } | 183 } |
| 180 | 184 |
| 181 | 185 |
| 182 static bool FilterOutCodeCreateEvent(Logger::LogEventsAndTags tag) { | 186 static bool FilterOutCodeCreateEvent(Logger::LogEventsAndTags tag) { |
| 183 return FLAG_prof_browser_mode | 187 return FLAG_prof_browser_mode |
| 184 && (tag != Logger::CALLBACK_TAG | 188 && (tag != Logger::CALLBACK_TAG |
| 185 && tag != Logger::FUNCTION_TAG | 189 && tag != Logger::FUNCTION_TAG |
| 186 && tag != Logger::LAZY_COMPILE_TAG | 190 && tag != Logger::LAZY_COMPILE_TAG |
| 187 && tag != Logger::REG_EXP_TAG | 191 && tag != Logger::REG_EXP_TAG |
| 188 && tag != Logger::SCRIPT_TAG); | 192 && tag != Logger::SCRIPT_TAG); |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 ReportBuiltinEventRecord* rec = &evt_rec.ReportBuiltinEventRecord_; | 517 ReportBuiltinEventRecord* rec = &evt_rec.ReportBuiltinEventRecord_; |
| 514 Builtins::Name id = static_cast<Builtins::Name>(i); | 518 Builtins::Name id = static_cast<Builtins::Name>(i); |
| 515 rec->start = builtins->builtin(id)->address(); | 519 rec->start = builtins->builtin(id)->address(); |
| 516 rec->builtin_id = id; | 520 rec->builtin_id = id; |
| 517 processor_->Enqueue(evt_rec); | 521 processor_->Enqueue(evt_rec); |
| 518 } | 522 } |
| 519 } | 523 } |
| 520 | 524 |
| 521 | 525 |
| 522 } } // namespace v8::internal | 526 } } // namespace v8::internal |
| OLD | NEW |