Skip to content

Commit

Permalink
CogVM source as per VMMaker.oscog-eem.3047
Browse files Browse the repository at this point in the history
Fix the performance regression for compilation performance introduced by
VMMaker.oscog-eem.2994 (primitiveFlushCacheByMethod).
  • Loading branch information
eliotmiranda committed Aug 22, 2021
1 parent 33013a9 commit 12b0d50
Show file tree
Hide file tree
Showing 51 changed files with 1,192 additions and 5,272 deletions.
2 changes: 1 addition & 1 deletion spur64src/vm/cogit.h
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.3041 uuid: d49739b7-03f7-49a6-817b-f6f232342ad7
CCodeGenerator VMMaker.oscog-eem.3047 uuid: 548d0a5b-eb23-4df6-bbb1-0b431cc840b3
*/


Expand Down
18 changes: 12 additions & 6 deletions spur64src/vm/cogitARMv8.c
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.3041 uuid: d49739b7-03f7-49a6-817b-f6f232342ad7
CCodeGenerator VMMaker.oscog-eem.3047 uuid: 548d0a5b-eb23-4df6-bbb1-0b431cc840b3
from
StackToRegisterMappingCogit VMMaker.oscog-eem.3041 uuid: d49739b7-03f7-49a6-817b-f6f232342ad7
StackToRegisterMappingCogit VMMaker.oscog-eem.3047 uuid: 548d0a5b-eb23-4df6-bbb1-0b431cc840b3
*/
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3041 uuid: d49739b7-03f7-49a6-817b-f6f232342ad7 " __DATE__ ;
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3047 uuid: 548d0a5b-eb23-4df6-bbb1-0b431cc840b3 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;


