Skip to content

Commit

Permalink
Merge pull request #16683 from dmitripivkine/master
Browse files Browse the repository at this point in the history
Prepare to move Scavenger creation to createGlobalCollector()
  • Loading branch information
amicic committed Feb 8, 2023
2 parents 076151b + a4e7f27 commit db9a9c2
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 12 deletions.
4 changes: 1 addition & 3 deletions runtime/gc_base/ObjectAccessBarrier.cpp
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 1991, 2022 IBM Corp. and others
* Copyright (c) 1991, 2023 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -45,8 +45,6 @@
bool
MM_ObjectAccessBarrier::initialize(MM_EnvironmentBase *env)
{
_extensions = MM_GCExtensions::getExtensions(env);
_heap = _extensions->heap;
J9JavaVM *vm = (J9JavaVM*)env->getOmrVM()->_language_vm;
OMR_VM *omrVM = env->getOmrVM();
char *refSignature = (char*) "I";
Expand Down
6 changes: 3 additions & 3 deletions runtime/gc_base/ObjectAccessBarrier.hpp
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 1991, 2022 IBM Corp. and others
* Copyright (c) 1991, 2023 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -605,8 +605,8 @@ class MM_ObjectAccessBarrier : public MM_BaseVirtual
}

MM_ObjectAccessBarrier(MM_EnvironmentBase *env) : MM_BaseVirtual()
, _extensions(NULL)
, _heap(NULL)
, _extensions(MM_GCExtensions::getExtensions(env))
, _heap(_extensions->heap)
#if defined(OMR_GC_COMPRESSED_POINTERS)
#if defined(OMR_GC_FULL_POINTERS)
, _compressObjectReferences(false)
Expand Down
4 changes: 2 additions & 2 deletions runtime/gc_modron_standard/StandardAccessBarrier.hpp
@@ -1,6 +1,6 @@

/*******************************************************************************
* Copyright (c) 1991, 2022 IBM Corp. and others
* Copyright (c) 1991, 2023 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -72,7 +72,7 @@ class MM_StandardAccessBarrier : public MM_ObjectAccessBarrier
MM_StandardAccessBarrier(MM_EnvironmentBase *env, MM_MarkingScheme *markingScheme) :
MM_ObjectAccessBarrier(env)
#if defined(J9VM_GC_GENERATIONAL)
, _scavenger(NULL)
, _scavenger(_extensions->scavenger)
#endif /* J9VM_GC_GENERATIONAL */
, _markingScheme(markingScheme)
{
Expand Down
8 changes: 7 additions & 1 deletion runtime/gc_realtime/ConfigurationRealtime.cpp
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 1991, 2020 IBM Corp. and others
* Copyright (c) 1991, 2023 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -232,3 +232,9 @@ MM_ConfigurationRealtime::createGlobalCollector(MM_EnvironmentBase *env)
{
return MM_RealtimeGC::newInstance(env);
}

MM_GlobalCollector *
MM_ConfigurationRealtime::createCollectors(MM_EnvironmentBase *env)
{
return MM_RealtimeGC::newInstance(env);
}
3 changes: 2 additions & 1 deletion runtime/gc_realtime/ConfigurationRealtime.hpp
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 1991, 2020 IBM Corp. and others
* Copyright (c) 1991, 2023 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -52,6 +52,7 @@ class MM_ConfigurationRealtime : public MM_Configuration
/* Methods */
public:
virtual MM_GlobalCollector *createGlobalCollector(MM_EnvironmentBase *env);
virtual MM_GlobalCollector *createCollectors(MM_EnvironmentBase *env);
virtual MM_Heap *createHeapWithManager(MM_EnvironmentBase *env, uintptr_t heapBytesRequested, MM_HeapRegionManager *regionManager);
virtual MM_HeapRegionManager *createHeapRegionManager(MM_EnvironmentBase *env);
virtual MM_MemorySpace *createDefaultMemorySpace(MM_EnvironmentBase *env, MM_Heap *heap, MM_InitializationParameters *parameters);
Expand Down
12 changes: 11 additions & 1 deletion runtime/gc_vlhgc/ConfigurationIncrementalGenerational.cpp
@@ -1,6 +1,6 @@

/*******************************************************************************
* Copyright (c) 1991, 2021 IBM Corp. and others
* Copyright (c) 1991, 2023 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -84,6 +84,16 @@ MM_ConfigurationIncrementalGenerational::createGlobalCollector(MM_EnvironmentBas
return MM_IncrementalGenerationalGC::newInstance(env, heapRegionManager);
}

MM_GlobalCollector *
MM_ConfigurationIncrementalGenerational::createCollectors(MM_EnvironmentBase *envBase)
{
MM_GCExtensionsBase *extensions = envBase->getExtensions();
MM_EnvironmentVLHGC *env = MM_EnvironmentVLHGC::getEnvironment(envBase);
MM_HeapRegionManager *heapRegionManager = extensions->heapRegionManager;

return MM_IncrementalGenerationalGC::newInstance(env, heapRegionManager);
}

/**
* Create the heap for a region based configuration
*/
Expand Down
3 changes: 2 additions & 1 deletion runtime/gc_vlhgc/ConfigurationIncrementalGenerational.hpp
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 1991, 2021 IBM Corp. and others
* Copyright (c) 1991, 2023 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -53,6 +53,7 @@ class MM_ConfigurationIncrementalGenerational : public MM_Configuration
static MM_Configuration *newInstance(MM_EnvironmentBase *env);

virtual MM_GlobalCollector *createGlobalCollector(MM_EnvironmentBase *env);
virtual MM_GlobalCollector *createCollectors(MM_EnvironmentBase *env);
virtual MM_Heap *createHeapWithManager(MM_EnvironmentBase *env, UDATA heapBytesRequested, MM_HeapRegionManager *regionManager);
virtual MM_HeapRegionManager *createHeapRegionManager(MM_EnvironmentBase *env);
virtual J9Pool *createEnvironmentPool(MM_EnvironmentBase *env);
Expand Down

0 comments on commit db9a9c2

Please sign in to comment.