| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 // Terminate the worker thread by setting running_ to false, | 679 // Terminate the worker thread by setting running_ to false, |
| 680 // inserting a fake element in the queue and then wait for | 680 // inserting a fake element in the queue and then wait for |
| 681 // the thread to terminate. | 681 // the thread to terminate. |
| 682 running_ = false; | 682 running_ = false; |
| 683 TickSample sample; | 683 TickSample sample; |
| 684 // Reset 'paused_' flag, otherwise semaphore may not be signalled. | 684 // Reset 'paused_' flag, otherwise semaphore may not be signalled. |
| 685 resume(); | 685 resume(); |
| 686 Insert(&sample); | 686 Insert(&sample); |
| 687 Join(); | 687 Join(); |
| 688 | 688 |
| 689 LOG(ISOLATE, UncheckedStringEvent("profiler", "end")); | 689 LOG(isolate_, UncheckedStringEvent("profiler", "end")); |
| 690 } | 690 } |
| 691 | 691 |
| 692 | 692 |
| 693 void Profiler::Run() { | 693 void Profiler::Run() { |
| 694 TickSample sample; | 694 TickSample sample; |
| 695 bool overflow = Remove(&sample); | 695 bool overflow = Remove(&sample); |
| 696 while (running_) { | 696 while (running_) { |
| 697 LOG(isolate_, TickEvent(&sample, overflow)); | 697 LOG(isolate_, TickEvent(&sample, overflow)); |
| 698 overflow = Remove(&sample); | 698 overflow = Remove(&sample); |
| 699 } | 699 } |
| (...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1906 if (jit_logger_) { | 1906 if (jit_logger_) { |
| 1907 removeCodeEventListener(jit_logger_); | 1907 removeCodeEventListener(jit_logger_); |
| 1908 delete jit_logger_; | 1908 delete jit_logger_; |
| 1909 jit_logger_ = NULL; | 1909 jit_logger_ = NULL; |
| 1910 } | 1910 } |
| 1911 | 1911 |
| 1912 return log_->Close(); | 1912 return log_->Close(); |
| 1913 } | 1913 } |
| 1914 | 1914 |
| 1915 } } // namespace v8::internal | 1915 } } // namespace v8::internal |
| OLD | NEW |