| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 return true; | 320 return true; |
| 321 } | 321 } |
| 322 | 322 |
| 323 | 323 |
| 324 bool CpuProfilesCollection::StartProfiling(String* title, unsigned uid) { | 324 bool CpuProfilesCollection::StartProfiling(String* title, unsigned uid) { |
| 325 return StartProfiling(GetName(title), uid); | 325 return StartProfiling(GetName(title), uid); |
| 326 } | 326 } |
| 327 | 327 |
| 328 | 328 |
| 329 CpuProfile* CpuProfilesCollection::StopProfiling(const char* title) { | 329 CpuProfile* CpuProfilesCollection::StopProfiling(const char* title) { |
| 330 const int title_len = strlen(title); | 330 const int title_len = StrLength(title); |
| 331 CpuProfile* profile = NULL; | 331 CpuProfile* profile = NULL; |
| 332 current_profiles_semaphore_->Wait(); | 332 current_profiles_semaphore_->Wait(); |
| 333 for (int i = current_profiles_.length() - 1; i >= 0; --i) { | 333 for (int i = current_profiles_.length() - 1; i >= 0; --i) { |
| 334 if (title_len == 0 || strcmp(current_profiles_[i]->title(), title) == 0) { | 334 if (title_len == 0 || strcmp(current_profiles_[i]->title(), title) == 0) { |
| 335 profile = current_profiles_.Remove(i); | 335 profile = current_profiles_.Remove(i); |
| 336 break; | 336 break; |
| 337 } | 337 } |
| 338 } | 338 } |
| 339 current_profiles_semaphore_->Signal(); | 339 current_profiles_semaphore_->Signal(); |
| 340 | 340 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 // Put VM state as the topmost entry. | 516 // Put VM state as the topmost entry. |
| 517 *entry++ = EntryForVMState(sample.state); | 517 *entry++ = EntryForVMState(sample.state); |
| 518 } | 518 } |
| 519 | 519 |
| 520 profiles_->AddPathToCurrentProfiles(entries); | 520 profiles_->AddPathToCurrentProfiles(entries); |
| 521 } | 521 } |
| 522 | 522 |
| 523 } } // namespace v8::internal | 523 } } // namespace v8::internal |
| 524 | 524 |
| 525 #endif // ENABLE_CPP_PROFILES_PROCESSOR | 525 #endif // ENABLE_CPP_PROFILES_PROCESSOR |
| OLD | NEW |