OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 #ifndef PRODUCT | 4 #ifndef PRODUCT |
5 #include "vm/source_report.h" | 5 #include "vm/source_report.h" |
6 | 6 |
7 #include "vm/compiler.h" | 7 #include "vm/compiler.h" |
8 #include "vm/isolate.h" | 8 #include "vm/isolate.h" |
9 #include "vm/object.h" | 9 #include "vm/object.h" |
10 #include "vm/object_store.h" | 10 #include "vm/object_store.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 TokenPosition end_pos) { | 51 TokenPosition end_pos) { |
52 thread_ = thread; | 52 thread_ = thread; |
53 script_ = script; | 53 script_ = script; |
54 start_pos_ = start_pos; | 54 start_pos_ = start_pos; |
55 end_pos_ = end_pos; | 55 end_pos_ = end_pos; |
56 ClearScriptTable(); | 56 ClearScriptTable(); |
57 if (IsReportRequested(kProfile)) { | 57 if (IsReportRequested(kProfile)) { |
58 // Build the profile. | 58 // Build the profile. |
59 SampleFilter samplesForIsolate(thread_->isolate()->main_port(), | 59 SampleFilter samplesForIsolate(thread_->isolate()->main_port(), |
60 Thread::kMutatorTask, -1, -1); | 60 Thread::kMutatorTask, -1, -1); |
61 profile_.Build(thread, &samplesForIsolate, Profile::kNoTags); | 61 profile_.Build(thread, &samplesForIsolate, Profiler::sample_buffer(), |
| 62 Profile::kNoTags); |
62 } | 63 } |
63 } | 64 } |
64 | 65 |
65 | 66 |
66 bool SourceReport::IsReportRequested(ReportKind report_kind) { | 67 bool SourceReport::IsReportRequested(ReportKind report_kind) { |
67 return (report_set_ & report_kind) != 0; | 68 return (report_set_ & report_kind) != 0; |
68 } | 69 } |
69 | 70 |
70 | 71 |
71 bool SourceReport::ShouldSkipFunction(const Function& func) { | 72 bool SourceReport::ShouldSkipFunction(const Function& func) { |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 VisitClosures(&ranges); | 527 VisitClosures(&ranges); |
527 } | 528 } |
528 | 529 |
529 // Print the script table. | 530 // Print the script table. |
530 JSONArray scripts(&report, "scripts"); | 531 JSONArray scripts(&report, "scripts"); |
531 PrintScriptTable(&scripts); | 532 PrintScriptTable(&scripts); |
532 } | 533 } |
533 | 534 |
534 } // namespace dart | 535 } // namespace dart |
535 #endif // PRODUCT | 536 #endif // PRODUCT |
OLD | NEW |