Пример #1
0
void
MM_ConcurrentOverflow::overflowItemInternal(MM_EnvironmentBase *env, void *item, MM_ConcurrentCardTable *cardTable)
{
	MM_EnvironmentStandard *envStandard = MM_EnvironmentStandard::getEnvironment(env);
	void *heapBase = _extensions->heap->getHeapBase();
	void *heapTop = _extensions->heap->getHeapTop();

	/* Check reference is within the heap */
	if ((PACKET_ARRAY_SPLIT_TAG != ((UDATA)item & PACKET_ARRAY_SPLIT_TAG)) && (item >= heapBase) && (item <  heapTop)) {
	/* ..and dirty its card if it is */
		omrobjectptr_t objectPtr = (omrobjectptr_t)item;
		cardTable->dirtyCard(envStandard, objectPtr);
		MM_ParallelGlobalGC *globalCollector = (MM_ParallelGlobalGC *)_extensions->getGlobalCollector();
		globalCollector->getMarkingScheme()->getMarkingDelegate()->handleWorkPacketOverflowItem(env,objectPtr);
	}
}
Пример #2
0
void
MM_OverflowStandard::overflowItemInternal(MM_EnvironmentBase *env, void *item)
{
	void *heapBase = _extensions->heap->getHeapBase();
	void *heapTop = _extensions->heap->getHeapTop();

	if ((PACKET_ARRAY_SPLIT_TAG != ((uintptr_t)item & PACKET_ARRAY_SPLIT_TAG)) &&  (item >= heapBase) && (item < heapTop)) {
		MM_ParallelGlobalGC *globalCollector = (MM_ParallelGlobalGC *)_extensions->getGlobalCollector();
		OMR::GC::MarkingScheme *markingScheme = globalCollector->getMarkingScheme();
		MM_MarkMap *markMap = env->getMarkingEnvironment()->markingExtensions()->markMap();
		omrobjectptr_t objectPtr = (omrobjectptr_t)item;

		/* object has to be marked already */
		Assert_MM_true(markMap->isBitSet(objectPtr));
		Assert_MM_false(markMap->isBitSet((omrobjectptr_t)((uintptr_t)item + markMap->getObjectGrain())));

		/* set overflow bit (double marking) */
		markMap->atomicSetBit((omrobjectptr_t)((uintptr_t)item + markMap->getObjectGrain()));

		/* Perform language specific actions */
		markingScheme->getMarkingDelegate()->handleWorkPacketOverflowItem(env,objectPtr);
	}
}