Skip to content

Commit a64d876

Browse files
committed
Merge 838c323
2 parents d110d3f + 838c323 commit a64d876

File tree

7 files changed

+71
-5
lines changed

7 files changed

+71
-5
lines changed

cmake/importSDL2.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ function(download_SDL2)
1818
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "ARM64")
1919
add_third_party_dependency("SDL2-2.0.5")
2020
else()
21-
add_third_party_dependency("SDL2-2.24.1")
21+
add_third_party_dependency("SDL2-2.32.6")
2222
endif()
2323
elseif(OSX)
24-
add_third_party_dependency("SDL2-2.32.2")
24+
add_third_party_dependency("SDL2-2.32.6")
2525
else() #LINUX
2626
If(${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7l" OR (${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64"))
2727
add_third_party_dependency("SDL2-2.0.14")

cmake/versionExtraction.cmake

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,18 @@ else()
118118
list(GET ${PROJECT_NAME}_VERSION_LIST 7 ${PROJECT_NAME}_VERSION_GIT_SHA)
119119
list(GET ${PROJECT_NAME}_VERSION_LIST 8 ${PROJECT_NAME}_VERSION_GIT_COMMIT_DATE)
120120

121+
# Save version to file (which will be used when Git is not available
122+
# or VERSION_UPDATE_FROM_GIT is disabled)
123+
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/version.info ${${PROJECT_NAME}_VERSION_STRING_FULL}
124+
"*" ${${PROJECT_NAME}_VERSION_STRING}
125+
"*" ${${PROJECT_NAME}_VERSION_MAJOR}
126+
"*" ${${PROJECT_NAME}_VERSION_MINOR}
127+
"*" ${${PROJECT_NAME}_VERSION_PATCH}
128+
"*" ${${PROJECT_NAME}_VERSION_TWEAK}
129+
"*" ${${PROJECT_NAME}_VERSION_AHEAD}
130+
"*" ${${PROJECT_NAME}_VERSION_GIT_SHA}
131+
"*" ${${PROJECT_NAME}_VERSION_GIT_COMMIT_DATE})
132+
121133
endif()
122134

123135

include/pharovm/parameters/parameters.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ typedef struct VMParameters_
4949
//The minimal Permanent Space Size
5050
long long minPermSpaceSize;
5151

52+
//The max slots in a single indexable young object
53+
long long maxSlotsForNewSpaceAlloc;
54+
5255
// FIXME: Why passing this is needed when we have the separated vectors?
5356
int processArgc;
5457
const char** processArgv;

smalltalksrc/VMMaker/SpurMemoryManager.class.st

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,8 @@ Class {
619619
'fromPermToOldSpaceRememberedSet',
620620
'fromPermToNewSpaceRememberedSet',
621621
'permSpaceForwardersToCleanUp',
622-
'avoidSearchingSegmentsWithPinnedObjects'
622+
'avoidSearchingSegmentsWithPinnedObjects',
623+
'maxSlotsForNewSpaceAlloc'
623624
],
624625
#classVars : [
625626
'BitsPerByte',
@@ -6860,6 +6861,8 @@ SpurMemoryManager >> initialize [
68606861
ifNil: [0].
68616862

68626863
avoidSearchingSegmentsWithPinnedObjects := false.
6864+
6865+
maxSlotsForNewSpaceAlloc := 0. "We will use the default value"
68636866

68646867
]
68656868

@@ -9357,7 +9360,12 @@ SpurMemoryManager >> maxSlotsForNewSpaceAlloc [
93579360
"Almost entirely arbitrary, but we dont want 1Mb bitmaps allocated in eden.
93589361
But this choice means no check for numSlots > maxSlotsForNewSpaceAlloc
93599362
for non-variable allocations."
9360-
^self fixedFieldsOfClassFormatMask
9363+
9364+
^ maxSlotsForNewSpaceAlloc = 0
9365+
ifTrue: [ self fixedFieldsOfClassFormatMask ]
9366+
ifFalse: [ maxSlotsForNewSpaceAlloc ]
9367+
9368+
93619369
]
93629370

