| 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 #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/object.h" | 8 #include "vm/object.h" |
| 9 #include "vm/object_store.h" | 9 #include "vm/object_store.h" |
| 10 | 10 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 | 112 |
| 113 void SourceReport::PrintCallSitesData(JSONObject* jsobj, | 113 void SourceReport::PrintCallSitesData(JSONObject* jsobj, |
| 114 const Function& function, | 114 const Function& function, |
| 115 const Code& code) { | 115 const Code& code) { |
| 116 const TokenPosition begin_pos = function.token_pos(); | 116 const TokenPosition begin_pos = function.token_pos(); |
| 117 const TokenPosition end_pos = function.end_token_pos(); | 117 const TokenPosition end_pos = function.end_token_pos(); |
| 118 | 118 |
| 119 ZoneGrowableArray<const ICData*>* ic_data_array = | 119 ZoneGrowableArray<const ICData*>* ic_data_array = |
| 120 new(zone()) ZoneGrowableArray<const ICData*>(); | 120 new(zone()) ZoneGrowableArray<const ICData*>(); |
| 121 function.RestoreICDataMap(ic_data_array, false /* clone descriptors */); | 121 function.RestoreICDataMap(ic_data_array, false /* clone ic-data */); |
| 122 const PcDescriptors& descriptors = PcDescriptors::Handle( | 122 const PcDescriptors& descriptors = PcDescriptors::Handle( |
| 123 zone(), code.pc_descriptors()); | 123 zone(), code.pc_descriptors()); |
| 124 | 124 |
| 125 JSONArray sites(jsobj, "callSites"); | 125 JSONArray sites(jsobj, "callSites"); |
| 126 | 126 |
| 127 PcDescriptors::Iterator iter( | 127 PcDescriptors::Iterator iter( |
| 128 descriptors, | 128 descriptors, |
| 129 RawPcDescriptors::kIcCall | RawPcDescriptors::kUnoptStaticCall); | 129 RawPcDescriptors::kIcCall | RawPcDescriptors::kUnoptStaticCall); |
| 130 while (iter.MoveNext()) { | 130 while (iter.MoveNext()) { |
| 131 HANDLESCOPE(thread()); | 131 HANDLESCOPE(thread()); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 143 } | 143 } |
| 144 | 144 |
| 145 void SourceReport::PrintCoverageData(JSONObject* jsobj, | 145 void SourceReport::PrintCoverageData(JSONObject* jsobj, |
| 146 const Function& function, | 146 const Function& function, |
| 147 const Code& code) { | 147 const Code& code) { |
| 148 const TokenPosition begin_pos = function.token_pos(); | 148 const TokenPosition begin_pos = function.token_pos(); |
| 149 const TokenPosition end_pos = function.end_token_pos(); | 149 const TokenPosition end_pos = function.end_token_pos(); |
| 150 | 150 |
| 151 ZoneGrowableArray<const ICData*>* ic_data_array = | 151 ZoneGrowableArray<const ICData*>* ic_data_array = |
| 152 new(zone()) ZoneGrowableArray<const ICData*>(); | 152 new(zone()) ZoneGrowableArray<const ICData*>(); |
| 153 function.RestoreICDataMap(ic_data_array, false /* clone descriptors */); | 153 function.RestoreICDataMap(ic_data_array, false /* clone ic-data */); |
| 154 const PcDescriptors& descriptors = PcDescriptors::Handle( | 154 const PcDescriptors& descriptors = PcDescriptors::Handle( |
| 155 zone(), code.pc_descriptors()); | 155 zone(), code.pc_descriptors()); |
| 156 | 156 |
| 157 const int kCoverageNone = 0; | 157 const int kCoverageNone = 0; |
| 158 const int kCoverageMiss = 1; | 158 const int kCoverageMiss = 1; |
| 159 const int kCoverageHit = 2; | 159 const int kCoverageHit = 2; |
| 160 | 160 |
| 161 intptr_t func_length = (end_pos.Pos() - begin_pos.Pos()) + 1; | 161 intptr_t func_length = (end_pos.Pos() - begin_pos.Pos()) + 1; |
| 162 GrowableArray<char> coverage(func_length); | 162 GrowableArray<char> coverage(func_length); |
| 163 coverage.SetLength(func_length); | 163 coverage.SetLength(func_length); |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 VisitClosures(&ranges); | 371 VisitClosures(&ranges); |
| 372 } | 372 } |
| 373 | 373 |
| 374 // Print the script table. | 374 // Print the script table. |
| 375 JSONArray scripts(&report, "scripts"); | 375 JSONArray scripts(&report, "scripts"); |
| 376 PrintScriptTable(&scripts); | 376 PrintScriptTable(&scripts); |
| 377 } | 377 } |
| 378 | 378 |
| 379 | 379 |
| 380 } // namespace dart | 380 } // namespace dart |
| OLD | NEW |