Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: runtime/observatory/lib/src/models/objects/function.dart

Issue 2273993002: Converted Observatory cpu-profile-table element (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Addressed comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 24 matching lines...) Expand all
35 default: 35 default:
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) {
46 var content = <String>[
47 function.name
48 ];
49 ObjectRef owner = function.dartOwner;
50 while (owner is FunctionRef) {
51 FunctionRef function = (owner as FunctionRef);
52 content.add(function.name);
53 owner = function.dartOwner;
54 }
55 if (owner is ClassRef) {
56 content.add(owner.name);
57 }
58 return content.reversed.join('.');
59 }
60
45 abstract class FunctionRef extends ObjectRef { 61 abstract class FunctionRef extends ObjectRef {
46 /// The name of this class. 62 /// The name of this class.
47 String get name; 63 String get name;
48 64
49 /// The owner of this function, which can be a LibraryRef, ClassRef, 65 /// The owner of this function, which can be a LibraryRef, ClassRef,
50 /// or a FunctionRef. 66 /// or a FunctionRef.
51 ObjectRef get dartOwner; // owner 67 ObjectRef get dartOwner; // owner
52 68
53 /// Is this function static? 69 /// Is this function static?
54 bool get isStatic; 70 bool get isStatic;
55 71
56 /// Is this function const? 72 /// Is this function const?
57 bool get isConst; 73 bool get isConst;
58 74
59 /// The kind of the function. 75 /// The kind of the function.
60 FunctionKind get kind; 76 FunctionKind get kind;
61 } 77 }
62 78
63 abstract class Function extends Object implements FunctionRef { 79 abstract class Function extends Object implements FunctionRef {
64 /// The location of this function in the source code. [optional] 80 /// The location of this function in the source code. [optional]
65 SourceLocation get location; 81 SourceLocation get location;
66 82
67 /// The compiled code associated with this function. [optional] 83 /// The compiled code associated with this function. [optional]
68 CodeRef get code; 84 CodeRef get code;
69 } 85 }
OLDNEW
« no previous file with comments | « runtime/observatory/lib/src/elements/function_ref.dart ('k') | runtime/observatory/lib/src/models/objects/sample_profile.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698