@@ -76,6 +76,7 @@ static VMErrorCode processMaxCodeSpaceSizeOption(const char *argument, VMParamet
76
76
static VMErrorCode processEdenSizeOption (const char * argument , VMParameters * params );
77
77
static VMErrorCode processWorkerOption (const char * argument , VMParameters * params );
78
78
static VMErrorCode processMinPermSpaceSizeOption (const char * argument , VMParameters * params );
79
+ static VMErrorCode processMaxSlotsForNewSpaceAlloc (const char * argument , VMParameters * params );
79
80
static VMErrorCode processStackPageSizeOption (const char * argument , VMParameters * params );
80
81
static VMErrorCode processWorkingDirectory (const char * argument , VMParameters * params );
81
82
static VMErrorCode processAvoidSearchingSegmentsWithPinnedObjects (const char * argument , VMParameters * params );
@@ -98,6 +99,7 @@ static const VMParameterSpec vm_parameters_spec[] =
98
99
{.name = "codeSize" , .hasArgument = true, .function = processMaxCodeSpaceSizeOption },
99
100
{.name = "edenSize" , .hasArgument = true, .function = processEdenSizeOption },
100
101
{.name = "minPermSpaceSize" , .hasArgument = true, .function = processMinPermSpaceSizeOption },
102
+ {.name = "maxSlotsForNewSpaceAlloc" , .hasArgument = true, .function = processMaxSlotsForNewSpaceAlloc },
101
103
102
104
{.name = "workingDirectory" , .hasArgument = true, .function = processWorkingDirectory },
103
105
@@ -441,6 +443,7 @@ vm_printUsageTo(FILE *out)
441
443
" It is possible to use k(kB), M(MB) and G(GB).\n"
442
444
" --edenSize=<size>[mk] Sets the size of eden (default: 15M)\n"
443
445
" It is possible to use k(kB), M(MB) and G(GB).\n"
446
+ " --maxSlotsForNewSpaceAlloc=<words> The max numbers of slots to allow allocating in a single young indexable object"
444
447
" --minPermSpaceSize=<size>[mk] Sets the min size of the permanent space (default: 0k)\n"
445
448
" It is possible to use k(kB), M(MB) and G(GB).\n"
446
449
" --stackPageSize=<size>[mk] Sets the size of each stack page (default: 8k)\n"
@@ -566,6 +569,23 @@ processMinPermSpaceSizeOption(const char* originalArgument, VMParameters * param
566
569
return VM_SUCCESS ;
567
570
}
568
571
572
+ static VMErrorCode
573
+ processMaxSlotsForNewSpaceAlloc (const char * originalArgument , VMParameters * params )
574
+ {
575
+ long long intValue = strtoll (originalArgument , NULL , 10 );
576
+
577
+ if (intValue < 0 )
578
+ {
579
+ logError ("Invalid option for max slots for new space allocation: %s\n" , originalArgument );
580
+ vm_printUsageTo (stderr );
581
+ return VM_ERROR_INVALID_PARAMETER_VALUE ;
582
+ }
583
+
584
+ params -> maxSlotsForNewSpaceAlloc = intValue ;
585
+
586
+ return VM_SUCCESS ;
587
+ }
588
+
569
589
static VMErrorCode
570
590
processWorkingDirectory (const char * originalArgument , VMParameters * params )
571
591
{
@@ -590,6 +610,14 @@ processEdenSizeOption(const char* originalArgument, VMParameters * params)
590
610
return VM_ERROR_INVALID_PARAMETER_VALUE ;
591
611
}
592
612
613
+ //The max value for the edenSize is 1GB check #nextCorpseOffset: for restriction details.
614
+ if (intValue > 1024 * 1024 * 1024 )
615
+ {
616
+ logError ("The max value for eden is 1G: %s\n" , originalArgument );
617
+ vm_printUsageTo (stderr );
618
+ return VM_ERROR_INVALID_PARAMETER_VALUE ;
619
+ }
620
+
593
621
params -> edenSize = intValue ;
594
622
595
623
return VM_SUCCESS ;
@@ -770,6 +798,7 @@ vm_parameters_init(VMParameters *parameters){
770
798
parameters -> maxStackFramesToPrint = 0 ;
771
799
parameters -> maxCodeSize = 0 ;
772
800
parameters -> maxOldSpaceSize = 0 ;
801
+ parameters -> maxSlotsForNewSpaceAlloc = 0 ;
773
802
parameters -> edenSize = 0 ;
774
803
parameters -> minPermSpaceSize = 0 ;
775
804
parameters -> stackPageSize = 0 ;
0 commit comments