| 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/profiler_service.h" | 5 #include "vm/profiler_service.h" |
| 6 | 6 |
| 7 #include "vm/growable_array.h" | 7 #include "vm/growable_array.h" |
| 8 #include "vm/hash_map.h" | 8 #include "vm/hash_map.h" |
| 9 #include "vm/log.h" | 9 #include "vm/log.h" |
| 10 #include "vm/native_symbol.h" | 10 #include "vm/native_symbol.h" |
| (...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 ProcessedSample* sample, | 1096 ProcessedSample* sample, |
| 1097 intptr_t frame_index, | 1097 intptr_t frame_index, |
| 1098 // Outputs: | 1098 // Outputs: |
| 1099 GrowableArray<const Function*>** inlined_functions, | 1099 GrowableArray<const Function*>** inlined_functions, |
| 1100 GrowableArray<TokenPosition>** inlined_token_positions, | 1100 GrowableArray<TokenPosition>** inlined_token_positions, |
| 1101 TokenPosition* token_position) { | 1101 TokenPosition* token_position) { |
| 1102 const intptr_t offset = OffsetForPC(pc, code, sample, frame_index); | 1102 const intptr_t offset = OffsetForPC(pc, code, sample, frame_index); |
| 1103 CacheEntry* cache_entry = &cache_[NextFreeIndex()]; | 1103 CacheEntry* cache_entry = &cache_[NextFreeIndex()]; |
| 1104 cache_entry->pc = pc; | 1104 cache_entry->pc = pc; |
| 1105 cache_entry->offset = offset; | 1105 cache_entry->offset = offset; |
| 1106 code.GetInlinedFunctionsAt(offset, &(cache_entry->inlined_functions), | 1106 code.GetInlinedFunctionsAtInstruction( |
| 1107 &(cache_entry->inlined_token_positions)); | 1107 offset, &(cache_entry->inlined_functions), |
| 1108 &(cache_entry->inlined_token_positions)); |
| 1108 if (cache_entry->inlined_functions.length() == 0) { | 1109 if (cache_entry->inlined_functions.length() == 0) { |
| 1109 *inlined_functions = NULL; | 1110 *inlined_functions = NULL; |
| 1110 *inlined_token_positions = NULL; | 1111 *inlined_token_positions = NULL; |
| 1111 *token_position = cache_entry->token_position = TokenPosition(); | 1112 *token_position = cache_entry->token_position = TokenPosition(); |
| 1112 return; | 1113 return; |
| 1113 } | 1114 } |
| 1114 | 1115 |
| 1115 // Write outputs. | 1116 // Write outputs. |
| 1116 *inlined_functions = &(cache_entry->inlined_functions); | 1117 *inlined_functions = &(cache_entry->inlined_functions); |
| 1117 *inlined_token_positions = &(cache_entry->inlined_token_positions); | 1118 *inlined_token_positions = &(cache_entry->inlined_token_positions); |
| (...skipping 1645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2763 // Disable thread interrupts while processing the buffer. | 2764 // Disable thread interrupts while processing the buffer. |
| 2764 DisableThreadInterruptsScope dtis(thread); | 2765 DisableThreadInterruptsScope dtis(thread); |
| 2765 | 2766 |
| 2766 ClearProfileVisitor clear_profile(isolate); | 2767 ClearProfileVisitor clear_profile(isolate); |
| 2767 sample_buffer->VisitSamples(&clear_profile); | 2768 sample_buffer->VisitSamples(&clear_profile); |
| 2768 } | 2769 } |
| 2769 | 2770 |
| 2770 #endif // !PRODUCT | 2771 #endif // !PRODUCT |
| 2771 | 2772 |
| 2772 } // namespace dart | 2773 } // namespace dart |
| OLD | NEW |