93639371
{ #category : 'interpreter access' }
@@ -12166,6 +12174,15 @@ SpurMemoryManager >> setMaxOldSpaceSize: limit [
1216612174
^0
1216712175
]
1216812176

12177+
{ #category : 'instantiation' }
12178+
SpurMemoryManager >> setMaxSlotsForNewSpaceAlloc: aValue [
12179+
12180+
<api>
12181+
12182+
maxSlotsForNewSpaceAlloc := aValue
12183+
12184+
]
12185+
1216912186
{ #category : 'accessing' }
1217012187
SpurMemoryManager >> setMinimalPermSpaceSize: min [
1217112188

smalltalksrc/VMMaker/StackInterpreterPrimitives.class.st

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1541,7 +1541,7 @@ StackInterpreterPrimitives >> primitiveGetVMParameter: index [
15411541
[9] -> [^objectMemory integerObjectOf: objectMemory statScavenges].
15421542
[10] -> [^objectMemory integerObjectOf: objectMemory statScavengeGCUsecs + 500 // 1000].
15431543
[11] -> [^objectMemory integerObjectOf: objectMemory statTenures].
1544-
[12] -> [^ConstZero]. "Was JITTER VM info"
1544+
[12] -> [^objectMemory integerObjectOf: objectMemory maxSlotsForNewSpaceAlloc ].
15451545
[13] -> [^ConstZero]. "Was JITTER VM info"
15461546
[14] -> [^ConstZero]. "Was JITTER VM info"
15471547
[15] -> [^ConstZero]. "Was JITTER VM info"
@@ -2662,6 +2662,9 @@ StackInterpreterPrimitives >> primitiveSetVMParameter: index arg: argOop [
26622662
[result := objectMemory integerObjectOf: objectMemory statTenures.
26632663
objectMemory statTenures: arg.
26642664
self initPrimCall]].
2665+
[12] -> [result := objectMemory integerObjectOf: objectMemory maxSlotsForNewSpaceAlloc.
2666+
objectMemory setMaxSlotsForNewSpaceAlloc: arg.
2667+
self initPrimCall ].
26652668
[17] -> [(SistaVM and: [self isCog]) ifTrue:
26662669
[result := objectMemory floatObjectOf: self getCogCodeZoneThreshold.
26672670
primFailCode := self setCogCodeZoneThreshold: (self noInlineLoadFloatOrIntFrom: argOop)]].

src/client.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ extern void setDesiredEdenBytes(sqLong anInteger);
1111
extern void setMinimalPermSpaceSize(sqInt min);
1212
extern void setDesiredStackPageBytes(sqLong anInteger);
1313
extern void setAvoidSearchingSegmentsWithPinnedObjects(sqInt aValue);
14+
extern void setMaxSlotsForNewSpaceAlloc(usqInt aValue);
1415

1516
#if defined(__GNUC__) && ( defined(i386) || defined(__i386) || defined(__i386__) \
1617
|| defined(i486) || defined(__i486) || defined (__i486__) \
@@ -72,6 +73,7 @@ EXPORT(int) vm_init(VMParameters* parameters)
7273
setDesiredEdenBytes(parameters->edenSize);
7374
setMinimalPermSpaceSize(parameters->minPermSpaceSize);
7475
setDesiredStackPageBytes(parameters->stackPageSize);
76+
setMaxSlotsForNewSpaceAlloc(parameters->maxSlotsForNewSpaceAlloc);
7577

7678
setAvoidSearchingSegmentsWithPinnedObjects(parameters->avoidSearchingSegmentsWithPinnedObjects);
7779

src/parameters/parameters.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ static VMErrorCode processMaxCodeSpaceSizeOption(const char *argument, VMParamet
7676
static VMErrorCode processEdenSizeOption(const char *argument, VMParameters * params);
7777
static VMErrorCode processWorkerOption(const char *argument, VMParameters * params);
7878
static VMErrorCode processMinPermSpaceSizeOption(const char *argument, VMParameters * params);
79+
static VMErrorCode processMaxSlotsForNewSpaceAlloc(const char *argument, VMParameters * params);
7980
static VMErrorCode processStackPageSizeOption(const char *argument, VMParameters * params);
8081
static VMErrorCode processWorkingDirectory(const char *argument, VMParameters * params);
8182
static VMErrorCode processAvoidSearchingSegmentsWithPinnedObjects(const char *argument, VMParameters * params);
@@ -98,6 +99,7 @@ static const VMParameterSpec vm_parameters_spec[] =
9899
{.name = "codeSize", .hasArgument = true, .function = processMaxCodeSpaceSizeOption},
99100
{.name = "edenSize", .hasArgument = true, .function = processEdenSizeOption},
100101
{.name = "minPermSpaceSize", .hasArgument = true, .function = processMinPermSpaceSizeOption},
102+
{.name = "maxSlotsForNewSpaceAlloc", .hasArgument = true, .function = processMaxSlotsForNewSpaceAlloc},
101103

102104
{.name = "workingDirectory", .hasArgument = true, .function = processWorkingDirectory},
103105

@@ -441,6 +443,7 @@ vm_printUsageTo(FILE *out)
441443
" It is possible to use k(kB), M(MB) and G(GB).\n"
442444
" --edenSize=<size>[mk] Sets the size of eden (default: 15M)\n"
443445
" 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"
444447
" --minPermSpaceSize=<size>[mk] Sets the min size of the permanent space (default: 0k)\n"
445448
" It is possible to use k(kB), M(MB) and G(GB).\n"
446449
" --stackPageSize=<size>[mk] Sets the size of each stack page (default: 8k)\n"
@@ -566,6 +569,23 @@ processMinPermSpaceSizeOption(const char* originalArgument, VMParameters * param
566569
return VM_SUCCESS;
567570
}
568571

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+
569589
static VMErrorCode
570590
processWorkingDirectory(const char* originalArgument, VMParameters * params)
571591
{
@@ -590,6 +610,14 @@ processEdenSizeOption(const char* originalArgument, VMParameters * params)
590610
return VM_ERROR_INVALID_PARAMETER_VALUE;
591611
}
592612

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+
593621
params->edenSize = intValue;
594622

595623
return VM_SUCCESS;
@@ -770,6 +798,7 @@ vm_parameters_init(VMParameters *parameters){
770798
parameters->maxStackFramesToPrint = 0;
771799
parameters->maxCodeSize = 0;
772800
parameters->maxOldSpaceSize = 0;
801+
parameters->maxSlotsForNewSpaceAlloc = 0;
773802
parameters->edenSize = 0;
774803
parameters->minPermSpaceSize = 0;
775804
parameters->stackPageSize = 0;

0 commit comments

Comments
 (0)