Skip to content

Commit

Permalink
CogVM source as per VMMaker.oscog-eem.3197
Browse files Browse the repository at this point in the history
adding pinning primitives (instantiate a pinned object in old space avoiding the overhead of allocating it in new space + become)
adding uninitialized new primitives for 64 bits Spur (including lifting the single header word limitation in the jit)
fix the mac profile plugin for 64 bit arm

[Thnaks Tom Braun!!]

Reassign primitive numbers for the new instantiation primitives:

580: pinned new
581: pinned new with arg
582: uninitialized new with arg

Add the upscaleDisplayIfHighDPI flag to the VM.  This is true by default.
It is controlled by bit 8 of the Persistent image header flags, accessed via vmParameterAt: 48 [put:...].

This flag is present to enable new VMs to allow the image to do its own scaling while keeping on scaling older images unaware of the option.
  • Loading branch information
eliotmiranda committed Jun 21, 2022
1 parent 27657fe commit cb310e4
Show file tree
Hide file tree
Showing 65 changed files with 20,942 additions and 643 deletions.
8 changes: 4 additions & 4 deletions src/plugins/FileDialogPlugin/FileDialogPlugin.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Automatically generated by
VMPluginCodeGenerator * VMMaker.oscog-eem.3191 uuid: 36b7165f-bcae-438e-8edb-d2def8bb3643
VMPluginCodeGenerator VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01
from
FileDialogPlugin * VMMaker.oscog-eem.3191 uuid: 36b7165f-bcae-438e-8edb-d2def8bb3643
FileDialogPlugin VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01
*/
static char __buildInfo[] = "FileDialogPlugin * VMMaker.oscog-eem.3191 uuid: 36b7165f-bcae-438e-8edb-d2def8bb3643 " __DATE__ ;
static char __buildInfo[] = "FileDialogPlugin VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 " __DATE__ ;


#include "config.h"
Expand Down Expand Up @@ -96,7 +96,7 @@ extern sqInt stackValue(sqInt offset);
extern
#endif
struct VirtualMachine* interpreterProxy;
static const char *moduleName = "FileDialogPlugin * VMMaker.oscog-eem.3191 " INT_EXT;
static const char *moduleName = "FileDialogPlugin VMMaker.oscog-eem.3197 " INT_EXT;



Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Automatically generated by
VMPluginCodeGenerator VMMaker.oscog-eem.3166 uuid: bda1c176-bedf-4490-bb95-90d3851c1526
VMPluginCodeGenerator VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01
from
VMProfileMacSupportPlugin VMMaker.oscog-eem.3166 uuid: bda1c176-bedf-4490-bb95-90d3851c1526
VMProfileMacSupportPlugin VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01
*/
static char __buildInfo[] = "VMProfileMacSupportPlugin VMMaker.oscog-eem.3166 uuid: bda1c176-bedf-4490-bb95-90d3851c1526 " __DATE__ ;
static char __buildInfo[] = "VMProfileMacSupportPlugin VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 " __DATE__ ;


#include "config.h"
Expand Down Expand Up @@ -94,7 +94,7 @@ extern sqInt topRemappableOop(void);
extern
#endif
struct VirtualMachine* interpreterProxy;
static const char *moduleName = "VMProfileMacSupportPlugin VMMaker.oscog-eem.3166 " INT_EXT;
static const char *moduleName = "VMProfileMacSupportPlugin VMMaker.oscog-eem.3197 " INT_EXT;



Expand Down Expand Up @@ -188,7 +188,7 @@ primitiveExecutableModulesAndOffsets(void)
start = (size = -1);
name = _dyld_get_image_name(i);
slide = _dyld_get_image_vmaddr_slide(i);
# if __x86_64__
# if __x86_64__ || __arm64__
h64 = (const struct mach_header_64 *)_dyld_get_image_header(i);
if (!(h64 == null)) {
s64 = getsectbynamefromheader_64(h64,SEG_TEXT,SECT_TEXT);
Expand All @@ -197,7 +197,7 @@ primitiveExecutableModulesAndOffsets(void)
size = s64->size;
}
}
# else // __x86_64__
# else // __x86_64__ || __arm64__
h = _dyld_get_image_header(i);
if (!(h == null)) {
s = getsectbynamefromheader(h,SEG_TEXT,SECT_TEXT);
Expand All @@ -206,7 +206,7 @@ primitiveExecutableModulesAndOffsets(void)
size = s->size;
}
}
# endif // __x86_64__
# endif // __x86_64__ || __arm64__
valueObj = instantiateClassindexableSize(classString(), strlen(name));
if (failed()) {
popRemappableOop();
Expand Down
2 changes: 1 addition & 1 deletion src/spur32.cog.lowcode/cogit.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.3188 uuid: 010bab73-d814-4c05-b0f1-f2da78c1568f
CCodeGenerator VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01
*/


Expand Down
28 changes: 23 additions & 5 deletions src/spur32.cog.lowcode/cogitARMv5.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.3188 uuid: 010bab73-d814-4c05-b0f1-f2da78c1568f
CCodeGenerator VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01
from
StackToRegisterMappingCogit VMMaker.oscog-eem.3188 uuid: 010bab73-d814-4c05-b0f1-f2da78c1568f
StackToRegisterMappingCogit VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01
*/
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3188 uuid: 010bab73-d814-4c05-b0f1-f2da78c1568f " __DATE__ ;
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;


Expand Down Expand Up @@ -226,7 +226,7 @@ char *__cogitBuildInfo = __buildInfo;
#define LS 9
#define LT 11
#define MapEnd 0
#define MaxCompiledPrimitiveIndex 575
#define MaxCompiledPrimitiveIndex 582
#define MaxCPICCases 6
#define MaxMethodSize 65535
#define MaxNegativeErrorCode -8
Expand Down Expand Up @@ -1003,6 +1003,7 @@ static sqInt genPrimitiveQuo(void);
static sqInt genPrimitiveSlotAt(void);
static sqInt genPrimitiveSlotAtPut(void);
static sqInt genPrimitiveSubtract(void);
static sqInt genPrimitiveUninitializedNewWithArg(void);
static sqInt NoDbgRegParms genPureDoubleArithmeticpreOpCheck(sqInt arithmeticOperator, AbstractInstruction *(*preOpCheckOrNil)(int rcvrReg, int argReg));
static sqInt NoDbgRegParms genPureDoubleComparisoninvert(AbstractInstruction * NoDbgRegParms (*jumpOpcodeGenerator)(void *), sqInt invertComparison);
static sqInt NoDbgRegParms genSmallIntegerComparison(sqInt jumpOpcode);
Expand Down Expand Up @@ -2679,7 +2680,14 @@ static PrimitiveDescriptor primitiveGeneratorTable[MaxCompiledPrimitiveIndex+1]
{ 0, -1 },
{ 0, -1 },
{ 0, -1 },
{ genPrimitiveHighBit, 0 }
{ genPrimitiveHighBit, 0 },
{ 0, -1 },
{ 0, -1 },
{ 0, -1 },
{ 0, -1 },
{ 0, -1 },
{ 0, -1 },
{ genPrimitiveUninitializedNewWithArg, 1 }
};
static sqInt primitiveIndex;
static sqInt processorLock;
Expand Down Expand Up @@ -19449,6 +19457,16 @@ genPrimitiveSubtract(void)
}


