| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 1776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1787 // Loop until the sampler is disengaged. | 1787 // Loop until the sampler is disengaged. |
| 1788 while (sampler_->IsActive()) { | 1788 while (sampler_->IsActive()) { |
| 1789 TickSample sample; | 1789 TickSample sample; |
| 1790 | 1790 |
| 1791 // If profiling, we record the pc and sp of the profiled thread. | 1791 // If profiling, we record the pc and sp of the profiled thread. |
| 1792 if (sampler_->IsProfiling() | 1792 if (sampler_->IsProfiling() |
| 1793 && SuspendThread(profiled_thread_) != (DWORD)-1) { | 1793 && SuspendThread(profiled_thread_) != (DWORD)-1) { |
| 1794 context.ContextFlags = CONTEXT_FULL; | 1794 context.ContextFlags = CONTEXT_FULL; |
| 1795 if (GetThreadContext(profiled_thread_, &context) != 0) { | 1795 if (GetThreadContext(profiled_thread_, &context) != 0) { |
| 1796 #if V8_HOST_ARCH_X64 | 1796 #if V8_HOST_ARCH_X64 |
| 1797 UNIMPLEMENTED(); | |
| 1798 sample.pc = context.Rip; | 1797 sample.pc = context.Rip; |
| 1799 sample.sp = context.Rsp; | 1798 sample.sp = context.Rsp; |
| 1800 sample.fp = context.Rbp; | 1799 sample.fp = context.Rbp; |
| 1801 #else | 1800 #else |
| 1802 sample.pc = context.Eip; | 1801 sample.pc = context.Eip; |
| 1803 sample.sp = context.Esp; | 1802 sample.sp = context.Esp; |
| 1804 sample.fp = context.Ebp; | 1803 sample.fp = context.Ebp; |
| 1805 #endif | 1804 #endif |
| 1806 sampler_->SampleStack(&sample); | 1805 sampler_->SampleStack(&sample); |
| 1807 } | 1806 } |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1881 | 1880 |
| 1882 // Release the thread handles | 1881 // Release the thread handles |
| 1883 CloseHandle(data_->sampler_thread_); | 1882 CloseHandle(data_->sampler_thread_); |
| 1884 CloseHandle(data_->profiled_thread_); | 1883 CloseHandle(data_->profiled_thread_); |
| 1885 } | 1884 } |
| 1886 | 1885 |
| 1887 | 1886 |
| 1888 #endif // ENABLE_LOGGING_AND_PROFILING | 1887 #endif // ENABLE_LOGGING_AND_PROFILING |
| 1889 | 1888 |
| 1890 } } // namespace v8::internal | 1889 } } // namespace v8::internal |
| OLD | NEW |