| 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/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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 zone(), code.pc_descriptors()); | 139 zone(), code.pc_descriptors()); |
| 140 | 140 |
| 141 JSONArray sites(jsobj, "callSites"); | 141 JSONArray sites(jsobj, "callSites"); |
| 142 | 142 |
| 143 PcDescriptors::Iterator iter( | 143 PcDescriptors::Iterator iter( |
| 144 descriptors, | 144 descriptors, |
| 145 RawPcDescriptors::kIcCall | RawPcDescriptors::kUnoptStaticCall); | 145 RawPcDescriptors::kIcCall | RawPcDescriptors::kUnoptStaticCall); |
| 146 while (iter.MoveNext()) { | 146 while (iter.MoveNext()) { |
| 147 HANDLESCOPE(thread()); | 147 HANDLESCOPE(thread()); |
| 148 const ICData* ic_data = (*ic_data_array)[iter.DeoptId()]; | 148 const ICData* ic_data = (*ic_data_array)[iter.DeoptId()]; |
| 149 if (!ic_data->IsNull()) { | 149 if (ic_data != NULL) { |
| 150 const TokenPosition token_pos = iter.TokenPos(); | 150 const TokenPosition token_pos = iter.TokenPos(); |
| 151 if ((token_pos < begin_pos) || (token_pos > end_pos)) { | 151 if ((token_pos < begin_pos) || (token_pos > end_pos)) { |
| 152 // Does not correspond to a valid source position. | 152 // Does not correspond to a valid source position. |
| 153 continue; | 153 continue; |
| 154 } | 154 } |
| 155 bool is_static_call = iter.Kind() == RawPcDescriptors::kUnoptStaticCall; | 155 bool is_static_call = iter.Kind() == RawPcDescriptors::kUnoptStaticCall; |
| 156 ic_data->PrintToJSONArrayNew(sites, token_pos, is_static_call); | 156 ic_data->PrintToJSONArrayNew(sites, token_pos, is_static_call); |
| 157 } | 157 } |
| 158 } | 158 } |
| 159 } | 159 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 180 for (int i = 0; i < func_length; i++) { | 180 for (int i = 0; i < func_length; i++) { |
| 181 coverage[i] = kCoverageNone; | 181 coverage[i] = kCoverageNone; |
| 182 } | 182 } |
| 183 | 183 |
| 184 PcDescriptors::Iterator iter( | 184 PcDescriptors::Iterator iter( |
| 185 descriptors, | 185 descriptors, |
| 186 RawPcDescriptors::kIcCall | RawPcDescriptors::kUnoptStaticCall); | 186 RawPcDescriptors::kIcCall | RawPcDescriptors::kUnoptStaticCall); |
| 187 while (iter.MoveNext()) { | 187 while (iter.MoveNext()) { |
| 188 HANDLESCOPE(thread()); | 188 HANDLESCOPE(thread()); |
| 189 const ICData* ic_data = (*ic_data_array)[iter.DeoptId()]; | 189 const ICData* ic_data = (*ic_data_array)[iter.DeoptId()]; |
| 190 if (!ic_data->IsNull()) { | 190 if (ic_data != NULL) { |
| 191 const TokenPosition token_pos = iter.TokenPos(); | 191 const TokenPosition token_pos = iter.TokenPos(); |
| 192 if ((token_pos < begin_pos) || (token_pos > end_pos)) { | 192 if ((token_pos < begin_pos) || (token_pos > end_pos)) { |
| 193 // Does not correspond to a valid source position. | 193 // Does not correspond to a valid source position. |
| 194 continue; | 194 continue; |
| 195 } | 195 } |
| 196 intptr_t count = ic_data->AggregateCount(); | 196 intptr_t count = ic_data->AggregateCount(); |
| 197 intptr_t token_offset = token_pos.Pos() - begin_pos.Pos(); | 197 intptr_t token_offset = token_pos.Pos() - begin_pos.Pos(); |
| 198 if (count > 0) { | 198 if (count > 0) { |
| 199 coverage[token_offset] = kCoverageHit; | 199 coverage[token_offset] = kCoverageHit; |
| 200 } else { | 200 } else { |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 VisitClosures(&ranges); | 481 VisitClosures(&ranges); |
| 482 } | 482 } |
| 483 | 483 |
| 484 // Print the script table. | 484 // Print the script table. |
| 485 JSONArray scripts(&report, "scripts"); | 485 JSONArray scripts(&report, "scripts"); |
| 486 PrintScriptTable(&scripts); | 486 PrintScriptTable(&scripts); |
| 487 } | 487 } |
| 488 | 488 |
| 489 | 489 |
| 490 } // namespace dart | 490 } // namespace dart |
| OLD | NEW |