OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 models; | 5 part of models; |
6 | 6 |
7 enum FunctionKind { | 7 enum FunctionKind { |
8 regular, | 8 regular, |
9 closure, | 9 closure, |
10 getter, | 10 getter, |
(...skipping 25 matching lines...) Expand all Loading... |
36 return false; | 36 return false; |
37 } | 37 } |
38 } | 38 } |
39 | 39 |
40 bool isDartFunction(FunctionKind kind) => !isSyntheticFunction(kind); | 40 bool isDartFunction(FunctionKind kind) => !isSyntheticFunction(kind); |
41 bool isStubFunction(FunctionKind kind) => kind == FunctionKind.stub; | 41 bool isStubFunction(FunctionKind kind) => kind == FunctionKind.stub; |
42 bool hasDartCode(FunctionKind kind) => | 42 bool hasDartCode(FunctionKind kind) => |
43 isDartFunction(kind) || isStubFunction(kind); | 43 isDartFunction(kind) || isStubFunction(kind); |
44 | 44 |
45 String getFunctionFullName(FunctionRef function) { | 45 String getFunctionFullName(FunctionRef function) { |
46 var content = <String>[ | 46 var content = <String>[function.name]; |
47 function.name | |
48 ]; | |
49 ObjectRef owner = function.dartOwner; | 47 ObjectRef owner = function.dartOwner; |
50 while (owner is FunctionRef) { | 48 while (owner is FunctionRef) { |
51 FunctionRef function = (owner as FunctionRef); | 49 FunctionRef function = (owner as FunctionRef); |
52 content.add(function.name); | 50 content.add(function.name); |
53 owner = function.dartOwner; | 51 owner = function.dartOwner; |
54 } | 52 } |
55 if (owner is ClassRef) { | 53 if (owner is ClassRef) { |
56 content.add(owner.name); | 54 content.add(owner.name); |
57 } | 55 } |
58 return content.reversed.join('.'); | 56 return content.reversed.join('.'); |
(...skipping 16 matching lines...) Expand all Loading... |
75 /// The kind of the function. | 73 /// The kind of the function. |
76 FunctionKind get kind; | 74 FunctionKind get kind; |
77 } | 75 } |
78 | 76 |
79 abstract class Function extends Object implements FunctionRef { | 77 abstract class Function extends Object implements FunctionRef { |
80 /// The location of this function in the source code. [optional] | 78 /// The location of this function in the source code. [optional] |
81 SourceLocation get location; | 79 SourceLocation get location; |
82 | 80 |
83 /// The compiled code associated with this function. [optional] | 81 /// The compiled code associated with this function. [optional] |
84 CodeRef get code; | 82 CodeRef get code; |
| 83 |
85 /// [optional] | 84 /// [optional] |
86 CodeRef get unoptimizedCode; | 85 CodeRef get unoptimizedCode; |
| 86 |
87 /// [optional] | 87 /// [optional] |
88 FieldRef get field; | 88 FieldRef get field; |
89 int get usageCounter; | 89 int get usageCounter; |
90 InstanceRef get icDataArray; | 90 InstanceRef get icDataArray; |
91 int get deoptimizations; | 91 int get deoptimizations; |
92 bool get isOptimizable; | 92 bool get isOptimizable; |
93 bool get isInlinable; | 93 bool get isInlinable; |
94 bool get hasIntrinsic; | 94 bool get hasIntrinsic; |
95 bool get isRecognized; | 95 bool get isRecognized; |
96 bool get isNative; | 96 bool get isNative; |
97 } | 97 } |
OLD | NEW |