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); | |
Ivan Posva
2015/08/20 18:00:10
How often does the first value change while a proc
Cutch
2015/08/20 20:40:18
Aside from tests it never changes.
| |
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 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1319 uword pc) { | 1321 uword pc) { |
1320 return vm_isolate->heap()->CodeContains(pc) | 1322 return vm_isolate->heap()->CodeContains(pc) |
1321 || isolate->heap()->CodeContains(pc); | 1323 || isolate->heap()->CodeContains(pc); |
1322 } | 1324 } |
1323 | 1325 |
1324 | 1326 |
1325 ProcessedSampleBuffer::ProcessedSampleBuffer() { | 1327 ProcessedSampleBuffer::ProcessedSampleBuffer() { |
1326 } | 1328 } |
1327 | 1329 |
1328 } // namespace dart | 1330 } // namespace dart |
OLD | NEW |