Lines Matching refs:gDvm
41 assert(!gDvm.heapWorkerInitialized); in dvmInitializeHeapWorkerState()
43 dvmInitMutex(&gDvm.heapWorkerLock); in dvmInitializeHeapWorkerState()
44 pthread_cond_init(&gDvm.heapWorkerCond, NULL); in dvmInitializeHeapWorkerState()
45 pthread_cond_init(&gDvm.heapWorkerIdleCond, NULL); in dvmInitializeHeapWorkerState()
47 gDvm.heapWorkerInitialized = true; in dvmInitializeHeapWorkerState()
57 assert(!gDvm.haltHeapWorker); in dvmHeapWorkerStartup()
58 assert(!gDvm.heapWorkerReady); in dvmHeapWorkerStartup()
59 assert(gDvm.heapWorkerHandle == 0); in dvmHeapWorkerStartup()
60 assert(gDvm.heapWorkerInitialized); in dvmHeapWorkerStartup()
63 dvmLockMutex(&gDvm.heapWorkerLock); in dvmHeapWorkerStartup()
67 if (!dvmCreateInternalThread(&gDvm.heapWorkerHandle, in dvmHeapWorkerStartup()
70 dvmUnlockMutex(&gDvm.heapWorkerLock); in dvmHeapWorkerStartup()
78 while (!gDvm.heapWorkerReady) { in dvmHeapWorkerStartup()
79 dvmWaitCond(&gDvm.heapWorkerCond, &gDvm.heapWorkerLock); in dvmHeapWorkerStartup()
82 dvmUnlockMutex(&gDvm.heapWorkerLock); in dvmHeapWorkerStartup()
94 if (gDvm.heapWorkerHandle != 0) { in dvmHeapWorkerShutdown()
95 gDvm.haltHeapWorker = true; in dvmHeapWorkerShutdown()
104 if (pthread_join(gDvm.heapWorkerHandle, &threadReturn) != 0) in dvmHeapWorkerShutdown()
106 else if (gDvm.verboseShutdown) in dvmHeapWorkerShutdown()
109 gDvm.heapWorkerReady = false; in dvmHeapWorkerShutdown()
123 if (gDvm.gcHeap->heapWorkerCurrentObject != NULL) { in dvmAssertHeapWorkerThreadRunning()
126 u8 heapWorkerInterpStartTime = gDvm.gcHeap->heapWorkerInterpStartTime; in dvmAssertHeapWorkerThreadRunning()
131 (gDvm.debuggerActive || gDvm.nativeDebuggerActive)) in dvmAssertHeapWorkerThreadRunning()
142 gDvm.gcHeap->heapWorkerInterpStartTime = now; /* reset timer */ in dvmAssertHeapWorkerThreadRunning()
152 Thread* thread = dvmGetThreadByHandle(gDvm.heapWorkerHandle); in dvmAssertHeapWorkerThreadRunning()
163 gDvm.gcHeap->heapWorkerInterpStartTime = now; in dvmAssertHeapWorkerThreadRunning()
169 &gDvm.gcHeap->heapWorkerCurrentMethod->prototype); in dvmAssertHeapWorkerThreadRunning()
172 gDvm.gcHeap->heapWorkerCurrentObject->clazz->descriptor, in dvmAssertHeapWorkerThreadRunning()
173 gDvm.gcHeap->heapWorkerCurrentMethod->name, desc); in dvmAssertHeapWorkerThreadRunning()
184 &gDvm.gcHeap->heapWorkerCurrentMethod->prototype); in dvmAssertHeapWorkerThreadRunning()
187 gDvm.gcHeap->heapWorkerCurrentObject->clazz->descriptor, in dvmAssertHeapWorkerThreadRunning()
188 gDvm.gcHeap->heapWorkerCurrentMethod->name, desc); in dvmAssertHeapWorkerThreadRunning()
222 gDvm.gcHeap->heapWorkerInterpStartTime = dvmGetRelativeTimeUsec(); in callMethod()
223 gDvm.gcHeap->heapWorkerInterpCpuStartTime = dvmGetThreadCpuTimeUsec(); in callMethod()
224 gDvm.gcHeap->heapWorkerCurrentMethod = method; in callMethod()
225 gDvm.gcHeap->heapWorkerCurrentObject = obj; in callMethod()
233 dvmUnlockMutex(&gDvm.heapWorkerLock); in callMethod()
249 lockMutex(&gDvm.heapWorkerLock); in callMethod()
251 gDvm.gcHeap->heapWorkerCurrentObject = NULL; in callMethod()
252 gDvm.gcHeap->heapWorkerCurrentMethod = NULL; in callMethod()
253 gDvm.gcHeap->heapWorkerInterpStartTime = 0LL; in callMethod()
278 assert(gDvm.voffJavaLangObject_finalize >= 0); in doHeapWork()
279 assert(gDvm.methJavaLangRefReference_enqueueInternal != NULL); in doHeapWork()
295 method = obj->clazz->vtable[gDvm.voffJavaLangObject_finalize]; in doHeapWork()
298 assert(method->clazz != gDvm.classJavaLangObject); in doHeapWork()
303 obj, gDvm.offJavaLangRefReference_queue) != NULL); in doHeapWork()
305 obj, gDvm.offJavaLangRefReference_queueNext) == NULL); in doHeapWork()
308 gDvm.methJavaLangRefReference_enqueueInternal); in doHeapWork()
332 lockMutex(&gDvm.heapWorkerLock); in heapWorkerThreadStart()
333 gDvm.heapWorkerReady = true; in heapWorkerThreadStart()
334 dvmSignalCond(&gDvm.heapWorkerCond); in heapWorkerThreadStart()
335 dvmUnlockMutex(&gDvm.heapWorkerLock); in heapWorkerThreadStart()
337 lockMutex(&gDvm.heapWorkerLock); in heapWorkerThreadStart()
338 while (!gDvm.haltHeapWorker) { in heapWorkerThreadStart()
346 dvmBroadcastCond(&gDvm.heapWorkerIdleCond); in heapWorkerThreadStart()
349 trimtime = gDvm.gcHeap->heapWorkerNextTrim; in heapWorkerThreadStart()
380 dvmUnlockMutex(&gDvm.heapWorkerLock); in heapWorkerThreadStart()
382 while (gDvm.gcHeap->gcRunning) { in heapWorkerThreadStart()
385 dvmLockMutex(&gDvm.heapWorkerLock); in heapWorkerThreadStart()
395 gDvm.gcHeap->heapWorkerNextTrim = trimtime; in heapWorkerThreadStart()
405 cc = pthread_cond_timedwait_monotonic(&gDvm.heapWorkerCond, in heapWorkerThreadStart()
406 &gDvm.heapWorkerLock, &trimtime); in heapWorkerThreadStart()
408 cc = pthread_cond_timedwait(&gDvm.heapWorkerCond, in heapWorkerThreadStart()
409 &gDvm.heapWorkerLock, &trimtime); in heapWorkerThreadStart()
413 dvmWaitCond(&gDvm.heapWorkerCond, &gDvm.heapWorkerLock); in heapWorkerThreadStart()
425 dvmUnlockMutex(&gDvm.heapWorkerLock); in heapWorkerThreadStart()
428 while (gDvm.gcHeap->gcRunning) { in heapWorkerThreadStart()
431 dvmLockMutex(&gDvm.heapWorkerLock); in heapWorkerThreadStart()
439 dvmUnlockMutex(&gDvm.heapWorkerLock); in heapWorkerThreadStart()
441 if (gDvm.verboseShutdown) in heapWorkerThreadStart()
452 dvmLockMutex(&gDvm.heapWorkerLock); in dvmSignalHeapWorker()
455 dvmSignalCond(&gDvm.heapWorkerCond); in dvmSignalHeapWorker()
458 dvmUnlockMutex(&gDvm.heapWorkerLock); in dvmSignalHeapWorker()
467 assert(gDvm.heapWorkerReady); in dvmWaitForHeapWorkerIdle()
471 dvmLockMutex(&gDvm.heapWorkerLock); in dvmWaitForHeapWorkerIdle()
479 dvmWaitCond(&gDvm.heapWorkerIdleCond, &gDvm.heapWorkerLock); in dvmWaitForHeapWorkerIdle()
481 dvmUnlockMutex(&gDvm.heapWorkerLock); in dvmWaitForHeapWorkerIdle()
493 if (gDvm.zygote) { in dvmRunFinalizationSync()
494 assert(!gDvm.heapWorkerReady); in dvmRunFinalizationSync()
499 dvmLockMutex(&gDvm.heapWorkerLock); in dvmRunFinalizationSync()
501 dvmUnlockMutex(&gDvm.heapWorkerLock); in dvmRunFinalizationSync()
519 GcHeap *gcHeap = gDvm.gcHeap; in dvmScheduleHeapSourceTrim()