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 part of cpu_profiler; | 5 part of cpu_profiler; |
6 | 6 |
7 abstract class CallTreeNode<NodeT extends M.CallTreeNode> | 7 abstract class CallTreeNode<NodeT extends M.CallTreeNode> |
8 implements M.CallTreeNode { | 8 implements M.CallTreeNode { |
9 final List<NodeT> children; | 9 final List<NodeT> children; |
10 final int count; | 10 final int count; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 final int ticks; | 97 final int ticks; |
98 FunctionCallTreeNodeCode(this.code, this.ticks); | 98 FunctionCallTreeNodeCode(this.code, this.ticks); |
99 } | 99 } |
100 | 100 |
101 class FunctionCallTreeNode extends CallTreeNode { | 101 class FunctionCallTreeNode extends CallTreeNode { |
102 final ProfileFunction profileFunction; | 102 final ProfileFunction profileFunction; |
103 final codes = new List<FunctionCallTreeNodeCode>(); | 103 final codes = new List<FunctionCallTreeNodeCode>(); |
104 int _totalCodeTicks = 0; | 104 int _totalCodeTicks = 0; |
105 int get totalCodesTicks => _totalCodeTicks; | 105 int get totalCodesTicks => _totalCodeTicks; |
106 | 106 |
107 String get name => profileFunction.function.name; | 107 String get name => M.getFunctionFullName(profileFunction.function); |
108 Object get profileData => profileFunction; | 108 Object get profileData => profileFunction; |
109 | 109 |
110 FunctionCallTreeNode(this.profileFunction, int count) | 110 FunctionCallTreeNode(this.profileFunction, int count) |
111 : super(new List<FunctionCallTreeNode>(), count) { | 111 : super(new List<FunctionCallTreeNode>(), count) { |
112 profileFunction._addKindBasedAttributes(attributes); | 112 profileFunction._addKindBasedAttributes(attributes); |
113 } | 113 } |
114 | 114 |
115 // Does this function have an optimized version of itself? | 115 // Does this function have an optimized version of itself? |
116 bool hasOptimizedCode() { | 116 bool hasOptimizedCode() { |
117 for (var nodeCode in codes) { | 117 for (var nodeCode in codes) { |
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 } | 966 } |
967 | 967 |
968 int approximateMillisecondsForCount(count) { | 968 int approximateMillisecondsForCount(count) { |
969 return (count * samplePeriod) ~/ Duration.MICROSECONDS_PER_MILLISECOND; | 969 return (count * samplePeriod) ~/ Duration.MICROSECONDS_PER_MILLISECOND; |
970 } | 970 } |
971 | 971 |
972 double approximateSecondsForCount(count) { | 972 double approximateSecondsForCount(count) { |
973 return (count * samplePeriod) / Duration.MICROSECONDS_PER_SECOND; | 973 return (count * samplePeriod) / Duration.MICROSECONDS_PER_SECOND; |
974 } | 974 } |
975 } | 975 } |
OLD | NEW |