Skip to content

Commit

Permalink
Merge branch 'pharo-12' into test_inlinings_1
Browse files Browse the repository at this point in the history
  • Loading branch information
guillep committed Aug 7, 2023
2 parents dbf4149 + b3eb1ef commit c379823
Show file tree
Hide file tree
Showing 27 changed files with 423 additions and 336 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ set(APPNAME "Pharo" CACHE STRING "VM Application name"
set(FLAVOUR "CoInterpreter" CACHE STRING "The kind of VM to generate. Possible values: StackVM, CoInterpreter")
set(PHARO_LIBRARY_PATH "@executable_path/Plugins" CACHE STRING "The RPATH to use in the build")
set(ICEBERG_DEFAULT_REMOTE "scpUrl" CACHE STRING "If Iceberg uses HTTPS (httpsUrl) or tries first with SSH (scpUrl)")
set(IMAGE_FORMAT "SpurFormat" CACHE STRING "Image Format to use in the builtVM (SpurFormat / ComposedFormat)")

if(VERBOSE_BUILD)
set(CMAKE_VERBOSE_MAKEFILE TRUE)
Expand Down
25 changes: 23 additions & 2 deletions cmake/vmmaker.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,27 @@ else()
endif()
endif()

# Obtain all the parameters prefixed as VMMaker_
# Remove the prefix
function (getVMMakerParameters _resultVar)
getListOfVarsStartingWith("VMMaker_" matchedVars)
set (_pharoParameterArray "")
foreach (_var IN LISTS matchedVars)
# VMMaker_ has 8 characters
string(SUBSTRING ${_var} 8 -1 _name)
set (_pharoParameterArray ${_pharoParameterArray} "'${_name}'" "'${${_var}}'")
endforeach()
set (${_resultVar} "#( ${_pharoParameterArray} )" PARENT_SCOPE)
endfunction()

function (getListOfVarsStartingWith _prefix _resultVar)
get_cmake_property(_vars VARIABLES)
string (REGEX MATCHALL "(^|;)${_prefix}[A-Za-z0-9_]*" _matchedVars "${_vars}")
set (${_resultVar} ${_matchedVars} PARENT_SCOPE)
endfunction()

getVMMakerParameters(VM_Parameters)

set(PLUGIN_GENERATED_FILES
${PHARO_CURRENT_GENERATED}/plugins/src/FilePlugin/FilePlugin.c
${PHARO_CURRENT_GENERATED}/plugins/src/SurfacePlugin/SurfacePlugin.c
Expand Down Expand Up @@ -144,9 +165,9 @@ if(GENERATE_SOURCES)
#Custom command that generates the vm source code from VMMaker into the generated folder
add_custom_command(
OUTPUT ${VMSOURCEFILES} ${PLUGIN_GENERATED_FILES}
COMMAND ${VMMAKER_VM} --headless ${VMMAKER_IMAGE} --no-default-preferences eval \"PharoVMMaker generate: \#\'${FLAVOUR}\' outputDirectory: \'${CMAKE_CURRENT_BINARY_DIR_TO_OUT}\' imageFormat: \'${IMAGE_FORMAT}\'\"
COMMAND ${VMMAKER_VM} --headless ${VMMAKER_IMAGE} --no-default-preferences eval \"PharoVMMaker generate: \#\'${FLAVOUR}\' outputDirectory: \'${CMAKE_CURRENT_BINARY_DIR_TO_OUT}\' options: ${VM_Parameters}\"
DEPENDS vmmaker ${VMMAKER_IMAGE} ${VMMAKER_VM}
COMMENT "Generating VM files for flavour: ${FLAVOUR}")
COMMENT "Generating VM files for flavour: ${FLAVOUR} with options: ${VM_Parameters}")

add_custom_target(generate-sources DEPENDS ${VMSOURCEFILES} ${PLUGIN_GENERATED_FILES})

Expand Down
62 changes: 0 additions & 62 deletions extracted/plugins/BitBltPlugin/src/common/BitBltPlugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ static unsigned int rgbSubwith(unsigned int sourceWord, unsigned int destination
EXPORT(sqInt) setInterpreter(struct VirtualMachine *anInterpreter);
static sqInt setupColorMasks(void);
static sqInt setupColorMasksFromto(sqInt srcBits, sqInt targetBits);
static sqInt showDisplayBits(void);
static sqInt sourceSkewAndPointerInit(void);
static unsigned int sourceWordwith(unsigned int sourceWord, unsigned int destinationWord);
static sqInt sqAssert(sqInt aBool);
Expand Down Expand Up @@ -293,7 +292,6 @@ static usqInt (*positive32BitValueOf)(sqInt oop);
static usqLong (*positive64BitValueOf)(sqInt oop);
static sqInt (*primitiveFail)(void);
static sqInt (*primitiveFailFor)(sqInt reasonCode);
static sqInt (*showDisplayBitsLeftTopRightBottom)(sqInt aForm, sqInt l, sqInt t, sqInt r, sqInt b);
static sqInt (*slotSizeOf)(sqInt oop);
static sqInt (*stackIntegerValue)(sqInt offset);
static sqInt (*stackObjectValue)(sqInt offset);
Expand Down Expand Up @@ -335,7 +333,6 @@ extern usqInt positive32BitValueOf(sqInt oop);
extern usqLong positive64BitValueOf(sqInt oop);
extern sqInt primitiveFail(void);
extern sqInt primitiveFailFor(sqInt reasonCode);
extern sqInt showDisplayBitsLeftTopRightBottom(sqInt aForm, sqInt l, sqInt t, sqInt r, sqInt b);
extern sqInt slotSizeOf(sqInt oop);
extern sqInt stackIntegerValue(sqInt offset);
extern sqInt stackObjectValue(sqInt offset);
Expand Down Expand Up @@ -1355,11 +1352,6 @@ copyBitsFromtoat(sqInt startX, sqInt stopX, sqInt yValue)
sourceX = startX;
width = stopX - startX;
copyBits();
/* begin showDisplayBits */
if (numGCsOnInvocation != (statNumGCs())) {
reloadDestAndSourceForms();
}
showDisplayBitsLeftTopRightBottom(destForm, affectedL, affectedT, affectedR, affectedB);
return 0;
}

Expand Down Expand Up @@ -2694,11 +2686,6 @@ drawLoopXY(sqInt xDelta, sqInt yDelta)
affectedR = affR;
affectedT = affT;
affectedB = affB;
/* begin showDisplayBits */
if (numGCsOnInvocation != (statNumGCs())) {
reloadDestAndSourceForms();
}
showDisplayBitsLeftTopRightBottom(destForm, affectedL, affectedT, affectedR, affectedB);

/* init null rectangle */
affL = (affT = 9999);
Expand Down Expand Up @@ -2738,11 +2725,6 @@ drawLoopXY(sqInt xDelta, sqInt yDelta)
affectedR = affR;
affectedT = affT;
affectedB = affB;
/* begin showDisplayBits */
if (numGCsOnInvocation != (statNumGCs())) {
reloadDestAndSourceForms();
}
showDisplayBitsLeftTopRightBottom(destForm, affectedL, affectedT, affectedR, affectedB);

/* init null rectangle */
affL = (affT = 9999);
Expand Down Expand Up @@ -5116,11 +5098,6 @@ primitiveCopyBits(void)
if (failed()) {
return null;
}
/* begin showDisplayBits */
if (numGCsOnInvocation != (statNumGCs())) {
reloadDestAndSourceForms();
}
showDisplayBitsLeftTopRightBottom(destForm, affectedL, affectedT, affectedR, affectedB);
if (failed()) {
return null;
}
Expand Down Expand Up @@ -5276,11 +5253,6 @@ primitiveDisplayString(void)
if (!quickBlt) {
unlockSurfaces();
}
/* begin showDisplayBits */
if (numGCsOnInvocation != (statNumGCs())) {
reloadDestAndSourceForms();
}
showDisplayBitsLeftTopRightBottom(destForm, affectedL, affectedT, affectedR, affectedB);
storeIntegerofObjectwithValue(BBDestXIndex, bbObj, destX);
pop(6);
return 0;
Expand Down Expand Up @@ -5373,11 +5345,6 @@ primitiveDrawLoop(void)
affectedR = affR;
affectedT = affT;
affectedB = affB;
/* begin showDisplayBits */
if (numGCsOnInvocation != (statNumGCs())) {
reloadDestAndSourceForms();
}
showDisplayBitsLeftTopRightBottom(destForm, affectedL, affectedT, affectedR, affectedB);

/* init null rectangle */
affL = (affT = 9999);
Expand Down Expand Up @@ -5417,11 +5384,6 @@ primitiveDrawLoop(void)
affectedR = affR;
affectedT = affT;
affectedB = affB;
/* begin showDisplayBits */
if (numGCsOnInvocation != (statNumGCs())) {
reloadDestAndSourceForms();
}
showDisplayBitsLeftTopRightBottom(destForm, affectedL, affectedT, affectedR, affectedB);

/* init null rectangle */
affL = (affT = 9999);
Expand All @@ -5440,11 +5402,6 @@ primitiveDrawLoop(void)
storeIntegerofObjectwithValue(BBDestXIndex, bitBltOop, destX);
storeIntegerofObjectwithValue(BBDestYIndex, bitBltOop, destY);
l1: /* end drawLoopX:Y: */;
/* begin showDisplayBits */
if (numGCsOnInvocation != (statNumGCs())) {
reloadDestAndSourceForms();
}
showDisplayBitsLeftTopRightBottom(destForm, affectedL, affectedT, affectedR, affectedB);
}
if (!(failed())) {
pop(2);
Expand Down Expand Up @@ -5655,11 +5612,6 @@ primitiveWarpBits(void)
if (failed()) {
return null;
}
/* begin showDisplayBits */
if (numGCsOnInvocation != (statNumGCs())) {
reloadDestAndSourceForms();
}
showDisplayBitsLeftTopRightBottom(destForm, affectedL, affectedT, affectedR, affectedB);
if (failed()) {
return null;
}
Expand Down Expand Up @@ -6656,7 +6608,6 @@ setInterpreter(struct VirtualMachine *anInterpreter)
positive64BitValueOf = interpreterProxy->positive64BitValueOf;
primitiveFail = interpreterProxy->primitiveFail;
primitiveFailFor = interpreterProxy->primitiveFailFor;
showDisplayBitsLeftTopRightBottom = interpreterProxy->showDisplayBitsLeftTopRightBottom;
slotSizeOf = interpreterProxy->slotSizeOf;
stackIntegerValue = interpreterProxy->stackIntegerValue;
stackObjectValue = interpreterProxy->stackObjectValue;
Expand Down Expand Up @@ -6759,19 +6710,6 @@ setupColorMasksFromto(sqInt srcBits, sqInt targetBits)
return 0;
}

