| 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 "vm/coverage.h" | 5 #include "vm/coverage.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 | 8 |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 const intptr_t begin_pos = function.token_pos(); | 89 const intptr_t begin_pos = function.token_pos(); |
| 90 const intptr_t end_pos = function.end_token_pos(); | 90 const intptr_t end_pos = function.end_token_pos(); |
| 91 intptr_t last_line = -1; | 91 intptr_t last_line = -1; |
| 92 intptr_t last_count = 0; | 92 intptr_t last_count = 0; |
| 93 // Only IC based calls have counting. | 93 // Only IC based calls have counting. |
| 94 PcDescriptors::Iterator iter(descriptors, | 94 PcDescriptors::Iterator iter(descriptors, |
| 95 RawPcDescriptors::kIcCall | RawPcDescriptors::kUnoptStaticCall); | 95 RawPcDescriptors::kIcCall | RawPcDescriptors::kUnoptStaticCall); |
| 96 while (iter.HasNext()) { | 96 while (iter.HasNext()) { |
| 97 HANDLESCOPE(isolate); | 97 HANDLESCOPE(isolate); |
| 98 const RawPcDescriptors::PcDescriptorRec& rec = iter.Next(); | 98 const RawPcDescriptors::PcDescriptorRec& rec = iter.Next(); |
| 99 intptr_t deopt_id = rec.deopt_id; | 99 intptr_t deopt_id = rec.deopt_id(); |
| 100 const ICData* ic_data = (*ic_data_array)[deopt_id]; | 100 const ICData* ic_data = (*ic_data_array)[deopt_id]; |
| 101 if (!ic_data->IsNull()) { | 101 if (!ic_data->IsNull()) { |
| 102 intptr_t token_pos = rec.token_pos; | 102 intptr_t token_pos = rec.token_pos(); |
| 103 // Filter out descriptors that do not map to tokens in the source code. | 103 // Filter out descriptors that do not map to tokens in the source code. |
| 104 if ((token_pos < begin_pos) || (token_pos > end_pos)) { | 104 if ((token_pos < begin_pos) || (token_pos > end_pos)) { |
| 105 continue; | 105 continue; |
| 106 } | 106 } |
| 107 intptr_t line = pos_to_line[token_pos]; | 107 intptr_t line = pos_to_line[token_pos]; |
| 108 #if defined(DEBUG) | 108 #if defined(DEBUG) |
| 109 const Script& script = Script::Handle(function.script()); | 109 const Script& script = Script::Handle(function.script()); |
| 110 intptr_t test_line = -1; | 110 intptr_t test_line = -1; |
| 111 script.GetTokenLocation(token_pos, &test_line, NULL); | 111 script.GetTokenLocation(token_pos, &test_line, NULL); |
| 112 ASSERT(test_line == line); | 112 ASSERT(test_line == line); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 cls = it.GetNextClass(); | 283 cls = it.GetNextClass(); |
| 284 ASSERT(!cls.IsNull()); | 284 ASSERT(!cls.IsNull()); |
| 285 PrintClass(lib, cls, jsarr, filter); | 285 PrintClass(lib, cls, jsarr, filter); |
| 286 } | 286 } |
| 287 } | 287 } |
| 288 } | 288 } |
| 289 } | 289 } |
| 290 | 290 |
| 291 | 291 |
| 292 } // namespace dart | 292 } // namespace dart |
| OLD | NEW |