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

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
Index: runtime/vm/object.h
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 5ba48aa5d6e4d773bd883723589c4b1295b94ec4..8a268f622c5822c78d4f1243df5a9c9acf0454fd 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 {
@@ -2646,6 +2647,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();
@@ -6642,6 +6644,44 @@ class MirrorReference : public Instance {
};
+class UserTag : public Instance {
+ public:
+ intptr_t tag() const { return raw_ptr()->tag(); }
+ void set_tag(intptr_t t) const {
+ ASSERT(t >= UserTagHelper::kUserTagIdOffset);
+ ASSERT(t < UserTagHelper::kUserTagIdOffset + UserTagHelper::kMaxUserTags);
+ raw_ptr()->tag_ = t;
+ };
+
+ RawString* label() const {
+ return raw_ptr()->label_;
+ }
+
+ void make_active();
srdjan 2014/04/09 17:08:18 MakeActive
Cutch 2014/04/09 20:28:54 Done.
+
+ static intptr_t InstanceSize() {
+ return RoundedAllocationSize(sizeof(RawUserTag));
+ }
+
+ static RawUserTag* New(const String& label,
+ Heap::Space space = Heap::kOld);
+
+ static bool TagTableFull(Isolate* isolate);
srdjan 2014/04/09 17:08:18 TagTableIsFull ?
Cutch 2014/04/09 20:28:54 Done.
+
+ private:
+ static RawUserTag* FindTagInIsolate(Isolate* isolate, const String& label);
+ static void AddTagToIsolate(Isolate* isolate, const UserTag& tag);
+
+ static intptr_t FindAvailableTagId(Isolate* isolate);
+ 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_);

Powered by Google App Engine
This is Rietveld 408576698