| Index: vm/symbols.h
|
| ===================================================================
|
| --- vm/symbols.h (revision 16012)
|
| +++ vm/symbols.h (working copy)
|
| @@ -273,15 +273,32 @@
|
| // 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_;
|
| -
|
| // Statistics used to measure the efficiency of the symbol table.
|
| static const intptr_t kMaxCollisionBuckets = 10;
|
| static intptr_t num_of_grows_;
|
| static intptr_t collision_count_[kMaxCollisionBuckets];
|
|
|
| + // Structure for managing handles allocation for symbols that are
|
| + // stored in the vm isolate. We don't want these handles to be
|
| + // destroyed as part of the C++ static destructors and hence this
|
| + // object is dynamically allocated.
|
| + class ReadOnlyHandles {
|
| + public:
|
| + ReadOnlyHandles() { }
|
| + uword AllocateHandle() {
|
| + return handles_.AllocateScopedHandle();
|
| + }
|
| + bool IsValidHandle(uword address) {
|
| + return handles_.IsValidScopedHandle(address);
|
| + }
|
| +
|
| + private:
|
| + VMHandles handles_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(ReadOnlyHandles);
|
| + };
|
| + static ReadOnlyHandles* predefined_handles_;
|
| +
|
| #define DECLARE_SYMBOL_HANDLE(symbol) \
|
| static String* symbol##_handle_;
|
| PREDEFINED_SYMBOL_HANDLES_LIST(DECLARE_SYMBOL_HANDLE)
|
|
|