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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 Isolate* isolate = Isolate::Current(); | 486 Isolate* isolate = Isolate::Current(); |
487 | 487 |
488 // Disable logging when using the new implementation. | 488 // Disable logging when using the new implementation. |
489 saved_logging_nesting_ = isolate->logger()->logging_nesting_; | 489 saved_logging_nesting_ = isolate->logger()->logging_nesting_; |
490 isolate->logger()->logging_nesting_ = 0; | 490 isolate->logger()->logging_nesting_ = 0; |
491 generator_ = new ProfileGenerator(profiles_); | 491 generator_ = new ProfileGenerator(profiles_); |
492 processor_ = new ProfilerEventsProcessor(generator_); | 492 processor_ = new ProfilerEventsProcessor(generator_); |
493 NoBarrier_Store(&is_profiling_, true); | 493 NoBarrier_Store(&is_profiling_, true); |
494 processor_->Start(); | 494 processor_->Start(); |
495 // Enumerate stuff we already have in the heap. | 495 // Enumerate stuff we already have in the heap. |
496 if (isolate->heap()->HasBeenSetup()) { | 496 if (isolate->heap()->HasBeenSetUp()) { |
497 if (!FLAG_prof_browser_mode) { | 497 if (!FLAG_prof_browser_mode) { |
498 bool saved_log_code_flag = FLAG_log_code; | 498 bool saved_log_code_flag = FLAG_log_code; |
499 FLAG_log_code = true; | 499 FLAG_log_code = true; |
500 isolate->logger()->LogCodeObjects(); | 500 isolate->logger()->LogCodeObjects(); |
501 FLAG_log_code = saved_log_code_flag; | 501 FLAG_log_code = saved_log_code_flag; |
502 } | 502 } |
503 isolate->logger()->LogCompiledFunctions(); | 503 isolate->logger()->LogCompiledFunctions(); |
504 isolate->logger()->LogAccessorCallbacks(); | 504 isolate->logger()->LogAccessorCallbacks(); |
505 } | 505 } |
506 // Enable stack sampling. | 506 // Enable stack sampling. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 processor_->Stop(); | 555 processor_->Stop(); |
556 processor_->Join(); | 556 processor_->Join(); |
557 delete processor_; | 557 delete processor_; |
558 delete generator_; | 558 delete generator_; |
559 processor_ = NULL; | 559 processor_ = NULL; |
560 generator_ = NULL; | 560 generator_ = NULL; |
561 logger->logging_nesting_ = saved_logging_nesting_; | 561 logger->logging_nesting_ = saved_logging_nesting_; |
562 } | 562 } |
563 | 563 |
564 | 564 |
565 void CpuProfiler::Setup() { | 565 void CpuProfiler::SetUp() { |
566 Isolate* isolate = Isolate::Current(); | 566 Isolate* isolate = Isolate::Current(); |
567 if (isolate->cpu_profiler() == NULL) { | 567 if (isolate->cpu_profiler() == NULL) { |
568 isolate->set_cpu_profiler(new CpuProfiler()); | 568 isolate->set_cpu_profiler(new CpuProfiler()); |
569 } | 569 } |
570 } | 570 } |
571 | 571 |
572 | 572 |
573 void CpuProfiler::TearDown() { | 573 void CpuProfiler::TearDown() { |
574 Isolate* isolate = Isolate::Current(); | 574 Isolate* isolate = Isolate::Current(); |
575 if (isolate->cpu_profiler() != NULL) { | 575 if (isolate->cpu_profiler() != NULL) { |
576 delete isolate->cpu_profiler(); | 576 delete isolate->cpu_profiler(); |
577 } | 577 } |
578 isolate->set_cpu_profiler(NULL); | 578 isolate->set_cpu_profiler(NULL); |
579 } | 579 } |
580 | 580 |
581 } } // namespace v8::internal | 581 } } // namespace v8::internal |
OLD | NEW |