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 | 4 |
5 #ifndef VM_SOURCE_REPORT_H_ | 5 #ifndef VM_SOURCE_REPORT_H_ |
6 #define VM_SOURCE_REPORT_H_ | 6 #define VM_SOURCE_REPORT_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/flags.h" | 9 #include "vm/flags.h" |
10 #include "vm/hash_map.h" | 10 #include "vm/hash_map.h" |
11 #include "vm/object.h" | 11 #include "vm/object.h" |
12 | 12 |
13 namespace dart { | 13 namespace dart { |
14 | 14 |
15 // A SourceReport object is used to generate reports about the program | 15 // A SourceReport object is used to generate reports about the program |
16 // source code, with information associated with source token | 16 // source code, with information associated with source token |
17 // positions. There are multiple possible kinds of reports. | 17 // positions. There are multiple possible kinds of reports. |
18 class SourceReport { | 18 class SourceReport { |
19 public: | 19 public: |
20 enum ReportKind { | 20 enum ReportKind { |
21 kCallSites = 0x1, | 21 kCallSites = 0x1, |
22 kCoverage = 0x2, | 22 kCoverage = 0x2, |
| 23 kPossibleBreakpoints = 0x4, |
23 }; | 24 }; |
24 | 25 |
25 enum CompileMode { | 26 enum CompileMode { |
26 kNoCompile, | 27 kNoCompile, |
27 kForceCompile | 28 kForceCompile |
28 }; | 29 }; |
29 | 30 |
30 // report_set is a bitvector indicating which reports to generate | 31 // report_set is a bitvector indicating which reports to generate |
31 // (e.g. kCallSites | kCoverage). | 32 // (e.g. kCallSites | kCoverage). |
32 explicit SourceReport(intptr_t report_set, | 33 explicit SourceReport(intptr_t report_set, |
(...skipping 15 matching lines...) Expand all Loading... |
48 | 49 |
49 bool IsReportRequested(ReportKind report_kind); | 50 bool IsReportRequested(ReportKind report_kind); |
50 bool ShouldSkipFunction(const Function& func); | 51 bool ShouldSkipFunction(const Function& func); |
51 intptr_t GetScriptIndex(const Script& script); | 52 intptr_t GetScriptIndex(const Script& script); |
52 bool ScriptIsLoadedByLibrary(const Script& script, const Library& lib); | 53 bool ScriptIsLoadedByLibrary(const Script& script, const Library& lib); |
53 | 54 |
54 void PrintCallSitesData(JSONObject* jsobj, | 55 void PrintCallSitesData(JSONObject* jsobj, |
55 const Function& func, const Code& code); | 56 const Function& func, const Code& code); |
56 void PrintCoverageData(JSONObject* jsobj, | 57 void PrintCoverageData(JSONObject* jsobj, |
57 const Function& func, const Code& code); | 58 const Function& func, const Code& code); |
| 59 void PrintPossibleBreakpointsData(JSONObject* jsobj, |
| 60 const Function& func, const Code& code); |
58 void PrintScriptTable(JSONArray* jsarr); | 61 void PrintScriptTable(JSONArray* jsarr); |
59 | 62 |
60 void VisitFunction(JSONArray* jsarr, const Function& func); | 63 void VisitFunction(JSONArray* jsarr, const Function& func); |
61 void VisitLibrary(JSONArray* jsarr, const Library& lib); | 64 void VisitLibrary(JSONArray* jsarr, const Library& lib); |
62 void VisitClosures(JSONArray* jsarr); | 65 void VisitClosures(JSONArray* jsarr); |
63 | 66 |
64 // An entry in the script table. | 67 // An entry in the script table. |
65 struct ScriptTableEntry { | 68 struct ScriptTableEntry { |
66 ScriptTableEntry() : key(NULL), index(-1), script(NULL) {} | 69 ScriptTableEntry() : key(NULL), index(-1), script(NULL) {} |
67 | 70 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 intptr_t start_pos_; | 103 intptr_t start_pos_; |
101 intptr_t end_pos_; | 104 intptr_t end_pos_; |
102 GrowableArray<ScriptTableEntry> script_table_entries_; | 105 GrowableArray<ScriptTableEntry> script_table_entries_; |
103 DirectChainedHashMap<ScriptTableTrait> script_table_; | 106 DirectChainedHashMap<ScriptTableTrait> script_table_; |
104 intptr_t next_script_index_; | 107 intptr_t next_script_index_; |
105 }; | 108 }; |
106 | 109 |
107 } // namespace dart | 110 } // namespace dart |
108 | 111 |
109 #endif // VM_SOURCE_REPORT_H_ | 112 #endif // VM_SOURCE_REPORT_H_ |
OLD | NEW |