| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/address_sanitizer.h" | 5 #include "platform/address_sanitizer.h" |
| 6 #include "platform/memory_sanitizer.h" | 6 #include "platform/memory_sanitizer.h" |
| 7 #include "platform/utils.h" | 7 #include "platform/utils.h" |
| 8 | 8 |
| 9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
| 10 #include "vm/atomic.h" | 10 #include "vm/atomic.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 return; | 162 return; |
| 163 } | 163 } |
| 164 if (!FLAG_profile) { | 164 if (!FLAG_profile) { |
| 165 return; | 165 return; |
| 166 } | 166 } |
| 167 ASSERT(initialized_); | 167 ASSERT(initialized_); |
| 168 IsolateProfilerData* profiler_data = isolate->profiler_data(); | 168 IsolateProfilerData* profiler_data = isolate->profiler_data(); |
| 169 if (profiler_data == NULL) { | 169 if (profiler_data == NULL) { |
| 170 return; | 170 return; |
| 171 } | 171 } |
| 172 ThreadInterrupter::Register(RecordSampleInterruptCallback, isolate); | 172 Thread* thread = Thread::Current(); |
| 173 thread->SetThreadInterrupter(RecordSampleInterruptCallback, isolate); |
| 173 ThreadInterrupter::WakeUp(); | 174 ThreadInterrupter::WakeUp(); |
| 174 } | 175 } |
| 175 | 176 |
| 176 | 177 |
| 177 void Profiler::EndExecution(Isolate* isolate) { | 178 void Profiler::EndExecution(Isolate* isolate) { |
| 178 if (isolate == NULL) { | 179 if (isolate == NULL) { |
| 179 return; | 180 return; |
| 180 } | 181 } |
| 181 if (!FLAG_profile) { | 182 if (!FLAG_profile) { |
| 182 return; | 183 return; |
| 183 } | 184 } |
| 184 ASSERT(initialized_); | 185 ASSERT(initialized_); |
| 185 ThreadInterrupter::Unregister(); | 186 Thread* thread = Thread::Current(); |
| 187 thread->SetThreadInterrupter(NULL, NULL); |
| 186 } | 188 } |
| 187 | 189 |
| 188 | 190 |
| 189 IsolateProfilerData::IsolateProfilerData(SampleBuffer* sample_buffer, | 191 IsolateProfilerData::IsolateProfilerData(SampleBuffer* sample_buffer, |
| 190 bool own_sample_buffer) { | 192 bool own_sample_buffer) { |
| 191 ASSERT(sample_buffer != NULL); | 193 ASSERT(sample_buffer != NULL); |
| 192 sample_buffer_ = sample_buffer; | 194 sample_buffer_ = sample_buffer; |
| 193 own_sample_buffer_ = own_sample_buffer; | 195 own_sample_buffer_ = own_sample_buffer; |
| 194 block_count_ = 0; | 196 block_count_ = 0; |
| 195 } | 197 } |
| (...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1322 uword pc) { | 1324 uword pc) { |
| 1323 return vm_isolate->heap()->CodeContains(pc) | 1325 return vm_isolate->heap()->CodeContains(pc) |
| 1324 || isolate->heap()->CodeContains(pc); | 1326 || isolate->heap()->CodeContains(pc); |
| 1325 } | 1327 } |
| 1326 | 1328 |
| 1327 | 1329 |
| 1328 ProcessedSampleBuffer::ProcessedSampleBuffer() { | 1330 ProcessedSampleBuffer::ProcessedSampleBuffer() { |
| 1329 } | 1331 } |
| 1330 | 1332 |
| 1331 } // namespace dart | 1333 } // namespace dart |
| OLD | NEW |