diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7c85c86..75f8db5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false # facilitates debugging matrix: os: [ ubuntu-latest, windows-latest ] - smalltalk: [ Squeak64-Trunk ] + smalltalk: [ Squeak64-Trunk, Squeak64-5.3 ] name: ${{ matrix.smalltalk }} on ${{ matrix.os }} steps: - uses: actions/checkout@v2 diff --git a/.squot b/.squot index 0a2a98b..881ad7d 100644 --- a/.squot +++ b/.squot @@ -4,5 +4,6 @@ OrderedDictionary { 'packages/SimulationStudio-Tracing.package' : #SquotCypressCodeSerializer, 'packages/SimulationStudio-Tests-Sandbox.package' : #SquotCypressCodeSerializer, 'packages/BaselineOfSimulationStudio.package' : #SquotCypressCodeSerializer, - 'packages/SimulationStudio-Tests-Base.package' : #SquotCypressCodeSerializer + 'packages/SimulationStudio-Tests-Base.package' : #SquotCypressCodeSerializer, + 'packages/SimulationStudio-Compatibility-Squeak5.package' : #SquotCypressCodeSerializer } \ No newline at end of file diff --git a/packages/BaselineOfSimulationStudio.package/BaselineOfSimulationStudio.class/instance/baseline..st b/packages/BaselineOfSimulationStudio.package/BaselineOfSimulationStudio.class/instance/baseline..st index 57ca98b..5e8cd58 100644 --- a/packages/BaselineOfSimulationStudio.package/BaselineOfSimulationStudio.class/instance/baseline..st +++ b/packages/BaselineOfSimulationStudio.package/BaselineOfSimulationStudio.class/instance/baseline..st @@ -26,4 +26,9 @@ baseline: spec "groups" spec group: #default with: #('SimulationStudio-Base' 'SimulationStudio-Sandbox' 'SimulationStudio-Tracing' 'SimulationStudio-Tests-Base' 'SimulationStudio-Tests-Sandbox'); - group: #tests with: #('SimulationStudio-Tests-Base' 'SimulationStudio-Tests-Sandbox')]. \ No newline at end of file + group: #tests with: #('SimulationStudio-Tests-Base' 'SimulationStudio-Tests-Sandbox')]. + + spec for: #'squeak5.x' do: [ + spec package: 'SimulationStudio-Compatibility-Squeak5'. + spec package: 'SimulationStudio-Base' with: [ + spec includes: 'SimulationStudio-Compatibility-Squeak5']]. \ No newline at end of file diff --git a/packages/BaselineOfSimulationStudio.package/BaselineOfSimulationStudio.class/instance/installPreviewDependenciesForTests.st b/packages/BaselineOfSimulationStudio.package/BaselineOfSimulationStudio.class/instance/installPreviewDependenciesForTests.st index 6d2f749..f902df7 100644 --- a/packages/BaselineOfSimulationStudio.package/BaselineOfSimulationStudio.class/instance/installPreviewDependenciesForTests.st +++ b/packages/BaselineOfSimulationStudio.package/BaselineOfSimulationStudio.class/instance/installPreviewDependenciesForTests.st @@ -4,5 +4,4 @@ installPreviewDependenciesForTests ^ self installPreviewDependencies: { self depInbox: 'SUnit-ct.125'. "TestCase>>#runCaseWithoutTimeout for SandboxKernelTest" self depInbox: 'SUnit-ct.132'. "TestCase>>#assert:equals:description: with lazy descriptions" - self depInbox: 'Kernel-ct.1407'. "Fixes Context >> #isPrimFailToken: for ProtoObjects" } \ No newline at end of file diff --git a/packages/BaselineOfSimulationStudio.package/BaselineOfSimulationStudio.class/methodProperties.json b/packages/BaselineOfSimulationStudio.package/BaselineOfSimulationStudio.class/methodProperties.json index 643b4ed..85b5846 100644 --- a/packages/BaselineOfSimulationStudio.package/BaselineOfSimulationStudio.class/methodProperties.json +++ b/packages/BaselineOfSimulationStudio.package/BaselineOfSimulationStudio.class/methodProperties.json @@ -2,11 +2,11 @@ "class" : { }, "instance" : { - "baseline:" : "ct 3/14/2021 19:21", + "baseline:" : "ct 11/1/2021 14:55", "depChangeset:" : "ct 3/22/2021 21:34", "depInbox:" : "ct 4/12/2021 22:28", "depSqueakSource:name:" : "ct 4/12/2021 22:27", "depSqueakSource:name:targetRepository:" : "ct 4/12/2021 22:45", "installPreviewDependencies:" : "ct 3/5/2021 22:10", - "installPreviewDependenciesForTests" : "ct 5/16/2021 19:07", + "installPreviewDependenciesForTests" : "ct 11/1/2021 14:32", "projectClass" : "ct 3/5/2021 19:01" } } diff --git a/packages/SimulationStudio-Base.package/Context.extension/instance/isPrimFailToken..st b/packages/SimulationStudio-Base.package/Context.extension/instance/isPrimFailToken..st new file mode 100644 index 0000000..2c57ed5 --- /dev/null +++ b/packages/SimulationStudio-Base.package/Context.extension/instance/isPrimFailToken..st @@ -0,0 +1,9 @@ +*SimulationStudio-Base-private-Kernel-ct.1407-override +isPrimFailToken: contextOrPrimFailToken + "Answer if contextOrPrimFailToken, which will either be a Context object or + a primitive fail token (a tuple of the PrimitiveFailToken unique object and + a primitive failure code), is the latter. This should only be used with the + (possibly indirect) results of Context>>doPrimitive:method:receiver:args:" + ^ (self objectClass: contextOrPrimFailToken) == Array + and: [contextOrPrimFailToken size = 2 + and: [(contextOrPrimFailToken at: 1) == PrimitiveFailToken]] \ No newline at end of file diff --git a/packages/SimulationStudio-Base.package/Context.extension/methodProperties.json b/packages/SimulationStudio-Base.package/Context.extension/methodProperties.json index 426981a..340eae8 100644 --- a/packages/SimulationStudio-Base.package/Context.extension/methodProperties.json +++ b/packages/SimulationStudio-Base.package/Context.extension/methodProperties.json @@ -7,5 +7,6 @@ "debug" : "ct 3/5/2021 02:21", "insertEnsure:" : "ct 3/5/2021 19:35", "insertOn:do:" : "ct 3/5/2021 19:35", + "isPrimFailToken:" : "ct 5/16/2021 19:03", "simCustomizationLevel" : "ct 3/5/2021 19:23", "wrap:" : "ct 3/5/2021 19:30" } } diff --git a/packages/SimulationStudio-Compatibility-Squeak5.package/.filetree b/packages/SimulationStudio-Compatibility-Squeak5.package/.filetree new file mode 100644 index 0000000..8998102 --- /dev/null +++ b/packages/SimulationStudio-Compatibility-Squeak5.package/.filetree @@ -0,0 +1,4 @@ +{ + "noMethodMetaData" : true, + "separateMethodMetaAndSource" : false, + "useCypressPropertiesFile" : true } diff --git a/packages/SimulationStudio-Compatibility-Squeak5.package/.squot-contents b/packages/SimulationStudio-Compatibility-Squeak5.package/.squot-contents new file mode 100644 index 0000000..239ddeb --- /dev/null +++ b/packages/SimulationStudio-Compatibility-Squeak5.package/.squot-contents @@ -0,0 +1,5 @@ +SquotTrackedObjectMetadata { + #objectClassName : #PackageInfo, + #objectsReplacedByNames : true, + #serializer : #SquotCypressCodeSerializer +} \ No newline at end of file diff --git a/packages/SimulationStudio-Compatibility-Squeak5.package/Object.extension/instance/isReadOnlyObject.st b/packages/SimulationStudio-Compatibility-Squeak5.package/Object.extension/instance/isReadOnlyObject.st new file mode 100644 index 0000000..8d4cef7 --- /dev/null +++ b/packages/SimulationStudio-Compatibility-Squeak5.package/Object.extension/instance/isReadOnlyObject.st @@ -0,0 +1,4 @@ +*SimulationStudio-Compatibility-Squeak5-write barrier +isReadOnlyObject + + ^ false \ No newline at end of file diff --git a/packages/SimulationStudio-Compatibility-Squeak5.package/Object.extension/methodProperties.json b/packages/SimulationStudio-Compatibility-Squeak5.package/Object.extension/methodProperties.json new file mode 100644 index 0000000..279ba0a --- /dev/null +++ b/packages/SimulationStudio-Compatibility-Squeak5.package/Object.extension/methodProperties.json @@ -0,0 +1,5 @@ +{ + "class" : { + }, + "instance" : { + "isReadOnlyObject" : "ct 11/1/2021 14:58" } } diff --git a/packages/SimulationStudio-Compatibility-Squeak5.package/Object.extension/properties.json b/packages/SimulationStudio-Compatibility-Squeak5.package/Object.extension/properties.json new file mode 100644 index 0000000..3d3b9ec --- /dev/null +++ b/packages/SimulationStudio-Compatibility-Squeak5.package/Object.extension/properties.json @@ -0,0 +1,2 @@ +{ + "name" : "Object" } diff --git a/packages/SimulationStudio-Compatibility-Squeak5.package/monticello.meta/categories.st b/packages/SimulationStudio-Compatibility-Squeak5.package/monticello.meta/categories.st new file mode 100644 index 0000000..32e9e81 --- /dev/null +++ b/packages/SimulationStudio-Compatibility-Squeak5.package/monticello.meta/categories.st @@ -0,0 +1 @@ +SystemOrganization addCategory: #'SimulationStudio-Compatibility-Squeak5'! diff --git a/packages/SimulationStudio-Compatibility-Squeak5.package/monticello.meta/initializers.st b/packages/SimulationStudio-Compatibility-Squeak5.package/monticello.meta/initializers.st new file mode 100644 index 0000000..e69de29 diff --git a/packages/SimulationStudio-Compatibility-Squeak5.package/properties.json b/packages/SimulationStudio-Compatibility-Squeak5.package/properties.json new file mode 100644 index 0000000..f037444 --- /dev/null +++ b/packages/SimulationStudio-Compatibility-Squeak5.package/properties.json @@ -0,0 +1,2 @@ +{ + } diff --git a/packages/SimulationStudio-Sandbox.package/SandboxContext.class/instance/doMorePrimitive.method.receiver.args.ifAbsent..st b/packages/SimulationStudio-Sandbox.package/SandboxContext.class/instance/doMorePrimitive.method.receiver.args.ifAbsent..st new file mode 100644 index 0000000..635a1e5 --- /dev/null +++ b/packages/SimulationStudio-Sandbox.package/SandboxContext.class/instance/doMorePrimitive.method.receiver.args.ifAbsent..st @@ -0,0 +1,104 @@ +private +doMorePrimitive: primitiveIndex method: meth receiver: rcvr args: arguments ifAbsent: absentBlock + + | accessIndirectors selector directRcvrAndArgs | + self flag: #refactor. "Maybe use a generated array of blocks/symbols instead? Could also be faster." + accessIndirectors := Array new: arguments size + 1 "withAll: nil". + primitiveIndex + caseOf: { + [158 "primitiveCompareWith"] -> [^ self class primitiveFailTokenFor: nil "use image implementation"]. + [160 "primitiveAdoptInstance"] -> [accessIndirectors + at: 1 put: #readableObjectFor:; + at: 2 put: #writableObjectFor:]. + [161 "primitiveSetOrHasIdentityHash"] -> [self shouldBeImplemented: 'primitiveSetOrHasIdentityHash']. + [163 "primitiveGetImmutability"] -> [accessIndirectors at: 1 put: #readableObjectFor:]. + [164 "primitiveSetImmutability"] -> [selector := #doPrimitiveSetImmutability:receiver:args:]. + [165 "primitiveIntegerAt"] -> [accessIndirectors at: 1 put: #readableObjectFor:]. + [166 "primitiveIntegerAtPut"] -> [accessIndirectors at: 1 put: #writableObjectFor:]. + [167 "primitiveYield"] -> [^ self activateOperationForbidden: 'Control primitives are disabled in sandbox simulation']. + [168 "primitiveCopyObject"] -> [^ self class primitiveFailTokenFor: nil "use image implementation"]. + [169 "primitiveNotIdentical"] -> [accessIndirectors + at: 1 put: #readableObjectFor:; + at: 2 put: #readableObjectFor:]. + [170 "primitiveAsCharacter"] -> [ + accessIndirectors at: 1 put: #readableObjectFor:. + selector := #doPrimitiveNew:receiver:args:]. + [171 "primitiveImmediateAsInteger"] -> [ + accessIndirectors at: 1 put: #readableObjectFor:. + selector := #doPrimitiveNew:receiver:args:]. + [172 "primitiveFetchNextMourner"] -> [self flag: #reconsider]. + [173 "primitiveSlotAt"] -> [accessIndirectors atLast: 2 put: #readableObjectFor:]. + [174 "primitiveSlotAtPut"] -> [accessIndirectors atLast: 3 put: #writableObjectFor:]. + [175 "primitiveBehaviorHash"] -> [#doPrimitiveHash:receiver:args:]. + [176 "primitiveMaxIdentityHash"] -> ["allowed"]. + [177 "primitiveAllInstances"] -> ["allowed"]. + [178 "primitiveAllObjects"] -> ["allowed"]. + [180 "primitiveGrowMemoryByAtLeast"] -> [^ self activateOperationForbidden: 'primitiveGrowMemoryByAtLeast is disabled in sandbox simulation']. + [181 "primitiveSizeInBytesOfInstance"] -> [ + self flag: #shouldBeImplemented. + ^ self activateOperationForbidden: 'primitiveSizeInBytesOfInstance is disabled in sandbox simulation']. + [182 "primitiveSizeInBytes"] -> [ + self flag: #shouldBeImplemented. + ^ self activateOperationForbidden: 'primitiveSizeInBytesOfInstance is disabled in sandbox simulation']. + [183 "primitiveIsPinned"] -> [^ self activateOperationForbidden: 'Pinning primitives are disabled in sandbox simulation']. + [184 "primitivePin"] -> [ + self flag: #forLater. "We could simulate that, too. Maybe interesting for TelegramSmalltalkSession?" + ^ self activateOperationForbidden: 'Pinning primitives are disabled in sandbox simulation']. + [185 "primitiveExitCriticalSection"] -> [^ self activateOperationForbidden: 'Critical section primitives are disabled in sandbox simulation']. + [186 "primitiveEnterCriticalSection"] -> [^ self activateOperationForbidden: 'Critical section primitives are disabled in sandbox simulation']. + [187 "primitiveTestAndSetOwnershipOfCriticalSection"] -> [^ self activateOperationForbidden: 'Critical section primitives are disabled in sandbox simulation']. + [195 "primitiveFindNextUnwindContext"] -> [ + "Note: Usually, this primitive will not be called for thisContext during simulation. However, if that's what the client is after, don't fall for it but use the image implementation." + ^ self class primitiveFailTokenFor: nil]. + [196 "primitiveTerminateTo"] -> [ + "Note: Usually, this primitive will not be called for thisContext during simulation. However, if that's what the client is after, don't fall for it but use the image implementation." + ^ self class primitiveFailTokenFor: nil]. + [197 "primitiveFindHandlerContext"] -> [ + "Note: Usually, this primitive will not be called for thisContext during simulation. However, if that's what the client is after, don't fall for it but use the image implementation." + ^ self class primitiveFailTokenFor: nil]. + [210 "primitiveContextAt"] -> [accessIndirectors at: 1 put: #readableObjectFor:]. + [211 "primitiveContextAtPut"] -> [accessIndirectors at: 1 put: #writableObjectFor:]. + [212 "primitiveContextSize"] -> [accessIndirectors at: 1 put: #readableObjectFor:]. + [213 "primitiveContextXray"] -> [self shouldBeImplemented: 'primitiveContextXray']. + [214 "primitiveVoidVMState"] -> [self shouldBeImplemented: 'primitiveVoidVMState']. + [215 "primitiveFlushCacheByMethod"] -> [ + self flag: #shouldBeImplemented. "This has not been tested. See primitiveFlushCache." + accessIndirectors at: 1 put: #writableObjectFor:]. + [230 "primitiveRelinquishProcessor"] -> [^ self class primitiveFailTokenFor: nil "optional primitive, just skip it"]. + [231 "primitiveForceDisplayUpdate"] -> [^ self class primitiveFailTokenFor: nil "use image implementation"]. + [232 "primitiveFormPrint"] -> [^ self class primitiveFailTokenFor: nil "don't support"]. + [233 "primitiveSetFullScreen"] -> [^ self activateOperationForbidden: 'primitiveSetFullScreen is disabled in sandbox simulation']. + [238] -> [self isThisEverCalled: 'serial port primitive?']. + [239] -> [self isThisEverCalled: 'serial port primitive?']. + [242 "primitiveSignalAtUTCMicroseconds"] -> [^ self activateOperationForbidden: 'primitiveSignalAtMilliseconds is disabled in sandbox simulation']. + [243 "primitiveUpdateTimezone"] -> [^ self class primitiveFailTokenFor: nil "don't support"]. + [247 "primitiveSnapshotEmbedded"] -> [^ self activateOperationForbidden: 'primitiveSnapshotEmbedded is disabled in sandbox simulation']. + [248 "primitiveArrayBecomeOneWayNoCopyHash"] -> [ + ^ self elements: rcvr forwardIdentityTo: arguments first]. + [249 "primitiveArrayBecomeOneWayCopyHash"] -> [ + ^ self elements: rcvr forwardIdentityTo: arguments first copyHash: arguments second]. + [570 "primitiveFlushExternalPrimitives"] -> [^ self activateOperationForbidden: 'primitiveFlushExternalPrimitives is disabled in sandbox simulation']. + [571 "primitiveUnloadModule"] -> [^ self activateOperationForbidden: 'primitiveUnloadModule is disabled in sandbox simulation']. + [572 "primitiveListBuiltinModule"] -> ["allowed"]. + [573 "primitiveListExternalModule"] -> ["allowed"]. + } + otherwise: [ + ^ absentBlock value]. + + self flag: #forLater. "Rethink several restrictions, e.g. instance enumeration, process signaling etc. Can we simulate sum of them?" + + directRcvrAndArgs := self + access: (arguments copyWithFirst: rcvr) + indirectors: accessIndirectors. + selector ifNotNil: [ + ^ self + perform: selector + with: primitiveIndex + with: directRcvrAndArgs first + with: directRcvrAndArgs allButFirst]. + + ^ super + doPrimitive: primitiveIndex + method: meth + receiver: directRcvrAndArgs first + args: directRcvrAndArgs allButFirst \ No newline at end of file diff --git a/packages/SimulationStudio-Sandbox.package/SandboxContext.class/instance/doPrimitive.method.receiver.args..st b/packages/SimulationStudio-Sandbox.package/SandboxContext.class/instance/doPrimitive.method.receiver.args..st index 6ee79c6..c246302 100644 --- a/packages/SimulationStudio-Sandbox.package/SandboxContext.class/instance/doPrimitive.method.receiver.args..st +++ b/packages/SimulationStudio-Sandbox.package/SandboxContext.class/instance/doPrimitive.method.receiver.args..st @@ -106,87 +106,17 @@ doPrimitive: primitiveIndex method: meth receiver: rcvr args: arguments selector := #doPrimitiveNew:receiver:args:. accessIndirectors at: 1 put: #readableObjectFor:]. [149 "primitiveGetAttribute"] -> ["allowed"]. - [158 "primitiveCompareWith"] -> [^ self class primitiveFailTokenFor: nil "use image implementation"]. - [160 "primitiveAdoptInstance"] -> [accessIndirectors - at: 1 put: #readableObjectFor:; - at: 2 put: #writableObjectFor:]. - [161 "primitiveSetOrHasIdentityHash"] -> [self shouldBeImplemented: 'primitiveSetOrHasIdentityHash']. - [163 "primitiveGetImmutability"] -> [accessIndirectors at: 1 put: #readableObjectFor:]. - [164 "primitiveSetImmutability"] -> [selector := #doPrimitiveSetImmutability:receiver:args:]. - [165 "primitiveIntegerAt"] -> [accessIndirectors at: 1 put: #readableObjectFor:]. - [166 "primitiveIntegerAtPut"] -> [accessIndirectors at: 1 put: #writableObjectFor:]. - [167 "primitiveYield"] -> [^ self activateOperationForbidden: 'Control primitives are disabled in sandbox simulation']. - [168 "primitiveCopyObject"] -> [^ self class primitiveFailTokenFor: nil "use image implementation"]. - [169 "primitiveNotIdentical"] -> [accessIndirectors - at: 1 put: #readableObjectFor:; - at: 2 put: #readableObjectFor:]. - [170 "primitiveAsCharacter"] -> [ - accessIndirectors at: 1 put: #readableObjectFor:. - selector := #doPrimitiveNew:receiver:args:]. - [171 "primitiveImmediateAsInteger"] -> [ - accessIndirectors at: 1 put: #readableObjectFor:. - selector := #doPrimitiveNew:receiver:args:]. - [172 "primitiveFetchNextMourner"] -> [self flag: #reconsider]. - [173 "primitiveSlotAt"] -> [accessIndirectors atLast: 2 put: #readableObjectFor:]. - [174 "primitiveSlotAtPut"] -> [accessIndirectors atLast: 3 put: #writableObjectFor:]. - [175 "primitiveBehaviorHash"] -> [#doPrimitiveHash:receiver:args:]. - [176 "primitiveMaxIdentityHash"] -> ["allowed"]. - [177 "primitiveAllInstances"] -> ["allowed"]. - [178 "primitiveAllObjects"] -> ["allowed"]. - [180 "primitiveGrowMemoryByAtLeast"] -> [^ self activateOperationForbidden: 'primitiveGrowMemoryByAtLeast is disabled in sandbox simulation']. - [181 "primitiveSizeInBytesOfInstance"] -> [ - self flag: #shouldBeImplemented. - ^ self activateOperationForbidden: 'primitiveSizeInBytesOfInstance is disabled in sandbox simulation']. - [182 "primitiveSizeInBytes"] -> [ - self flag: #shouldBeImplemented. - ^ self activateOperationForbidden: 'primitiveSizeInBytesOfInstance is disabled in sandbox simulation']. - [183 "primitiveIsPinned"] -> [^ self activateOperationForbidden: 'Pinning primitives are disabled in sandbox simulation']. - [184 "primitivePin"] -> [ - self flag: #forLater. "We could simulate that, too. Maybe interesting for TelegramSmalltalkSession?" - ^ self activateOperationForbidden: 'Pinning primitives are disabled in sandbox simulation']. - [185 "primitiveExitCriticalSection"] -> [^ self activateOperationForbidden: 'Critical section primitives are disabled in sandbox simulation']. - [186 "primitiveEnterCriticalSection"] -> [^ self activateOperationForbidden: 'Critical section primitives are disabled in sandbox simulation']. - [187 "primitiveTestAndSetOwnershipOfCriticalSection"] -> [^ self activateOperationForbidden: 'Critical section primitives are disabled in sandbox simulation']. - [195 "primitiveFindNextUnwindContext"] -> [ - "Note: Usually, this primitive will not be called for thisContext during simulation. However, if that's what the client is after, don't fall for it but use the image implementation." - ^ self class primitiveFailTokenFor: nil]. - [196 "primitiveTerminateTo"] -> [ - "Note: Usually, this primitive will not be called for thisContext during simulation. However, if that's what the client is after, don't fall for it but use the image implementation." - ^ self class primitiveFailTokenFor: nil]. - [197 "primitiveFindHandlerContext"] -> [ - "Note: Usually, this primitive will not be called for thisContext during simulation. However, if that's what the client is after, don't fall for it but use the image implementation." - ^ self class primitiveFailTokenFor: nil]. - [210 "primitiveContextAt"] -> [accessIndirectors at: 1 put: #readableObjectFor:]. - [211 "primitiveContextAtPut"] -> [accessIndirectors at: 1 put: #writableObjectFor:]. - [212 "primitiveContextSize"] -> [accessIndirectors at: 1 put: #readableObjectFor:]. - [213 "primitiveContextXray"] -> [self shouldBeImplemented: 'primitiveContextXray']. - [214 "primitiveVoidVMState"] -> [self shouldBeImplemented: 'primitiveVoidVMState']. - [215 "primitiveFlushCacheByMethod"] -> [ - self flag: #shouldBeImplemented. "This has not been tested. See primitiveFlushCache." - accessIndirectors at: 1 put: #writableObjectFor:]. - [230 "primitiveRelinquishProcessor"] -> [^ self class primitiveFailTokenFor: nil "optional primitive, just skip it"]. - [231 "primitiveForceDisplayUpdate"] -> [^ self class primitiveFailTokenFor: nil "use image implementation"]. - [232 "primitiveFormPrint"] -> [^ self class primitiveFailTokenFor: nil "don't support"]. - [233 "primitiveSetFullScreen"] -> [^ self activateOperationForbidden: 'primitiveSetFullScreen is disabled in sandbox simulation']. - [238] -> [self isThisEverCalled: 'serial port primitive?']. - [239] -> [self isThisEverCalled: 'serial port primitive?']. - [242 "primitiveSignalAtUTCMicroseconds"] -> [^ self activateOperationForbidden: 'primitiveSignalAtMilliseconds is disabled in sandbox simulation']. - [243 "primitiveUpdateTimezone"] -> [^ self class primitiveFailTokenFor: nil "don't support"]. - [247 "primitiveSnapshotEmbedded"] -> [^ self activateOperationForbidden: 'primitiveSnapshotEmbedded is disabled in sandbox simulation']. - [248 "primitiveArrayBecomeOneWayNoCopyHash"] -> [ - ^ self elements: rcvr forwardIdentityTo: arguments first]. - [249 "primitiveArrayBecomeOneWayCopyHash"] -> [ - ^ self elements: rcvr forwardIdentityTo: arguments first copyHash: arguments second]. - [570 "primitiveFlushExternalPrimitives"] -> [^ self activateOperationForbidden: 'primitiveFlushExternalPrimitives is disabled in sandbox simulation']. - [571 "primitiveUnloadModule"] -> [^ self activateOperationForbidden: 'primitiveUnloadModule is disabled in sandbox simulation']. - [572 "primitiveListBuiltinModule"] -> ["allowed"]. - [573 "primitiveListExternalModule"] -> ["allowed"]. } - otherwise: [ - (primitiveIndex >= 250 and: [primitiveIndex <= 254]) "VM implementor primitives" - ifTrue: [^ self activateOperationForbidden: 'VM implementor primitives are disabled in sandbox simulation']. - (primitiveIndex >= 264 and: [primitiveIndex <= 519]) "primitiveLoadInstVar" - ifTrue: [accessIndirectors at: 1 put: #readableObjectFor:]]. + otherwise: [ | morePrimitive moreResult | + self flag: #vmCapability. "Squeak 5.3/ClosureV3 encoder cannot handle more literals in one method..." + morePrimitive := true. + moreResult := self doMorePrimitive: primitiveIndex method: meth receiver: rcvr args: arguments ifAbsent: [ + morePrimitive := false. + (primitiveIndex >= 250 and: [primitiveIndex <= 254]) "VM implementor primitives" + ifTrue: [^ self activateOperationForbidden: 'VM implementor primitives are disabled in sandbox simulation']. + (primitiveIndex >= 264 and: [primitiveIndex <= 519]) "primitiveLoadInstVar" + ifTrue: [accessIndirectors at: 1 put: #readableObjectFor:]]. + morePrimitive ifTrue: [^ moreResult]]. self flag: #forLater. "Rethink several restrictions, e.g. instance enumeration, process signaling etc. Can we simulate sum of them?" diff --git a/packages/SimulationStudio-Sandbox.package/SandboxContext.class/methodProperties.json b/packages/SimulationStudio-Sandbox.package/SandboxContext.class/methodProperties.json index 45a61df..edc0c3f 100644 --- a/packages/SimulationStudio-Sandbox.package/SandboxContext.class/methodProperties.json +++ b/packages/SimulationStudio-Sandbox.package/SandboxContext.class/methodProperties.json @@ -5,8 +5,9 @@ "access:indirectors:" : "ct 3/20/2021 23:35", "activateOperationForbidden:" : "ct 3/3/2021 17:55", "canBeImmutable:" : "ct 3/22/2021 23:47", + "doMorePrimitive:method:receiver:args:ifAbsent:" : "ct 11/1/2021 14:41", "doNamedPrimitiveIn:for:withArgs:" : "ct 3/22/2021 17:43", - "doPrimitive:method:receiver:args:" : "ct 3/22/2021 23:39", + "doPrimitive:method:receiver:args:" : "ct 11/1/2021 14:40", "doPrimitiveHash:receiver:args:" : "ct 3/22/2021 18:51", "doPrimitiveNew:receiver:args:" : "ct 3/4/2021 20:16", "doPrimitiveSetImmutability:receiver:args:" : "ct 3/22/2021 23:39", diff --git a/packages/SimulationStudio-Tests-Base.package/SimulationKernelTest.class/class/testSelectorsFromGroups..st b/packages/SimulationStudio-Tests-Base.package/SimulationKernelTest.class/class/testSelectorsFromGroups..st index 853f02f..d116a6b 100644 --- a/packages/SimulationStudio-Tests-Base.package/SimulationKernelTest.class/class/testSelectorsFromGroups..st +++ b/packages/SimulationStudio-Tests-Base.package/SimulationKernelTest.class/class/testSelectorsFromGroups..st @@ -10,6 +10,9 @@ testSelectorsFromGroups: testGroups (true caseOf: { + [SystemVersion current isAlpha not and: [testClass isNil]] -> [ + Transcript showln: ('Skipping {1} on legacy version of Squeak' format: {key}). + #()]. [selectors isSymbol] -> [ (testClass perform: selectors) tests collect: #selector]. diff --git a/packages/SimulationStudio-Tests-Base.package/SimulationKernelTest.class/methodProperties.json b/packages/SimulationStudio-Tests-Base.package/SimulationKernelTest.class/methodProperties.json index acd7a57..3d7978e 100644 --- a/packages/SimulationStudio-Tests-Base.package/SimulationKernelTest.class/methodProperties.json +++ b/packages/SimulationStudio-Tests-Base.package/SimulationKernelTest.class/methodProperties.json @@ -6,7 +6,7 @@ "shouldInheritSelectors" : "ct 3/5/2021 16:44", "testGroups" : "ct 3/24/2021 20:33", "testSelectors" : "ct 3/5/2021 17:14", - "testSelectorsFromGroups:" : "ct 3/5/2021 23:18", + "testSelectorsFromGroups:" : "ct 11/1/2021 14:49", "wantsToTest:" : "ct 3/5/2021 16:50" }, "instance" : { "basicPerformTest" : "ct 3/14/2021 16:08",