Revision: 5249
Author: [email protected]
Date: Wed Aug 11 14:24:26 2010
Log: [Isolates] Fix Linux build in Isolates branch.

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

Modified:
 /branches/experimental/isolates/src/platform-linux.cc
 /branches/experimental/isolates/src/v8threads.cc
 /branches/experimental/isolates/test/cctest/test-api.cc
 /branches/experimental/isolates/test/cctest/test-log.cc

=======================================
--- /branches/experimental/isolates/src/platform-linux.cc Mon Aug 9 14:00:56 2010 +++ /branches/experimental/isolates/src/platform-linux.cc Wed Aug 11 14:24:26 2010
@@ -748,7 +748,7 @@
   if (isolate == NULL) return false;

   ThreadManager* thread_manager = isolate->thread_manager();
-  if (thread_manager->HasId() && !thread_manager->IsArchived() &&
+  if (!thread_manager->IsArchived() &&
       thread_manager->CurrentId() == isolate->thread_id()) {
     return true;
   }
=======================================
--- /branches/experimental/isolates/src/v8threads.cc Mon Aug 2 17:41:48 2010 +++ /branches/experimental/isolates/src/v8threads.cc Wed Aug 11 14:24:26 2010
@@ -341,7 +341,8 @@


 bool ThreadManager::IsArchived() {
-  return Isolate::CurrentPerIsolateThreadData()->thread_state() != NULL;
+ Isolate::PerIsolateThreadData* data = Isolate::CurrentPerIsolateThreadData();
+  return data != NULL && data->thread_state() != NULL;
 }


=======================================
--- /branches/experimental/isolates/test/cctest/test-api.cc Mon Aug 9 14:00:56 2010 +++ /branches/experimental/isolates/test/cctest/test-api.cc Wed Aug 11 14:24:26 2010
@@ -11256,12 +11256,15 @@
   v8::Isolate* isolate = v8::Isolate::New();
   CHECK(isolate);
   isolate->Enter();
-  v8::HandleScope scope_new;
-  LocalContext context_new;
-
-  // Run something in new isolate.
-  CompileRun("var foo = 153;");
-  ExpectTrue("function f() { return foo == 153; }; f()");
+  { // Need this block because subsequent Exit() will deallocate Heap,
+    // so we need all scope objects to be deconstructed when it happens.
+    v8::HandleScope scope_new;
+    LocalContext context_new;
+
+    // Run something in new isolate.
+    CompileRun("var foo = 153;");
+    ExpectTrue("function f() { return foo == 153; }; f()");
+  }
   isolate->Exit();

   // This runs automatically in default isolate.
=======================================
--- /branches/experimental/isolates/test/cctest/test-log.cc Fri Jul 16 10:48:57 2010 +++ /branches/experimental/isolates/test/cctest/test-log.cc Wed Aug 11 14:24:26 2010
@@ -389,7 +389,7 @@
   void RunLoop() {
     v8::Locker locker;
     CHECK(i::Isolate::Current() != NULL);
-    CHECK(i::Isolate::Current()->thread_manager()->HasId());
+    CHECK(i::Isolate::Current()->thread_manager()->CurrentId() > 0);
     SetV8ThreadId();
     while (IsRunning()) {
       v8::HandleScope scope;
@@ -417,7 +417,7 @@
     v8::Unlocker unlocker;
     // Now thread has V8's id, but will not run VM code.
     CHECK(i::Isolate::Current() != NULL);
-    CHECK(i::Isolate::Current()->thread_manager()->HasId());
+    CHECK(i::Isolate::Current()->thread_manager()->CurrentId() > 0);
     double i = 10;
     SignalRunning();
     while (IsRunning()) {

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

Reply via email to