Revision: 5834
Author: [email protected]
Date: Tue Nov 16 09:37:01 2010
Log: [Isolates] Pass isolate to VMState constructor.

Other functions in the class still do the TLS access, but they are
only used by the profiler. So we'll clean them up once we get to the
profiler.

Review URL: http://codereview.chromium.org/4888002
http://code.google.com/p/v8/source/detail?r=5834

Modified:
 /branches/experimental/isolates/src/api.cc
 /branches/experimental/isolates/src/builtins.cc
 /branches/experimental/isolates/src/compiler.cc
 /branches/experimental/isolates/src/cpu-profiler.h
 /branches/experimental/isolates/src/execution.cc
 /branches/experimental/isolates/src/global-handles.cc
 /branches/experimental/isolates/src/global-handles.h
 /branches/experimental/isolates/src/handles.cc
 /branches/experimental/isolates/src/heap.cc
 /branches/experimental/isolates/src/isolate.cc
 /branches/experimental/isolates/src/isolate.h
 /branches/experimental/isolates/src/log.h
 /branches/experimental/isolates/src/objects.cc
 /branches/experimental/isolates/src/stub-cache.cc
 /branches/experimental/isolates/src/top.cc
 /branches/experimental/isolates/src/vm-state-inl.h
 /branches/experimental/isolates/src/vm-state.h

=======================================
--- /branches/experimental/isolates/src/api.cc  Tue Nov  9 14:15:38 2010
+++ /branches/experimental/isolates/src/api.cc  Tue Nov 16 09:37:01 2010
@@ -49,9 +49,10 @@

 #define LOG_API(expr) LOG(ApiEntryCall(expr))

+// TODO(isolates): avoid repeated TLS reads in function prologues.
 #ifdef ENABLE_VMSTATE_TRACKING
-#define ENTER_V8 i::VMState __state__(i::OTHER)
-#define LEAVE_V8 i::VMState __state__(i::EXTERNAL)
+#define ENTER_V8 i::VMState __state__(i::Isolate::Current(), i::OTHER)
+#define LEAVE_V8 i::VMState __state__(i::Isolate::Current(), i::EXTERNAL)
 #else
 #define ENTER_V8 ((void) 0)
 #define LEAVE_V8 ((void) 0)
