| 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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 delete profiles_; | 430 delete profiles_; |
| 431 } | 431 } |
| 432 | 432 |
| 433 | 433 |
| 434 void CpuProfiler::ResetProfiles() { | 434 void CpuProfiler::ResetProfiles() { |
| 435 delete profiles_; | 435 delete profiles_; |
| 436 profiles_ = new CpuProfilesCollection(); | 436 profiles_ = new CpuProfilesCollection(); |
| 437 } | 437 } |
| 438 | 438 |
| 439 void CpuProfiler::StartProfiling(const char* title, bool record_samples) { | 439 void CpuProfiler::StartProfiling(const char* title, bool record_samples) { |
| 440 i::HandleScope scope(isolate_); |
| 441 v8::Local<v8::Context> context = v8::Context::New( |
| 442 reinterpret_cast<v8::Isolate*>(isolate_)); |
| 443 v8::Context::Scope contextScope(context); |
| 440 if (profiles_->StartProfiling(title, next_profile_uid_++, record_samples)) { | 444 if (profiles_->StartProfiling(title, next_profile_uid_++, record_samples)) { |
| 441 StartProcessorIfNotStarted(); | 445 StartProcessorIfNotStarted(); |
| 442 } | 446 } |
| 443 processor_->AddCurrentStack(); | 447 processor_->AddCurrentStack(); |
| 444 } | 448 } |
| 445 | 449 |
| 446 | 450 |
| 447 void CpuProfiler::StartProfiling(String* title, bool record_samples) { | 451 void CpuProfiler::StartProfiling(String* title, bool record_samples) { |
| 448 StartProfiling(profiles_->GetName(title), record_samples); | 452 StartProfiling(profiles_->GetName(title), record_samples); |
| 449 } | 453 } |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 processor_->Join(); | 524 processor_->Join(); |
| 521 delete processor_; | 525 delete processor_; |
| 522 delete generator_; | 526 delete generator_; |
| 523 processor_ = NULL; | 527 processor_ = NULL; |
| 524 generator_ = NULL; | 528 generator_ = NULL; |
| 525 logger->logging_nesting_ = saved_logging_nesting_; | 529 logger->logging_nesting_ = saved_logging_nesting_; |
| 526 } | 530 } |
| 527 | 531 |
| 528 | 532 |
| 529 } } // namespace v8::internal | 533 } } // namespace v8::internal |
| OLD | NEW |