@@ -302,47 +302,6 @@ struct ares_task_t {
302302
303303RB_HEAD (ares_task_list, ares_task_t );
304304
305- class IsolateData {
306- public:
307- static inline IsolateData* GetOrCreate (v8::Isolate* isolate, uv_loop_t * loop);
308- inline void Put ();
309- inline uv_loop_t * event_loop () const ;
310-
311- #define VP (PropertyName, StringValue ) V(v8::Private, PropertyName, StringValue)
312- #define VS (PropertyName, StringValue ) V(v8::String, PropertyName, StringValue)
313- #define V (TypeName, PropertyName, StringValue ) \
314- inline v8::Local<TypeName> PropertyName () const ;
315- PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES (VP)
316- PER_ISOLATE_STRING_PROPERTIES (VS)
317- #undef V
318- #undef VS
319- #undef VP
320-
321- private:
322- static const int kIsolateSlot = NODE_ISOLATE_SLOT;
323-
324- inline static IsolateData* Get (v8::Isolate* isolate);
325- inline explicit IsolateData (v8::Isolate* isolate, uv_loop_t * loop);
326- inline v8::Isolate* isolate () const ;
327-
328- uv_loop_t * const event_loop_;
329- v8::Isolate* const isolate_;
330-
331- #define VP (PropertyName, StringValue ) V(v8::Private, PropertyName, StringValue)
332- #define VS (PropertyName, StringValue ) V(v8::String, PropertyName, StringValue)
333- #define V (TypeName, PropertyName, StringValue ) \
334- v8::Eternal<TypeName> PropertyName ## _;
335- PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES (VP)
336- PER_ISOLATE_STRING_PROPERTIES (VS)
337- #undef V
338- #undef VS
339- #undef VP
340-
341- unsigned int ref_count_;
342-
343- DISALLOW_COPY_AND_ASSIGN (IsolateData);
344- };
345-
346305class Environment {
347306 public:
348307 class AsyncHooks {
@@ -609,6 +568,9 @@ class Environment {
609568 static const int kContextEmbedderDataIndex = NODE_CONTEXT_EMBEDDER_DATA_INDEX;
610569
611570 private:
571+ static const int kIsolateSlot = NODE_ISOLATE_SLOT;
572+
573+ class IsolateData ;
612574 inline Environment (v8::Local<v8::Context> context, uv_loop_t * loop);
613575 inline ~Environment ();
614576 inline IsolateData* isolate_data () const ;
@@ -653,6 +615,47 @@ class Environment {
653615 ENVIRONMENT_STRONG_PERSISTENT_PROPERTIES (V)
654616#undef V
655617
618+ // Per-thread, reference-counted singleton.
619+ class IsolateData {
620+ public:
621+ static inline IsolateData* GetOrCreate (v8::Isolate* isolate,
622+ uv_loop_t * loop);
623+ inline void Put ();
624+ inline uv_loop_t * event_loop () const ;
625+
626+ #define VP (PropertyName, StringValue ) V(v8::Private, PropertyName, StringValue)
627+ #define VS (PropertyName, StringValue ) V(v8::String, PropertyName, StringValue)
628+ #define V (TypeName, PropertyName, StringValue ) \
629+ inline v8::Local<TypeName> PropertyName () const ;
630+ PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES (VP)
631+ PER_ISOLATE_STRING_PROPERTIES (VS)
632+ #undef V
633+ #undef VS
634+ #undef VP
635+
636+ private:
637+ inline static IsolateData* Get (v8::Isolate* isolate);
638+ inline explicit IsolateData (v8::Isolate* isolate, uv_loop_t * loop);
639+ inline v8::Isolate* isolate () const ;
640+
641+ uv_loop_t * const event_loop_;
642+ v8::Isolate* const isolate_;
643+
644+ #define VP (PropertyName, StringValue ) V(v8::Private, PropertyName, StringValue)
645+ #define VS (PropertyName, StringValue ) V(v8::String, PropertyName, StringValue)
646+ #define V (TypeName, PropertyName, StringValue ) \
647+ v8::Eternal<TypeName> PropertyName ## _;
648+ PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES (VP)
649+ PER_ISOLATE_STRING_PROPERTIES (VS)
650+ #undef V
651+ #undef VS
652+ #undef VP
653+
654+ unsigned int ref_count_;
655+
656+ DISALLOW_COPY_AND_ASSIGN (IsolateData);
657+ };
658+
656659 DISALLOW_COPY_AND_ASSIGN (Environment);
657660};
658661
0 commit comments