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

Unified Diff: runtime/vm/object.h

Issue 230863005: Initial UserTag and dart:profiler library (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index f42ab40472e93677eeae191f1e04948c485eda76..00f87c50eaccc9b40571064c9b044d7ff421a1ab 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -18,6 +18,7 @@
#include "vm/os.h"
#include "vm/raw_object.h"
#include "vm/scanner.h"
+#include "vm/tags.h"
namespace dart {
@@ -2653,6 +2654,7 @@ class Library : public Object {
static RawLibrary* MirrorsLibrary();
static RawLibrary* NativeWrappersLibrary();
static RawLibrary* TypedDataLibrary();
+ static RawLibrary* ProfilerLibrary();
// Eagerly compile all classes and functions in the library.
static RawError* CompileAll();
@@ -6649,6 +6651,45 @@ class MirrorReference : public Instance {
};
+class UserTag : public Instance {
+ public:
+ uword tag() const { return raw_ptr()->tag(); }
+ void set_tag(uword t) const {
+ ASSERT(t >= UserTags::kUserTagIdOffset);
+ ASSERT(t < UserTags::kUserTagIdOffset + UserTags::kMaxUserTags);
+ raw_ptr()->tag_ = t;
+ };
+
+ RawString* label() const {
+ return raw_ptr()->label_;
+ }
+
+ void MakeActive() const;
+ static void ClearActive();
+
+ static intptr_t InstanceSize() {
+ return RoundedAllocationSize(sizeof(RawUserTag));
+ }
+
+ static RawUserTag* New(const String& label,
+ Heap::Space space = Heap::kOld);
+
+ static bool TagTableIsFull(Isolate* isolate);
+ static RawUserTag* FindTagById(uword tag_id);
+
+ private:
+ static RawUserTag* FindTagInIsolate(Isolate* isolate, const String& label);
+ static void AddTagToIsolate(Isolate* isolate, const UserTag& tag);
+
+ void set_label(const String& tag_label) const {
+ StorePointer(&raw_ptr()->label_, tag_label.raw());
+ }
+
+ FINAL_HEAP_OBJECT_IMPLEMENTATION(UserTag, Instance);
+ friend class Class;
+};
+
+
// Breaking cycles and loops.
RawClass* Object::clazz() const {
uword raw_value = reinterpret_cast<uword>(raw_);
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698