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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 | 480 |
481 CpuProfilesCollection::~CpuProfilesCollection() { | 481 CpuProfilesCollection::~CpuProfilesCollection() { |
482 finished_profiles_.Iterate(DeleteCpuProfile); | 482 finished_profiles_.Iterate(DeleteCpuProfile); |
483 current_profiles_.Iterate(DeleteCpuProfile); | 483 current_profiles_.Iterate(DeleteCpuProfile); |
484 code_entries_.Iterate(DeleteCodeEntry); | 484 code_entries_.Iterate(DeleteCodeEntry); |
485 } | 485 } |
486 | 486 |
487 | 487 |
488 bool CpuProfilesCollection::StartProfiling(const char* title, | 488 bool CpuProfilesCollection::StartProfiling(const char* title, |
489 bool record_samples) { | 489 bool record_samples) { |
490 ASSERT(uid > 0); | |
491 current_profiles_semaphore_.Wait(); | 490 current_profiles_semaphore_.Wait(); |
492 if (current_profiles_.length() >= kMaxSimultaneousProfiles) { | 491 if (current_profiles_.length() >= kMaxSimultaneousProfiles) { |
493 current_profiles_semaphore_.Signal(); | 492 current_profiles_semaphore_.Signal(); |
494 return false; | 493 return false; |
495 } | 494 } |
496 for (int i = 0; i < current_profiles_.length(); ++i) { | 495 for (int i = 0; i < current_profiles_.length(); ++i) { |
497 if (strcmp(current_profiles_[i]->title(), title) == 0) { | 496 if (strcmp(current_profiles_[i]->title(), title) == 0) { |
498 // Ignore attempts to start profile with the same title. | 497 // Ignore attempts to start profile with the same title. |
499 current_profiles_semaphore_.Signal(); | 498 current_profiles_semaphore_.Signal(); |
500 return false; | 499 return false; |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 case OTHER: | 691 case OTHER: |
693 case EXTERNAL: | 692 case EXTERNAL: |
694 return program_entry_; | 693 return program_entry_; |
695 case IDLE: | 694 case IDLE: |
696 return idle_entry_; | 695 return idle_entry_; |
697 default: return NULL; | 696 default: return NULL; |
698 } | 697 } |
699 } | 698 } |
700 | 699 |
701 } } // namespace v8::internal | 700 } } // namespace v8::internal |
OLD | NEW |