=======================================
--- /branches/experimental/isolates/src/builtins.cc     Wed Nov 10 11:31:49 2010
+++ /branches/experimental/isolates/src/builtins.cc     Tue Nov 16 09:37:01 2010
@@ -1051,7 +1051,7 @@
     v8::Handle<v8::Value> value;
     {
       // Leaving JavaScript.
-      VMState state(EXTERNAL);
+      VMState state(isolate, EXTERNAL);
 #ifdef ENABLE_LOGGING_AND_PROFILING
       state.set_external_callback(v8::ToCData<Address>(callback_obj));
 #endif
@@ -1131,7 +1131,7 @@
   v8::Handle<v8::Value> value;
   {
     // Leaving JavaScript.
-    VMState state(EXTERNAL);
+    VMState state(isolate, EXTERNAL);
 #ifdef ENABLE_LOGGING_AND_PROFILING
     state.set_external_callback(v8::ToCData<Address>(callback_obj));
 #endif
@@ -1199,7 +1199,7 @@
     v8::Handle<v8::Value> value;
     {
       // Leaving JavaScript.
-      VMState state(EXTERNAL);
+      VMState state(isolate, EXTERNAL);
 #ifdef ENABLE_LOGGING_AND_PROFILING
       state.set_external_callback(v8::ToCData<Address>(callback_obj));
 #endif
=======================================
--- /branches/experimental/isolates/src/compiler.cc     Tue Nov  9 14:15:38 2010
+++ /branches/experimental/isolates/src/compiler.cc     Tue Nov 16 09:37:01 2010
@@ -265,7 +265,7 @@
   COUNTERS->total_compile_size()->Increment(source_length);

   // The VM is in the COMPILER state until exiting this function.
-  VMState state(COMPILER);
+  VMState state(isolate, COMPILER);

   CompilationCache* compilation_cache = isolate->compilation_cache();

@@ -331,31 +331,30 @@
 Handle<SharedFunctionInfo> Compiler::CompileEval(Handle<String> source,
                                                  Handle<Context> context,
                                                  bool is_global) {
+  Isolate* isolate = source->GetIsolate();
   int source_length = source->length();
-  COUNTERS->total_eval_size()->Increment(source_length);
-  COUNTERS->total_compile_size()->Increment(source_length);
+  isolate->counters()->total_eval_size()->Increment(source_length);
+  isolate->counters()->total_compile_size()->Increment(source_length);

   // The VM is in the COMPILER state until exiting this function.
-  VMState state(COMPILER);
+  VMState state(isolate, COMPILER);

// Do a lookup in the compilation cache; if the entry is not there, invoke
   // the compiler and add the result to the cache.
   Handle<SharedFunctionInfo> result;
-  CompilationCache* compilation_cache =
-      context->GetIsolate()->compilation_cache();
+  CompilationCache* compilation_cache = isolate->compilation_cache();
   result = compilation_cache->LookupEval(source, context, is_global);

   if (result.is_null()) {
     // Create a script object describing the script to be compiled.
-    Handle<Script> script = FACTORY->NewScript(source);
+    Handle<Script> script = isolate->factory()->NewScript(source);
     CompilationInfo info(script);
     info.MarkAsEval();
     if (is_global) info.MarkAsGlobal();
     info.SetCallingContext(context);
     result = MakeFunctionInfo(&info);
     if (!result.is_null()) {
-      CompilationCache* compilation_cache =
-          context->GetIsolate()->compilation_cache();
+      CompilationCache* compilation_cache = isolate->compilation_cache();
       compilation_cache->PutEval(source, context, is_global, result);
     }
   }
@@ -368,7 +367,7 @@
   CompilationZoneScope zone_scope(DELETE_ON_EXIT);

   // The VM is in the COMPILER state until exiting this function.
-  VMState state(COMPILER);
+  VMState state(info->isolate(), COMPILER);

   PostponeInterruptsScope postpone;

=======================================
--- /branches/experimental/isolates/src/cpu-profiler.h Tue Nov 9 06:55:28 2010 +++ /branches/experimental/isolates/src/cpu-profiler.h Tue Nov 16 09:37:01 2010
@@ -226,6 +226,8 @@
 namespace v8 {
 namespace internal {

+
+// TODO(isolates): isolatify this class.
 class CpuProfiler {
  public:
   static void Setup();
@@ -270,7 +272,10 @@
   static void SetterCallbackEvent(String* name, Address entry_point);

   static INLINE(bool is_profiling()) {
-    Isolate* isolate = Isolate::Current();
+    return is_profiling(Isolate::Current());
+  }
+
+  static INLINE(bool is_profiling(Isolate* isolate)) {
     return isolate->cpu_profiler() != NULL &&
            isolate->cpu_profiler()->processor_ != NULL;
   }
=======================================
--- /branches/experimental/isolates/src/execution.cc Tue Nov 9 06:55:28 2010 +++ /branches/experimental/isolates/src/execution.cc Tue Nov 16 09:37:01 2010
@@ -72,7 +72,7 @@
   Isolate* isolate = func->GetIsolate();

   // Entering JavaScript.
-  VMState state(JS);
+  VMState state(isolate, JS);

   // Placeholder for return value.
   MaybeObject* value = reinterpret_cast<Object*>(kZapValue);
=======================================
--- /branches/experimental/isolates/src/global-handles.cc Tue Nov 9 14:15:38 2010 +++ /branches/experimental/isolates/src/global-handles.cc Tue Nov 16 09:37:01 2010
@@ -149,7 +149,8 @@
   // Returns the callback for this weak handle.
   WeakReferenceCallback callback() { return callback_; }

-  bool PostGarbageCollectionProcessing(GlobalHandles* global_handles) {
+  bool PostGarbageCollectionProcessing(Isolate* isolate,
+                                       GlobalHandles* global_handles) {
     if (state_ != Node::PENDING) return false;
     LOG(HandleEvent("GlobalHandle::Processing", handle().location()));
     WeakReferenceCallback func = callback();
@@ -177,7 +178,7 @@
       ASSERT(!object_->IsExternalTwoByteString() ||
              ExternalTwoByteString::cast(object_)->resource() != NULL);
       // Leaving V8.
-      VMState state(EXTERNAL);
+      VMState state(isolate, EXTERNAL);
       func(object, par);
     }
     // Absense of explicit cleanup or revival of weak handle
@@ -276,8 +277,9 @@
 };


-GlobalHandles::GlobalHandles()
-    : number_of_weak_handles_(0),
+GlobalHandles::GlobalHandles(Isolate* isolate)
+    : isolate_(isolate),
+      number_of_weak_handles_(0),
       number_of_global_object_weak_handles_(0),
       head_(NULL),
       first_free_(NULL),
@@ -295,7 +297,7 @@


 Handle<Object> GlobalHandles::Create(Object* value) {
-  COUNTERS->global_handles()->Increment();
+  isolate_->counters()->global_handles()->Increment();
   Node* result;
   if (first_free()) {
     // Take the first node in the free list.
@@ -319,7 +321,7 @@


 void GlobalHandles::Destroy(Object** location) {
-  COUNTERS->global_handles()->Decrement();
+  isolate_->counters()->global_handles()->Decrement();
   if (location == NULL) return;
   Node* node = Node::FromLocation(location);
   node->Destroy(this);
@@ -391,12 +393,12 @@
   // GC is completely done, because the callbacks may invoke arbitrary
   // API functions.
   // At the same time deallocate all DESTROYED nodes.
-  ASSERT(HEAP->gc_state() == Heap::NOT_IN_GC);
+  ASSERT(isolate_->heap()->gc_state() == Heap::NOT_IN_GC);
   const int initial_post_gc_processing_count = ++post_gc_processing_count_;
   bool next_gc_likely_to_collect_more = false;
   Node** p = &head_;
   while (*p != NULL) {
-    if ((*p)->PostGarbageCollectionProcessing(this)) {
+    if ((*p)->PostGarbageCollectionProcessing(isolate_, this)) {
       if (initial_post_gc_processing_count != post_gc_processing_count_) {
         // Weak callback triggered another GC and another round of
         // PostGarbageCollection processing.  The current node might
=======================================
--- /branches/experimental/isolates/src/global-handles.h Tue Nov 9 14:15:38 2010 +++ /branches/experimental/isolates/src/global-handles.h Tue Nov 16 09:37:01 2010
@@ -138,11 +138,13 @@
 #endif
   class Pool;
  private:
-  GlobalHandles();
+  explicit GlobalHandles(Isolate* isolate);

   // Internal node structure, one for each global handle.
   class Node;

+  Isolate* isolate_;
+
   // Field always containing the number of weak and near-death handles.
   int number_of_weak_handles_;

=======================================
--- /branches/experimental/isolates/src/handles.cc      Wed Nov 10 11:31:49 2010
+++ /branches/experimental/isolates/src/handles.cc      Tue Nov 16 09:37:01 2010
@@ -661,9 +661,9 @@
 // Compute the property keys from the interceptor.
 v8::Handle<v8::Array> GetKeysForNamedInterceptor(Handle<JSObject> receiver,
                                                  Handle<JSObject> object) {
+  Isolate* isolate = receiver->GetIsolate();
   Handle<InterceptorInfo> interceptor(object->GetNamedInterceptor());
-  CustomArguments args(receiver->GetIsolate(),
-                       interceptor->data(), *receiver, *object);
+  CustomArguments args(isolate, interceptor->data(), *receiver, *object);
   v8::AccessorInfo info(args.end());
   v8::Handle<v8::Array> result;
   if (!interceptor->enumerator()->IsUndefined()) {
@@ -672,7 +672,7 @@
     LOG(ApiObjectAccess("interceptor-named-enum", *object));
     {
       // Leaving JavaScript.
-      VMState state(EXTERNAL);
+      VMState state(isolate, EXTERNAL);
       result = enum_fun(info);
     }
   }
@@ -683,9 +683,9 @@
 // Compute the element keys from the interceptor.
v8::Handle<v8::Array> GetKeysForIndexedInterceptor(Handle<JSObject> receiver, Handle<JSObject> object) {
+  Isolate* isolate = receiver->GetIsolate();
   Handle<InterceptorInfo> interceptor(object->GetIndexedInterceptor());
-  CustomArguments args(receiver->GetIsolate(),
-                       interceptor->data(), *receiver, *object);
+  CustomArguments args(isolate, interceptor->data(), *receiver, *object);
   v8::AccessorInfo info(args.end());
   v8::Handle<v8::Array> result;
   if (!interceptor->enumerator()->IsUndefined()) {
@@ -694,7 +694,7 @@
     LOG(ApiObjectAccess("interceptor-indexed-enum", *object));
     {
       // Leaving JavaScript.
-      VMState state(EXTERNAL);
+      VMState state(isolate, EXTERNAL);
       result = enum_fun(info);
     }
   }
=======================================
--- /branches/experimental/isolates/src/heap.cc Tue Nov  9 14:15:38 2010
+++ /branches/experimental/isolates/src/heap.cc Tue Nov 16 09:37:01 2010
@@ -453,7 +453,7 @@

bool Heap::CollectGarbage(AllocationSpace space, GarbageCollector collector) {
   // The VM is in the GC state until exiting this function.
-  VMState state(GC);
+  VMState state(isolate_, GC);

 #ifdef DEBUG
   // Reset the allocation timeout to the GC interval, but make sure to
=======================================
--- /branches/experimental/isolates/src/isolate.cc      Tue Nov  9 06:55:28 2010
+++ /branches/experimental/isolates/src/isolate.cc      Tue Nov 16 09:37:01 2010
@@ -576,7 +576,7 @@
   scanner_character_classes_ = new ScannerCharacterClasses();
   pc_to_code_cache_ = new PcToCodeCache(this);
   write_input_buffer_ = new StringInputBuffer();
-  global_handles_ = new GlobalHandles();
+  global_handles_ = new GlobalHandles(this);
   bootstrapper_ = new Bootstrapper();
   cpu_features_ = new CpuFeatures();
   handle_scope_implementer_ = new HandleScopeImplementer();
=======================================
--- /branches/experimental/isolates/src/isolate.h       Tue Nov  9 06:55:28 2010
+++ /branches/experimental/isolates/src/isolate.h       Tue Nov 16 09:37:01 2010
@@ -106,7 +106,7 @@
 // of handles to the actual constants.
 typedef ZoneList<Handle<Object> > ZoneObjectList;

-
+// TODO(isolates): pass isolate pointer here.
 #define RETURN_IF_SCHEDULED_EXCEPTION()              \
   if (Isolate::Current()->has_scheduled_exception()) \
       return Isolate::Current()->PromoteScheduledException()
=======================================
--- /branches/experimental/isolates/src/log.h   Tue Nov  9 06:55:28 2010
+++ /branches/experimental/isolates/src/log.h   Tue Nov 16 09:37:01 2010
@@ -77,6 +77,7 @@
 class CompressionHelper;

 #undef LOG
+// TODO(isolates): pass isolate pointer here.
 #ifdef ENABLE_LOGGING_AND_PROFILING
 #define LOG(Call)                                   \
   do {                                              \
=======================================
--- /branches/experimental/isolates/src/objects.cc      Wed Nov 10 11:31:49 2010
+++ /branches/experimental/isolates/src/objects.cc      Tue Nov 16 09:37:01 2010
@@ -188,7 +188,7 @@
     v8::Handle<v8::Value> result;
     {
       // Leaving JavaScript.
-      VMState state(EXTERNAL);
+      VMState state(isolate, EXTERNAL);
       result = call_fun(v8::Utils::ToLocal(key), info);
     }
     RETURN_IF_SCHEDULED_EXCEPTION();
@@ -1598,7 +1598,7 @@
     v8::Handle<v8::Value> result;
     {
       // Leaving JavaScript.
-      VMState state(EXTERNAL);
+      VMState state(isolate, EXTERNAL);
       Handle<Object> value_unhole(value->IsTheHole() ?
                                   isolate->heap()->undefined_value() :
                                   value,
@@ -1664,7 +1664,7 @@
     v8::AccessorInfo info(args.end());
     {
       // Leaving JavaScript.
-      VMState state(EXTERNAL);
+      VMState state(isolate, EXTERNAL);
       call_fun(v8::Utils::ToLocal(key),
                v8::Utils::ToLocal(value_handle),
                info);
@@ -2120,7 +2120,7 @@
     v8::Handle<v8::Integer> result;
     {
       // Leaving JavaScript.
-      VMState state(EXTERNAL);
+      VMState state(isolate, EXTERNAL);
       result = query(v8::Utils::ToLocal(name_handle), info);
     }
     if (!result.IsEmpty()) {
@@ -2134,7 +2134,7 @@
     v8::Handle<v8::Value> result;
     {
       // Leaving JavaScript.
-      VMState state(EXTERNAL);
+      VMState state(isolate, EXTERNAL);
       result = getter(v8::Utils::ToLocal(name_handle), info);
     }
     if (!result.IsEmpty()) return DONT_ENUM;
@@ -2507,7 +2507,7 @@
     v8::Handle<v8::Boolean> result;
     {
       // Leaving JavaScript.
-      VMState state(EXTERNAL);
+      VMState state(isolate, EXTERNAL);
       result = deleter(v8::Utils::ToLocal(name_handle), info);
     }
     RETURN_IF_SCHEDULED_EXCEPTION();
@@ -2575,7 +2575,7 @@
   v8::Handle<v8::Boolean> result;
   {
     // Leaving JavaScript.
-    VMState state(EXTERNAL);
+    VMState state(isolate, EXTERNAL);
     result = deleter(index, info);
   }
   RETURN_IF_SCHEDULED_EXCEPTION();
@@ -6352,7 +6352,7 @@
     v8::Handle<v8::Integer> result;
     {
       // Leaving JavaScript.
-      VMState state(EXTERNAL);
+      VMState state(isolate, EXTERNAL);
       result = query(index, info);
     }
     if (!result.IsEmpty()) {
@@ -6366,7 +6366,7 @@
     v8::Handle<v8::Value> result;
     {
       // Leaving JavaScript.
-      VMState state(EXTERNAL);
+      VMState state(isolate, EXTERNAL);
       result = getter(index, info);
     }
     if (!result.IsEmpty()) return true;
@@ -6525,7 +6525,7 @@
     v8::Handle<v8::Value> result;
     {
       // Leaving JavaScript.
-      VMState state(EXTERNAL);
+      VMState state(isolate, EXTERNAL);
       result = setter(index, v8::Utils::ToLocal(value_handle), info);
     }
     RETURN_IF_SCHEDULED_EXCEPTION();
@@ -6561,7 +6561,7 @@
     v8::Handle<v8::Value> result;
     {
       // Leaving JavaScript.
-      VMState state(EXTERNAL);
+      VMState state(isolate, EXTERNAL);
       result = call_fun(v8::Utils::ToLocal(key), info);
     }
     RETURN_IF_SCHEDULED_EXCEPTION();
@@ -6615,7 +6615,7 @@
     v8::AccessorInfo info(args.end());
     {
       // Leaving JavaScript.
-      VMState state(EXTERNAL);
+      VMState state(isolate, EXTERNAL);
       call_fun(v8::Utils::ToLocal(key),
                v8::Utils::ToLocal(value_handle),
                info);
@@ -6955,7 +6955,7 @@
     v8::Handle<v8::Value> result;
     {
       // Leaving JavaScript.
-      VMState state(EXTERNAL);
+      VMState state(isolate, EXTERNAL);
       result = getter(index, info);
     }
     RETURN_IF_SCHEDULED_EXCEPTION();
@@ -7276,7 +7276,7 @@
     v8::Handle<v8::Value> result;
     {
       // Leaving JavaScript.
-      VMState state(EXTERNAL);
+      VMState state(isolate, EXTERNAL);
       result = getter(v8::Utils::ToLocal(name_handle), info);
     }
     RETURN_IF_SCHEDULED_EXCEPTION();
=======================================
--- /branches/experimental/isolates/src/stub-cache.cc Wed Nov 10 11:31:49 2010 +++ /branches/experimental/isolates/src/stub-cache.cc Tue Nov 16 09:37:01 2010
@@ -955,7 +955,7 @@
   v8::Handle<v8::Value> result;
   {
     // Leaving JavaScript.
-    VMState state(EXTERNAL);
+    VMState state(isolate, EXTERNAL);
 #ifdef ENABLE_LOGGING_AND_PROFILING
     state.set_external_callback(getter_address);
 #endif
@@ -982,7 +982,7 @@
   v8::AccessorInfo info(custom_args.end());
   {
     // Leaving JavaScript.
-    VMState state(EXTERNAL);
+    VMState state(isolate, EXTERNAL);
 #ifdef ENABLE_LOGGING_AND_PROFILING
     state.set_external_callback(setter_address);
 #endif
@@ -1025,7 +1025,7 @@
     v8::Handle<v8::Value> r;
     {
       // Leaving JavaScript.
-      VMState state(EXTERNAL);
+      VMState state(isolate, EXTERNAL);
       r = getter(v8::Utils::ToLocal(name_handle), info);
     }
     RETURN_IF_SCHEDULED_EXCEPTION();
@@ -1065,6 +1065,8 @@
   Handle<JSObject> holder_handle = args->at<JSObject>(3);
   ASSERT(args->length() == 5);  // Last arg is data object.

+  Isolate* isolate = receiver_handle->GetIsolate();
+
Address getter_address = v8::ToCData<Address>(interceptor_info->getter());
   v8::NamedPropertyGetter getter =
       FUNCTION_CAST<v8::NamedPropertyGetter>(getter_address);
@@ -1074,11 +1076,11 @@
     // Use the interceptor getter.
     v8::AccessorInfo info(args->arguments() -
                           kAccessorInfoOffsetInInterceptorArgs);
-    HandleScope scope;
+    HandleScope scope(isolate);
     v8::Handle<v8::Value> r;
     {
       // Leaving JavaScript.
-      VMState state(EXTERNAL);
+      VMState state(isolate, EXTERNAL);
       r = getter(v8::Utils::ToLocal(name_handle), info);
     }
     RETURN_IF_SCHEDULED_EXCEPTION();
=======================================
--- /branches/experimental/isolates/src/top.cc  Tue Nov  9 06:55:28 2010
+++ /branches/experimental/isolates/src/top.cc  Tue Nov 16 09:37:01 2010
@@ -443,15 +443,15 @@

   if (!callback) return false;

-  HandleScope scope;
-  Handle<JSObject> receiver_handle(receiver);
-  Handle<Object> key_handle(key);
-  Handle<Object> data(AccessCheckInfo::cast(data_obj)->data());
+  HandleScope scope(this);
+  Handle<JSObject> receiver_handle(receiver, this);
+  Handle<Object> key_handle(key, this);
+  Handle<Object> data(AccessCheckInfo::cast(data_obj)->data(), this);
   LOG(ApiNamedSecurityCheck(key));
   bool result = false;
   {
     // Leaving JavaScript.
-    VMState state(EXTERNAL);
+    VMState state(this, EXTERNAL);
     result = callback(v8::Utils::ToLocal(receiver_handle),
                       v8::Utils::ToLocal(key_handle),
                       type,
@@ -486,14 +486,14 @@

   if (!callback) return false;

-  HandleScope scope;
-  Handle<JSObject> receiver_handle(receiver);
-  Handle<Object> data(AccessCheckInfo::cast(data_obj)->data());
+  HandleScope scope(this);
+  Handle<JSObject> receiver_handle(receiver, this);
+  Handle<Object> data(AccessCheckInfo::cast(data_obj)->data(), this);
   LOG(ApiIndexedSecurityCheck(index));
   bool result = false;
   {
     // Leaving JavaScript.
-    VMState state(EXTERNAL);
+    VMState state(this, EXTERNAL);
     result = callback(v8::Utils::ToLocal(receiver_handle),
                       index,
                       type,
=======================================
--- /branches/experimental/isolates/src/vm-state-inl.h Tue Nov 9 06:55:28 2010 +++ /branches/experimental/isolates/src/vm-state-inl.h Tue Nov 16 09:37:01 2010
@@ -55,13 +55,16 @@
   }
 }

-VMState::VMState(StateTag state)
-    : disabled_(true),
+VMState::VMState(Isolate* isolate, StateTag state)
+    : isolate_(isolate),
+      disabled_(true),
       state_(OTHER),
-      external_callback_(NULL),
-      isolate_(Isolate::Current()) {
+      external_callback_(NULL) {
+  ASSERT(isolate == Isolate::Current());
+
 #ifdef ENABLE_LOGGING_AND_PROFILING
-  if (!LOGGER->is_logging() && !CpuProfiler::is_profiling()) {
+  if (!isolate_->logger()->is_logging() &&
+      !CpuProfiler::is_profiling(isolate_)) {
     return;
   }
 #endif
=======================================
--- /branches/experimental/isolates/src/vm-state.h      Tue Nov  9 06:55:28 2010
+++ /branches/experimental/isolates/src/vm-state.h      Tue Nov 16 09:37:01 2010
@@ -36,7 +36,7 @@
 class VMState BASE_EMBEDDED {
 #ifdef ENABLE_VMSTATE_TRACKING
  public:
-  inline VMState(StateTag state);
+  inline VMState(Isolate* isolate, StateTag state);
   inline ~VMState();

   StateTag state() { return state_; }
@@ -60,15 +60,15 @@
   }

  private:
+  Isolate* isolate_;
   bool disabled_;
   StateTag state_;
   VMState* previous_;
   Address external_callback_;
-  Isolate* isolate_;

 #else
  public:
-  explicit VMState(StateTag state) {}
+  VMState(Isolate* isolate, StateTag state) {}
 #endif
 };

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to