Skip to content

Commit ea939d2

Browse files
committed
Fix pre-gc init and move out of gc-specific files
This includes the Cando initialization, which expects the command line arguments to be in place already. This initialization doesn't actually do anything boehm-specific etc. so having it triplicated is unnecessary.
1 parent 3ba3c5f commit ea939d2

File tree

4 files changed

+14
-31
lines changed

4 files changed

+14
-31
lines changed

src/gctools/boehmGarbageCollection.cc

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -389,12 +389,6 @@ void boehm_clear_finalizer_list(gctools::Tagged object_tagged) {
389389

390390
}; // namespace gctools
391391

392-
#ifndef SCRAPING
393-
#define ALL_PREGCSTARTUPS_EXTERN
394-
#include PRE_GC_STARTUP_INC_H
395-
#undef ALL_PREGCSTARTUPS_EXTERN
396-
#endif
397-
398392
namespace gctools {
399393
__attribute__((noinline)) void startupBoehm(gctools::ClaspInfo* claspInfo) {
400394
GC_set_handle_fork(1);
@@ -436,12 +430,6 @@ __attribute__((noinline)) void startupBoehm(gctools::ClaspInfo* claspInfo) {
436430
GC_register_my_thread(&gc_stack_base);
437431
#endif
438432

439-
#ifndef SCRAPING
440-
#define ALL_PREGCSTARTUPS_CALLS
441-
#include PRE_GC_STARTUP_INC_H
442-
#undef ALL_PREGCSTARTUPS_CALLS
443-
#endif
444-
445433
//
446434
// Set up the _lisp and symbols memory as roots
447435
//

src/gctools/mmtkGarbageCollection.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@ THE SOFTWARE.
3737
#include <clasp/core/compiler.h>
3838
#include <clasp/gctools/snapshotSaveLoad.h>
3939

40-
#ifndef SCRAPING
41-
#define ALL_PREGCSTARTUPS_EXTERN
42-
#include PRE_GC_STARTUP_INC_H
43-
#undef ALL_PREGCSTARTUPS_EXTERN
44-
#endif
45-
4640
THREAD_LOCAL MMTk_Mutator my_mutator;
4741

4842
namespace gctools {

src/gctools/mpsGarbageCollection.cc

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,6 @@ extern mps_addr_t cons_skip(mps_addr_t client);
175175
extern mps_addr_t weak_obj_skip(mps_addr_t client);
176176
};
177177

178-
#ifndef SCRAPING
179-
#define ALL_PREGCSTARTUPS_EXTERN
180-
#include PRE_GC_STARTUP_INC_H
181-
#undef ALL_PREGCSTARTUPS_EXTERN
182-
#endif
183-
184178
namespace gctools {
185179

186180
THREAD_LOCAL ThreadLocalAllocationPoints my_thread_allocation_points;
@@ -1087,12 +1081,6 @@ __attribute__((noinline)) void startupMemoryPoolSystem(gctools::ClaspInfo* clasp
10871081
if (res != MPS_RES_OK)
10881082
GC_RESULT_ERROR(res, "Could not create awl pool");
10891083

1090-
#ifndef SCRAPING
1091-
#define ALL_PREGCSTARTUPS_CALLS
1092-
#include PRE_GC_STARTUP_INC_H
1093-
#undef ALL_PREGCSTARTUPS_CALLS
1094-
#endif // ifndef SCRAPING
1095-
10961084
// register the current and only thread
10971085
mps_thr_t global_thread;
10981086
res = mps_thread_reg(&global_thread, global_arena);

src/gctools/startRunStop.cc

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@ static void clasp_terminate_handler(void) {
165165

166166
}; // namespace gctools
167167

168+
#ifndef SCRAPING
169+
#define ALL_PREGCSTARTUPS_EXTERN
170+
#include PRE_GC_STARTUP_INC_H
171+
#undef ALL_PREGCSTARTUPS_EXTERN
172+
#endif
173+
168174
extern "C" {
169175

170176
int startup_clasp(void** stackMarker, gctools::ClaspInfo* claspInfo, int* exitCode) {
@@ -263,6 +269,14 @@ int startup_clasp(void** stackMarker, gctools::ClaspInfo* claspInfo, int* exitCo
263269
#endif
264270
gctools::initialize_signals(DEFAULT_THREAD_INTERRUPT_SIGNAL);
265271

272+
core::global_options = new core::CommandLineOptions(claspInfo->_argc, claspInfo->_argv);
273+
274+
#ifndef SCRAPING
275+
#define ALL_PREGCSTARTUPS_CALLS
276+
#include PRE_GC_STARTUP_INC_H
277+
#undef ALL_PREGCSTARTUPS_CALLS
278+
#endif
279+
266280
#if defined(USE_MPS)
267281
gctools::startupMemoryPoolSystem(claspInfo);
268282
#elif defined(USE_BOEHM)
@@ -272,7 +286,6 @@ int startup_clasp(void** stackMarker, gctools::ClaspInfo* claspInfo, int* exitCo
272286
claspInfo->_mpiSize);
273287
#endif
274288

275-
core::global_options = new core::CommandLineOptions(claspInfo->_argc, claspInfo->_argv);
276289
core::transfer_StartupInfo_to_my_thread();
277290
my_thread->startUpVM();
278291

0 commit comments

Comments
 (0)