/* BitBltSimulation>>#showDisplayBits */
static sqInt
showDisplayBits(void)
{
/* begin ensureDestAndSourceFormsAreValid */
if (numGCsOnInvocation != (statNumGCs())) {
reloadDestAndSourceForms();
}
showDisplayBitsLeftTopRightBottom(destForm, affectedL, affectedT, affectedR, affectedB);
return 0;
}


/* This is only used when source and dest are same depth,
ie, when the barrel-shift copy loop is used. */

Expand Down
1 change: 0 additions & 1 deletion extracted/vm/include/common/sqVirtualMachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ typedef struct VirtualMachine {
sqInt (*failed)(void);
void (*fullGC)(void);
sqInt (*primitiveFail)(void);
sqInt (*showDisplayBitsLeftTopRightBottom)(sqInt aForm, sqInt l, sqInt t, sqInt r, sqInt b);
sqInt (*signalSemaphoreWithIndex)(sqInt semaIndex);
sqInt (*success)(sqInt aBoolean);
sqInt (*superclassOf)(sqInt classPointer);
Expand Down
2 changes: 0 additions & 2 deletions extracted/vm/src/common/sqVirtualMachine.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ sqInt failed(void);
void fullGC(void);
sqInt primitiveFail(void);
sqInt primitiveFailFor(sqInt reasonCode);
sqInt showDisplayBitsLeftTopRightBottom(sqInt aForm, sqInt l, sqInt t, sqInt r, sqInt b);
sqInt signalSemaphoreWithIndex(sqInt semaIndex);
sqInt success(sqInt aBoolean);
sqInt superclassOf(sqInt classPointer);
Expand Down Expand Up @@ -358,7 +357,6 @@ struct VirtualMachine* sqGetInterpreterProxy(void)
VM->failed = failed;
VM->fullGC = fullGC;
VM->primitiveFail = primitiveFail;
VM->showDisplayBitsLeftTopRightBottom = showDisplayBitsLeftTopRightBottom;
VM->signalSemaphoreWithIndex = signalSemaphoreWithIndex;
VM->success = success;
VM->superclassOf = superclassOf;
Expand Down

0 comments on commit c379823

Please sign in to comment.