/* subclasses override if they can */

/* CogObjectRepresentation>>#genPrimitiveUninitializedNewWithArg */
static sqInt
genPrimitiveUninitializedNewWithArg(void)
{
return UnimplementedPrimitive;
}


/* In the Pure version, mixed arithmetic with SmallInteger is forbidden */

/* CogObjectRepresentation>>#genPureDoubleArithmetic:preOpCheck: */
Expand Down
28 changes: 23 additions & 5 deletions src/spur32.cog.lowcode/cogitIA32.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.3188 uuid: 010bab73-d814-4c05-b0f1-f2da78c1568f
CCodeGenerator VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01
from
StackToRegisterMappingCogit VMMaker.oscog-eem.3188 uuid: 010bab73-d814-4c05-b0f1-f2da78c1568f
StackToRegisterMappingCogit VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01
*/
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3188 uuid: 010bab73-d814-4c05-b0f1-f2da78c1568f " __DATE__ ;
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3197 uuid: c5f845c2-b1f7-41fc-acd1-9d3054673e01 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;


Expand Down Expand Up @@ -222,7 +222,7 @@ char *__cogitBuildInfo = __buildInfo;
#define LogicalShiftRightRR 94
#define LowcodeContextMark 60
#define MapEnd 0
#define MaxCompiledPrimitiveIndex 575
#define MaxCompiledPrimitiveIndex 582
#define MaxCPICCases 6
#define MaxMethodSize 65535
#define MaxNegativeErrorCode -8
Expand Down Expand Up @@ -962,6 +962,7 @@ static sqInt genPrimitiveQuo(void);
static sqInt genPrimitiveSlotAt(void);
static sqInt genPrimitiveSlotAtPut(void);
static sqInt genPrimitiveSubtract(void);
static sqInt genPrimitiveUninitializedNewWithArg(void);
static sqInt NoDbgRegParms genPureDoubleArithmeticpreOpCheck(sqInt arithmeticOperator, AbstractInstruction *(*preOpCheckOrNil)(int rcvrReg, int argReg));
static sqInt NoDbgRegParms genPureDoubleComparisoninvert(AbstractInstruction * NoDbgRegParms (*jumpOpcodeGenerator)(void *), sqInt invertComparison);
static sqInt NoDbgRegParms genSmallIntegerComparison(sqInt jumpOpcode);
Expand Down Expand Up @@ -2610,7 +2611,14 @@ static PrimitiveDescriptor primitiveGeneratorTable[MaxCompiledPrimitiveIndex+1]
{ 0, -1 },
{ 0, -1 },
{ 0, -1 },
{ genPrimitiveHighBit, 0 }
{ genPrimitiveHighBit, 0 },
{ 0, -1 },
{ 0, -1 },
{ 0, -1 },
{ 0, -1 },
{ 0, -1 },
{ 0, -1 },
{ genPrimitiveUninitializedNewWithArg, 1 }
};
static sqInt primitiveIndex;
static sqInt processorLock;
Expand Down Expand Up @@ -19008,6 +19016,16 @@ genPrimitiveSubtract(void)
}


/* subclasses override if they can */

/* CogObjectRepresentation>>#genPrimitiveUninitializedNewWithArg */
static sqInt
genPrimitiveUninitializedNewWithArg(void)
{
return UnimplementedPrimitive;
}


/* In the Pure version, mixed arithmetic with SmallInteger is forbidden */

/* CogObjectRepresentation>>#genPureDoubleArithmetic:preOpCheck: */
Expand Down
Loading

0 comments on commit cb310e4

Please sign in to comment.