bug 695061: workers Isolate fix, update EnterSafepointManager code (p=dtomack,r=jasowill)
authorDan Schaffer <Dan.Schaffer@adobe.com>
Thu, 02 Aug 2012 13:34:12 -0700
changeset 7517 cb72b01ee01629726c6b6dfc38aefc67552b5442
parent 7516 b4e4ed919a2d71223d1f2d545c5ce70db532ff24
child 7518 f0a40cb503020850d2f52e43b13f1fa7d63bdb3e
push id4254
push userdschaffe@adobe.com
push dateFri, 03 Aug 2012 15:34:49 +0000
reviewersjasowill
bugs695061, 1094850, 1095933
bug 695061: workers Isolate fix, update EnterSafepointManager code (p=dtomack,r=jasowill) integrate CL: 1094850 CL@1095933
core/Isolate.cpp
--- a/core/Isolate.cpp
+++ b/core/Isolate.cpp
@@ -906,39 +906,34 @@ namespace avmplus
             locker.notifyAll();
         }
         AvmAssert(targetCore->getIsolate() == current);
     }
 
     EnterSafepointManager::EnterSafepointManager(AvmCore* core)
     {
         Isolate* isolate = core->getIsolate();
-        // we only need to perform this operation on platforms that
-        // support workers, otherwise we can skip it
         if (isolate) {
 		    m_aggregate = isolate->getAggregate();
-            m_safepointMgr = m_aggregate->safepointManager();
+		}
+        m_safepointMgr = core->getSafepointManager();
+        m_spRecord.setLocationAndDesc( (int32_t*)&core->interrupted, core->getIsolateDesc() ); 
 
-            m_spRecord.setLocationAndDesc( (int32_t*)&core->interrupted, core->getIsolateDesc() ); 
-
-            m_safepointMgr->enter(&m_spRecord);
-        }
+        m_safepointMgr->enter(&m_spRecord);
     }
     
     EnterSafepointManager::~EnterSafepointManager()
     {
         cleanup();
     }
 
     void EnterSafepointManager::cleanup() 
     {
-        if (m_aggregate != NULL) {
-            m_safepointMgr->leave(&m_spRecord);
-            m_spRecord.setLocationAndDesc( NULL, -1 );
-        }
+        m_safepointMgr->leave(&m_spRecord);
+        m_spRecord.setLocationAndDesc( NULL, -1 );
     }
 
     void Aggregate::runIsolate(Isolate* isolate) 
     {
         stateTransition(isolate, Isolate::STARTING);
         // Make sure the isolate survives for the duration of the following call.
         {
             FixedHeapRef<Isolate> handle(isolate);