Expand Down Expand Up @@ -2704,6 +2704,7 @@ void (*realCEEnterCogCodePopReceiverReg)(void);
#define halt() warning("halt")
#define haltmsg(msg) warning("halt: " msg)
#define interpretOffset() missOffset
#define mapPerMethodProfile() 0
#define maxCogCodeSize() (16*1024*1024)
#define maybeBreakGeneratingFromto(address,end) 0
#define maybeBreakGeneratingInstructionWithIndex(i) 0
Expand All @@ -2712,6 +2713,7 @@ void (*realCEEnterCogCodePopReceiverReg)(void);
#define methodZoneBase() methodZoneBase
#define minCallAddress() minValidCallAddress
#define minCogMethodAddress() methodZoneBase
#define moveProfileToMethods() 0
#define noCheckEntryOffset() cmNoCheckEntryOffset
#define noContextSwitchBlockEntryOffset() blockNoContextSwitchOffset
#define notYetImplemented() warning("not yet implemented")
Expand Down Expand Up @@ -7270,7 +7272,7 @@ rewriteImm19JumpBeforetarget(AbstractInstruction * self_in_rewriteImm19JumpBefor
static sqInt NoDbgRegParms
rewriteImm26JumpBeforetarget(AbstractInstruction * self_in_rewriteImm26JumpBeforetarget, sqInt followingAddress, sqInt targetAddress)
{
sqInt instrOpcode;
usqInt instrOpcode;
sqInt mcpc;
sqInt offset;

Expand All @@ -7280,7 +7282,7 @@ rewriteImm26JumpBeforetarget(AbstractInstruction * self_in_rewriteImm26JumpBefor
instrOpcode = ((instructionBeforeAddress(self_in_rewriteImm26JumpBeforetarget, followingAddress))) >> 26;
assert((instrOpcode == 5)
|| (instrOpcode == 37));
codeLong32Atput(mcpc, (((sqInt)((usqInt)(instrOpcode) << 26))) + (((offset) >> 2) & (0x3FFFFFF)));
codeLong32Atput(mcpc, (instrOpcode << 26) + (((offset) >> 2) & (0x3FFFFFF)));
return 4;
}

Expand Down Expand Up @@ -10116,6 +10118,7 @@ compactCogCompiledCode(void)

assertValidDualZone();
assert(noCogMethodsMaximallyMarked());
moveProfileToMethods();
/* begin ensureWritableCodeZone */
# if !DUAL_MAPPED_CODE_ZONE
/* begin makeCodeZoneWritable */
Expand Down Expand Up @@ -11774,6 +11777,7 @@ void
freeCogMethod(CogMethod *cogMethod)
{

moveProfileToMethods();
freeMethod(cogMethod);
/* begin ensureExecutableCodeZone */
# if !DUAL_MAPPED_CODE_ZONE
Expand All @@ -11793,9 +11797,10 @@ freeCogMethod(CogMethod *cogMethod)
void
freeUnmarkedMachineCode(void)
{
CogMethod *cogMethod;
CogMethod * cogMethod;
sqInt freedMethod;

moveProfileToMethods();
freedMethod = 0;
cogMethod = ((CogMethod *) methodZoneBase);
while (cogMethod < (limitZony())) {
Expand Down Expand Up @@ -14155,6 +14160,7 @@ mapObjectReferencesInMachineCode(sqInt gcMode)
default:
error("Case not found and no otherwise clause");
}
mapPerMethodProfile();
if (!(asserta((freeStart()) <= (youngReferrers())))) {
error("youngReferrers list overflowed");
}
Expand Down
14 changes: 10 additions & 4 deletions spur64src/vm/cogitX64SysV.c
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.3041 uuid: d49739b7-03f7-49a6-817b-f6f232342ad7
CCodeGenerator VMMaker.oscog-eem.3047 uuid: 548d0a5b-eb23-4df6-bbb1-0b431cc840b3
from
StackToRegisterMappingCogit VMMaker.oscog-eem.3041 uuid: d49739b7-03f7-49a6-817b-f6f232342ad7
StackToRegisterMappingCogit VMMaker.oscog-eem.3047 uuid: 548d0a5b-eb23-4df6-bbb1-0b431cc840b3
*/
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3041 uuid: d49739b7-03f7-49a6-817b-f6f232342ad7 " __DATE__ ;
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3047 uuid: 548d0a5b-eb23-4df6-bbb1-0b431cc840b3 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;


Expand Down Expand Up @@ -2626,6 +2626,7 @@ void (*realCEEnterCogCodePopReceiverReg)(void);
#define halt() warning("halt")
#define haltmsg(msg) warning("halt: " msg)
#define interpretOffset() missOffset
#define mapPerMethodProfile() 0
#define maxCogCodeSize() (16*1024*1024)
#define maybeBreakGeneratingFromto(address,end) 0
#define maybeBreakGeneratingInstructionWithIndex(i) 0
Expand All @@ -2634,6 +2635,7 @@ void (*realCEEnterCogCodePopReceiverReg)(void);
#define methodZoneBase() methodZoneBase
#define minCallAddress() minValidCallAddress
#define minCogMethodAddress() methodZoneBase
#define moveProfileToMethods() 0
#define noCheckEntryOffset() cmNoCheckEntryOffset
#define noContextSwitchBlockEntryOffset() blockNoContextSwitchOffset
#define notYetImplemented() warning("not yet implemented")
Expand Down Expand Up @@ -5487,6 +5489,7 @@ compactCogCompiledCode(void)
{
assertValidDualZone();
assert(noCogMethodsMaximallyMarked());
moveProfileToMethods();
/* begin ensureWritableCodeZone */
# if !DUAL_MAPPED_CODE_ZONE

Expand Down Expand Up @@ -7128,6 +7131,7 @@ followMovableLiteralsAndUpdateYoungReferrers(void)
void
freeCogMethod(CogMethod *cogMethod)
{
moveProfileToMethods();
freeMethod(cogMethod);
/* begin ensureExecutableCodeZone */
# if !DUAL_MAPPED_CODE_ZONE
Expand All @@ -7144,9 +7148,10 @@ freeCogMethod(CogMethod *cogMethod)
void
freeUnmarkedMachineCode(void)
{
CogMethod *cogMethod;
CogMethod * cogMethod;
sqInt freedMethod;

moveProfileToMethods();
freedMethod = 0;
cogMethod = ((CogMethod *) methodZoneBase);
while (cogMethod < (limitZony())) {
Expand Down Expand Up @@ -9205,6 +9210,7 @@ mapObjectReferencesInMachineCode(sqInt gcMode)
default:
error("Case not found and no otherwise clause");
}
mapPerMethodProfile();
if (!(asserta((freeStart()) <= (youngReferrers())))) {
error("youngReferrers list overflowed");
}
Expand Down
14 changes: 10 additions & 4 deletions spur64src/vm/cogitX64WIN64.c
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.3041 uuid: d49739b7-03f7-49a6-817b-f6f232342ad7
CCodeGenerator VMMaker.oscog-eem.3047 uuid: 548d0a5b-eb23-4df6-bbb1-0b431cc840b3
from
StackToRegisterMappingCogit VMMaker.oscog-eem.3041 uuid: d49739b7-03f7-49a6-817b-f6f232342ad7
StackToRegisterMappingCogit VMMaker.oscog-eem.3047 uuid: 548d0a5b-eb23-4df6-bbb1-0b431cc840b3
*/
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3041 uuid: d49739b7-03f7-49a6-817b-f6f232342ad7 " __DATE__ ;
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3047 uuid: 548d0a5b-eb23-4df6-bbb1-0b431cc840b3 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;


Expand Down Expand Up @@ -2626,6 +2626,7 @@ void (*realCEEnterCogCodePopReceiverReg)(void);
#define halt() warning("halt")
#define haltmsg(msg) warning("halt: " msg)
#define interpretOffset() missOffset
#define mapPerMethodProfile() 0
#define maxCogCodeSize() (16*1024*1024)
#define maybeBreakGeneratingFromto(address,end) 0
#define maybeBreakGeneratingInstructionWithIndex(i) 0
Expand All @@ -2634,6 +2635,7 @@ void (*realCEEnterCogCodePopReceiverReg)(void);
#define methodZoneBase() methodZoneBase
#define minCallAddress() minValidCallAddress
#define minCogMethodAddress() methodZoneBase
#define moveProfileToMethods() 0
#define noCheckEntryOffset() cmNoCheckEntryOffset
#define noContextSwitchBlockEntryOffset() blockNoContextSwitchOffset
#define notYetImplemented() warning("not yet implemented")
Expand Down Expand Up @@ -5487,6 +5489,7 @@ compactCogCompiledCode(void)
{
assertValidDualZone();
assert(noCogMethodsMaximallyMarked());
moveProfileToMethods();
/* begin ensureWritableCodeZone */
# if !DUAL_MAPPED_CODE_ZONE

Expand Down Expand Up @@ -7136,6 +7139,7 @@ followMovableLiteralsAndUpdateYoungReferrers(void)
void
freeCogMethod(CogMethod *cogMethod)
{
moveProfileToMethods();
freeMethod(cogMethod);
/* begin ensureExecutableCodeZone */
# if !DUAL_MAPPED_CODE_ZONE
Expand All @@ -7152,9 +7156,10 @@ freeCogMethod(CogMethod *cogMethod)
void
freeUnmarkedMachineCode(void)
{
CogMethod *cogMethod;
CogMethod * cogMethod;
sqInt freedMethod;

moveProfileToMethods();
freedMethod = 0;
cogMethod = ((CogMethod *) methodZoneBase);
while (cogMethod < (limitZony())) {
Expand Down Expand Up @@ -9223,6 +9228,7 @@ mapObjectReferencesInMachineCode(sqInt gcMode)
default:
error("Case not found and no otherwise clause");
}
mapPerMethodProfile();
if (!(asserta((freeStart()) <= (youngReferrers())))) {
error("youngReferrers list overflowed");
}
Expand Down

5 comments on commit 12b0d50

@marceltaeumel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm that compilation performance (e.g. Morph compileAll) is back to normal in cog.spur :-)

@OpenSmalltalk-Bot
Copy link

@OpenSmalltalk-Bot OpenSmalltalk-Bot commented on 12b0d50 Aug 23, 2021 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eliotmiranda
Copy link
Contributor Author

@eliotmiranda eliotmiranda commented on 12b0d50 Aug 24, 2021 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OpenSmalltalk-Bot
Copy link

@OpenSmalltalk-Bot OpenSmalltalk-Bot commented on 12b0d50 Aug 24, 2021 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eliotmiranda
Copy link
Contributor Author

@eliotmiranda eliotmiranda commented on 12b0d50 Aug 24, 2021 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.