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

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

Issue 2194383002: Converted Observatory code-ref function-ref element (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fixed CSS problem Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: runtime/observatory/lib/src/models/objects/function.dart
diff --git a/runtime/observatory/lib/src/models/objects/function.dart b/runtime/observatory/lib/src/models/objects/function.dart
new file mode 100644
index 0000000000000000000000000000000000000000..bb763af57c4e2c6a4b224f323e45586b5e3b92ea
--- /dev/null
+++ b/runtime/observatory/lib/src/models/objects/function.dart
@@ -0,0 +1,69 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file
+
+part of models;
+
+enum FunctionKind {
+ regular,
+ closure,
+ getter,
+ setter,
+ constructor,
+ implicitGetter,
+ implicitSetter,
+ implicitStaticFinalGetter,
+ irregexpFunction,
+ staticInitializer,
+ methodExtractor,
+ noSuchMethodDispatcher,
+ invokeFieldDispatcher,
+ collected,
+ native,
+ stub,
+ tag,
+ signatureFunction
+}
+
+bool isSyntheticFunction(FunctionKind kind) {
+ switch (kind) {
+ case FunctionKind.collected:
+ case FunctionKind.native:
+ case FunctionKind.stub:
+ case FunctionKind.tag:
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool isDartFunction(FunctionKind kind) => !isSyntheticFunction(kind);
+bool isStubFunction(FunctionKind kind) => kind == FunctionKind.stub;
+bool hasDartCode(FunctionKind kind) =>
+ isDartFunction(kind) || isStubFunction(kind);
+
+abstract class FunctionRef extends ObjectRef {
+ /// The name of this class.
+ String get name;
+
+ /// The owner of this function, which can be a LibraryRef, ClassRef,
+ /// or a FunctionRef.
+ ObjectRef get dartOwner; // owner
+
+ /// Is this function static?
+ bool get isStatic;
+
+ /// Is this function const?
+ bool get isConst;
+
+ /// The kind of the function.
+ FunctionKind get kind;
+}
+
+abstract class Function extends Object implements FunctionRef {
+ /// The location of this function in the source code. [optional]
+ SourceLocation get location;
+
+ /// The compiled code associated with this function. [optional]
+ CodeRef get code;
+}
« no previous file with comments | « runtime/observatory/lib/src/models/objects/code.dart ('k') | runtime/observatory/lib/src/service/object.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698