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

Unified Diff: vm/symbols.h

Issue 11469036: - Create frame work for adding read only handles for symbols in the VM isolate (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years 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
« vm/parser.cc ('K') | « vm/parser.cc ('k') | vm/symbols.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/symbols.h
===================================================================
--- vm/symbols.h (revision 15861)
+++ vm/symbols.h (working copy)
@@ -144,6 +144,9 @@
V(InvocationMirror, "_InvocationMirror") \
V(AllocateInvocationMirror, "_allocateInvocationMirror") \
+#define PREDEFINED_SYMBOL_HANDLES_LIST(V) \
+ V(Dot) \
+
// Contains a list of frequently used strings in a canonicalized form. This
// list is kept in the vm_isolate in order to share the copy across isolates
// without having to maintain copies in each isolate.
@@ -170,6 +173,12 @@
PREDEFINED_SYMBOLS_LIST(DEFINE_SYMBOL_ACCESSOR)
#undef DEFINE_SYMBOL_ACCESSOR
+ // Access methods for symbol handles stored in the vm isolate.
+#define DEFINE_SYMBOL_HANDLE_ACCESSOR(symbol) \
+ static const String& symbol##Handle() { return *symbol##_handle_; }
+PREDEFINED_SYMBOL_HANDLES_LIST(DEFINE_SYMBOL_HANDLE_ACCESSOR)
+#undef DEFINE_SYMBOL_HANDLE_ACCESSOR
+
// Initialize frequently used symbols in the vm isolate.
static void InitOnce(Isolate* isolate);
@@ -255,6 +264,15 @@
// List of symbols that are stored in the vm isolate for easy access.
static RawString* predefined_[kMaxId];
+ // Structure for managing handles allocation for symbols that are
+ // stored in the vm isolate.
+ static VMHandles predefined_handles_;
+
+#define DECLARE_SYMBOL_HANDLE(symbol) \
+ static String* symbol##_handle_;
+PREDEFINED_SYMBOL_HANDLES_LIST(DECLARE_SYMBOL_HANDLE)
+#undef DECLARE_SYMBOL_HANDLE
+
friend class String;
friend class SnapshotReader;
friend class SnapshotWriter;
« vm/parser.cc ('K') | « vm/parser.cc ('k') | vm/symbols.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698