From 268fdece33997b0e257526682edb4cc2c77be86e Mon Sep 17 00:00:00 2001 From: Pablo Tesone Date: Fri, 14 Jun 2024 10:31:00 +0200 Subject: [PATCH 01/27] Adding macro for win32. Fix #753 --- src/imageAccess.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/imageAccess.c b/src/imageAccess.c index 4200fb23d4..429f1cd4cf 100644 --- a/src/imageAccess.c +++ b/src/imageAccess.c @@ -9,6 +9,19 @@ #include #endif +/* + * Windows does not provide this macro for testing + * + */ +#ifdef _WIN32 + #ifndef _S_ISTYPE + #define _S_ISTYPE(mode, mask) (((mode) & _S_IFMT) == (mask)) + #define S_ISREG(mode) _S_ISTYPE((mode), _S_IFREG) + #define S_ISDIR(mode) _S_ISTYPE((mode), _S_IFDIR) + #endif +#endif + + /* * The read and write function uses a 128kb chunk size. * It is based in the analysis of how cp, cat and other tools access the disk From 539aedd1d475d7d831ad73c60591c92a46a50141 Mon Sep 17 00:00:00 2001 From: Kris <1611248+Rinzwind@users.noreply.github.com> Date: Sun, 16 Jun 2024 01:12:38 +0200 Subject: [PATCH 02/27] =?UTF-8?q?Fixed=20bug=20in=20=E2=80=98sqAcceptSSL?= =?UTF-8?q?=E2=80=99=20in=20=E2=80=98sqMacSSL.c=E2=80=99=20which,=20after?= =?UTF-8?q?=20setting=20the=20state=20to=20=E2=80=98SQSSL=5FCONNECTED?= =?UTF-8?q?=E2=80=99,=20returned=20the=20value=20of=20=E2=80=98SQSSL=5FOK?= =?UTF-8?q?=E2=80=99=20(zero)=20rather=20than=20the=20number=20of=20bytes?= =?UTF-8?q?=20written=20to=20the=20output=20buffer.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extracted/plugins/SqueakSSL/src/osx/sqMacSSL.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extracted/plugins/SqueakSSL/src/osx/sqMacSSL.c b/extracted/plugins/SqueakSSL/src/osx/sqMacSSL.c index 4b61be6aea..d385e68828 100644 --- a/extracted/plugins/SqueakSSL/src/osx/sqMacSSL.c +++ b/extracted/plugins/SqueakSSL/src/osx/sqMacSSL.c @@ -626,7 +626,7 @@ sqInt sqAcceptSSL(sqInt handle, char* srcBuf, sqInt srcLen, char* dstBuf, } /* We are connected. Verify the cert. */ ssl->state = SQSSL_CONNECTED; - return SQSSL_OK; + return ssl->outLen; } /* sqEncryptSSL: Encrypt data for SSL transmission. From 28670bcf54e36eb48ab25660c63bf0b11a68926c Mon Sep 17 00:00:00 2001 From: Kris <1611248+Rinzwind@users.noreply.github.com> Date: Sun, 16 Jun 2024 22:51:53 +0200 Subject: [PATCH 03/27] =?UTF-8?q?Made=20=E2=80=98sqSetupSSL=E2=80=99=20in?= =?UTF-8?q?=20=E2=80=98sqMacSSL.c=E2=80=99=20handle=20the=20=E2=80=98CERTN?= =?UTF-8?q?AME=E2=80=99=20property=20having=20been=20set=20(by=20searching?= =?UTF-8?q?=20for=20a=20valid=20identity=20with=20the=20property=20value?= =?UTF-8?q?=20as=20its=20subject=20through=20=E2=80=98SecItemCopyMatching?= =?UTF-8?q?=E2=80=99=20and=20setting=20it=20as=20the=20SSL=20session=20con?= =?UTF-8?q?text=E2=80=99s=20certificate=20through=20=E2=80=98SSLSetCertifi?= =?UTF-8?q?cate=E2=80=99).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/SqueakSSL/src/osx/sqMacSSL.c | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/extracted/plugins/SqueakSSL/src/osx/sqMacSSL.c b/extracted/plugins/SqueakSSL/src/osx/sqMacSSL.c index d385e68828..2c28e855e9 100644 --- a/extracted/plugins/SqueakSSL/src/osx/sqMacSSL.c +++ b/extracted/plugins/SqueakSSL/src/osx/sqMacSSL.c @@ -206,6 +206,40 @@ OSStatus sqSetupSSL(sqSSL* ssl, int isServer) } } + if (ssl->certName) { + CFStringRef certName = CFStringCreateWithCString(kCFAllocatorDefault, ssl->certName, kCFStringEncodingASCII); + if (certName == NULL) + return SQSSL_GENERIC_ERROR; + CFMutableDictionaryRef query = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); + if (query == NULL) { + CFRelease(certName); + return SQSSL_GENERIC_ERROR; + } + CFDictionarySetValue(query, kSecMatchLimit, kSecMatchLimitOne); + CFDictionarySetValue(query, kSecReturnRef, kCFBooleanTrue); + CFDictionarySetValue(query, kSecClass, kSecClassIdentity); + CFDictionarySetValue(query, kSecMatchSubjectWholeString, certName); + CFDictionarySetValue(query, kSecMatchValidOnDate, kCFNull); + CFRelease(certName); + SecIdentityRef identity; + status = SecItemCopyMatching(query, (CFTypeRef*) &identity); + CFRelease(query); + if (status != noErr) { + logStatus(status, status == errSecItemNotFound ? "SecItemCopyMatching had no results" : "SecItemCopyMatching failed"); + return status; + } + CFArrayRef certs = CFArrayCreate(kCFAllocatorDefault, (const void **)&identity, 1, &kCFTypeArrayCallBacks); + CFRelease(identity); + if (certs == NULL) + return SQSSL_GENERIC_ERROR; + status = SSLSetCertificate(ssl->ctx, certs); + CFRelease(certs); + if (status != noErr) { + logStatus(status, "SSLSetCertificate failed"); + return status; + } + } + return status; } From 63b164c8363cb201107a27fb674a04ab815783a0 Mon Sep 17 00:00:00 2001 From: Pablo Tesone Date: Wed, 19 Jun 2024 12:23:14 +0200 Subject: [PATCH 04/27] Ignoring EAGAIN in epoll_wait --- extracted/vm/src/unix/aio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extracted/vm/src/unix/aio.c b/extracted/vm/src/unix/aio.c index 1b0b29a12e..f38989b1ec 100644 --- a/extracted/vm/src/unix/aio.c +++ b/extracted/vm/src/unix/aio.c @@ -308,7 +308,7 @@ aio_handle_events(long microSecondsTimeout){ aio_flush_pipe(signal_pipe_fd[0]); if(epollReturn == -1){ - if(errno != EINTR){ + if(errno != EINTR && errno != EAGAIN){ logErrorFromErrno("epoll_wait"); } return 0; From 4d04ad90a018f7f19125b0a3abcad43bee6654be Mon Sep 17 00:00:00 2001 From: Guille Polito Date: Fri, 28 Jun 2024 09:13:47 +0200 Subject: [PATCH 05/27] Making it loadable in P12 - update dependency to pharo-opal-simd-bytecode - update usage of undeclareds - update method protocols --- .../BaselineOfVMMaker.class.st | 11 +- smalltalksrc/BaselineOfVMMaker/package.st | 2 +- .../AbstractComposedImageAccess.class.st | 40 +- .../AbstractFileReference.extension.st | 4 +- .../VMMaker/AbstractImageAccess.class.st | 50 +- smalltalksrc/VMMaker/Array.extension.st | 20 +- .../VMMaker/ArrayedCollection.extension.st | 8 +- .../VMMaker/AsynchFilePlugin.class.st | 36 +- .../VMMaker/B3DAcceleratorPlugin.class.st | 166 +- .../VMMaker/BMPReadWriterPlugin.class.st | 12 +- smalltalksrc/VMMaker/BalloonArray.class.st | 28 +- smalltalksrc/VMMaker/BitBlt.extension.st | 8 +- .../VMMaker/BitBltSimulation.class.st | 290 +-- smalltalksrc/VMMaker/BitBltSimulator.class.st | 80 +- smalltalksrc/VMMaker/Bitmap.extension.st | 30 +- .../VMMaker/BlockClosure.extension.st | 6 +- smalltalksrc/VMMaker/Boolean.extension.st | 20 +- smalltalksrc/VMMaker/BrokenPlugin.class.st | 24 +- smalltalksrc/VMMaker/ByteArray.extension.st | 22 +- .../VMMaker/CMethodCacheAccessor.class.st | 14 +- .../VMMaker/ClassDescription.extension.st | 4 +- .../VMMaker/ClipboardExtendedPlugin.class.st | 20 +- smalltalksrc/VMMaker/CoInterpreter.class.st | 644 ++--- .../VMMaker/CoInterpreterPrimitives.class.st | 62 +- smalltalksrc/VMMaker/CogARMCompiler.class.st | 514 ++-- .../VMMaker/CogARMv8Compiler.class.st | 722 +++--- .../VMMaker/CogAbstractInstruction.class.st | 405 ++-- .../VMMaker/CogAbstractRegisters.class.st | 14 +- .../VMMaker/CogBytecodeDescriptor.class.st | 84 +- .../VMMaker/CogBytecodeFixup.class.st | 48 +- .../VMMaker/CogCheck32BitHeapMap.class.st | 26 +- smalltalksrc/VMMaker/CogCodeRange.class.st | 26 +- .../VMMaker/CogCompilationConstants.class.st | 8 +- smalltalksrc/VMMaker/CogIA32Compiler.class.st | 446 ++-- .../CogICacheFlushingIA32Compiler.class.st | 14 +- .../CogInLineLiteralsARMCompiler.class.st | 46 +- .../CogInLineLiteralsX64Compiler.class.st | 46 +- .../VMMaker/CogMIPSELCompiler.class.st | 502 ++-- smalltalksrc/VMMaker/CogMethod.class.st | 102 +- .../VMMaker/CogMethodConstants.class.st | 8 +- .../VMMaker/CogMethodSurrogate.class.st | 68 +- .../VMMaker/CogMethodSurrogate32.class.st | 80 +- .../VMMaker/CogMethodSurrogate64.class.st | 80 +- smalltalksrc/VMMaker/CogMethodZone.class.st | 138 +- .../VMMaker/CogObjectRepresentation.class.st | 430 ++-- ...gObjectRepresentationFor32BitSpur.class.st | 110 +- ...gObjectRepresentationFor64BitSpur.class.st | 200 +- .../CogObjectRepresentationForSpur.class.st | 402 ++-- .../CogOutOfLineLiteralsARMCompiler.class.st | 58 +- ...CogOutOfLineLiteralsARMv8Compiler.class.st | 68 +- .../CogOutOfLineLiteralsX64Compiler.class.st | 18 +- .../VMMaker/CogPrimitiveCallState.class.st | 32 +- .../VMMaker/CogPrimitiveDescriptor.class.st | 26 +- .../VMMaker/CogRASSBytecodeFixup.class.st | 28 +- smalltalksrc/VMMaker/CogRTLOpcodes.class.st | 23 +- ...ogRegisterAllocatingSimStackEntry.class.st | 40 +- .../VMMaker/CogSSBytecodeFixup.class.st | 58 +- smalltalksrc/VMMaker/CogSSOptStatus.class.st | 20 +- .../VMMaker/CogSimStackEntry.class.st | 74 +- .../CogSistaMethodSurrogate32.class.st | 16 +- .../CogSistaMethodSurrogate64.class.st | 16 +- smalltalksrc/VMMaker/CogVMSimulator.class.st | 436 ++-- .../VMMaker/CogVMSimulatorLSB.class.st | 18 +- smalltalksrc/VMMaker/CogX64Compiler.class.st | 462 ++-- smalltalksrc/VMMaker/Cogit.class.st | 1548 +++++++------ smalltalksrc/VMMaker/Cogit.extension.st | 7 - smalltalksrc/VMMaker/Collection.extension.st | 4 +- .../VMMaker/CompiledMethod.extension.st | 8 +- .../VMMaker/ComposedImageReader.class.st | 38 +- .../VMMaker/ComposedImageWriter.class.st | 40 +- .../VMMaker/ComposedMetadataStruct.class.st | 22 +- .../VMMaker/CrossPlatformVMMaker.class.st | 20 +- .../CurrentImageCoInterpreterFacade.class.st | 364 +-- ...eFor64BitSpurObjectRepresentation.class.st | 24 +- ...FacadeForSpurObjectRepresentation.class.st | 102 +- smalltalksrc/VMMaker/DeflatePlugin.class.st | 52 +- .../VMMaker/DoubleWordArray.extension.st | 30 +- smalltalksrc/VMMaker/FFTPlugin.class.st | 30 +- smalltalksrc/VMMaker/FakeStdinStream.class.st | 24 +- smalltalksrc/VMMaker/FileCopyPlugin.class.st | 12 +- smalltalksrc/VMMaker/FilePlugin.class.st | 100 +- .../VMMaker/FilePluginSimulator.class.st | 66 +- smalltalksrc/VMMaker/Float.extension.st | 18 +- .../VMMaker/Float32Array.extension.st | 6 +- .../VMMaker/FloatArrayPlugin.class.st | 44 +- smalltalksrc/VMMaker/FloatMathPlugin.class.st | 62 +- .../VMMaker/FloatMathPluginSimulator.class.st | 12 +- .../VMMaker/IdentityDictionary.extension.st | 6 +- .../VMMaker/InLineLiteralsManager.class.st | 42 +- smalltalksrc/VMMaker/InflatePlugin.class.st | 30 +- smalltalksrc/VMMaker/Integer.extension.st | 76 +- .../VMMaker/IntegerArray.extension.st | 6 +- .../VMMaker/InternetConfigPlugin.class.st | 20 +- .../VMMaker/InterpreterPlugin.class.st | 138 +- .../VMMaker/InterpreterPrimitives.class.st | 546 ++--- .../VMMaker/InterpreterProxy.class.st | 364 +-- .../VMMaker/JPEGReadWriter2Plugin.class.st | 54 +- .../VMMaker/JPEGReaderPlugin.class.st | 60 +- .../VMMaker/LargeIntegersPlugin.class.st | 138 +- .../VMMaker/LargeNegativeInteger.extension.st | 4 +- .../VMMaker/LargePositiveInteger.extension.st | 4 +- smalltalksrc/VMMaker/LibFFI.class.st | 54 +- smalltalksrc/VMMaker/LibFFICIF.class.st | 44 +- smalltalksrc/VMMaker/LibFFIConstants.class.st | 10 +- .../VMMaker/LibFFITestWorker.class.st | 18 +- smalltalksrc/VMMaker/LibFFIType.class.st | 34 +- .../VMMaker/LibFFIWorkerTask.class.st | 44 +- .../VMMaker/LittleEndianBitmap.class.st | 46 +- smalltalksrc/VMMaker/LocalePlugin.class.st | 44 +- smalltalksrc/VMMaker/MIDIPlugin.class.st | 38 +- smalltalksrc/VMMaker/MIPSConstants.class.st | 20 +- .../MachineSimulatorMemoryManager.class.st | 12 +- smalltalksrc/VMMaker/ManifestVMMaker.class.st | 17 +- smalltalksrc/VMMaker/Matrix2x3Plugin.class.st | 42 +- .../VMMaker/Matrix2x3PluginSimulator.class.st | 12 +- .../VMMaker/MiscPrimitivePlugin.class.st | 30 +- smalltalksrc/VMMaker/NullStream.extension.st | 4 +- smalltalksrc/VMMaker/Object.extension.st | 56 +- ...yForTranslatedPrimitiveSimulation.class.st | 34 +- smalltalksrc/VMMaker/Oop.class.st | 18 +- .../VMMaker/OutOfLineLiteralsManager.class.st | 48 +- .../PrintfFormatDescriptor.extension.st | 4 +- .../VMMaker/PrintfFormatString.extension.st | 4 +- .../PrintfNumberFormatDescriptor.extension.st | 4 +- smalltalksrc/VMMaker/RePlugin.class.st | 66 +- .../VMMaker/ReadOnlyArrayWrapper.class.st | 20 +- .../VMMaker/ReenterInterpreter.class.st | 14 +- .../VMMaker/ReenterMachineCode.class.st | 12 +- .../VMMaker/RegisterAllocatingCogit.class.st | 198 +- ...elativeDetailedInstructionPrinter.class.st | 18 +- .../VMMaker/ResumableVMError.class.st | 10 +- smalltalksrc/VMMaker/SecurityPlugin.class.st | 62 +- .../SequenceableCollection.extension.st | 4 +- smalltalksrc/VMMaker/SerialPlugin.class.st | 34 +- .../VMMaker/SimpleStackBasedCogit.class.st | 424 ++-- .../SimpleStackBasedCogit.extension.st | 7 - smalltalksrc/VMMaker/SistaCogMethod.class.st | 16 +- smalltalksrc/VMMaker/SistaCogit.class.st | 206 +- smalltalksrc/VMMaker/SistaMethodZone.class.st | 24 +- .../SlangAbstractTestCase.extension.st | 4 +- .../SlangBasicTranslationTest.extension.st | 22 +- ...ethodPrototypeTranslationTest.extension.st | 4 +- .../VMMaker/SmallInteger.extension.st | 14 +- .../SmartSyntaxInterpreterPlugin.class.st | 34 +- ...ntaxPluginAssignmentCodeGenerator.class.st | 56 +- .../SmartSyntaxPluginCodeGenerator.class.st | 162 +- ...rtSyntaxPluginPrologCodeGenerator.class.st | 10 +- .../SmartSyntaxPluginSimulator.class.st | 82 +- .../VMMaker/SmartSyntaxPluginTMethod.class.st | 62 +- ...ntaxPluginValidationCodeGenerator.class.st | 56 +- smalltalksrc/VMMaker/SocketPlugin.class.st | 152 +- .../VMMaker/SocketPluginSimulator.class.st | 66 +- smalltalksrc/VMMaker/SoundPlugin.class.st | 66 +- .../VMMaker/Spur32BitCoMemoryManager.class.st | 58 +- .../VMMaker/Spur32BitMMLECoSimulator.class.st | 96 +- .../VMMaker/Spur32BitMMLESimulator.class.st | 94 +- .../VMMaker/Spur32BitMemoryManager.class.st | 166 +- .../VMMaker/Spur64BitCoMemoryManager.class.st | 60 +- .../VMMaker/Spur64BitMMLECoSimulator.class.st | 90 +- ...Spur64BitMMLECoSimulatorFor64Bits.class.st | 22 +- .../VMMaker/Spur64BitMMLESimulator.class.st | 88 +- .../Spur64BitMMLESimulatorFor64Bits.class.st | 22 +- .../VMMaker/Spur64BitMemoryManager.class.st | 202 +- smalltalksrc/VMMaker/SpurCompactor.class.st | 34 +- .../VMMaker/SpurContiguousObjStack.class.st | 14 +- .../VMMaker/SpurGenerationScavenger.class.st | 176 +- .../SpurGenerationScavengerSimulator.class.st | 22 +- .../VMMaker/SpurHybridCompactor.class.st | 28 +- .../VMMaker/SpurImageHeaderStruct.class.st | 78 +- smalltalksrc/VMMaker/SpurImageReader.class.st | 28 +- smalltalksrc/VMMaker/SpurImageWriter.class.st | 28 +- .../SpurMemoryManagementConstants.class.st | 8 +- .../VMMaker/SpurMemoryManager.class.st | 2062 +++++++++-------- .../VMMaker/SpurNewSpaceSpace.class.st | 24 +- .../VMMaker/SpurPlanningCompactor.class.st | 122 +- .../SpurPlanningCompactorSimulator.class.st | 20 +- .../VMMaker/SpurScavengeLogRecord.class.st | 58 +- smalltalksrc/VMMaker/SpurSegmentInfo.class.st | 40 +- .../VMMaker/SpurSegmentManager.class.st | 108 +- .../VMMaker/SpurSelectiveCompactor.class.st | 62 +- .../SpurSelectiveCompactorSimulator.class.st | 38 +- .../VMMaker/SpurSimulatedMemory.class.st | 62 +- smalltalksrc/VMMaker/SpurSweeper.class.st | 26 +- smalltalksrc/VMMaker/SqueakSSLPlugin.class.st | 32 +- .../VMMaker/StackDepthFinder.class.st | 134 +- .../VMMaker/StackInterpreter.class.st | 1888 +++++++-------- .../StackInterpreterPrimitives.class.st | 326 +-- .../StackInterpreterSimulator.class.st | 390 ++-- .../StackInterpreterSimulatorLSB.class.st | 16 +- .../StackToRegisterMappingCogit.class.st | 528 ++--- smalltalksrc/VMMaker/Stream.extension.st | 6 +- smalltalksrc/VMMaker/String.extension.st | 10 +- smalltalksrc/VMMaker/SurfacePlugin.class.st | 62 +- smalltalksrc/VMMaker/Symbol.extension.st | 6 +- smalltalksrc/VMMaker/TImageReader.trait.st | 10 +- smalltalksrc/VMMaker/TImageWriter.trait.st | 8 +- smalltalksrc/VMMaker/TVMSimulator.trait.st | 9 +- .../TVMSpurMemoryManagerSimulator.trait.st | 14 +- .../VMMaker/ThreadSafeTranscript.extension.st | 8 +- smalltalksrc/VMMaker/UUIDPlugin.class.st | 18 +- .../VMMaker/UndefinedObject.extension.st | 20 +- smalltalksrc/VMMaker/UnicodePlugin.class.st | 34 +- smalltalksrc/VMMaker/Unsigned.class.st | 18 +- .../VMMaker/VMBytecodeConstants.class.st | 10 +- .../VMMaker/VMCallbackContext.class.st | 56 +- smalltalksrc/VMMaker/VMClass.extension.st | 8 +- smalltalksrc/VMMaker/VMClassIndices.class.st | 8 +- .../VMMaker/VMCompiledMethodProxy.class.st | 32 +- .../VMMaker/VMImageReaderWriter.class.st | 38 +- .../VMMaker/VMMakerConfiguration.class.st | 68 +- smalltalksrc/VMMaker/VMMemoryMap.class.st | 166 +- .../VMMaker/VMMemoryMapConfiguration.class.st | 24 +- ...VMMemoryMapConfigurationFor32Bits.class.st | 20 +- ...VMMemoryMapConfigurationFor64Bits.class.st | 20 +- .../VMMaker/VMMethodCacheConstants.class.st | 8 +- smalltalksrc/VMMaker/VMObjectProxy.class.st | 24 +- .../VMProfileLinuxSupportPlugin.class.st | 22 +- .../VMProfileMacSupportPlugin.class.st | 14 +- smalltalksrc/VMMaker/VMRememberedSet.class.st | 117 +- ...geToComposedImageMigrationProcess.class.st | 18 +- ...SpurObjectRepresentationConstants.class.st | 8 +- .../VMMaker/VMStackFrameOffsets.class.st | 8 +- smalltalksrc/VMMaker/VMStackPage.class.st | 72 +- .../VMMaker/VMStackPageSurrogate.class.st | 30 +- .../VMMaker/VMStackPageSurrogate32.class.st | 54 +- .../VMMaker/VMStackPageSurrogate64.class.st | 54 +- smalltalksrc/VMMaker/VMStackPages.class.st | 86 +- smalltalksrc/VMMaker/VMStackPagesLSB.class.st | 12 +- smalltalksrc/VMMaker/VMStackPagesMSB.class.st | 10 +- smalltalksrc/VMMaker/VMStructType.class.st | 64 +- .../VMWellKnownPrimitivesConstants.class.st | 8 +- smalltalksrc/VMMaker/ValueHolder.extension.st | 4 +- smalltalksrc/VMMaker/WarpBlt.extension.st | 6 +- smalltalksrc/VMMaker/WordArray.extension.st | 6 +- smalltalksrc/VMMaker/WordsOrBytes.class.st | 14 +- smalltalksrc/VMMaker/WriteStream.extension.st | 6 +- .../ZnBufferedWriteStream.extension.st | 4 +- smalltalksrc/VMMaker/package.st | 2 +- 238 files changed, 11557 insertions(+), 11193 deletions(-) delete mode 100644 smalltalksrc/VMMaker/Cogit.extension.st delete mode 100644 smalltalksrc/VMMaker/SimpleStackBasedCogit.extension.st diff --git a/smalltalksrc/BaselineOfVMMaker/BaselineOfVMMaker.class.st b/smalltalksrc/BaselineOfVMMaker/BaselineOfVMMaker.class.st index 18dae2d352..8c632de8b3 100644 --- a/smalltalksrc/BaselineOfVMMaker/BaselineOfVMMaker.class.st +++ b/smalltalksrc/BaselineOfVMMaker/BaselineOfVMMaker.class.st @@ -1,10 +1,11 @@ Class { - #name : #BaselineOfVMMaker, - #superclass : #BaselineOf, - #category : #BaselineOfVMMaker + #name : 'BaselineOfVMMaker', + #superclass : 'BaselineOf', + #category : 'BaselineOfVMMaker', + #package : 'BaselineOfVMMaker' } -{ #category : #baselines } +{ #category : 'baselines' } BaselineOfVMMaker >> baseline: spec [ spec @@ -37,7 +38,7 @@ BaselineOfVMMaker >> baseline: spec [ spec baseline: 'LLVMDisassembler' with: [ spec repository: 'github://pharo-project/pharo-llvmDisassembler' ]. spec baseline: 'OpalSimdBytecode' with: [ - spec repository: 'github://nrainhart/pharo-opal-simd-bytecode:main' ]. + spec repository: 'github://evref-inria/pharo-opal-simd-bytecode:main' ]. "Tests" spec diff --git a/smalltalksrc/BaselineOfVMMaker/package.st b/smalltalksrc/BaselineOfVMMaker/package.st index 20dbfec67d..5b020a46d7 100644 --- a/smalltalksrc/BaselineOfVMMaker/package.st +++ b/smalltalksrc/BaselineOfVMMaker/package.st @@ -1 +1 @@ -Package { #name : #BaselineOfVMMaker } +Package { #name : 'BaselineOfVMMaker' } diff --git a/smalltalksrc/VMMaker/AbstractComposedImageAccess.class.st b/smalltalksrc/VMMaker/AbstractComposedImageAccess.class.st index d4433fd457..496ffd0e5b 100644 --- a/smalltalksrc/VMMaker/AbstractComposedImageAccess.class.st +++ b/smalltalksrc/VMMaker/AbstractComposedImageAccess.class.st @@ -1,10 +1,12 @@ Class { - #name : #AbstractComposedImageAccess, - #superclass : #AbstractImageAccess, - #category : #'VMMaker-ImageFormat' + #name : 'AbstractComposedImageAccess', + #superclass : 'AbstractImageAccess', + #category : 'VMMaker-ImageFormat', + #package : 'VMMaker', + #tag : 'ImageFormat' } -{ #category : #translation } +{ #category : 'translation' } AbstractComposedImageAccess class >> declareCVarsIn: aCCodeGenerator [ aCCodeGenerator @@ -12,7 +14,7 @@ AbstractComposedImageAccess class >> declareCVarsIn: aCCodeGenerator [ ] -{ #category : #'file operations' } +{ #category : 'file operations' } AbstractComposedImageAccess >> createImageDirectory: imageFileName [ self @@ -26,7 +28,7 @@ AbstractComposedImageAccess >> createImageDirectory: imageFileName [ imageFileName asFileReference ensureCreateDirectory ] ] -{ #category : #'file operations' } +{ #category : 'file operations' } AbstractComposedImageAccess >> existSegment: segmentIndex inImage: imageFileName [ @@ -43,7 +45,7 @@ AbstractComposedImageAccess >> existSegment: segmentIndex inImage: imageFileName ] -{ #category : #formats } +{ #category : 'formats' } AbstractComposedImageAccess >> fieldFormat [ @@ -51,7 +53,7 @@ AbstractComposedImageAccess >> fieldFormat [ ^ '\t#%s : %' , PRIdSQINT. ] -{ #category : #'file operations' } +{ #category : 'file operations' } AbstractComposedImageAccess >> fileExists: fileName [ | sb | @@ -65,7 +67,7 @@ AbstractComposedImageAccess >> fileExists: fileName [ inSmalltalk: [ fileName asFileReference exists ] ] -{ #category : #'file primitives' } +{ #category : 'file primitives' } AbstractComposedImageAccess >> fscanf: file _: format _: varHolder [ @@ -75,7 +77,7 @@ AbstractComposedImageAccess >> fscanf: file _: format _: varHolder [ yourself ] -{ #category : #'file primitives' } +{ #category : 'file primitives' } AbstractComposedImageAccess >> fscanf: file _: format _: varHolder1 _: varHolder2 [ @@ -93,14 +95,14 @@ AbstractComposedImageAccess >> fscanf: file _: format _: varHolder1 _: varHolder yourself ] -{ #category : #formats } +{ #category : 'formats' } AbstractComposedImageAccess >> headFormat [ ^ '%s {\n'. ] -{ #category : #'file operations' } +{ #category : 'file operations' } AbstractComposedImageAccess >> headerFileNameinImage: imageFileName into: buffer bufferSize: bufferSize [ | headerFileName | @@ -118,7 +120,7 @@ AbstractComposedImageAccess >> headerFileNameinImage: imageFileName into: buffer inSmalltalk: [ imageFileName , '/', headerFileName ] ] -{ #category : #formats } +{ #category : 'formats' } AbstractComposedImageAccess >> msgFormat: aMessage [ @@ -126,7 +128,7 @@ AbstractComposedImageAccess >> msgFormat: aMessage [ ^ aMessage , '%' , PRIdSQINT. ] -{ #category : #'perm - space' } +{ #category : 'perm - space' } AbstractComposedImageAccess >> permSpaceDataFileInImage: imageFileName [ @@ -139,7 +141,7 @@ AbstractComposedImageAccess >> permSpaceDataFileInImage: imageFileName [ ^ self permSpaceFileName: 'permSpace.data' inImage: imageFileName into: buffer bufferSize: 255 ] -{ #category : #'perm - space' } +{ #category : 'perm - space' } AbstractComposedImageAccess >> permSpaceFileName: fileName inImage: imageFileName into: buffer bufferSize: bufferSize [ ^ self @@ -153,7 +155,7 @@ AbstractComposedImageAccess >> permSpaceFileName: fileName inImage: imageFileNam inSmalltalk: [ imageFileName , '/', fileName ]. ] -{ #category : #'perm - space' } +{ #category : 'perm - space' } AbstractComposedImageAccess >> permSpaceMetadataFileNameInImage: imageFileName [ @@ -166,7 +168,7 @@ AbstractComposedImageAccess >> permSpaceMetadataFileNameInImage: imageFileName [ ^ self permSpaceFileName: 'permSpace.ston' inImage: imageFileName into: buffer bufferSize: 255 ] -{ #category : #segments } +{ #category : 'segments' } AbstractComposedImageAccess >> segmentDataFile: segmentIndex inImage: imageFileName [ @@ -180,7 +182,7 @@ AbstractComposedImageAccess >> segmentDataFile: segmentIndex inImage: imageFileN ] -{ #category : #segments } +{ #category : 'segments' } AbstractComposedImageAccess >> segmentFileName: segmentIndex withExtension: extension inImage: imageFileName into: buffer bufferSize: bufferSize [ ^ self @@ -194,7 +196,7 @@ AbstractComposedImageAccess >> segmentFileName: segmentIndex withExtension: exte inSmalltalk: [ imageFileName , '/seg', segmentIndex asString , extension ] ] -{ #category : #segments } +{ #category : 'segments' } AbstractComposedImageAccess >> segmentMetadataFile: segmentIndex inImage: imageFileName [ diff --git a/smalltalksrc/VMMaker/AbstractFileReference.extension.st b/smalltalksrc/VMMaker/AbstractFileReference.extension.st index df0f6f425a..48b90627f8 100644 --- a/smalltalksrc/VMMaker/AbstractFileReference.extension.st +++ b/smalltalksrc/VMMaker/AbstractFileReference.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #AbstractFileReference } +Extension { #name : 'AbstractFileReference' } -{ #category : #'*VMMaker' } +{ #category : '*VMMaker' } AbstractFileReference >> hasChildrenMatching: patterns [ ^ (self childrenMatching: patterns) isNotEmpty diff --git a/smalltalksrc/VMMaker/AbstractImageAccess.class.st b/smalltalksrc/VMMaker/AbstractImageAccess.class.st index ee7a207030..06411301b0 100644 --- a/smalltalksrc/VMMaker/AbstractImageAccess.class.st +++ b/smalltalksrc/VMMaker/AbstractImageAccess.class.st @@ -1,21 +1,23 @@ Class { - #name : #AbstractImageAccess, - #superclass : #VMClass, + #name : 'AbstractImageAccess', + #superclass : 'VMClass', #instVars : [ 'objectMemory', 'segmentManager', 'coInterpreter' ], - #category : #'VMMaker-ImageFormat' + #category : 'VMMaker-ImageFormat', + #package : 'VMMaker', + #tag : 'ImageFormat' } -{ #category : #translation } +{ #category : 'translation' } AbstractImageAccess class >> implicitReturnTypeFor: aSelector [ "Answer the return type for methods that don't have an explicit return." ^#void ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } AbstractImageAccess class >> newWithMemory: memory andInterpreter: anInterpreter [ | newInstance | @@ -28,7 +30,7 @@ AbstractImageAccess class >> newWithMemory: memory andInterpreter: anInterpreter ^ newInstance ] -{ #category : #'accessing - files' } +{ #category : 'accessing - files' } AbstractImageAccess >> beginWriteImageSegments [ " self assert: @@ -39,7 +41,7 @@ AbstractImageAccess >> beginWriteImageSegments [ ] -{ #category : #reading } +{ #category : 'reading' } AbstractImageAccess >> extractImageVersionFrom: fileVersion into: header [ "Read and verify the image file version number and return true if the the given image file needs to be byte-swapped. As a side effect, position the file stream just after the version number of the image header. This code prints a warning and does a hard-exit if it cannot find a valid version number." "This code is based on C code by Ian Piumarta." @@ -70,7 +72,7 @@ AbstractImageAccess >> extractImageVersionFrom: fileVersion into: header [ ] -{ #category : #segments } +{ #category : 'segments' } AbstractImageAccess >> finalizeSegmentsRead: totalBytesRead newBase: newBase [ "newBase should point just past the last bridge. all others should have been eliminated." @@ -85,14 +87,14 @@ AbstractImageAccess >> finalizeSegmentsRead: totalBytesRead newBase: newBase [ ] -{ #category : #reading } +{ #category : 'reading' } AbstractImageAccess >> imageFormatCompatibilityVersion [ "This VM is backward-compatible with the immediately preceding version." ^objectMemory wordSize = 4 ifTrue: [6504] ifFalse: [68002] ] -{ #category : #reading } +{ #category : 'reading' } AbstractImageAccess >> imageFormatVersion [ "Return a magic constant that changes when the image format changes. Since the image reading code uses this to detect byte ordering, one @@ -102,7 +104,7 @@ AbstractImageAccess >> imageFormatVersion [ ^objectMemory imageFormatVersion ] -{ #category : #reading } +{ #category : 'reading' } AbstractImageAccess >> initializeInterpreterFromHeader: header withBytes: bytesRead [ | bytesToShift | @@ -119,7 +121,7 @@ AbstractImageAccess >> initializeInterpreterFromHeader: header withBytes: bytesR coInterpreter initializeInterpreter: bytesToShift "adjusts all oops to new location" ] -{ #category : #accessing } +{ #category : 'accessing' } AbstractImageAccess >> interpreter [ @@ -127,7 +129,7 @@ AbstractImageAccess >> interpreter [ ^ coInterpreter ] -{ #category : #accessing } +{ #category : 'accessing' } AbstractImageAccess >> interpreter: anObject [ @@ -135,7 +137,7 @@ AbstractImageAccess >> interpreter: anObject [ coInterpreter := anObject ] -{ #category : #reading } +{ #category : 'reading' } AbstractImageAccess >> loadHeaderToMemory: header [ @@ -159,27 +161,27 @@ AbstractImageAccess >> loadHeaderToMemory: header [ ] -{ #category : #accessing } +{ #category : 'accessing' } AbstractImageAccess >> objectMemory: memory [ objectMemory := memory ] -{ #category : #segments } +{ #category : 'segments' } AbstractImageAccess >> prepareSegmentsToRead [ segmentManager clearSegments. segmentManager allocateOrExtendSegmentInfos ] -{ #category : #segments } +{ #category : 'segments' } AbstractImageAccess >> readSegmentsFromImageFile: imageFile header: header [ self subclassResponsibility ] -{ #category : #reading } +{ #category : 'reading' } AbstractImageAccess >> readableFormat: imageVersion [ "Anwer true if images of the given format are readable by this interpreter. Allows a virtual machine to accept selected older image formats." @@ -188,14 +190,14 @@ AbstractImageAccess >> readableFormat: imageVersion [ or: [imageVersion = self imageFormatCompatibilityVersion] "Float words in BigEndian order" ] -{ #category : #accessing } +{ #category : 'accessing' } AbstractImageAccess >> segmentManager: anObject [ segmentManager := anObject ] -{ #category : #'accessing - files' } +{ #category : 'accessing - files' } AbstractImageAccess >> sq: startingAddress Image: byteSize File: bytesToRead Read: aZnBufferedReadStream [ @@ -209,7 +211,7 @@ AbstractImageAccess >> sq: startingAddress Image: byteSize File: bytesToRead Rea count: bytesToRead ] -{ #category : #'accessing - files' } +{ #category : 'accessing - files' } AbstractImageAccess >> sq: start Image: n File: segSize Write: file [ @@ -224,7 +226,7 @@ AbstractImageAccess >> sq: start Image: n File: segSize Write: file [ ^ segSize ] -{ #category : #'accessing - files' } +{ #category : 'accessing - files' } AbstractImageAccess >> sqImageFile: imageName Open: fileMode [ @@ -237,14 +239,14 @@ AbstractImageAccess >> sqImageFile: imageName Open: fileMode [ self error: 'File mode not supported' ] -{ #category : #'accessing - files' } +{ #category : 'accessing - files' } AbstractImageAccess >> sqImageFileClose: file [ file close ] -{ #category : #testing } +{ #category : 'testing' } AbstractImageAccess >> validateImage: imageName [ diff --git a/smalltalksrc/VMMaker/Array.extension.st b/smalltalksrc/VMMaker/Array.extension.st index 3de5cc37f5..d913a3bf8c 100644 --- a/smalltalksrc/VMMaker/Array.extension.st +++ b/smalltalksrc/VMMaker/Array.extension.st @@ -1,11 +1,11 @@ -Extension { #name : #Array } +Extension { #name : 'Array' } -{ #category : #'*VMMaker-interpreter simulator' } +{ #category : '*VMMaker-interpreter simulator' } Array >> addBreakpoint: address [ ^self, {address} ] -{ #category : #'*VMMaker-plugin generation' } +{ #category : '*VMMaker-plugin generation' } Array class >> ccg: cg prolog: aBlock expr: aString index: anInteger [ ^cg @@ -15,31 +15,31 @@ Array class >> ccg: cg prolog: aBlock expr: aString index: anInteger [ andThen: (cg ccgValBlock: 'isIndexable') ] -{ #category : #'*VMMaker-plugin generation' } +{ #category : '*VMMaker-plugin generation' } Array class >> ccgDeclareCForVar: aSymbolOrString [ ^'sqInt *', aSymbolOrString ] -{ #category : #'*VMMaker-interpreter simulator' } +{ #category : '*VMMaker-interpreter simulator' } Array >> coerceTo: cTypeString sim: interpreterSimulator [ ^ self ] -{ #category : #'*VMMaker-interpreter simulator' } +{ #category : '*VMMaker-interpreter simulator' } Array >> isActiveBreakpoint [ ^self size > 0 ] -{ #category : #'*VMMaker-interpreter simulator' } +{ #category : '*VMMaker-interpreter simulator' } Array >> isBreakpointFor: address [ 1 to: self size do: [:i| (self at: i) = address ifTrue: [^true]]. ^false ] -{ #category : #'*VMMaker-interpreter simulator' } +{ #category : '*VMMaker-interpreter simulator' } Array >> menuPrompt [ ^String streamContents: [:s| @@ -49,12 +49,12 @@ Array >> menuPrompt [ s nextPut: $)] ] -{ #category : #'*VMMaker-interpreter simulator' } +{ #category : '*VMMaker-interpreter simulator' } Array >> removeBreakpoint: address [ ^(self copyWithout: address) ifEmpty: nil ] -{ #category : #'*VMMaker-interpreter simulator' } +{ #category : '*VMMaker-interpreter simulator' } Array >> singleStepRequiredToTriggerIn: aCogit [ ^self anySatisfy: [:address| address between: aCogit cogCodeBase and: aCogit methodZone limitZony] ] diff --git a/smalltalksrc/VMMaker/ArrayedCollection.extension.st b/smalltalksrc/VMMaker/ArrayedCollection.extension.st index d658df1ec8..61e673a593 100644 --- a/smalltalksrc/VMMaker/ArrayedCollection.extension.st +++ b/smalltalksrc/VMMaker/ArrayedCollection.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #ArrayedCollection } +Extension { #name : 'ArrayedCollection' } -{ #category : #'*VMMaker-plugin generation' } +{ #category : '*VMMaker-plugin generation' } ArrayedCollection class >> ccg: cg generateCoerceToOopFrom: aNode on: aStream [ "N.B. The is used both for generation and simulation so answer the result (for interpretation)" self instSize > 0 ifTrue: @@ -8,7 +8,7 @@ ArrayedCollection class >> ccg: cg generateCoerceToOopFrom: aNode on: aStream [ ^cg generateCoerceToObjectFromPtr: aNode on: aStream ] -{ #category : #'*VMMaker-plugin generation' } +{ #category : '*VMMaker-plugin generation' } ArrayedCollection class >> ccg: cg generateCoerceToValueFrom: aNode on: aStream [ "N.B. The could be used both for generation and simulation so answer the result (for interpretation)" ^cg @@ -16,7 +16,7 @@ ArrayedCollection class >> ccg: cg generateCoerceToValueFrom: aNode on: aStream fromObject: aNode on: aStream ] -{ #category : #'*VMMaker-simulated image growing' } +{ #category : '*VMMaker-simulated image growing' } ArrayedCollection >> copyGrownBy: n [ "Create a new collection containing all the elements from aCollection." diff --git a/smalltalksrc/VMMaker/AsynchFilePlugin.class.st b/smalltalksrc/VMMaker/AsynchFilePlugin.class.st index 0f4a2951ad..6959d16e4e 100644 --- a/smalltalksrc/VMMaker/AsynchFilePlugin.class.st +++ b/smalltalksrc/VMMaker/AsynchFilePlugin.class.st @@ -2,34 +2,36 @@ Implements the asynchronous file primitives available on a few platforms. See the platform specific files in platforms- {your platform} - plugins - Asynchplugin " Class { - #name : #AsynchFilePlugin, - #superclass : #SmartSyntaxInterpreterPlugin, + #name : 'AsynchFilePlugin', + #superclass : 'SmartSyntaxInterpreterPlugin', #instVars : [ 'sCOAFfn' ], - #category : #'VMMaker-Plugins' + #category : 'VMMaker-Plugins', + #package : 'VMMaker', + #tag : 'Plugins' } -{ #category : #translation } +{ #category : 'translation' } AsynchFilePlugin class >> declareCVarsIn: cg [ super declareCVarsIn: cg. cg var: #sCOAFfn type: #'void *'. ] -{ #category : #translation } +{ #category : 'translation' } AsynchFilePlugin class >> hasHeaderFile [ "If there is a single intrinsic header file to be associated with the plugin, here is where you want to flag" ^true ] -{ #category : #translation } +{ #category : 'translation' } AsynchFilePlugin class >> requiresPlatformFiles [ "this plugin requires platform specific files in order to work" ^true ] -{ #category : #primitives } +{ #category : 'primitives' } AsynchFilePlugin >> asyncFileValueOf: oop [ "Answer a pointer to the first byte of the async file record within the given Smalltalk bytes object, or fail and answer nil if oop is not an async file record." @@ -42,7 +44,7 @@ AsynchFilePlugin >> asyncFileValueOf: oop [ ^nil ] -{ #category : #'initialize-release' } +{ #category : 'initialize-release' } AsynchFilePlugin >> initialiseModule [ "Initialise the module" @@ -50,7 +52,7 @@ AsynchFilePlugin >> initialiseModule [ ^self cCode: 'asyncFileInit()' inSmalltalk:[true] ] -{ #category : #'initialize-release' } +{ #category : 'initialize-release' } AsynchFilePlugin >> moduleUnloaded: aModuleName [ "The module with the given name was just unloaded. Make sure we have no dangling references." @@ -61,7 +63,7 @@ AsynchFilePlugin >> moduleUnloaded: aModuleName [ sCOAFfn := 0] ] -{ #category : #primitives } +{ #category : 'primitives' } AsynchFilePlugin >> primitiveAsyncFileClose: fh [ | f | @@ -71,7 +73,7 @@ AsynchFilePlugin >> primitiveAsyncFileClose: fh [ self asyncFileClose: f ] -{ #category : #primitives } +{ #category : 'primitives' } AsynchFilePlugin >> primitiveAsyncFileOpen: fileName forWrite: writeFlag semaIndex: semaIndex [ | fileNameSize fOop f okToOpen | @@ -93,7 +95,7 @@ AsynchFilePlugin >> primitiveAsyncFileOpen: fileName forWrite: writeFlag semaInd ^fOop ] -{ #category : #primitives } +{ #category : 'primitives' } AsynchFilePlugin >> primitiveAsyncFileReadResult: fhandle intoBuffer: buffer at: start count: num [ | bufferSize bufferPtr r f count startIndex | @@ -116,7 +118,7 @@ AsynchFilePlugin >> primitiveAsyncFileReadResult: fhandle intoBuffer: buffer at: ^r asOop: SmallInteger ] -{ #category : #primitives } +{ #category : 'primitives' } AsynchFilePlugin >> primitiveAsyncFileReadStart: fHandle fPosition: fPosition count: count [ | f | @@ -126,7 +128,7 @@ AsynchFilePlugin >> primitiveAsyncFileReadStart: fHandle fPosition: fPosition co self asyncFile: f Read: fPosition Start: count ] -{ #category : #primitives } +{ #category : 'primitives' } AsynchFilePlugin >> primitiveAsyncFileWriteResult: fHandle [ | f r | @@ -138,7 +140,7 @@ AsynchFilePlugin >> primitiveAsyncFileWriteResult: fHandle [ ^r asOop: SmallInteger ] -{ #category : #primitives } +{ #category : 'primitives' } AsynchFilePlugin >> primitiveAsyncFileWriteStart: fHandle fPosition: fPosition fromBuffer: buffer at: start count: num [ | f bufferSize bufferPtr count startIndex | @@ -159,14 +161,14 @@ AsynchFilePlugin >> primitiveAsyncFileWriteStart: fHandle fPosition: fPosition f self async: f File: fPosition Write: bufferPtr asVoidPointer Start: count ] -{ #category : #'initialize-release' } +{ #category : 'initialize-release' } AsynchFilePlugin >> shutdownModule [ "Initialise the module" ^self cCode: 'asyncFileShutdown()' inSmalltalk:[true] ] -{ #category : #simulation } +{ #category : 'simulation' } AsynchFilePlugin >> sizeof: objectSymbolOrClass [ objectSymbolOrClass isInteger ifTrue: diff --git a/smalltalksrc/VMMaker/B3DAcceleratorPlugin.class.st b/smalltalksrc/VMMaker/B3DAcceleratorPlugin.class.st index 4838643aac..89421a0ce3 100644 --- a/smalltalksrc/VMMaker/B3DAcceleratorPlugin.class.st +++ b/smalltalksrc/VMMaker/B3DAcceleratorPlugin.class.st @@ -2,227 +2,229 @@ B3DAcceleratorPlugin translate " Class { - #name : #B3DAcceleratorPlugin, - #superclass : #InterpreterPlugin, + #name : 'B3DAcceleratorPlugin', + #superclass : 'InterpreterPlugin', #instVars : [ 'doRangeChecks' ], - #category : #'VMMaker-Plugins' + #category : 'VMMaker-Plugins', + #package : 'VMMaker', + #tag : 'Plugins' } -{ #category : #translation } +{ #category : 'translation' } B3DAcceleratorPlugin class >> hasHeaderFile [ "If there is a single intrinsic header file to be associated with the plugin, here is where you want to flag" ^true ] -{ #category : #translation } +{ #category : 'translation' } B3DAcceleratorPlugin class >> moduleName [ ^'B3DAcceleratorPlugin' ] -{ #category : #translation } +{ #category : 'translation' } B3DAcceleratorPlugin class >> requiresCrossPlatformFiles [ "default is ok for most, any plugin needing platform specific files must say so" ^true ] -{ #category : #translation } +{ #category : 'translation' } B3DAcceleratorPlugin class >> requiresPlatformFiles [ "default is ok for most, any plugin needing platform specific files must say so" ^true ] -{ #category : #testing } +{ #category : 'testing' } B3DAcceleratorPlugin class >> testLoadPlugin [ "B3DAcceleratorPlugin testLoadPlugin" self primitiveFailed ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dDrawArrays: handle _: mode _: minIdx _: maxIdx [ "int b3dDrawArrays(int handle, int mode, int minIdx, int maxIdx)" ^false ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dDrawElements: handle _: mode _: faceSize _: facePtr [ "int b3dDrawElements(int handle, int mode, int nFaces, unsigned int *facePtr)" ^false ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dDrawRangeElements: handle _: mode _: minIdx _: maxIdx _: faceSize _: facePtr [ "int b3dDrawRangeElements(int handle, int mode, int minIdx, int maxIdx, int nFaces, unsigned int *facePtr)" ^false ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dLoadClientState: handle _: vtxData _: vtxSize _: colorData _: colorSize _: normalData _: normalSize _: txData _: txSize [ "int b3dLoadClientState(int handle, float *vtxData, int vtxSize, float *colorData, int colorSize, float *normalData, int normalSize, float *txData, int txSize)" ^false ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dxActualTextureDepth: renderer _: handle [ "int b3dxActualTextureDepth(int renderer, int handle)" ^-1 ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dxAllocateTexture: renderer _: w _: h _: d [ "int b3dxAllocateTexture(int renderer, int w, int h, int d)" ^-1 ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dxCompositeTexture: rendererHandle _: texHandle _: x _: y _: w _: h _: translucent [ "int b3dxCompositeTexture(int renderer, int handle, int x, int y, int w, int h, int translucent)" ^false ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dxDestroyRenderer: handle [ "int b3dxDestroyRenderer(int handle)" ^false ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dxDestroyTexture: renderer _: handle [ "int b3dxDestroyTexture(int renderer, int handle)" ^false ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dxDisableLights: handle [ "int b3dxDisableLights(int handle)" ^false ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dxFinishRenderer: handle [ "int b3dxFinishRenderer(int handle)" ^false ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dxFlushRenderer: handle [ "int b3dxFlushRenderer(int handle)" ^false ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dxGetRendererColorMasks: handle _: masks [ "int b3dxGetRendererColorMasks(int handle, int *masks)" ^false ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dxGetRendererSurfaceDepth: handle [ "int b3dxGetRendererSurfaceDepth(int handle)" ^-1 ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dxGetRendererSurfaceHandle: handle [ "int b3dxGetRendererSurfaceHandle(int handle)" ^-1 ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dxGetRendererSurfaceHeight: handle [ "int b3dxGetRendererSurfaceHeight(int handle)" ^-1 ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dxGetRendererSurfaceWidth: handle [ "int b3dxGetRendererSurfaceWidth(int handle)" ^-1 ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dxIsOverlayRenderer: handle [ "int b3dxIsOverlayRenderer(int handle)" ^false ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dxLoadLight: handle _: i _: light [ "int b3dxLoadLight(int handle, int index, B3DPrimitiveLight *light)" ^false ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dxLoadMaterial: handle _: material [ "int b3dxLoadMaterial(int handle, B3DPrimitiveMaterial *material)" ^false ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dxRenderVertexBuffer: handle _: primType _: flags _: texHandle _: vtxArray _: vtxCount _: idxArray _: idxCount [ "int b3dxRenderVertexBuffer(int handle, int primType, int flags, int texHandle, float *vtxArray, int vtxSize, int *idxArray, int idxSize)" ^false ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dxSwapRendererBuffers: handle [ "int b3dxSwapRendererBuffers(int handle)" ^false ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dxTextureByteSex: renderer _: handle [ "int b3dxTextureByteSex(int renderer, int handle)" ^-1 ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dxTextureColorMasks: renderer _: handle _: masks [ "int b3dxTextureColorMasks(int renderer, int handle, int masks[4])" ^false ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dxTextureSurfaceHandle: renderer _: handle [ "int b3dxTextureSurfaceHandle(int renderer, int handle)" ^-1 ] -{ #category : #simulation } +{ #category : 'simulation' } B3DAcceleratorPlugin >> b3dxUploadTexture: renderer _: handle _: w _: h _: d _: bitsPtr [ "int b3dxUploadTexture(int renderer, int handle, int w, int h, int d, void* bits)" ^false ] -{ #category : #'primitives-qwaq' } +{ #category : 'primitives-qwaq' } B3DAcceleratorPlugin >> checkBoundsRange: vertices faces: facePtr count: faceCount [ "Verify the bounds condition on the entire faces array" | vtxSize | @@ -234,7 +236,7 @@ B3DAcceleratorPlugin >> checkBoundsRange: vertices faces: facePtr count: faceCou ] -{ #category : #'primitives-qwaq' } +{ #category : 'primitives-qwaq' } B3DAcceleratorPlugin >> checkVertexData: vertices [ "Check the entire vertex data to ensure no nan/inf values" | vtxSize vtxPtr f | @@ -249,7 +251,7 @@ B3DAcceleratorPlugin >> checkVertexData: vertices [ ] -{ #category : #'primitive support' } +{ #category : 'primitive support' } B3DAcceleratorPlugin >> fetchLightSource: index ofObject: anArray [ "Fetch the primitive light source from the given array. Note: No checks are done within here - that happened in stackLightArrayValue:" @@ -260,14 +262,14 @@ B3DAcceleratorPlugin >> fetchLightSource: index ofObject: anArray [ ^interpreterProxy firstIndexableField: lightOop ] -{ #category : #'initialize-release' } +{ #category : 'initialize-release' } B3DAcceleratorPlugin >> initialiseModule [ doRangeChecks := true. ^self b3dxInitialize ] -{ #category : #'primitives-qwaq' } +{ #category : 'primitives-qwaq' } B3DAcceleratorPlugin >> loadClientState: handle vertices: vertices colors: colors normals: normals texCoords: texCoords [ "Common method to set up client state for some render ops" | nilOop vtxSize sz colorPtr normalPtr txPtr vertexPtr ok | @@ -315,7 +317,7 @@ B3DAcceleratorPlugin >> loadClientState: handle vertices: vertices colors: color ] -{ #category : #'primitives-textures' } +{ #category : 'primitives-textures' } B3DAcceleratorPlugin >> primitiveAllocateTexture [ | h w d result renderer | @@ -332,7 +334,7 @@ B3DAcceleratorPlugin >> primitiveAllocateTexture [ ^interpreterProxy pushInteger: result. ] -{ #category : #'primitives-renderer' } +{ #category : 'primitives-renderer' } B3DAcceleratorPlugin >> primitiveClearDepthBuffer [ | handle | @@ -345,7 +347,7 @@ B3DAcceleratorPlugin >> primitiveClearDepthBuffer [ ifFalse:[interpreterProxy primitiveFail]] ] -{ #category : #'primitives-renderer' } +{ #category : 'primitives-renderer' } B3DAcceleratorPlugin >> primitiveClearViewport [ | handle pv rgba | @@ -360,7 +362,7 @@ B3DAcceleratorPlugin >> primitiveClearViewport [ ifFalse:[interpreterProxy primitiveFail] ] -{ #category : #'primitives-textures' } +{ #category : 'primitives-textures' } B3DAcceleratorPlugin >> primitiveCompositeTexture [ | result translucent y x w h texHandle rendererHandle | @@ -380,7 +382,7 @@ B3DAcceleratorPlugin >> primitiveCompositeTexture [ ] -{ #category : #'primitives-renderer' } +{ #category : 'primitives-renderer' } B3DAcceleratorPlugin >> primitiveCreateRenderer [ "NOTE: This primitive is obsolete but should be supported for older images" | h w y x result allowHardware allowSoftware | @@ -399,7 +401,7 @@ B3DAcceleratorPlugin >> primitiveCreateRenderer [ ifFalse: [interpreterProxy primitiveFail]] ] -{ #category : #'primitives-renderer' } +{ #category : 'primitives-renderer' } B3DAcceleratorPlugin >> primitiveCreateRendererFlags [ | flags h w y x result | @@ -416,7 +418,7 @@ B3DAcceleratorPlugin >> primitiveCreateRendererFlags [ ifFalse: [interpreterProxy primitiveFail]] ] -{ #category : #'primitives-renderer' } +{ #category : 'primitives-renderer' } B3DAcceleratorPlugin >> primitiveDestroyRenderer [ | handle result | @@ -429,7 +431,7 @@ B3DAcceleratorPlugin >> primitiveDestroyRenderer [ ^interpreterProxy pop: 1. "pop arg; return rcvr" ] -{ #category : #'primitives-textures' } +{ #category : 'primitives-textures' } B3DAcceleratorPlugin >> primitiveDestroyTexture [ | handle result renderer | @@ -443,7 +445,7 @@ B3DAcceleratorPlugin >> primitiveDestroyTexture [ ^interpreterProxy pop: 2. "pop arg; return rcvr" ] -{ #category : #'primitives-qwaq' } +{ #category : 'primitives-qwaq' } B3DAcceleratorPlugin >> primitiveDrawArrays [ "Primitive. Setup non-VBO client state and call drawRangeElements in one go to avoid garbage collection to move the buffers underneith." @@ -480,7 +482,7 @@ B3DAcceleratorPlugin >> primitiveDrawArrays [ ] -{ #category : #'primitives-qwaq' } +{ #category : 'primitives-qwaq' } B3DAcceleratorPlugin >> primitiveDrawElements [ "Primitive. Setup non-VBO client state and call drawElements in one go to avoid garbage collection to move the buffers underneith." @@ -521,7 +523,7 @@ B3DAcceleratorPlugin >> primitiveDrawElements [ ] -{ #category : #'primitives-qwaq' } +{ #category : 'primitives-qwaq' } B3DAcceleratorPlugin >> primitiveDrawRangeElements [ "Primitive. Setup non-VBO client state and call drawRangeElements in one go to avoid garbage collection to move the buffers underneith." @@ -568,7 +570,7 @@ B3DAcceleratorPlugin >> primitiveDrawRangeElements [ ] -{ #category : #'primitives-qwaq' } +{ #category : 'primitives-qwaq' } B3DAcceleratorPlugin >> primitiveEnableDrawRangeChecks [ "Primitive. Enable/disable draw (range) checks" | enabled | @@ -584,7 +586,7 @@ B3DAcceleratorPlugin >> primitiveEnableDrawRangeChecks [ ^nil "keep compiler quiet" ] -{ #category : #'primitives-renderer' } +{ #category : 'primitives-renderer' } B3DAcceleratorPlugin >> primitiveFinishRenderer [ | handle result | @@ -597,7 +599,7 @@ B3DAcceleratorPlugin >> primitiveFinishRenderer [ ^interpreterProxy pop: 1. "pop arg; return rcvr" ] -{ #category : #'primitives-renderer' } +{ #category : 'primitives-renderer' } B3DAcceleratorPlugin >> primitiveFlushRenderer [ | handle result | @@ -610,7 +612,7 @@ B3DAcceleratorPlugin >> primitiveFlushRenderer [ ^interpreterProxy pop: 1. "pop arg; return rcvr" ] -{ #category : #'primitives-renderer' } +{ #category : 'primitives-renderer' } B3DAcceleratorPlugin >> primitiveGetIntProperty [ | handle prop result | @@ -622,7 +624,7 @@ B3DAcceleratorPlugin >> primitiveGetIntProperty [ interpreterProxy methodReturnInteger: result ] -{ #category : #'primitives-renderer' } +{ #category : 'primitives-renderer' } B3DAcceleratorPlugin >> primitiveGetRendererColorMasks [ | handle masks array | @@ -646,7 +648,7 @@ B3DAcceleratorPlugin >> primitiveGetRendererColorMasks [ ^interpreterProxy pop: 2 "pop args return receiver" ] -{ #category : #'primitives-renderer' } +{ #category : 'primitives-renderer' } B3DAcceleratorPlugin >> primitiveGetRendererSurfaceDepth [ | handle result | @@ -660,7 +662,7 @@ B3DAcceleratorPlugin >> primitiveGetRendererSurfaceDepth [ ^interpreterProxy pushInteger: result ] -{ #category : #'primitives-renderer' } +{ #category : 'primitives-renderer' } B3DAcceleratorPlugin >> primitiveGetRendererSurfaceHandle [ | handle result | @@ -674,7 +676,7 @@ B3DAcceleratorPlugin >> primitiveGetRendererSurfaceHandle [ ^interpreterProxy pushInteger: result ] -{ #category : #'primitives-renderer' } +{ #category : 'primitives-renderer' } B3DAcceleratorPlugin >> primitiveGetRendererSurfaceHeight [ | handle result | @@ -688,7 +690,7 @@ B3DAcceleratorPlugin >> primitiveGetRendererSurfaceHeight [ ^interpreterProxy pushInteger: result ] -{ #category : #'primitives-renderer' } +{ #category : 'primitives-renderer' } B3DAcceleratorPlugin >> primitiveGetRendererSurfaceWidth [ | handle result | @@ -702,7 +704,7 @@ B3DAcceleratorPlugin >> primitiveGetRendererSurfaceWidth [ ^interpreterProxy pushInteger: result ] -{ #category : #'primitives-renderer' } +{ #category : 'primitives-renderer' } B3DAcceleratorPlugin >> primitiveIsOverlayRenderer [ | handle result | @@ -715,7 +717,7 @@ B3DAcceleratorPlugin >> primitiveIsOverlayRenderer [ ^interpreterProxy pushBool: result. ] -{ #category : #'primitives-renderer' } +{ #category : 'primitives-renderer' } B3DAcceleratorPlugin >> primitiveRenderVertexBuffer [ | idxCount vtxCount vtxArray idxArray texHandle primType result flags handle | @@ -745,7 +747,7 @@ B3DAcceleratorPlugin >> primitiveRenderVertexBuffer [ ^interpreterProxy pop: 8. "pop args; return rcvr" ] -{ #category : #'primitives-renderer' } +{ #category : 'primitives-renderer' } B3DAcceleratorPlugin >> primitiveRendererVersion [ interpreterProxy methodArgumentCount = 0 @@ -754,7 +756,7 @@ B3DAcceleratorPlugin >> primitiveRendererVersion [ ^interpreterProxy pushInteger: 1. ] -{ #category : #'primitives-renderer' } +{ #category : 'primitives-renderer' } B3DAcceleratorPlugin >> primitiveSetBufferRect [ "Primitive. Set the buffer rectangle (e.g., the pixel area on screen) to use for this renderer. The viewport is positioned within the buffer rectangle." @@ -773,7 +775,7 @@ B3DAcceleratorPlugin >> primitiveSetBufferRect [ ifFalse:[interpreterProxy primitiveFail]] ] -{ #category : #'primitives-renderer' } +{ #category : 'primitives-renderer' } B3DAcceleratorPlugin >> primitiveSetFog [ | handle rgba density fogType stop start | @@ -794,7 +796,7 @@ B3DAcceleratorPlugin >> primitiveSetFog [ ifFalse:[interpreterProxy primitiveFail]] ] -{ #category : #'primitives-renderer' } +{ #category : 'primitives-renderer' } B3DAcceleratorPlugin >> primitiveSetIntProperty [ | handle prop value | @@ -809,7 +811,7 @@ B3DAcceleratorPlugin >> primitiveSetIntProperty [ ] -{ #category : #'primitives-renderer' } +{ #category : 'primitives-renderer' } B3DAcceleratorPlugin >> primitiveSetLights [ | lightArray lightCount light handle | @@ -834,7 +836,7 @@ B3DAcceleratorPlugin >> primitiveSetLights [ ^interpreterProxy pop: 2. "args; return rcvr" ] -{ #category : #'primitives-renderer' } +{ #category : 'primitives-renderer' } B3DAcceleratorPlugin >> primitiveSetMaterial [ | material handle | @@ -850,7 +852,7 @@ B3DAcceleratorPlugin >> primitiveSetMaterial [ ^interpreterProxy pop: 2. "args; return rcvr" ] -{ #category : #'primitives-renderer' } +{ #category : 'primitives-renderer' } B3DAcceleratorPlugin >> primitiveSetTransform [ "Transform an entire vertex buffer using the supplied modelview and projection matrix." | projectionMatrix modelViewMatrix handle | @@ -868,7 +870,7 @@ B3DAcceleratorPlugin >> primitiveSetTransform [ interpreterProxy pop: 3] "Leave rcvr on stack" ] -{ #category : #'primitives-renderer' } +{ #category : 'primitives-renderer' } B3DAcceleratorPlugin >> primitiveSetVerboseLevel [ | result level | @@ -879,7 +881,7 @@ B3DAcceleratorPlugin >> primitiveSetVerboseLevel [ interpreterProxy methodReturnInteger: result ] -{ #category : #'primitives-renderer' } +{ #category : 'primitives-renderer' } B3DAcceleratorPlugin >> primitiveSetViewport [ | h w y x handle | @@ -896,7 +898,7 @@ B3DAcceleratorPlugin >> primitiveSetViewport [ ifFalse:[interpreterProxy primitiveFail]] ] -{ #category : #'primitives-renderer' } +{ #category : 'primitives-renderer' } B3DAcceleratorPlugin >> primitiveSwapRendererBuffers [ | handle result | @@ -909,7 +911,7 @@ B3DAcceleratorPlugin >> primitiveSwapRendererBuffers [ ^interpreterProxy pop: 1. "pop arg; return rcvr" ] -{ #category : #'primitives-textures' } +{ #category : 'primitives-textures' } B3DAcceleratorPlugin >> primitiveTextureByteSex [ | handle result renderer | @@ -924,7 +926,7 @@ B3DAcceleratorPlugin >> primitiveTextureByteSex [ ^interpreterProxy pushBool: result. ] -{ #category : #'primitives-textures' } +{ #category : 'primitives-textures' } B3DAcceleratorPlugin >> primitiveTextureDepth [ | handle result renderer | @@ -939,7 +941,7 @@ B3DAcceleratorPlugin >> primitiveTextureDepth [ ^interpreterProxy pushInteger: result. ] -{ #category : #'primitives-textures' } +{ #category : 'primitives-textures' } B3DAcceleratorPlugin >> primitiveTextureGetColorMasks [ | handle masks array renderer | @@ -964,7 +966,7 @@ B3DAcceleratorPlugin >> primitiveTextureGetColorMasks [ ^interpreterProxy pop: 3 "pop args return receiver" ] -{ #category : #'primitives-textures' } +{ #category : 'primitives-textures' } B3DAcceleratorPlugin >> primitiveTextureSurfaceHandle [ | handle result renderer | @@ -979,7 +981,7 @@ B3DAcceleratorPlugin >> primitiveTextureSurfaceHandle [ ^interpreterProxy pushInteger: result ] -{ #category : #'primitives-textures' } +{ #category : 'primitives-textures' } B3DAcceleratorPlugin >> primitiveTextureUpload [ | h w d result form bits ppw bitsPtr handle renderer | @@ -1007,13 +1009,13 @@ B3DAcceleratorPlugin >> primitiveTextureUpload [ ^interpreterProxy pop: 3. "args; return rcvr" ] -{ #category : #'initialize-release' } +{ #category : 'initialize-release' } B3DAcceleratorPlugin >> shutdownModule [ ^self b3dxShutdown ] -{ #category : #'primitive support' } +{ #category : 'primitive support' } B3DAcceleratorPlugin >> stackLightArrayValue: stackIndex [ "Load an Array of B3DPrimitiveLights from the given stack index" | oop array arraySize | @@ -1031,7 +1033,7 @@ B3DAcceleratorPlugin >> stackLightArrayValue: stackIndex [ ^array ] -{ #category : #'primitive support' } +{ #category : 'primitive support' } B3DAcceleratorPlugin >> stackMaterialValue: stackIndex [ "Load a B3DMaterial from the given stack index" | oop | @@ -1045,7 +1047,7 @@ B3DAcceleratorPlugin >> stackMaterialValue: stackIndex [ ^nil ] -{ #category : #'primitive support' } +{ #category : 'primitive support' } B3DAcceleratorPlugin >> stackMatrix: index [ "Load a 4x4 transformation matrix from the interpreter stack. Return a pointer to the matrix data if successful, nil otherwise." @@ -1059,7 +1061,7 @@ B3DAcceleratorPlugin >> stackMatrix: index [ ^nil ] -{ #category : #'primitive support' } +{ #category : 'primitive support' } B3DAcceleratorPlugin >> stackPrimitiveIndexArray: stackIndex ofSize: nItems validate: aBool forVertexSize: maxIndex [ "Load a primitive index array from the interpreter stack. If aBool is true then check that all the indexes are in the range (1,maxIndex). @@ -1082,7 +1084,7 @@ B3DAcceleratorPlugin >> stackPrimitiveIndexArray: stackIndex ofSize: nItems vali ^idxPtr ] -{ #category : #'primitive support' } +{ #category : 'primitive support' } B3DAcceleratorPlugin >> stackPrimitiveVertexArray: index ofSize: nItems [ "Load a primitive vertex array from the interpreter stack. Return a pointer to the vertex data if successful, nil otherwise." diff --git a/smalltalksrc/VMMaker/BMPReadWriterPlugin.class.st b/smalltalksrc/VMMaker/BMPReadWriterPlugin.class.st index 7429fba80e..4e1c72cf36 100644 --- a/smalltalksrc/VMMaker/BMPReadWriterPlugin.class.st +++ b/smalltalksrc/VMMaker/BMPReadWriterPlugin.class.st @@ -2,12 +2,14 @@ A plugin to provide fast read and write of .bmp files " Class { - #name : #BMPReadWriterPlugin, - #superclass : #InterpreterPlugin, - #category : #'VMMaker-Plugins' + #name : 'BMPReadWriterPlugin', + #superclass : 'InterpreterPlugin', + #category : 'VMMaker-Plugins', + #package : 'VMMaker', + #tag : 'Plugins' } -{ #category : #primitives } +{ #category : 'primitives' } BMPReadWriterPlugin >> primitiveRead24BmpLine [ | width formBitsIndex formBitsOop pixelLineOop formBitsSize formBits pixelLineSize pixelLine | @@ -49,7 +51,7 @@ BMPReadWriterPlugin >> primitiveRead24BmpLine [ ] -{ #category : #primitives } +{ #category : 'primitives' } BMPReadWriterPlugin >> primitiveWrite24BmpLine [ | width formBitsIndex formBitsOop pixelLineOop formBitsSize formBits pixelLineSize pixelLine | diff --git a/smalltalksrc/VMMaker/BalloonArray.class.st b/smalltalksrc/VMMaker/BalloonArray.class.st index 632fd0c228..88f6863c72 100644 --- a/smalltalksrc/VMMaker/BalloonArray.class.st +++ b/smalltalksrc/VMMaker/BalloonArray.class.st @@ -2,30 +2,32 @@ BalloonArray keeps a shadow copy of its raw memory data in a Smalltalk array. This allows support for C's inhomogeneous access, returning floats where Floats were stored, and negative ints where they were stored. This ruse only works, of course where we have control over all the access. " Class { - #name : #BalloonArray, - #superclass : #CArray, + #name : 'BalloonArray', + #superclass : 'CArray', #instVars : [ 'simArray', 'simOffset' ], - #category : #'VMMaker-InterpreterSimulation' + #category : 'VMMaker-InterpreterSimulation', + #package : 'VMMaker', + #tag : 'InterpreterSimulation' } -{ #category : #'pointer arithmetic' } +{ #category : 'pointer arithmetic' } BalloonArray >> += increment [ super += increment. simOffset := simOffset + (increment / unitSize) ] -{ #category : #'pointer arithmetic' } +{ #category : 'pointer arithmetic' } BalloonArray >> -= increment [ super -= increment. simOffset := simOffset - (increment / unitSize) ] -{ #category : #'memory access' } +{ #category : 'memory access' } BalloonArray >> at: index [ | value | value := simArray at: index + simOffset. @@ -38,7 +40,7 @@ BalloonArray >> at: index [ ^value ] -{ #category : #'memory access' } +{ #category : 'memory access' } BalloonArray >> at: index put: value [ super at: index put: (self bitsOf: value). @@ -46,7 +48,7 @@ BalloonArray >> at: index put: value [ ] -{ #category : #'memory access' } +{ #category : 'memory access' } BalloonArray >> bitsOf: value [ "Convert pos and neg ints and floats to 32-bit representations expected by C" @@ -59,7 +61,7 @@ BalloonArray >> bitsOf: value [ ^ 0 ] -{ #category : #'memory access' } +{ #category : 'memory access' } BalloonArray >> floatAt: index [ | value | value := self at: index. @@ -70,7 +72,7 @@ BalloonArray >> floatAt: index [ ^ value ] -{ #category : #'memory access' } +{ #category : 'memory access' } BalloonArray >> floatAt: index put: value [ value isFloat @@ -78,7 +80,7 @@ BalloonArray >> floatAt: index put: value [ ^ self at: index put: value ] -{ #category : #'memory access' } +{ #category : 'memory access' } BalloonArray >> intAt: index [ | value | value := self at: index. @@ -87,7 +89,7 @@ BalloonArray >> intAt: index [ ^ value ] -{ #category : #'memory access' } +{ #category : 'memory access' } BalloonArray >> intAt: index put: value [ value isInteger @@ -95,7 +97,7 @@ BalloonArray >> intAt: index put: value [ ^ self at: index put: value ] -{ #category : #'memory access' } +{ #category : 'memory access' } BalloonArray >> setSimArray: anArray [ simArray := anArray. "Now sync the contents of the simArray with the actual work buffer. diff --git a/smalltalksrc/VMMaker/BitBlt.extension.st b/smalltalksrc/VMMaker/BitBlt.extension.st index 7cd755d9bf..261ae0eab7 100644 --- a/smalltalksrc/VMMaker/BitBlt.extension.st +++ b/smalltalksrc/VMMaker/BitBlt.extension.st @@ -1,16 +1,16 @@ -Extension { #name : #BitBlt } +Extension { #name : 'BitBlt' } -{ #category : #'*VMMaker-Interpreter' } +{ #category : '*VMMaker-Interpreter' } BitBlt >> copyBitsSimulated [ ^ BitBltSimulation copyBitsFrom: self ] -{ #category : #'*VMMaker-Interpreter' } +{ #category : '*VMMaker-Interpreter' } BitBlt >> copyBitsSimulated: alpha [ ^ BitBltSimulation copyBitsFrom: self ] -{ #category : #'*VMMaker-Interpreter' } +{ #category : '*VMMaker-Interpreter' } BitBlt >> simulatePrimitive: aString args: args [ "simulate primitives in RSqueak" | proxy bb | diff --git a/smalltalksrc/VMMaker/BitBltSimulation.class.st b/smalltalksrc/VMMaker/BitBltSimulation.class.st index a9b30a7865..15511f5bd9 100644 --- a/smalltalksrc/VMMaker/BitBltSimulation.class.st +++ b/smalltalksrc/VMMaker/BitBltSimulation.class.st @@ -43,8 +43,8 @@ To add a new rule to BitBlt... " Class { - #name : #BitBltSimulation, - #superclass : #SmartSyntaxInterpreterPlugin, + #name : 'BitBltSimulation', + #superclass : 'SmartSyntaxInterpreterPlugin', #instVars : [ 'destForm', 'sourceForm', @@ -176,10 +176,12 @@ Class { 'OpTableSize', 'RedIndex' ], - #category : #'VMMaker-Interpreter' + #category : 'VMMaker-Interpreter', + #package : 'VMMaker', + #tag : 'Interpreter' } -{ #category : #'system simulation' } +{ #category : 'system simulation' } BitBltSimulation class >> copyBitsFrom: aBitBlt [ "Simulate the copyBits primitive" | proxy bb | @@ -193,7 +195,7 @@ BitBltSimulation class >> copyBitsFrom: aBitBlt [ ^ proxy stackValue: 0 ] -{ #category : #translation } +{ #category : 'translation' } BitBltSimulation class >> declareCVarsIn: aCCodeGenerator [ "add option of fast path BitBLT code header" @@ -259,7 +261,7 @@ BitBltSimulation class >> declareCVarsIn: aCCodeGenerator [ [:ivar| aCCodeGenerator var: ivar type: #usqInt] ] -{ #category : #initialization } +{ #category : 'initialization' } BitBltSimulation class >> initialize [ "BitBltSimulation initialize" @@ -318,7 +320,7 @@ BitBltSimulation class >> initialize [ ColorMapNewStyle := 8. "new style color map" ] -{ #category : #initialization } +{ #category : 'initialization' } BitBltSimulation class >> initializeRuleTable [ "BitBltSimulation initializeRuleTable" "**WARNING** You MUST change initBBOpTable if you change this" @@ -371,29 +373,29 @@ BitBltSimulation class >> initializeRuleTable [ ] -{ #category : #translation } +{ #category : 'translation' } BitBltSimulation class >> moduleName [ ^'BitBltPlugin' ] -{ #category : #translation } +{ #category : 'translation' } BitBltSimulation class >> opTable [ ^ OpTable ] -{ #category : #translation } +{ #category : 'translation' } BitBltSimulation class >> requiredMethodNames: options [ ^self opTable asSet ] -{ #category : #'system simulation' } +{ #category : 'system simulation' } BitBltSimulation class >> simulatorClass [ ^BitBltSimulator ] -{ #category : #testing } +{ #category : 'testing' } BitBltSimulation class >> test2 [ "BitBltSimulation test2" | f | @@ -403,7 +405,7 @@ BitBltSimulation class >> test2 [ 0 to: 20 do: [:x | f displayOn: Display at: x * 13 @ (i * 10)]] ] -{ #category : #testing } +{ #category : 'testing' } BitBltSimulation class >> timingTest: extent [ "BitBltSimulation timingTest: 640@480" | f f2 map | @@ -416,7 +418,7 @@ BitBltSimulation class >> timingTest: extent [ with: (Time millisecondsToRun: [100 timesRepeat: [f copyBits: f boundingBox from: f2 at: 0 @ 0 colorMap: map]]) ] -{ #category : #'system simulation' } +{ #category : 'system simulation' } BitBltSimulation class >> warpBitsFrom: aBitBlt [ "Simulate the warpBits primitive" | proxy bb | @@ -432,7 +434,7 @@ BitBltSimulation class >> warpBitsFrom: aBitBlt [ ^proxy stackValue: 0 ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> OLDrgbDiff: sourceWord with: destinationWord [ "Subract the pixels in the source and destination, color by color, and return the sum of the absolute value of all the differences. @@ -472,7 +474,7 @@ BitBltSimulation >> OLDrgbDiff: sourceWord with: destinationWord [ ^ destinationWord "For no effect on dest" ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> OLDtallyIntoMap: sourceWord with: destinationWord [ "Tally pixels into the color map. Note that the source should be specified = destination, in order for the proper color map checks @@ -509,7 +511,7 @@ BitBltSimulation >> OLDtallyIntoMap: sourceWord with: destinationWord [ ^ destinationWord "For no effect on dest" ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> addWord: sourceWord with: destinationWord [ @@ -517,31 +519,31 @@ BitBltSimulation >> addWord: sourceWord with: destinationWord [ ^sourceWord + destinationWord ] -{ #category : #accessing } +{ #category : 'accessing' } BitBltSimulation >> affectedBottom [ ^affectedB ] -{ #category : #accessing } +{ #category : 'accessing' } BitBltSimulation >> affectedLeft [ ^affectedL ] -{ #category : #accessing } +{ #category : 'accessing' } BitBltSimulation >> affectedRight [ ^affectedR ] -{ #category : #accessing } +{ #category : 'accessing' } BitBltSimulation >> affectedTop [ ^affectedT ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> alphaBlend: sourceWord with: destinationWord [ "Blend sourceWord with destinationWord, assuming both are 32-bit pixels. The source is assumed to have 255*alpha in the high 8 bits of each pixel, @@ -579,7 +581,7 @@ BitBltSimulation >> alphaBlend: sourceWord with: destinationWord [ ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> alphaBlendConst: sourceWord with: destinationWord [ @@ -588,7 +590,7 @@ BitBltSimulation >> alphaBlendConst: sourceWord with: destinationWord [ ^ self alphaBlendConst: sourceWord with: destinationWord paintMode: false ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> alphaBlendConst: sourceWord with: destinationWord paintMode: paintMode [ "Blend sourceWord with destinationWord using a constant alpha. Alpha is encoded as 0 meaning 0.0, and 255 meaning 1.0. @@ -667,7 +669,7 @@ BitBltSimulation >> alphaBlendConst: sourceWord with: destinationWord paintMode: ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> alphaBlendScaled: sourceWord with: destinationWord [ "Blend sourceWord with destinationWord using the alpha value from sourceWord. Alpha is encoded as 0 meaning 0.0, and 255 meaning 1.0. @@ -692,7 +694,7 @@ BitBltSimulation >> alphaBlendScaled: sourceWord with: destinationWord [ ^ag bitOr: rb "recompose" ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> alphaPaintConst: sourceWord with: destinationWord [ @@ -702,7 +704,7 @@ BitBltSimulation >> alphaPaintConst: sourceWord with: destinationWord [ ^ self alphaBlendConst: sourceWord with: destinationWord paintMode: true ] -{ #category : #'inner loop' } +{ #category : 'inner loop' } BitBltSimulation >> alphaSourceBlendBits16 [ "This version assumes combinationRule = 34 @@ -779,7 +781,7 @@ BitBltSimulation >> alphaSourceBlendBits16 [ ]. ] -{ #category : #'inner loop' } +{ #category : 'inner loop' } BitBltSimulation >> alphaSourceBlendBits32 [ "This version assumes combinationRule = 34 @@ -857,7 +859,7 @@ BitBltSimulation >> alphaSourceBlendBits32 [ ]. ] -{ #category : #'inner loop' } +{ #category : 'inner loop' } BitBltSimulation >> alphaSourceBlendBits8 [ "This version assumes combinationRule = 34 @@ -935,7 +937,7 @@ BitBltSimulation >> alphaSourceBlendBits8 [ ]. ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> bitAnd: sourceWord with: destinationWord [ @@ -943,7 +945,7 @@ BitBltSimulation >> bitAnd: sourceWord with: destinationWord [ ^sourceWord bitAnd: destinationWord ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> bitAndInvert: sourceWord with: destinationWord [ @@ -951,7 +953,7 @@ BitBltSimulation >> bitAndInvert: sourceWord with: destinationWord [ ^sourceWord bitAnd: destinationWord bitInvert32 ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> bitInvertAnd: sourceWord with: destinationWord [ @@ -959,7 +961,7 @@ BitBltSimulation >> bitInvertAnd: sourceWord with: destinationWord [ ^sourceWord bitInvert32 bitAnd: destinationWord ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> bitInvertAndInvert: sourceWord with: destinationWord [ @@ -967,7 +969,7 @@ BitBltSimulation >> bitInvertAndInvert: sourceWord with: destinationWord [ ^sourceWord bitInvert32 bitAnd: destinationWord bitInvert32 ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> bitInvertDestination: sourceWord with: destinationWord [ @@ -975,7 +977,7 @@ BitBltSimulation >> bitInvertDestination: sourceWord with: destinationWord [ ^destinationWord bitInvert32 ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> bitInvertOr: sourceWord with: destinationWord [ @@ -983,7 +985,7 @@ BitBltSimulation >> bitInvertOr: sourceWord with: destinationWord [ ^sourceWord bitInvert32 bitOr: destinationWord ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> bitInvertOrInvert: sourceWord with: destinationWord [ @@ -991,7 +993,7 @@ BitBltSimulation >> bitInvertOrInvert: sourceWord with: destinationWord [ ^sourceWord bitInvert32 bitOr: destinationWord bitInvert32 ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> bitInvertSource: sourceWord with: destinationWord [ @@ -999,7 +1001,7 @@ BitBltSimulation >> bitInvertSource: sourceWord with: destinationWord [ ^sourceWord bitInvert32 ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> bitInvertXor: sourceWord with: destinationWord [ @@ -1007,7 +1009,7 @@ BitBltSimulation >> bitInvertXor: sourceWord with: destinationWord [ ^sourceWord bitInvert32 bitXor: destinationWord ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> bitOr: sourceWord with: destinationWord [ @@ -1015,7 +1017,7 @@ BitBltSimulation >> bitOr: sourceWord with: destinationWord [ ^sourceWord bitOr: destinationWord ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> bitOrInvert: sourceWord with: destinationWord [ @@ -1023,7 +1025,7 @@ BitBltSimulation >> bitOrInvert: sourceWord with: destinationWord [ ^sourceWord bitOr: destinationWord bitInvert32 ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> bitXor: sourceWord with: destinationWord [ @@ -1031,7 +1033,7 @@ BitBltSimulation >> bitXor: sourceWord with: destinationWord [ ^sourceWord bitXor: destinationWord ] -{ #category : #setup } +{ #category : 'setup' } BitBltSimulation >> checkSourceOverlap [ "check for possible overlap of source and destination" @@ -1059,7 +1061,7 @@ BitBltSimulation >> checkSourceOverlap [ destDelta := destPitch * vDir - (4 * (nWords * hDir)) ] ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> clearWord: sourceWord with: destinationWord [ @@ -1067,7 +1069,7 @@ BitBltSimulation >> clearWord: sourceWord with: destinationWord [ ^ 0 ] -{ #category : #setup } +{ #category : 'setup' } BitBltSimulation >> clipRange [ "clip and adjust source origin and extent appropriately" "first in x" @@ -1105,7 +1107,7 @@ BitBltSimulation >> clipRange [ ifTrue: [bbH := bbH - (sy + bbH - sourceHeight)] ] -{ #category : #setup } +{ #category : 'setup' } BitBltSimulation >> copyBits [ "This function is exported for the Balloon engine" @@ -1127,7 +1129,7 @@ BitBltSimulation >> copyBits [ self unlockSurfaces. ] -{ #category : #setup } +{ #category : 'setup' } BitBltSimulation >> copyBits: op Fallback: flags [ "Recover from the fast path specialised code saying Help-I-cant-cope" |done | @@ -1194,7 +1196,7 @@ BitBltSimulation >> copyBits: op Fallback: flags [ ] -{ #category : #setup } +{ #category : 'setup' } BitBltSimulation >> copyBitsFastPathSpecialised [ "Perform the actual copyBits operation using the fast path specialised code; fail some cases by falling back to normal code. Assume: Surfaces have been locked and clipping was performed." @@ -1276,7 +1278,7 @@ BitBltSimulation >> copyBitsFastPathSpecialised [ ] ] -{ #category : #setup } +{ #category : 'setup' } BitBltSimulation >> copyBitsFrom: startX to: stopX at: yValue [ "Support for the balloon engine." @@ -1288,7 +1290,7 @@ BitBltSimulation >> copyBitsFrom: startX to: stopX at: yValue [ self showDisplayBits. ] -{ #category : #setup } +{ #category : 'setup' } BitBltSimulation >> copyBitsLockedAndClipped [ "Perform the actual copyBits operation. Assume: Surfaces have been locked and clipping was performed." @@ -1332,7 +1334,7 @@ BitBltSimulation >> copyBitsLockedAndClipped [ affectedB := dy + 1]] ] -{ #category : #setup } +{ #category : 'setup' } BitBltSimulation >> copyBitsRule41Test [ "Test possible use of rule 41, rgbComponentAlpha:with: Nothing to return, just set up some variables" | gammaLookupTableOop ungammaLookupTableOop | @@ -1372,7 +1374,7 @@ BitBltSimulation >> copyBitsRule41Test [ ] -{ #category : #'inner loop' } +{ #category : 'inner loop' } BitBltSimulation >> copyLoop [ | prevWord thisWord skewWord halftoneWord mergeWord hInc y unskew skewMask notSkewMask mergeFnwith destWord | "This version of the inner loop assumes noSource = false." @@ -1551,7 +1553,7 @@ BitBltSimulation >> copyLoop [ self incDestIndex: destDelta]] ] -{ #category : #'inner loop' } +{ #category : 'inner loop' } BitBltSimulation >> copyLoopNoSource [ "Faster copyLoop when source not used. hDir and vDir are both positive, and perload and skew are unused" @@ -1611,7 +1613,7 @@ BitBltSimulation >> copyLoopNoSource [ self incDestIndex: destDelta] ] -{ #category : #'inner loop' } +{ #category : 'inner loop' } BitBltSimulation >> copyLoopPixMap [ "This version of the inner loop maps source pixels to a destination form with different depth. Because it is already @@ -1715,7 +1717,7 @@ BitBltSimulation >> copyLoopPixMap [ ] -{ #category : #'pixel mapping' } +{ #category : 'pixel mapping' } BitBltSimulation >> default8To32Table [ "Return the default translation table from 1..8 bit indexed colors to 32bit" "The table has been generated by the following statements" @@ -1770,7 +1772,7 @@ BitBltSimulation >> default8To32Table [ ^theTable ] -{ #category : #'pixel mapping' } +{ #category : 'pixel mapping' } BitBltSimulation >> deltaFrom: x1 to: x2 nSteps: n [ "Utility routine for computing Warp increments." @@ -1780,7 +1782,7 @@ BitBltSimulation >> deltaFrom: x1 to: x2 nSteps: n [ ^ 0 - (x1 - x2 + FixedPt1 // (n+1) + 1)] ] -{ #category : #setup } +{ #category : 'setup' } BitBltSimulation >> destMaskAndPointerInit [ "Compute masks for left and right destination words" | startBits pixPerM1 endBits | @@ -1815,7 +1817,7 @@ BitBltSimulation >> destMaskAndPointerInit [ destDelta := destPitch * vDir - (4 * (nWords * hDir)) "byte addr delta" ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> destinationWord: sourceWord with: destinationWord [ @@ -1823,7 +1825,7 @@ BitBltSimulation >> destinationWord: sourceWord with: destinationWord [ ^destinationWord ] -{ #category : #'pixel mapping' } +{ #category : 'pixel mapping' } BitBltSimulation >> dither32To16: srcWord threshold: ditherValue [ "Dither the given 32bit word to 16 bit. Ignore alpha." | addThreshold | @@ -1837,7 +1839,7 @@ BitBltSimulation >> dither32To16: srcWord threshold: ditherValue [ ] -{ #category : #'interpreter interface' } +{ #category : 'interpreter interface' } BitBltSimulation >> drawLoopX: xDelta Y: yDelta [ "This is the primitive implementation of the line-drawing loop. See the comments in BitBlt>>drawLoopX:Y:" @@ -1921,14 +1923,14 @@ BitBltSimulation >> drawLoopX: xDelta Y: yDelta [ interpreterProxy storeInteger: BBDestYIndex ofObject: bitBltOop withValue: destY. ] -{ #category : #'memory access' } +{ #category : 'memory access' } BitBltSimulation >> dstLongAt: idx [ self assert: idx asUnsignedInteger < endOfDestination. ^self long32At: idx ] -{ #category : #'memory access' } +{ #category : 'memory access' } BitBltSimulation >> dstLongAt: idx put: value [ "We omit the assert here since dstLongAt:put: is always preceded by a dstLongAt: which does have an assert. @@ -1936,7 +1938,7 @@ BitBltSimulation >> dstLongAt: idx put: value [ ^self long32At: idx put: value ] -{ #category : #'memory access' } +{ #category : 'memory access' } BitBltSimulation >> dstLongAt: idx put: srcValue mask: dstMask [ "Store the given value back into destination form, using dstMask to mask out the bits to be modified. This is an essential @@ -1949,7 +1951,7 @@ BitBltSimulation >> dstLongAt: idx put: srcValue mask: dstMask [ self dstLongAt: idx put: dstValue. ] -{ #category : #setup } +{ #category : 'setup' } BitBltSimulation >> ensureDestAndSourceFormsAreValid [ "If a GC has occurred, update destForm and sourceForm from the stack." @@ -1957,7 +1959,7 @@ BitBltSimulation >> ensureDestAndSourceFormsAreValid [ [self reloadDestAndSourceForms] ] -{ #category : #'pixel mapping' } +{ #category : 'pixel mapping' } BitBltSimulation >> expensiveDither32To16: srcWord threshold: ditherValue [ "Dither the given 32bit word to 16 bit. Ignore alpha." | pv threshold value out | @@ -1985,7 +1987,7 @@ BitBltSimulation >> expensiveDither32To16: srcWord threshold: ditherValue [ ^out ] -{ #category : #'interpreter interface' } +{ #category : 'interpreter interface' } BitBltSimulation >> fetchIntOrFloat: fieldIndex ofObject: objectPointer [ "Return the integer value of the given field of the given object. If the field contains a Float, truncate it and return its integral part. Fail if the given field does not contain a small integer or Float, or if the truncated Float is out of the range of small integers." | fieldOop floatValue | @@ -1999,7 +2001,7 @@ BitBltSimulation >> fetchIntOrFloat: fieldIndex ofObject: objectPointer [ ^floatValue asInteger ] -{ #category : #'interpreter interface' } +{ #category : 'interpreter interface' } BitBltSimulation >> fetchIntOrFloat: fieldIndex ofObject: objectPointer ifNil: defaultValue [ "Return the integer value of the given field of the given object. If the field contains a Float, truncate it and return its integral part. Fail if the given field does not contain a small integer or Float, or if the truncated Float is out of the range of small integers." | fieldOop floatValue | @@ -2014,7 +2016,7 @@ BitBltSimulation >> fetchIntOrFloat: fieldIndex ofObject: objectPointer ifNil: d ^floatValue asInteger ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> fixAlpha: sourceWord with: destinationWord [ "For any non-zero pixel value in destinationWord with zero alpha channel take the alpha from sourceWord and fill it in. Intended for fixing alpha channels left at zero during 16->32 bpp conversions." @@ -2027,14 +2029,14 @@ BitBltSimulation >> fixAlpha: sourceWord with: destinationWord [ ] -{ #category : #'memory access' } +{ #category : 'memory access' } BitBltSimulation >> halftoneAt: idx [ "Return a value from the halftone pattern." ^self long32At: halftoneBase + (idx \\ halftoneHeight * 4) ] -{ #category : #setup } +{ #category : 'setup' } BitBltSimulation >> ignoreSourceOrHalftone: formPointer [ formPointer = interpreterProxy nilObject ifTrue: [ ^true ]. @@ -2045,21 +2047,21 @@ BitBltSimulation >> ignoreSourceOrHalftone: formPointer [ ^false ] -{ #category : #'memory access' } +{ #category : 'memory access' } BitBltSimulation >> incDestIndex: offset [ ^destIndex := destIndex + offset ] -{ #category : #'memory access' } +{ #category : 'memory access' } BitBltSimulation >> incSrcIndex: offset [ ^sourceIndex := sourceIndex + offset ] -{ #category : #'initialize-release' } +{ #category : 'initialize-release' } BitBltSimulation >> initBBOpTable [ self cCode: 'opTable[0+1] = (void *)clearWordwith'. self cCode: 'opTable[1+1] = (void *)bitAndwith'. @@ -2105,7 +2107,7 @@ BitBltSimulation >> initBBOpTable [ self cCode: 'opTable[41+1] = (void *)rgbComponentAlphawith'. ] -{ #category : #'initialize-release' } +{ #category : 'initialize-release' } BitBltSimulation >> initDither8Lookup [ 0 to: 255 do: [:b | @@ -2115,7 +2117,7 @@ BitBltSimulation >> initDither8Lookup [ ] -{ #category : #'initialize-release' } +{ #category : 'initialize-release' } BitBltSimulation >> initialiseModule [ self initBBOpTable. @@ -2125,7 +2127,7 @@ BitBltSimulation >> initialiseModule [ ^true ] -{ #category : #'interpreter interface' } +{ #category : 'interpreter interface' } BitBltSimulation >> isIdentityMap: shifts with: masks [ "Return true if shiftTable/maskTable define an identity mapping." @@ -2143,7 +2145,7 @@ BitBltSimulation >> isIdentityMap: shifts with: masks [ ^false ] -{ #category : #'interpreter interface' } +{ #category : 'interpreter interface' } BitBltSimulation >> loadBitBltDestForm [ "Load the dest form for BitBlt. Answer false if anything is wrong, true otherwise." @@ -2187,7 +2189,7 @@ BitBltSimulation >> loadBitBltDestForm [ ^true ] -{ #category : #'interpreter interface' } +{ #category : 'interpreter interface' } BitBltSimulation >> loadBitBltFrom: bbObj [ "Load BitBlt from the oop. This function is exported for the Balloon engine." @@ -2195,7 +2197,7 @@ BitBltSimulation >> loadBitBltFrom: bbObj [ ^self loadBitBltFrom: bbObj warping: false. ] -{ #category : #'interpreter interface' } +{ #category : 'interpreter interface' } BitBltSimulation >> loadBitBltFrom: bbObj warping: aBool [ "Load context from BitBlt instance. Return false if anything is amiss" "NOTE this should all be changed to minX/maxX coordinates for simpler clipping @@ -2257,7 +2259,7 @@ BitBltSimulation >> loadBitBltFrom: bbObj warping: aBool [ ^true ] -{ #category : #'interpreter interface' } +{ #category : 'interpreter interface' } BitBltSimulation >> loadBitBltSourceForm [ "Load the source form for BitBlt. Return false if anything is wrong, true otherwise." | sourceBitsSize | @@ -2300,7 +2302,7 @@ BitBltSimulation >> loadBitBltSourceForm [ ^true ] -{ #category : #'interpreter interface' } +{ #category : 'interpreter interface' } BitBltSimulation >> loadColorMap [ "ColorMap, if not nil, must be longWords, and 2^N long, where N = sourceDepth for 1, 2, 4, 8 bits, @@ -2356,7 +2358,7 @@ BitBltSimulation >> loadColorMap [ ^true ] -{ #category : #'interpreter interface' } +{ #category : 'interpreter interface' } BitBltSimulation >> loadColorMapShiftOrMaskFrom: mapOop [ mapOop = interpreterProxy nilObject ifTrue:[^nil]. @@ -2366,7 +2368,7 @@ BitBltSimulation >> loadColorMapShiftOrMaskFrom: mapOop [ ^interpreterProxy firstIndexableField: mapOop ] -{ #category : #'interpreter interface' } +{ #category : 'interpreter interface' } BitBltSimulation >> loadHalftoneForm [ "Load the halftone form" | halftoneBits | @@ -2392,7 +2394,7 @@ BitBltSimulation >> loadHalftoneForm [ ^true ] -{ #category : #'surface support' } +{ #category : 'surface support' } BitBltSimulation >> loadSurfacePlugin [ "Load the surface support plugin" querySurfaceFn := interpreterProxy ioLoadFunction:'ioGetSurfaceFormat' From:'SurfacePlugin'. @@ -2401,19 +2403,19 @@ BitBltSimulation >> loadSurfacePlugin [ ^querySurfaceFn ~= 0 and:[lockSurfaceFn ~= 0 and:[unlockSurfaceFn ~= 0]] ] -{ #category : #'interpreter interface' } +{ #category : 'interpreter interface' } BitBltSimulation >> loadWarpBltFrom: bbObj [ ^self loadBitBltFrom: bbObj warping: true ] -{ #category : #'surface support' } +{ #category : 'surface support' } BitBltSimulation >> lockSurfaceFn: sourceHandle _: pitchPtr _: x _: y _: w _: h [ "Simulate the lockSurfaceFn function call as a failure to load the surface." ^0 ] -{ #category : #'surface support' } +{ #category : 'surface support' } BitBltSimulation >> lockSurfaces [ "Get a pointer to the bits of any OS surfaces." "Notes: @@ -2538,7 +2540,7 @@ BitBltSimulation >> lockSurfaces [ ^destBits ~= 0 and: [sourceBits ~= 0 or: [noSource]] ] -{ #category : #'color mapping' } +{ #category : 'color mapping' } BitBltSimulation >> mapPixel: sourcePixel flags: mapperFlags [ "Color map the given source pixel." | pv | @@ -2555,7 +2557,7 @@ BitBltSimulation >> mapPixel: sourcePixel flags: mapperFlags [ ^pv ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> merge: sourceWord with: destinationWord [ | mergeFnwith | "Sender warpLoop is too big to include this in-line" @@ -2569,7 +2571,7 @@ BitBltSimulation >> merge: sourceWord with: destinationWord [ ^ self mergeFn: sourceWord with: destinationWord ] -{ #category : #'initialize-release' } +{ #category : 'initialize-release' } BitBltSimulation >> moduleUnloaded: aModuleName [ "The module with the given name was just unloaded. Make sure we have no dangling references." @@ -2581,7 +2583,7 @@ BitBltSimulation >> moduleUnloaded: aModuleName [ unlockSurfaceFn := 0] ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> partitionedAND: word1 to: word2 nBits: nBits nPartitions: nParts [ "AND word1 to word2 as nParts partitions of nBits each. Any field of word1 not all-ones is treated as all-zeroes. @@ -2602,7 +2604,7 @@ BitBltSimulation >> partitionedAND: word1 to: word2 nBits: nBits nPartitions: nP ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> partitionedAdd: word1 to: word2 nBits: nBits componentMask: componentMask carryOverflowMask: carryOverflowMask [ "Add word1 to word2 as nParts partitions of nBits each. This is useful for packed pixels, or packed colors" @@ -2625,7 +2627,7 @@ BitBltSimulation >> partitionedAdd: word1 to: word2 nBits: nBits componentMask: bitOr: carryOverflow>>(nBits-1) * componentMask "saturate in case of overflow" ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> partitionedMax: word1 with: word2 nBits: nBits nPartitions: nParts [ "Max word1 to word2 as nParts partitions of nBits each" | mask result | @@ -2647,7 +2649,7 @@ BitBltSimulation >> partitionedMax: word1 with: word2 nBits: nBits nPartitions: ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> partitionedMin: word1 with: word2 nBits: nBits nPartitions: nParts [ "Min word1 to word2 as nParts partitions of nBits each" | mask result | @@ -2669,7 +2671,7 @@ BitBltSimulation >> partitionedMin: word1 with: word2 nBits: nBits nPartitions: ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> partitionedMul: word1 with: word2 nBits: nBits nPartitions: nParts [ "Multiply word1 with word2 as nParts partitions of nBits each. This is useful for packed pixels, or packed colors. @@ -2715,7 +2717,7 @@ BitBltSimulation >> partitionedMul: word1 with: word2 nBits: nBits nPartitions: ^ result" ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> partitionedRgbComponentAlpha: sourceWord dest: destWord nBits: nBits nPartitions: nParts [ | mask result p1 p2 v | @@ -2750,7 +2752,7 @@ BitBltSimulation >> partitionedRgbComponentAlpha: sourceWord dest: destWord nBit ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> partitionedSub: word1 from: word2 nBits: nBits nPartitions: nParts [ "Subtract word1 from word2 as nParts partitions of nBits each. This is useful for packed pixels, or packed colors" @@ -2779,7 +2781,7 @@ BitBltSimulation >> partitionedSub: word1 from: word2 nBits: nBits nPartitions: ] -{ #category : #setup } +{ #category : 'setup' } BitBltSimulation >> performCopyLoop [ "Based on the values provided during setup choose and perform the appropriate inner loop function." @@ -2799,7 +2801,7 @@ BitBltSimulation >> performCopyLoop [ self copyLoop]] ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> pickSourcePixels: nPixels flags: mapperFlags srcMask: srcMask destMask: dstMask srcShiftInc: srcShiftInc dstShiftInc: dstShiftInc [ "Pick nPix pixels starting at srcBitIndex from the source, map by the color map, and justify them according to dstBitIndex in the resulting destWord." @@ -2845,7 +2847,7 @@ BitBltSimulation >> pickSourcePixels: nPixels flags: mapperFlags srcMask: srcMas ] -{ #category : #'pixel mapping' } +{ #category : 'pixel mapping' } BitBltSimulation >> pickWarpPixelAtX: xx y: yy [ "Pick a single pixel from the source for WarpBlt. Note: This method is crucial for WarpBlt speed w/o smoothing @@ -2874,7 +2876,7 @@ BitBltSimulation >> pickWarpPixelAtX: xx y: yy [ ^sourcePix ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> pixClear: sourceWord with: destinationWord [ "Clear all pixels in destinationWord for which the pixels of sourceWord have the same values. Used to clear areas of some constant color to zero." | mask result nBits pv | @@ -2899,7 +2901,7 @@ BitBltSimulation >> pixClear: sourceWord with: destinationWord [ ^ result ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> pixMask: sourceWord with: destinationWord [ @@ -2909,7 +2911,7 @@ BitBltSimulation >> pixMask: sourceWord with: destinationWord [ nBits: destDepth nPartitions: destPPW ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> pixPaint: sourceWord with: destinationWord [ @@ -2921,7 +2923,7 @@ BitBltSimulation >> pixPaint: sourceWord with: destinationWord [ nBits: destDepth nPartitions: destPPW) ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> pixSwap: sourceWord with: destWord [ "Swap the pixels in destWord" | result shift lowMask highMask | @@ -2951,7 +2953,7 @@ BitBltSimulation >> pixSwap: sourceWord with: destWord [ ^result ] -{ #category : #primitives } +{ #category : 'primitives' } BitBltSimulation >> primitiveCompareColorA: colorA to: colorB test: testID [ "Invoke the pixel color comparing primitive.Only applicable if compiling with ENABLE_FAST_BLT" @@ -2995,7 +2997,7 @@ BitBltSimulation >> primitiveCompareColorA: colorA to: colorB test: testID [ ifFalse: [interpreterProxy primitiveFail] ] -{ #category : #primitives } +{ #category : 'primitives' } BitBltSimulation >> primitiveCopyBits [ "Invoke the copyBits primitive. If the destination is the display, then copy it to the screen." | rcvr | @@ -3012,7 +3014,7 @@ BitBltSimulation >> primitiveCopyBits [ ifFalse: [interpreterProxy methodReturnReceiver] ] -{ #category : #primitives } +{ #category : 'primitives' } BitBltSimulation >> primitiveDisplayString [ | kernDelta xTable glyphMap stopIndex startIndex sourceString bbObj maxGlyph ascii glyphIndex sourcePtr left quickBlt | @@ -3095,7 +3097,7 @@ BitBltSimulation >> primitiveDisplayString [ interpreterProxy pop: 6 "pop args, return rcvr" ] -{ #category : #primitives } +{ #category : 'primitives' } BitBltSimulation >> primitiveDrawLoop [ "Invoke the line drawing primitive." | rcvr xDelta yDelta | @@ -3110,7 +3112,7 @@ BitBltSimulation >> primitiveDrawLoop [ interpreterProxy failed ifFalse:[interpreterProxy pop: 2]. ] -{ #category : #primitives } +{ #category : 'primitives' } BitBltSimulation >> primitivePixelValueAtX: xVal y: yVal [ "returns the single pixel at x@y. It does not handle LSB bitmaps right now. @@ -3156,7 +3158,7 @@ BitBltSimulation >> primitivePixelValueAtX: xVal y: yVal [ ] -{ #category : #primitives } +{ #category : 'primitives' } BitBltSimulation >> primitiveWarpBits [ "Invoke the warpBits primitive. If the destination is the display, then copy it to the screen." | rcvr | @@ -3171,7 +3173,7 @@ BitBltSimulation >> primitiveWarpBits [ interpreterProxy methodReturnReceiver ] -{ #category : #'surface support' } +{ #category : 'surface support' } BitBltSimulation >> querySurfaceFn: handle _: widthPtr _: heightPtr _: depthPtr _: endianPtr [ "Query the dimension of an OS surface. This method is provided so that in case the inst vars of the @@ -3183,7 +3185,7 @@ BitBltSimulation >> querySurfaceFn: handle _: widthPtr _: heightPtr _: depthPtr ^false ] -{ #category : #setup } +{ #category : 'setup' } BitBltSimulation >> reloadDestAndSourceForms [ "A GC has occurred. The destForm must be updated. But where to derive it from? For copyBits and warpBits it is derived from the receiver. But for a BalloonEnginePlugin @@ -3197,7 +3199,7 @@ BitBltSimulation >> reloadDestAndSourceForms [ sourceForm := interpreterProxy fetchPointer: BBSourceFormIndex ofObject: receiver ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> rgbAdd: sourceWord with: destinationWord [ @@ -3226,7 +3228,7 @@ BitBltSimulation >> rgbAdd: sourceWord with: destinationWord [ nBits: 8 componentMask: componentMask carryOverflowMask: carryOverflowMask] ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> rgbComponentAlpha16 [ "This version assumes combinationRule = 41 @@ -3296,7 +3298,7 @@ BitBltSimulation >> rgbComponentAlpha16 [ ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> rgbComponentAlpha32 [ "This version assumes combinationRule = 41 @@ -3362,7 +3364,7 @@ BitBltSimulation >> rgbComponentAlpha32 [ ]. ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> rgbComponentAlpha32: sourceWord with: destinationWord [ " componentAlphaModeColor is the color, @@ -3447,7 +3449,7 @@ BitBltSimulation >> rgbComponentAlpha32: sourceWord with: destinationWord [ ^answer ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> rgbComponentAlpha8 [ "This version assumes combinationRule = 41 @@ -3532,7 +3534,7 @@ BitBltSimulation >> rgbComponentAlpha8 [ ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> rgbComponentAlpha: sourceWord with: destinationWord [ " componentAlphaModeColor is the color, @@ -3556,7 +3558,7 @@ BitBltSimulation >> rgbComponentAlpha: sourceWord with: destinationWord [ ^self partitionedRgbComponentAlpha: sourceWord dest: destinationWord nBits: destDepth nPartitions: destPPW. ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> rgbDiff: sourceWord with: destinationWord [ "Subract the pixels in the source and destination, color by color, and return the sum of the absolute value of all the differences. @@ -3601,7 +3603,7 @@ BitBltSimulation >> rgbDiff: sourceWord with: destinationWord [ ] -{ #category : #'color mapping' } +{ #category : 'color mapping' } BitBltSimulation >> rgbMap16To32: sourcePixel [ "Convert the given 16bit pixel value to a 32bit RGBA value. Note: This method is intended to deal with different source formats." @@ -3610,14 +3612,14 @@ BitBltSimulation >> rgbMap16To32: sourcePixel [ ((sourcePixel bitAnd: 16r7C00) << 9) ] -{ #category : #'color mapping' } +{ #category : 'color mapping' } BitBltSimulation >> rgbMap32To32: sourcePixel [ "Convert the given 32bit pixel value to a 32bit RGBA value. Note: This method is intended to deal with different source formats." ^sourcePixel "For now do it simple" ] -{ #category : #'pixel mapping' } +{ #category : 'pixel mapping' } BitBltSimulation >> rgbMap: sourcePixel from: nBitsIn to: nBitsOut [ "Convert the given pixel value with nBitsIn bits for each color component to a pixel value with nBitsOut bits for each color component. Typical values for nBitsIn/nBitsOut are 3, 5, or 8." | mask d srcPix destPix | @@ -3658,7 +3660,7 @@ BitBltSimulation >> rgbMap: sourcePixel from: nBitsIn to: nBitsOut [ ^ destPix] ] -{ #category : #'color mapping' } +{ #category : 'color mapping' } BitBltSimulation >> rgbMapPixel: sourcePixel flags: mapperFlags [ "Perform the RGBA conversion for the given source pixel" | val | @@ -3670,7 +3672,7 @@ BitBltSimulation >> rgbMapPixel: sourcePixel flags: mapperFlags [ ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> rgbMax: sourceWord with: destinationWord [ @@ -3692,7 +3694,7 @@ BitBltSimulation >> rgbMax: sourceWord with: destinationWord [ nBits: 8 nPartitions: 4] ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> rgbMin: sourceWord with: destinationWord [ @@ -3714,7 +3716,7 @@ BitBltSimulation >> rgbMin: sourceWord with: destinationWord [ nBits: 8 nPartitions: 4] ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> rgbMinInvert: wordToInvert with: destinationWord [ | sourceWord | @@ -3739,7 +3741,7 @@ BitBltSimulation >> rgbMinInvert: wordToInvert with: destinationWord [ nBits: 8 nPartitions: 4] ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> rgbMul: sourceWord with: destinationWord [ @@ -3766,7 +3768,7 @@ BitBltSimulation >> rgbMul: sourceWord with: destinationWord [ MessageTally time: [0 to: 760 by: 4 do: [:y |scanner drawString: 'qwrepoiuasfd=)(/&()=#!lkjzxv.,mn124+09857907QROIYTOAFDJZXNBNB,M-.,Mqwrepoiuasfd=)(/&()=#!lkjzxv.,mn124+09857907QROIYTOAFDJZXNBNB,M-.,M1234124356785678' at: 0@y]]. " ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> rgbSub: sourceWord with: destinationWord [ @@ -3788,7 +3790,7 @@ BitBltSimulation >> rgbSub: sourceWord with: destinationWord [ nBits: 8 nPartitions: 4] ] -{ #category : #'interpreter interface' } +{ #category : 'interpreter interface' } BitBltSimulation >> setupColorMasks [ "WARNING: For WarpBlt w/ smoothing the source depth is wrong here!" | bits targetBits | @@ -3807,7 +3809,7 @@ BitBltSimulation >> setupColorMasks [ self setupColorMasksFrom: bits to: targetBits ] -{ #category : #'interpreter interface' } +{ #category : 'interpreter interface' } BitBltSimulation >> setupColorMasksFrom: srcBits to: targetBits [ "Setup color masks for converting an incoming RGB pixel value from srcBits to targetBits." | mask shifts masks deltaBits | @@ -3844,7 +3846,7 @@ BitBltSimulation >> setupColorMasksFrom: srcBits to: targetBits [ ] -{ #category : #'interpreter interface' } +{ #category : 'interpreter interface' } BitBltSimulation >> showDisplayBits [ self ensureDestAndSourceFormsAreValid. interpreterProxy @@ -3855,7 +3857,7 @@ BitBltSimulation >> showDisplayBits [ Bottom: affectedB ] -{ #category : #setup } +{ #category : 'setup' } BitBltSimulation >> sourceSkewAndPointerInit [ "This is only used when source and dest are same depth, ie, when the barrel-shift copy loop is used." @@ -3892,7 +3894,7 @@ BitBltSimulation >> sourceSkewAndPointerInit [ self assert: (skew between: -31 and: 31) ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> sourceWord: sourceWord with: destinationWord [ @@ -3900,14 +3902,14 @@ BitBltSimulation >> sourceWord: sourceWord with: destinationWord [ ^sourceWord ] -{ #category : #'memory access' } +{ #category : 'memory access' } BitBltSimulation >> srcLongAt: idx [ self assert: idx asUnsignedInteger < endOfSource. ^self long32At: idx ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> subWord: sourceWord with: destinationWord [ @@ -3915,7 +3917,7 @@ BitBltSimulation >> subWord: sourceWord with: destinationWord [ ^sourceWord - destinationWord ] -{ #category : #'combination rules' } +{ #category : 'combination rules' } BitBltSimulation >> tallyIntoMap: sourceWord with: destinationWord [ "Tally pixels into the color map. Those tallied are exactly those in the destination rectangle. Note that the source should be @@ -3951,21 +3953,21 @@ BitBltSimulation >> tallyIntoMap: sourceWord with: destinationWord [ ^ destinationWord "For no effect on dest" ] -{ #category : #'memory access' } +{ #category : 'memory access' } BitBltSimulation >> tallyMapAt: idx [ "Return the word at position idx from the colorMap" ^cmLookupTable at: (idx bitAnd: cmMask) ] -{ #category : #'memory access' } +{ #category : 'memory access' } BitBltSimulation >> tallyMapAt: idx put: value [ "Store the word at position idx in the colorMap" ^cmLookupTable at: (idx bitAnd: cmMask) put: value ] -{ #category : #setup } +{ #category : 'setup' } BitBltSimulation >> tryCopyingBitsQuickly [ "Shortcut for stuff that's being run from the balloon engine. Since we do this at each scan line we should avoid the expensive @@ -4025,7 +4027,7 @@ BitBltSimulation >> tryCopyingBitsQuickly [ ^true ] -{ #category : #'surface support' } +{ #category : 'surface support' } BitBltSimulation >> unlockSurfaces [ "Unlock the bits of any OS surfaces." "See the comment in lockSurfaces. Similar rules apply. That is, the area provided in ioUnlockSurface @@ -4059,7 +4061,7 @@ BitBltSimulation >> unlockSurfaces [ hasSurfaceLock := false ] -{ #category : #setup } +{ #category : 'setup' } BitBltSimulation >> warpBits [ | ns | @@ -4088,7 +4090,7 @@ BitBltSimulation >> warpBits [ self unlockSurfaces. ] -{ #category : #'inner loop' } +{ #category : 'inner loop' } BitBltSimulation >> warpLoop [ "This version of the inner loop traverses an arbirary quadrilateral source, thus producing a general affine transformation." @@ -4241,7 +4243,7 @@ BitBltSimulation >> warpLoop [ self incDestIndex: destDelta] ] -{ #category : #'pixel mapping' } +{ #category : 'pixel mapping' } BitBltSimulation >> warpLoopSetup [ "Setup values for faster pixel fetching." | words | @@ -4272,7 +4274,7 @@ BitBltSimulation >> warpLoopSetup [ ] -{ #category : #'pixel mapping' } +{ #category : 'pixel mapping' } BitBltSimulation >> warpPickSmoothPixels: nPixels xDeltah: xDeltah yDeltah: yDeltah xDeltav: xDeltav yDeltav: yDeltav @@ -4352,7 +4354,7 @@ BitBltSimulation >> warpPickSmoothPixels: nPixels ] -{ #category : #'pixel mapping' } +{ #category : 'pixel mapping' } BitBltSimulation >> warpPickSourcePixels: nPixels xDeltah: xDeltah yDeltah: yDeltah xDeltav: xDeltav yDeltav: yDeltav diff --git a/smalltalksrc/VMMaker/BitBltSimulator.class.st b/smalltalksrc/VMMaker/BitBltSimulator.class.st index d200536fb4..34ec5b3617 100644 --- a/smalltalksrc/VMMaker/BitBltSimulator.class.st +++ b/smalltalksrc/VMMaker/BitBltSimulator.class.st @@ -20,8 +20,8 @@ destinationHashes and comparing against results in the regressed version. " Class { - #name : #BitBltSimulator, - #superclass : #BitBltSimulation, + #name : 'BitBltSimulator', + #superclass : 'BitBltSimulation', #instVars : [ 'destinationHashes', 'copyBitsCount', @@ -37,34 +37,36 @@ Class { 'dither8Lookup', 'isInitialised' ], - #category : #'VMMaker-InterpreterSimulation' + #category : 'VMMaker-InterpreterSimulation', + #package : 'VMMaker', + #tag : 'InterpreterSimulation' } -{ #category : #accessing } +{ #category : 'accessing' } BitBltSimulator class >> dither8Lookup [ ^ dither8Lookup ] -{ #category : #accessing } +{ #category : 'accessing' } BitBltSimulator class >> ditherMatrix4x4 [ ^ ditherMatrix4x4 ] -{ #category : #accessing } +{ #category : 'accessing' } BitBltSimulator class >> ditherThresholds16 [ ^ ditherThresholds16 ] -{ #category : #accessing } +{ #category : 'accessing' } BitBltSimulator class >> ditherValues16 [ ^ ditherValues16 ] -{ #category : #'class initialization' } +{ #category : 'class initialization' } BitBltSimulator class >> initialize [ "self initialize" super initialize. @@ -72,42 +74,42 @@ BitBltSimulator class >> initialize [ ] -{ #category : #accessing } +{ #category : 'accessing' } BitBltSimulator class >> isInitialised [ ^ isInitialised ] -{ #category : #accessing } +{ #category : 'accessing' } BitBltSimulator class >> maskTable [ ^ maskTable ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } BitBltSimulator class >> new [ ^super new ] -{ #category : #accessing } +{ #category : 'accessing' } BitBltSimulator class >> setInitialised [ isInitialised := true. ] -{ #category : #translation } +{ #category : 'translation' } BitBltSimulator class >> shouldBeTranslated [ "This class should not be translated " ^false ] -{ #category : #accessing } +{ #category : 'accessing' } BitBltSimulator class >> warpBitShiftTable [ ^ warpBitShiftTable ] -{ #category : #'debug support' } +{ #category : 'debug support' } BitBltSimulator >> copyBits [ (destinationHashes notNil and: [copyBitsCount + 1 = copyBitsBreakCount]) ifTrue: [self halt: 'reached copyBitsBreakCount ', copyBitsBreakCount printString]. @@ -123,31 +125,31 @@ BitBltSimulator >> copyBits [ [destinationHashes addLast: self destinationHash]] ] -{ #category : #'debug support' } +{ #category : 'debug support' } BitBltSimulator >> copyBitsBreakCount [ ^ copyBitsBreakCount ] -{ #category : #'debug support' } +{ #category : 'debug support' } BitBltSimulator >> copyBitsBreakCount: anObject [ copyBitsBreakCount := anObject ] -{ #category : #'debug support' } +{ #category : 'debug support' } BitBltSimulator >> copyBitsCount [ ^ copyBitsCount ] -{ #category : #'debug support' } +{ #category : 'debug support' } BitBltSimulator >> copyBitsCount: anObject [ copyBitsCount := anObject ] -{ #category : #'translation support' } +{ #category : 'translation support' } BitBltSimulator >> cppIf: conditionBlockOrSymbolValue ifTrue: trueExpressionOrBlock ifFalse: falseExpressionOrBlockOrNil [ "The simulator does not have fast blt defines" ^ conditionBlockOrSymbolValue == #'ENABLE_FAST_BLT' @@ -158,7 +160,7 @@ BitBltSimulator >> cppIf: conditionBlockOrSymbolValue ifTrue: trueExpressionOrBl ifFalse: falseExpressionOrBlockOrNil] ] -{ #category : #'debug support' } +{ #category : 'debug support' } BitBltSimulator >> destinationHash [ | mem bits | mem := interpreterProxy memory. @@ -169,13 +171,13 @@ BitBltSimulator >> destinationHash [ ^bits hash ] -{ #category : #'debug support' } +{ #category : 'debug support' } BitBltSimulator >> destinationHashes [ ^ destinationHashes ] -{ #category : #'debug support' } +{ #category : 'debug support' } BitBltSimulator >> destinationHashes: anObject [ destinationHashes := anObject. @@ -183,28 +185,28 @@ BitBltSimulator >> destinationHashes: anObject [ copyBitsBreakCount ifNil: [copyBitsBreakCount := -1] ] -{ #category : #'debug support' } +{ #category : 'debug support' } BitBltSimulator >> dstLongAt: dstIndex [ interpreterProxy isInterpreterProxy ifTrue: [^dstIndex long32At: 0]. ^super dstLongAt: dstIndex ] -{ #category : #'debug support' } +{ #category : 'debug support' } BitBltSimulator >> dstLongAt: dstIndex put: value [ interpreterProxy isInterpreterProxy ifTrue: [^dstIndex long32At: 0 put: value]. ^super dstLongAt: dstIndex put: value ] -{ #category : #'memory access' } +{ #category : 'memory access' } BitBltSimulator >> halftoneAt: idx [ interpreterProxy isInterpreterProxy ifTrue: [^(halftoneBase + (idx \\ halftoneHeight * 4)) long32At: 0]. ^super halftoneAt: idx ] -{ #category : #'memory access' } +{ #category : 'memory access' } BitBltSimulator >> incDestIndex: offset [ "if offset is a CObject, this avoids a copy, making the simulation massively faster" ^ destIndex isCObjectAccessor @@ -213,7 +215,7 @@ BitBltSimulator >> incDestIndex: offset [ ] -{ #category : #'memory access' } +{ #category : 'memory access' } BitBltSimulator >> incSrcIndex: offset [ "if offset is a CObject, this avoids a copy, making the simulation massively faster" ^ sourceIndex isCObjectAccessor @@ -222,7 +224,7 @@ BitBltSimulator >> incSrcIndex: offset [ ] -{ #category : #simulation } +{ #category : 'simulation' } BitBltSimulator >> initBBOpTable [ opTable := OpTable. maskTable := Array new: 32. @@ -231,7 +233,7 @@ BitBltSimulator >> initBBOpTable [ warpBitShiftTable := CArrayAccessor on: (Array new: 32). ] -{ #category : #'initialize-release' } +{ #category : 'initialize-release' } BitBltSimulator >> initialiseModule [ self class isInitialised ifFalse: [| ivars | @@ -249,7 +251,7 @@ BitBltSimulator >> initialiseModule [ ^true ] -{ #category : #simulation } +{ #category : 'simulation' } BitBltSimulator >> initializeDitherTables [ ditherMatrix4x4 := CArrayAccessor on: #( 0 8 2 10 @@ -263,22 +265,22 @@ BitBltSimulator >> initializeDitherTables [ dither8Lookup := CArrayAccessor on: (Array new: 4096). ] -{ #category : #'memory access' } +{ #category : 'memory access' } BitBltSimulator >> long32At: byteAddress [ ^interpreterProxy long32At: byteAddress ] -{ #category : #'memory access' } +{ #category : 'memory access' } BitBltSimulator >> long32At: byteAddress put: a32BitValue [ ^interpreterProxy long32At: byteAddress put: a32BitValue ] -{ #category : #simulation } +{ #category : 'simulation' } BitBltSimulator >> mergeFn: arg1 with: arg2 [ ^ self perform: (opTable at: combinationRule+1) with: arg1 with: arg2 ] -{ #category : #simulation } +{ #category : 'simulation' } BitBltSimulator >> primitive: primitiveName parameters: parameterTypesArray receiver: rcvrType [ "This exists just to check the set of methods that use smart syntax for which marshallers have been written. If a case cannot be found you'll have to write @@ -293,7 +295,7 @@ BitBltSimulator >> primitive: primitiveName parameters: parameterTypesArray rece ['primitiveCompareColors'] -> [^self] } ] -{ #category : #primitives } +{ #category : 'primitives' } BitBltSimulator >> primitiveCompareColors [ "This is a hack to mimic the SmartSyntaxPlugin support for primitive:parameters:receiver: which is hacked here at BitBltSimulator>>primitive:parameters:receiver:" @@ -310,7 +312,7 @@ BitBltSimulator >> primitiveCompareColors [ [self primitiveCompareColorA: colorA to: colorB test: testID] ] -{ #category : #primitives } +{ #category : 'primitives' } BitBltSimulator >> primitiveCopyBits [ "Override to provide a convenience to investigate primitive failures. Comment out the first statement to be able to loop, examining e.g. why a BitBlt fails to load." @@ -321,7 +323,7 @@ BitBltSimulator >> primitiveCopyBits [ [self halt. interpreterProxy coInterpreter initPrimCall] ] -{ #category : #primitives } +{ #category : 'primitives' } BitBltSimulator >> primitivePixelValueAt [ "This is a hack to mimic the SmartSyntaxPlugin support for primitive:parameters:receiver: which is hacked here at BitBltSimulator>>primitive:parameters:receiver:" @@ -332,7 +334,7 @@ BitBltSimulator >> primitivePixelValueAt [ [self primitivePixelValueAtX: xVal y: yVal] ] -{ #category : #'debug support' } +{ #category : 'debug support' } BitBltSimulator >> srcLongAt: srcIndex [ interpreterProxy isInterpreterProxy ifTrue: [^srcIndex long32At: 0]. diff --git a/smalltalksrc/VMMaker/Bitmap.extension.st b/smalltalksrc/VMMaker/Bitmap.extension.st index 9a44c7f6a4..b59f574137 100644 --- a/smalltalksrc/VMMaker/Bitmap.extension.st +++ b/smalltalksrc/VMMaker/Bitmap.extension.st @@ -1,12 +1,12 @@ -Extension { #name : #Bitmap } +Extension { #name : 'Bitmap' } -{ #category : #'*VMMaker-interpreter simulator' } +{ #category : '*VMMaker-interpreter simulator' } Bitmap >> coerceTo: cTypeString sim: interpreter [ ^ self ] -{ #category : #'*VMMaker-JITSimulation' } +{ #category : '*VMMaker-JITSimulation' } Bitmap >> long64At: byteAddress [ | lowBits hiWord loWord midWord mask wordIndex result signBit | wordIndex := byteAddress - 1 // 4 + 1. @@ -32,7 +32,7 @@ Bitmap >> long64At: byteAddress [ ^result ] -{ #category : #'*VMMaker-JITSimulation' } +{ #category : '*VMMaker-JITSimulation' } Bitmap >> long64At: byteIndex put: aValue [ | lowBits mask wordIndex | (lowBits := byteIndex - 1 \\ 4) = 0 ifTrue: @@ -57,7 +57,7 @@ Bitmap >> long64At: byteIndex put: aValue [ ^aValue ] -{ #category : #'*VMMaker-JITSimulation' } +{ #category : '*VMMaker-JITSimulation' } Bitmap >> longAt: byteIndex [ "Default bigEndian access" | lowBits wordIndex value word0 word1 | @@ -75,7 +75,7 @@ Bitmap >> longAt: byteIndex [ ^value ] -{ #category : #'*VMMaker-JITSimulation' } +{ #category : '*VMMaker-JITSimulation' } Bitmap >> longAt: byteIndex bigEndian: bigEndian [ "Compatibility with the ByteArray method of the same name." | lowBits wordIndex value word0 word1 | @@ -112,7 +112,7 @@ Bitmap >> longAt: byteIndex bigEndian: bigEndian [ [:i| { i. (bm longAt: i bigEndian: false) hex. (ba longAt: i bigEndian: false) hex}])" ] -{ #category : #'*VMMaker-JITSimulation' } +{ #category : '*VMMaker-JITSimulation' } Bitmap >> longAt: byteIndex put: aValue [ "Default bigEndian access" | lowBits wordIndex value mask | @@ -135,7 +135,7 @@ Bitmap >> longAt: byteIndex put: aValue [ ^aValue ] -{ #category : #'*VMMaker-JITSimulation' } +{ #category : '*VMMaker-JITSimulation' } Bitmap >> longAt: byteIndex put: aValue bigEndian: bigEndian [ "Compatibility with the ByteArray method of the same name." | lowBits wordIndex value mask | @@ -180,7 +180,7 @@ Bitmap >> longAt: byteIndex put: aValue bigEndian: bigEndian [ { (bm at: 1) hex. (bm at: 2) hex }]" ] -{ #category : #'*VMMaker-JITSimulation' } +{ #category : '*VMMaker-JITSimulation' } Bitmap >> unsignedByteAt: byteAddress [ "Compatibility with the ByteArray and Alien methods of the same name." | lowBits | @@ -190,7 +190,7 @@ Bitmap >> unsignedByteAt: byteAddress [ bitAnd: 16rFF ] -{ #category : #'*VMMaker-JITSimulation' } +{ #category : '*VMMaker-JITSimulation' } Bitmap >> unsignedByteAt: byteAddress put: byte [ "Compatibility with the ByteArray and Alien methods of the same name." | longWord shift lowBits longAddr | @@ -204,7 +204,7 @@ Bitmap >> unsignedByteAt: byteAddress put: byte [ ^ byte ] -{ #category : #'*VMMaker-JITSimulation' } +{ #category : '*VMMaker-JITSimulation' } Bitmap >> unsignedLong64At: byteAddress [ "memory is a Bitmap, a 32-bit indexable array of bits" | lowBits hiWord loWord midWord mask wordIndex result | @@ -228,7 +228,7 @@ Bitmap >> unsignedLong64At: byteAddress [ ^result ] -{ #category : #'*VMMaker-JITSimulation' } +{ #category : '*VMMaker-JITSimulation' } Bitmap >> unsignedLong64At: byteIndex put: aValue [ | lowBits mask wordIndex | (lowBits := byteIndex - 1 \\ 4) = 0 ifTrue: @@ -248,7 +248,7 @@ Bitmap >> unsignedLong64At: byteIndex put: aValue [ ^aValue ] -{ #category : #'*VMMaker-JITSimulation' } +{ #category : '*VMMaker-JITSimulation' } Bitmap >> unsignedLongAt: byteIndex [ "Compatiblity with the ByteArray & Alien methods of the same name." ^(byteIndex - 1 bitAnd: 3) = 0 @@ -256,7 +256,7 @@ Bitmap >> unsignedLongAt: byteIndex [ ifFalse: [self unsignedLongAt: byteIndex bigEndian: true] ] -{ #category : #'*VMMaker-JITSimulation' } +{ #category : '*VMMaker-JITSimulation' } Bitmap >> unsignedLongAt: byteIndex bigEndian: bigEndian [ "Compatiblity with the ByteArray method of the same name." | lowBits wordIndex value word0 word1 | @@ -291,7 +291,7 @@ Bitmap >> unsignedLongAt: byteIndex bigEndian: bigEndian [ [:i| { i. (bm unsignedLongAt: i bigEndian: false) hex. (ba unsignedLongAt: i bigEndian: false) hex}])" ] -{ #category : #'*VMMaker-JITSimulation' } +{ #category : '*VMMaker-JITSimulation' } Bitmap >> unsignedLongAt: byteIndex put: aValue [ "Compatiblity with the ByteArray & Alien methods of the same name." | lowBits mask wordIndex | diff --git a/smalltalksrc/VMMaker/BlockClosure.extension.st b/smalltalksrc/VMMaker/BlockClosure.extension.st index 3cdd42f7db..d79c2b345a 100644 --- a/smalltalksrc/VMMaker/BlockClosure.extension.st +++ b/smalltalksrc/VMMaker/BlockClosure.extension.st @@ -1,12 +1,12 @@ -Extension { #name : #BlockClosure } +Extension { #name : 'BlockClosure' } -{ #category : #'*VMMaker-interpreter simulator' } +{ #category : '*VMMaker-interpreter simulator' } BlockClosure >> shouldStopIfAtPC: address [ ^self value: address ] -{ #category : #'*VMMaker-conveniences' } +{ #category : '*VMMaker-conveniences' } BlockClosure >> value: firstArg value: secondArg value: thirdArg value: fourthArg value: fifthArg [ "Activate the receiver, creating a closure activation (MethodContext) whose closure is the receiver and whose caller is the sender of this diff --git a/smalltalksrc/VMMaker/Boolean.extension.st b/smalltalksrc/VMMaker/Boolean.extension.st index cc307553c6..d29261af8b 100644 --- a/smalltalksrc/VMMaker/Boolean.extension.st +++ b/smalltalksrc/VMMaker/Boolean.extension.st @@ -1,52 +1,52 @@ -Extension { #name : #Boolean } +Extension { #name : 'Boolean' } -{ #category : #'*VMMaker-interpreter simulator' } +{ #category : '*VMMaker-interpreter simulator' } Boolean >> asBooleanObj [ ^(Notification new tag: #getInterpreter; signal) ifNotNil: [:interpreter| interpreter booleanObjectOf: self] ifNil: [self] ] -{ #category : #'*VMMaker-C translation' } +{ #category : '*VMMaker-C translation' } Boolean >> asCCodeInlineStrategy [ ^ CCodeGeneratorInlineStrategy from: self ] -{ #category : #'*VMMaker-plugin generation' } +{ #category : '*VMMaker-plugin generation' } Boolean class >> ccg: cg generateCoerceToOopFrom: aNode on: aStream [ "N.B. The is used both for generation and simulation so answer the result (for interpretation)" ^cg generateCoerceToBooleanObjectFrom: aNode on: aStream ] -{ #category : #'*VMMaker-plugin generation' } +{ #category : '*VMMaker-plugin generation' } Boolean class >> ccg: cg generateCoerceToValueFrom: aNode on: aStream [ "N.B. The could be used both for generation and simulation so answer the result (for interpretation)" ^cg generateCoerceToBooleanValueFrom: aNode on: aStream ] -{ #category : #'*VMMaker-plugin generation' } +{ #category : '*VMMaker-plugin generation' } Boolean class >> ccg: cg prolog: aBlock expr: aString index: anInteger [ ^cg ccgLoad: aBlock expr: aString asBooleanValueFrom: anInteger ] -{ #category : #'*VMMaker-interpreter simulator' } +{ #category : '*VMMaker-interpreter simulator' } Boolean >> isBreakpointFor: address [ ^self ] -{ #category : #'*VMMaker-interpreter simulator' } +{ #category : '*VMMaker-interpreter simulator' } Boolean >> menuPrompt [ ^' (CLICK STEPPING!!)' ] -{ #category : #'*VMMaker-interpreter simulator' } +{ #category : '*VMMaker-interpreter simulator' } Boolean >> shouldStopIfAtPC: address [ ^self ] -{ #category : #'*VMMaker-interpreter simulator' } +{ #category : '*VMMaker-interpreter simulator' } Boolean >> singleStepRequiredToTriggerIn: aCogit [ ^self ] diff --git a/smalltalksrc/VMMaker/BrokenPlugin.class.st b/smalltalksrc/VMMaker/BrokenPlugin.class.st index 7b7a93290d..1637be94cd 100644 --- a/smalltalksrc/VMMaker/BrokenPlugin.class.st +++ b/smalltalksrc/VMMaker/BrokenPlugin.class.st @@ -2,47 +2,49 @@ A test plugin to exercise imbalanced stack access. " Class { - #name : #BrokenPlugin, - #superclass : #InterpreterPlugin, - #category : #'VMMaker-Plugins' + #name : 'BrokenPlugin', + #superclass : 'InterpreterPlugin', + #category : 'VMMaker-Plugins', + #package : 'VMMaker', + #tag : 'Plugins' } -{ #category : #tests } +{ #category : 'tests' } BrokenPlugin class >> testNoPopButPush [ "BrokenPlugin testNoPopButPush" ] -{ #category : #tests } +{ #category : 'tests' } BrokenPlugin class >> testPopAndFail [ "BrokenPlugin testPopAndFail" ] -{ #category : #tests } +{ #category : 'tests' } BrokenPlugin class >> testPopLessThanExpected: arg1 with: arg2 [ "BrokenPlugin testPopLessThanExpected: 3 with: 4" ] -{ #category : #tests } +{ #category : 'tests' } BrokenPlugin class >> testPopMoreThanExpected [ "BrokenPlugin testPopMoreThanExpected" ] -{ #category : #primitives } +{ #category : 'primitives' } BrokenPlugin >> primitiveNoPopButPush [ "Doesn't pop anything but pushes return value" interpreterProxy pushBool: true. ] -{ #category : #primitives } +{ #category : 'primitives' } BrokenPlugin >> primitivePopAndFail [ "Pops in a failing primitive" @@ -50,7 +52,7 @@ BrokenPlugin >> primitivePopAndFail [ interpreterProxy primitiveFail. ] -{ #category : #primitives } +{ #category : 'primitives' } BrokenPlugin >> primitivePopLessThanExpected [ "Pops less than expected; call this with two arguments." @@ -58,7 +60,7 @@ BrokenPlugin >> primitivePopLessThanExpected [ ] -{ #category : #primitives } +{ #category : 'primitives' } BrokenPlugin >> primitivePopMoreThanExpected [ "Pops more than expected" diff --git a/smalltalksrc/VMMaker/ByteArray.extension.st b/smalltalksrc/VMMaker/ByteArray.extension.st index 4f9454ee5d..b42f703cf8 100644 --- a/smalltalksrc/VMMaker/ByteArray.extension.st +++ b/smalltalksrc/VMMaker/ByteArray.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #ByteArray } +Extension { #name : 'ByteArray' } -{ #category : #'*VMMaker-plugin generation' } +{ #category : '*VMMaker-plugin generation' } ByteArray class >> ccg: cg prolog: aBlock expr: aString index: anInteger [ ^cg @@ -10,42 +10,42 @@ ByteArray class >> ccg: cg prolog: aBlock expr: aString index: anInteger [ andThen: (cg ccgValBlock: 'isBytes') ] -{ #category : #'*VMMaker-plugin generation' } +{ #category : '*VMMaker-plugin generation' } ByteArray class >> ccgDeclareCForVar: aSymbolOrString [ ^'char *', aSymbolOrString ] -{ #category : #'*VMMaker-coercing' } +{ #category : '*VMMaker-coercing' } ByteArray >> coerceTo: cTypeString sim: interpreterSimulator [ ^CLiteralArray on: self ] -{ #category : #'*VMMaker-accessing' } +{ #category : '*VMMaker-accessing' } ByteArray >> long64At: index [ "Answer a 64-bit integer in Smalltalk order (little-endian)." ^self integerAt: index size: 8 signed: true ] -{ #category : #'*VMMaker-accessing' } +{ #category : '*VMMaker-accessing' } ByteArray >> long64At: index put: value [ "I store 64-bit integers in Smalltalk (little-endian) order." ^self integerAt: index put: value size: 8 signed: true ] -{ #category : #'*VMMaker-accessing' } +{ #category : '*VMMaker-accessing' } ByteArray >> longAt: byteIndex [ "Store a 32bit signed integer starting at the given byte offset" ^self integerAt: byteIndex size: 4 signed: true ] -{ #category : #'*VMMaker-accessing' } +{ #category : '*VMMaker-accessing' } ByteArray >> longAt: byteIndex put: aValue [ "Store a 32bit signed integer starting at the given byte offset" ^self integerAt: byteIndex put: aValue size: 4 signed: true ] -{ #category : #'*VMMaker-printing' } +{ #category : '*VMMaker-printing' } ByteArray >> storeOn: aStream base: base [ aStream nextPutAll: '#['. self @@ -54,13 +54,13 @@ ByteArray >> storeOn: aStream base: base [ aStream nextPut: $] ] -{ #category : #'*VMMaker-accessing' } +{ #category : '*VMMaker-accessing' } ByteArray >> unsignedLong64At: byteOffset [ "Answer a 64-bit integer in Smalltalk order (little-endian)." ^self integerAt: byteOffset size: 8 signed: false ] -{ #category : #'*VMMaker-accessing' } +{ #category : '*VMMaker-accessing' } ByteArray >> unsignedLong64At: byteOffset put: value [ "I store 64-bit integers in Smalltalk (little-endian) order." ^self integerAt: byteOffset put: value size: 8 signed: false diff --git a/smalltalksrc/VMMaker/CMethodCacheAccessor.class.st b/smalltalksrc/VMMaker/CMethodCacheAccessor.class.st index 7838d7d01b..9ce8f13e7a 100644 --- a/smalltalksrc/VMMaker/CMethodCacheAccessor.class.st +++ b/smalltalksrc/VMMaker/CMethodCacheAccessor.class.st @@ -3,17 +3,19 @@ I am used to simulate accesses to the methodCache so it can live partly in memor " Class { - #name : #CMethodCacheAccessor, - #superclass : #CArrayOfLongsAccessor, + #name : 'CMethodCacheAccessor', + #superclass : 'CArrayOfLongsAccessor', #instVars : [ 'methodCacheArray', 'entrySize', 'functionPointerIndex' ], - #category : #'VMMaker-JITSimulation' + #category : 'VMMaker-JITSimulation', + #package : 'VMMaker', + #tag : 'JITSimulation' } -{ #category : #accessing } +{ #category : 'accessing' } CMethodCacheAccessor >> at: index [ "The special handling of functionPointerIndex is necessary because in simulation function pointers are Smalltalk symbols (under simulation primitive dispatch is done via perform:)." @@ -22,7 +24,7 @@ CMethodCacheAccessor >> at: index [ ^objectMemory longAt: index * elementByteSize + address ] -{ #category : #accessing } +{ #category : 'accessing' } CMethodCacheAccessor >> at: index put: value [ "The special handling of functionPointerIndex is necessary because in simulation function pointers are Smalltalk symbols (under simulation primitive dispatch is done via perform:)." @@ -34,7 +36,7 @@ CMethodCacheAccessor >> at: index put: value [ ^objectMemory longAt: index * elementByteSize + address put: value ] -{ #category : #'initialize-release' } +{ #category : 'initialize-release' } CMethodCacheAccessor >> objectMemory: anObjectMemory at: anAddress array: cacheArray functionPointerIndex: fpIndex entrySize: wordsPerCacheEntry [ self objectMemory: anObjectMemory at: anAddress - anObjectMemory wordSize. "implicit -1 for indices in at:[put:]; the MethodCache is one-relative" diff --git a/smalltalksrc/VMMaker/ClassDescription.extension.st b/smalltalksrc/VMMaker/ClassDescription.extension.st index a8428d74d0..173f1c3c22 100644 --- a/smalltalksrc/VMMaker/ClassDescription.extension.st +++ b/smalltalksrc/VMMaker/ClassDescription.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #ClassDescription } +Extension { #name : 'ClassDescription' } -{ #category : #'*VMMaker-accessing' } +{ #category : '*VMMaker-accessing' } ClassDescription >> >>> aSelector [ "Convenience for creating MethodReferences" ^MethodReference class: self selector: aSelector diff --git a/smalltalksrc/VMMaker/ClipboardExtendedPlugin.class.st b/smalltalksrc/VMMaker/ClipboardExtendedPlugin.class.st index 6d5d823937..fb3446d198 100644 --- a/smalltalksrc/VMMaker/ClipboardExtendedPlugin.class.st +++ b/smalltalksrc/VMMaker/ClipboardExtendedPlugin.class.st @@ -1,16 +1,18 @@ Class { - #name : #ClipboardExtendedPlugin, - #superclass : #SmartSyntaxInterpreterPlugin, - #category : #'VMMaker-Plugins' + #name : 'ClipboardExtendedPlugin', + #superclass : 'SmartSyntaxInterpreterPlugin', + #category : 'VMMaker-Plugins', + #package : 'VMMaker', + #tag : 'Plugins' } -{ #category : #simulation } +{ #category : 'simulation' } ClipboardExtendedPlugin class >> simulatorClass [ "This should be easy to simulate, but I'm short of time. Feel free to have a go, following e.g. the pattern in JPEGReadWriter2Plugin." ^nil ] -{ #category : #io } +{ #category : 'io' } ClipboardExtendedPlugin >> ioAddClipboardData: clipboard data: data dataFormat: aFormat [ | clipboardAddress formatLength dataLength | @@ -24,7 +26,7 @@ ClipboardExtendedPlugin >> ioAddClipboardData: clipboard data: data dataFormat: ] -{ #category : #io } +{ #category : 'io' } ClipboardExtendedPlugin >> ioClearClipboard: clipboard [ | clipboardAddress | @@ -33,7 +35,7 @@ ClipboardExtendedPlugin >> ioClearClipboard: clipboard [ self sqPasteboardClear: clipboardAddress. ] -{ #category : #io } +{ #category : 'io' } ClipboardExtendedPlugin >> ioCreateClipboard [ | clipboardAddress | self primitive: 'ioCreateClipboard' parameters: #(). @@ -43,7 +45,7 @@ ClipboardExtendedPlugin >> ioCreateClipboard [ ^ clipboardAddress. ] -{ #category : #io } +{ #category : 'io' } ClipboardExtendedPlugin >> ioGetClipboardFormat: clipboard formatNumber: formatNumber [ | clipboardAddress itemCount | @@ -55,7 +57,7 @@ ClipboardExtendedPlugin >> ioGetClipboardFormat: clipboard formatNumber: formatN ^ interpreterProxy nilObject ] -{ #category : #io } +{ #category : 'io' } ClipboardExtendedPlugin >> ioReadClipboardData: clipboard format: format [ | clipboardAddress formatLength | diff --git a/smalltalksrc/VMMaker/CoInterpreter.class.st b/smalltalksrc/VMMaker/CoInterpreter.class.st index 8ab0eca861..70ab8c2911 100644 --- a/smalltalksrc/VMMaker/CoInterpreter.class.st +++ b/smalltalksrc/VMMaker/CoInterpreter.class.st @@ -68,8 +68,8 @@ traceSources - the names associated with the codes of events in traceLog " Class { - #name : #CoInterpreter, - #superclass : #StackInterpreterPrimitives, + #name : 'CoInterpreter', + #superclass : 'StackInterpreterPrimitives', #instVars : [ 'cogit', 'cogMethodZone', @@ -120,10 +120,12 @@ Class { 'CogMethodConstants', 'VMStackFrameOffsets' ], - #category : #'VMMaker-JIT' + #category : 'VMMaker-JIT', + #package : 'VMMaker', + #tag : 'JIT' } -{ #category : #translation } +{ #category : 'translation' } CoInterpreter class >> ancilliaryClasses [ "Answer any extra classes to be included in the translation." @@ -134,12 +136,12 @@ CoInterpreter class >> ancilliaryClasses [ class inheritsFrom: CogMethod ]) ] -{ #category : #translation } +{ #category : 'translation' } CoInterpreter class >> apiExportHeaderName [ ^'cointerp.h' ] -{ #category : #translation } +{ #category : 'translation' } CoInterpreter class >> declareCVarsIn: aCCodeGenerator [ "Override to avoid repeating StackInterpreter's declarations and add our own extensions" self class == thisContext methodClass ifFalse: [^self]. "Don't duplicate decls in subclasses" @@ -167,19 +169,19 @@ CoInterpreter class >> declareCVarsIn: aCCodeGenerator [ var: #traceSources type: #'char *' array: TraceSources ] -{ #category : #'accessing class hierarchy' } +{ #category : 'accessing class hierarchy' } CoInterpreter class >> hasCogit [ ^true ] -{ #category : #initialization } +{ #category : 'initialization' } CoInterpreter class >> initializeCaches [ "Eliminate the AtCache" super initializeCaches. AtCacheTotalSize := AtCacheSize := AtCacheMask := AtCacheFixedFields := AtCacheFmt := AtCacheOop := #undefined ] -{ #category : #initialization } +{ #category : 'initialization' } CoInterpreter class >> initializeContextIndices [ super initializeContextIndices. @@ -187,7 +189,7 @@ CoInterpreter class >> initializeContextIndices [ HasBeenReturnedFromMCPCOop := self objectMemoryClass basicNew integerObjectOf: HasBeenReturnedFromMCPC ] -{ #category : #initialization } +{ #category : 'initialization' } CoInterpreter class >> initializeFrameIndices [ "Format of a stack frame. Word-sized indices relative to the frame pointer. Terminology @@ -268,7 +270,7 @@ CoInterpreter class >> initializeFrameIndices [ MFMethodMask := (MFMethodFlagsMask + 1) negated ] -{ #category : #initialization } +{ #category : 'initialization' } CoInterpreter class >> initializeMiscConstants [ super initializeMiscConstants. @@ -308,7 +310,7 @@ CoInterpreter class >> initializeMiscConstants [ RumpCStackSize := 4096 ] -{ #category : #initialization } +{ #category : 'initialization' } CoInterpreter class >> initializePrimitiveTable [ super initializePrimitiveTable. PrimNumberHashMultiply := 159. @@ -324,7 +326,7 @@ CoInterpreter class >> initializePrimitiveTable [ at: 217 + 1 put: #primitiveMethodProfilingData ] -{ #category : #documentation } +{ #category : 'documentation' } CoInterpreter class >> interpreterMachineCodeTransitions [ "The CoInterpreter only asks the Cog compiler to generate machine-code methods when a bytecoded method has been found in the cache, or block value has tried to @@ -360,19 +362,19 @@ CoInterpreter class >> interpreterMachineCodeTransitions [ from the interpreter''." ] -{ #category : #accessing } +{ #category : 'accessing' } CoInterpreter class >> interpreterVersion [ ^ 'Cog' ] -{ #category : #translation } +{ #category : 'translation' } CoInterpreter class >> isNonArgumentImplicitReceiverVariableName: aString [ ^ (#( 'cogit' 'cogMethodZone' ) includes: aString) or: [ super isNonArgumentImplicitReceiverVariableName: aString ] ] -{ #category : #translation } +{ #category : 'translation' } CoInterpreter class >> mustBeGlobal: var [ "Answer if a variable must be global and exported. Used for inst vars that are accessed from VM support code." @@ -381,12 +383,12 @@ CoInterpreter class >> mustBeGlobal: var [ 'maxLiteralCountForCompile' 'minBackwardJumpCountForCompile') includes: var] ] -{ #category : #translation } +{ #category : 'translation' } CoInterpreter class >> needsCogit [ ^true ] -{ #category : #translation } +{ #category : 'translation' } CoInterpreter class >> preGenerationHook: aCCodeGenerator [ "Override to undo the hiding of primitiveClosureValueNoContextSwitch" super preGenerationHook: aCCodeGenerator. @@ -400,26 +402,26 @@ CoInterpreter class >> preGenerationHook: aCCodeGenerator [ var: #primFailCode declareC: '#if VMBIGENDIAN\struct { short pad; unsigned char pfc; unsigned char ac; } acpfc;\#else /* argumentCount & primFailCode */\struct { unsigned char ac; unsigned char pfc; } acpfc;\#endif' withCRs] ] -{ #category : #'accessing class hierarchy' } +{ #category : 'accessing class hierarchy' } CoInterpreter class >> primitivesClass [ ^CoInterpreterPrimitives ] -{ #category : #translation } +{ #category : 'translation' } CoInterpreter class >> shouldGenerateTypedefFor: aStructClass [ "Hack to work-around multiple definitions. Sometimes a type has been defined in an include." ^(super shouldGenerateTypedefFor: aStructClass) and: [Cogit shouldGenerateTypedefFor: aStructClass] ] -{ #category : #translation } +{ #category : 'translation' } CoInterpreter class >> sourceFileName [ "Answer the filename for the core interpreter" ^'cointerp.c' ] -{ #category : #translation } +{ #category : 'translation' } CoInterpreter class >> specialValueForConstant: constantName default: defaultValue [ constantName = 'DoAssertionChecks' ifTrue: [^'(!PRODUCTION)']. @@ -428,7 +430,7 @@ CoInterpreter class >> specialValueForConstant: constantName default: defaultVal ^super specialValueForConstant: constantName default: defaultValue ] -{ #category : #translation } +{ #category : 'translation' } CoInterpreter class >> writeVMHeaderTo: aStream bytesPerWord: bytesPerWord generator: aCCodeGenerator [ super writeVMHeaderTo: aStream bytesPerWord: bytesPerWord generator: aCCodeGenerator. aCCodeGenerator @@ -436,20 +438,20 @@ CoInterpreter class >> writeVMHeaderTo: aStream bytesPerWord: bytesPerWord gener aStream cr ] -{ #category : #simulation } +{ #category : 'simulation' } CoInterpreter >> ISA [ ^cogit backEnd class ISA ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> accessorDepthForPrimitiveIndex: primIndex [ ^primitiveAccessorDepthTable at: primIndex ] -{ #category : #'message sending' } +{ #category : 'message sending' } CoInterpreter >> activateCoggedNewMethod: inInterpreter [ "Activate newMethod when newMethod has been cogged, i.e. create a machine-code frame and (re)enter machine-code." | methodHeader cogMethod rcvr numTemps switched | @@ -498,7 +500,7 @@ CoInterpreter >> activateCoggedNewMethod: inInterpreter [ self returnToExecutive: inInterpreter postContextSwitch: switched ] -{ #category : #'control primitives' } +{ #category : 'control primitives' } CoInterpreter >> activateNewFullClosure: blockClosure method: theMethod numArgs: numArgs mayContextSwitch: mayContextSwitch [ "Similar to activateNewMethod but for Closure and newMethod." | numCopied methodHeader inInterpreter | @@ -554,7 +556,7 @@ CoInterpreter >> activateNewFullClosure: blockClosure method: theMethod numArgs: ^ super activateNewFullClosure: blockClosure method: theMethod numArgs: numArgs mayContextSwitch: mayContextSwitch ] -{ #category : #'message sending' } +{ #category : 'message sending' } CoInterpreter >> activateNewMethod [ | methodHeader inInterpreter switched | @@ -584,7 +586,7 @@ CoInterpreter >> activateNewMethod [ self returnToExecutive: inInterpreter postContextSwitch: switched ] -{ #category : #'method lookup cache' } +{ #category : 'method lookup cache' } CoInterpreter >> addNewMethodToCache: classObj [ "Override to refuse to cache other than compiled methods. This protects open PICs against having to test for compiled methods." @@ -594,7 +596,7 @@ CoInterpreter >> addNewMethodToCache: classObj [ super addNewMethodToCache: classObj ] -{ #category : #'image save/restore' } +{ #category : 'image save/restore' } CoInterpreter >> allocateMemoryForImage: f withHeader: header [ @@ -618,7 +620,7 @@ CoInterpreter >> allocateMemoryForImage: f withHeader: header [ upTo: objectMemory getMemoryMap codeZoneEnd ] -{ #category : #'trampoline support' } +{ #category : 'trampoline support' } CoInterpreter >> argumentCountAddress [ @@ -626,7 +628,7 @@ CoInterpreter >> argumentCountAddress [ inSmalltalk: [cogit simulatedReadWriteVariableAddress: #argumentCount in: self] ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> assertValidExecutionPointe: lip r: lifp s: lisp imbar: inInterpreter line: ln [ @@ -671,7 +673,7 @@ CoInterpreter >> assertValidExecutionPointe: lip r: lifp s: lisp imbar: inInterp self assert: (self frameContext: lifp) = (stackPages unsignedLongAt: stackPage baseAddress - objectMemory wordSize) l: ln] ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> assertValidExternalStackPointers [ self assert: framePointer < stackPage baseAddress. self assert: stackPointer < framePointer. @@ -679,7 +681,7 @@ CoInterpreter >> assertValidExternalStackPointers [ self assert: stackPointer >= (stackPage realStackLimit - self stackLimitOffset) ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> assertValidMachineCodeFrame: instrPtr [ @@ -692,7 +694,7 @@ CoInterpreter >> assertValidMachineCodeFrame: instrPtr [ instrPtr < (cogMethod asInteger + cogMethod blockSize) ]) ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> assertValidStackPageHeadPointers [ self assert: stackPage headFP < stackPage baseAddress. self assert: stackPage headSP < stackPage headFP. @@ -700,7 +702,7 @@ CoInterpreter >> assertValidStackPageHeadPointers [ self assert: stackPage headSP >= (stackPage realStackLimit - self stackLimitOffset) ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> assertValidStackedInstructionPointers: ln [ "Check that the stacked instruction pointers in all pages are correct. Checks the interpreter sender/machine code callee contract. @@ -715,7 +717,7 @@ CoInterpreter >> assertValidStackedInstructionPointers: ln [ [self assert: (self assertValidStackedInstructionPointersIn: thePage line: ln) l: ln]] ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> assertValidStackedInstructionPointersIn: aStackPage line: ln [ "Check that the stacked instruction pointers in the given page are correct. Checks the interpreter sender/machine code callee contract." @@ -766,7 +768,7 @@ CoInterpreter >> assertValidStackedInstructionPointersIn: aStackPage line: ln [ ^true ] -{ #category : #'jump bytecodes' } +{ #category : 'jump bytecodes' } CoInterpreter >> attemptToSwitchToMachineCode: bcpc [ "Attempt to convert the current interpreted activation into a machine code activation, and if this is popssible, jump into machine code. bcpc is the @@ -791,7 +793,7 @@ CoInterpreter >> attemptToSwitchToMachineCode: bcpc [ self callEnilopmart: #ceEnterCogCodePopReceiverReg] ] -{ #category : #'return bytecodes' } +{ #category : 'return bytecodes' } CoInterpreter >> baseFrameCannotReturnTo: contextToReturnTo [ | contextToReturnFrom | @@ -807,12 +809,12 @@ CoInterpreter >> baseFrameCannotReturnTo: contextToReturnTo [ from: contextToReturnFrom ] -{ #category : #hooks } +{ #category : 'hooks' } CoInterpreter >> beforeCodeZoneInitialization [ "Hook point for the simulator" ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> bytecodePCFor: theIP cogMethod: cogMethod startBcpc: startBcpc [ "Answer the mapping of the native pc theIP to a zero-relative bytecode pc. See contextInstructionPointer:frame: for the explanation." @@ -832,7 +834,7 @@ CoInterpreter >> bytecodePCFor: theIP cogMethod: cogMethod startBcpc: startBcpc ^ cogit bytecodePCFor: mcpc startBcpc: startBcpc in: cogMethod ] -{ #category : #'common selector sends' } +{ #category : 'common selector sends' } CoInterpreter >> bytecodePrimAt [ "Override to eliminate the atCache, something of little benefit to the JIT." messageSelector := self specialSelector: 16. @@ -840,7 +842,7 @@ CoInterpreter >> bytecodePrimAt [ self normalSend ] -{ #category : #'common selector sends' } +{ #category : 'common selector sends' } CoInterpreter >> bytecodePrimAtPut [ "Override to eliminate the atCache, something of little benefit to the JIT." messageSelector := self specialSelector: 17. @@ -848,7 +850,7 @@ CoInterpreter >> bytecodePrimAtPut [ self normalSend ] -{ #category : #enilopmarts } +{ #category : 'enilopmarts' } CoInterpreter >> callEnilopmart: anElinopmart [ @@ -860,14 +862,14 @@ CoInterpreter >> callEnilopmart: anElinopmart [ ^ cogit perform: anElinopmart ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> callForCogCompiledCodeCompaction [ cogCompiledCodeCompactionCalledFor := true. self forceInterruptCheck ] -{ #category : #enilopmarts } +{ #category : 'enilopmarts' } CoInterpreter >> callRegisterArgCogMethod: cogMethod at: entryOffset receiver: rcvr [ "convert rcvr base @@ -905,7 +907,7 @@ CoInterpreter >> callRegisterArgCogMethod: cogMethod at: entryOffset receiver: r "NOTREACHED" ] -{ #category : #enilopmarts } +{ #category : 'enilopmarts' } CoInterpreter >> ceActivateFailingPrimitiveMethod: aPrimitiveMethod [ "An external call or FFI primitive has failed. Build the frame and @@ -932,7 +934,7 @@ CoInterpreter >> ceActivateFailingPrimitiveMethod: aPrimitiveMethod [ ifFalse: [ self activateNewMethod ] ] -{ #category : #trampolines } +{ #category : 'trampolines' } CoInterpreter >> ceBaseFrameReturn: returnValue [ "Return across a page boundary. The context to return to (which may be married) is stored in the first word of the stack. We get here when a return instruction jumps @@ -1018,7 +1020,7 @@ CoInterpreter >> ceBaseFrameReturn: returnValue [ ^nil ] -{ #category : #trampolines } +{ #category : 'trampolines' } CoInterpreter >> ceCannotAssignTo: immutableObject withIndex: index valueToAssign: valueToAssign [ "index is unboxed and 0-based. The call-back expects 1-based value (to perform the operation with instVarAt:put:" @@ -1034,7 +1036,7 @@ CoInterpreter >> ceCannotAssignTo: immutableObject withIndex: index valueToAssig numArgs: 2 ] -{ #category : #trampolines } +{ #category : 'trampolines' } CoInterpreter >> ceCannotResume [ "A context that has been returned from, or otherwise has an invalid pc has been reentered. @@ -1053,7 +1055,7 @@ CoInterpreter >> ceCannotResume [ numArgs: 1 ] -{ #category : #'primitive support' } +{ #category : 'primitive support' } CoInterpreter >> ceCheckAndMaybeRetryPrimitive: primIndex [ "Log failure and then retry if there's an accessorDepth or failure due to no memory." @@ -1067,7 +1069,7 @@ CoInterpreter >> ceCheckAndMaybeRetryPrimitive: primIndex [ [self fastLogPrim: TracePrimitiveRetry] ] -{ #category : #trampolines } +{ #category : 'trampolines' } CoInterpreter >> ceCheckForInterrupts [ | switched | @@ -1077,7 +1079,7 @@ CoInterpreter >> ceCheckForInterrupts [ self returnToExecutive: false postContextSwitch: switched ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> ceCheckProfileTick [ "Check if the profile timer has expired and if so take a sample. If the primitive has failed sample the profileMethod as nil. @@ -1089,7 +1091,7 @@ CoInterpreter >> ceCheckProfileTick [ self checkProfileTick: newMethod ] -{ #category : #trampolines } +{ #category : 'trampolines' } CoInterpreter >> ceContext: maybeContext instVar: slotIndex [ | result | @@ -1102,7 +1104,7 @@ CoInterpreter >> ceContext: maybeContext instVar: slotIndex [ ^result ] -{ #category : #trampolines } +{ #category : 'trampolines' } CoInterpreter >> ceContext: maybeMarriedContext instVar: slotIndex value: anOop [ "genStorePop:MaybeContextReceiverVariable: filters out unmarried contexts @@ -1119,7 +1121,7 @@ CoInterpreter >> ceContext: maybeMarriedContext instVar: slotIndex value: anOop ^maybeMarriedContext ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> ceCounterTripped: condition [ "Two things are going on here. The main one is catching a counter trip and attempting to send the SelectorCounterTripped selector. In this case we would like to back-up @@ -1172,7 +1174,7 @@ CoInterpreter >> ceCounterTripped: condition [ ^true ] -{ #category : #trampolines } +{ #category : 'trampolines' } CoInterpreter >> ceInterpretMethodFromPIC: aMethodObj receiver: rcvr [ | pic primitiveIndex | @@ -1204,7 +1206,7 @@ CoInterpreter >> ceInterpretMethodFromPIC: aMethodObj receiver: rcvr [ "NOTREACHED" ] -{ #category : #trampolines } +{ #category : 'trampolines' } CoInterpreter >> ceMNUFromPICMNUMethod: aMethodObj receiver: rcvr [ | cPIC primitiveIndex | @@ -1240,7 +1242,7 @@ CoInterpreter >> ceMNUFromPICMNUMethod: aMethodObj receiver: rcvr [ self assert: false ] -{ #category : #trampolines } +{ #category : 'trampolines' } CoInterpreter >> ceNewHashOf: anObject [ @@ -1251,7 +1253,7 @@ CoInterpreter >> ceNewHashOf: anObject [ ^objectMemory integerObjectOf: (objectMemory newHashBitsOf: anObject) ] -{ #category : #trampolines } +{ #category : 'trampolines' } CoInterpreter >> ceNonLocalReturn: returnValue [ | closure home unwindContextOrNilOrZero ourContext frameToReturnTo contextToReturnTo theFP callerFP newPage | @@ -1366,7 +1368,7 @@ CoInterpreter >> ceNonLocalReturn: returnValue [ ^self return: returnValue toExecutive: false ] -{ #category : #trampolines } +{ #category : 'trampolines' } CoInterpreter >> ceReapAndResetErrorCodeFor: cogMethod [ @@ -1376,7 +1378,7 @@ CoInterpreter >> ceReapAndResetErrorCodeFor: cogMethod [ header: cogMethod methodHeader ] -{ #category : #trampolines } +{ #category : 'trampolines' } CoInterpreter >> ceReturnToInterpreter: anOop [ "Perform a return from a machine code frame to an interpreted frame. The machine code has executed a return instruction when the return address @@ -1401,7 +1403,7 @@ CoInterpreter >> ceReturnToInterpreter: anOop [ ^nil ] -{ #category : #trampolines } +{ #category : 'trampolines' } CoInterpreter >> ceSend: selector above: methodClass to: rcvr numArgs: numArgs [ "Entry-point for an unlinked directed super send in a CogMethod. Smalltalk stack looks like receiver @@ -1488,7 +1490,7 @@ CoInterpreter >> ceSend: selector above: methodClass to: rcvr numArgs: numArgs [ "NOTREACHED" ] -{ #category : #trampolines } +{ #category : 'trampolines' } CoInterpreter >> ceSend: selector aboveClassBinding: methodClassBinding to: rcvr numArgs: numArgs [ "Entry-point for an unlinked directed super send in a CogMethod. Smalltalk stack looks like receiver @@ -1504,7 +1506,7 @@ CoInterpreter >> ceSend: selector aboveClassBinding: methodClassBinding to: rcvr numArgs: numArgs ] -{ #category : #trampolines } +{ #category : 'trampolines' } CoInterpreter >> ceSend: selector super: superNormalBar to: rcvr numArgs: numArgs [ "Entry-point for an unlinked send in a CogMethod. Smalltalk stack looks like receiver @@ -1606,7 +1608,7 @@ CoInterpreter >> ceSend: selector super: superNormalBar to: rcvr numArgs: numArg "NOTREACHED" ] -{ #category : #trampolines } +{ #category : 'trampolines' } CoInterpreter >> ceSendAbort: selector to: rcvr numArgs: numArgs [ "Entry-point for an abort send in a CogMethod (aboutToReturn:through:, cannotReturn: et al). Try and dispatch the send, but the send may turn into an MNU in which case defer to @@ -1645,7 +1647,7 @@ CoInterpreter >> ceSendAbort: selector to: rcvr numArgs: numArgs [ "NOTREACHED" ] -{ #category : #trampolines } +{ #category : 'trampolines' } CoInterpreter >> ceSendFromInLineCacheMiss: cogMethodOrPIC [ "Send from an Open PIC when the first-level method lookup probe has failed, or to continue when PIC creation has failed (e.g. because we're out of code space), @@ -1691,7 +1693,7 @@ CoInterpreter >> ceSendFromInLineCacheMiss: cogMethodOrPIC [ "NOTREACHED" ] -{ #category : #trampolines } +{ #category : 'trampolines' } CoInterpreter >> ceSendMustBeBoolean: anObject [ instructionPointer := self popStack. @@ -1703,7 +1705,7 @@ CoInterpreter >> ceSendMustBeBoolean: anObject [ numArgs: 0 ] -{ #category : #trampolines } +{ #category : 'trampolines' } CoInterpreter >> ceSendMustBeBooleanTo: aNonBooleanObject interpretingAtDelta: jumpSize [ "For RegisterAllocatingCogit we want the pc following a conditional branch not to be reachable, so we don't have to generate code to reload registers. But notionally the pc following a conditional @@ -1759,7 +1761,7 @@ CoInterpreter >> ceSendMustBeBooleanTo: aNonBooleanObject interpretingAtDelta: j self siglong: reenterInterpreter jmp: ReturnToInterpreter ] -{ #category : #trampolines } +{ #category : 'trampolines' } CoInterpreter >> ceSistaTrap [ "When we arrive here, the value that trapped is pushed on stack" @@ -1775,7 +1777,7 @@ CoInterpreter >> ceSistaTrap [ numArgs: 0 ] -{ #category : #trampolines } +{ #category : 'trampolines' } CoInterpreter >> ceStackOverflow: contextSwitchIfNotNil [ "If contextSwitchIfNotNil is nil we can't context switch. contextSwitchIfNotNil is set to nil by @@ -1799,7 +1801,7 @@ CoInterpreter >> ceStackOverflow: contextSwitchIfNotNil [ ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> ceTraceBlockActivation [ cogit recordBlockTrace ifTrue: @@ -1814,7 +1816,7 @@ CoInterpreter >> ceTraceBlockActivation [ self cr]] ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> ceTraceLinkedSend: theReceiver [ | cogMethod | @@ -1841,7 +1843,7 @@ CoInterpreter >> ceTraceLinkedSend: theReceiver [ self sendBreakpoint: cogMethod selector receiver: theReceiver ] -{ #category : #trampolines } +{ #category : 'trampolines' } CoInterpreter >> ceTraceStoreOf: aValue into: anObject [ "For assertion checking." @@ -1849,7 +1851,7 @@ CoInterpreter >> ceTraceStoreOf: aValue into: anObject [ self assert: (objectMemory addressCouldBeObj: anObject) ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> checkAssertsEnabledInCoInterpreter [ | assertsAreEnabledInCoInterpreter | @@ -1857,7 +1859,7 @@ CoInterpreter >> checkAssertsEnabledInCoInterpreter [ self assert: assertsAreEnabledInCoInterpreter ] -{ #category : #'object memory support' } +{ #category : 'object memory support' } CoInterpreter >> checkCodeIntegrity: gcModes [ "Perform an integrity/leak check using the heapMap. Assume clearLeakMapAndMapAccessibleObjects has set a bit at each @@ -1866,13 +1868,13 @@ CoInterpreter >> checkCodeIntegrity: gcModes [ ^cogit checkIntegrityOfObjectReferencesInCode: gcModes ] -{ #category : #'process primitive support' } +{ #category : 'process primitive support' } CoInterpreter >> checkCogCompiledCodeCompactionCalledFor [ cogCompiledCodeCompactionCalledFor ifTrue: [self commenceCogCompiledCodeCompaction] ] -{ #category : #'primitive support' } +{ #category : 'primitive support' } CoInterpreter >> checkForAndFollowForwardedPrimitiveState [ "Override to log" @@ -1885,7 +1887,7 @@ CoInterpreter >> checkForAndFollowForwardedPrimitiveState [ ^found ] -{ #category : #'object memory support' } +{ #category : 'object memory support' } CoInterpreter >> checkLogIntegrity [ "Check the log for leaks. The trace log is a circular buffer of pairs of entries. If there is an entry at traceLogIndex - 3 \\ TraceBufferSize it has entries. If @@ -1909,7 +1911,7 @@ CoInterpreter >> checkLogIntegrity [ ^ok ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> checkOkayFields: oop [ "Check if the argument is an ok object. @@ -1952,7 +1954,7 @@ CoInterpreter >> checkOkayFields: oop [ ^ true ] -{ #category : #'object memory support' } +{ #category : 'object memory support' } CoInterpreter >> checkStackIntegrity [ "Perform an integrity/leak check using the heapMap. Assume clearLeakMapAndMapAccesibleObjects has set a bit at each @@ -2032,13 +2034,13 @@ CoInterpreter >> checkStackIntegrity [ ^ok ] -{ #category : #'process primitive support' } +{ #category : 'process primitive support' } CoInterpreter >> clearCogCompiledCodeCompactionCalledFor [ "For in-image tests" cogCompiledCodeCompactionCalledFor := false ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> clearTraceLog [ traceLogIndex := 0. @@ -2047,18 +2049,18 @@ CoInterpreter >> clearTraceLog [ traceLog at: i put: 0] ] -{ #category : #accessing } +{ #category : 'accessing' } CoInterpreter >> cogCodeSize [ ^cogCodeSize ] -{ #category : #accessing } +{ #category : 'accessing' } CoInterpreter >> cogCodeSize: anInteger [ cogCodeSize := anInteger ] -{ #category : #'compiled methods' } +{ #category : 'compiled methods' } CoInterpreter >> cogMethodOf: aMethodOop [ | methodHeader | @@ -2068,26 +2070,26 @@ CoInterpreter >> cogMethodOf: aMethodOop [ ^self cCoerceSimple: methodHeader to: #'CogMethod *' ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CoInterpreter >> cogMethodZone [ ^ cogMethodZone ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CoInterpreter >> cogMethodZone: aCogMethodZone [ cogMethodZone := aCogMethodZone ] -{ #category : #accessing } +{ #category : 'accessing' } CoInterpreter >> cogit: aCogit [ "for in-image tests" cogit := aCogit ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> commenceCogCompiledCodeCompaction [ | startTime | @@ -2123,7 +2125,7 @@ CoInterpreter >> commenceCogCompiledCodeCompaction [ self assert: (self checkCodeIntegrity: false)] ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> compilationBreak: selectorOop point: selectorLength isMNUCase: isMNUCase [ > compilationBreak: selectorOop point: selectorLength isMNUCase: ifFalse: [i := 0]]] ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> compilationBreakpointFor: selectorOop [ suppressHeartbeatFlag := true. @@ -2153,7 +2155,7 @@ CoInterpreter >> compilationBreakpointFor: selectorOop [ inSmalltalk: [self halt: 'Compilation of ', breakSelector] ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> contextInstructionPointer: theIP frame: theFP [ "Answer a value to store in the InstructionPointer index of a context object for theIP and theFP. Mapping native pcs to bytecode pcs is quite expensive, requiring a search through the method @@ -2181,7 +2183,7 @@ CoInterpreter >> contextInstructionPointer: theIP frame: theFP [ + 2 ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> convertToMachineCodeFrame: cogHomeMethod bcpc: bcpc [ @@ -2233,7 +2235,7 @@ CoInterpreter >> convertToMachineCodeFrame: cogHomeMethod bcpc: bcpc [ ^pc ] -{ #category : #'process primitive support' } +{ #category : 'process primitive support' } CoInterpreter >> deferStackLimitSmashAround: functionSymbol [ "Defer smashes of the stackLimit around the call of functionSymbol (for assert checks)" @@ -2246,7 +2248,7 @@ CoInterpreter >> deferStackLimitSmashAround: functionSymbol [ ^true "called from assert" ] -{ #category : #'process primitive support' } +{ #category : 'process primitive support' } CoInterpreter >> deferStackLimitSmashAround: functionSymbol with: arg [ "Defer smashes of the stackLimit around the call of functionSymbol (for assert checks)" @@ -2262,7 +2264,7 @@ CoInterpreter >> deferStackLimitSmashAround: functionSymbol with: arg [ ^true "called from assert" ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> divorceAMachineCodeFrameWithCogMethod: cogMethod in: aStackPage [ "Divorce at most one frame in the current page (since the divorce may cause the page to be split) and answer whether a frame was divorced." @@ -2292,7 +2294,7 @@ CoInterpreter >> divorceAMachineCodeFrameWithCogMethod: cogMethod in: aStackPage ^false ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> divorceMachineCodeFramesWithMethod: methodObj [ | cogMethod divorcedSome | @@ -2306,7 +2308,7 @@ CoInterpreter >> divorceMachineCodeFramesWithMethod: methodObj [ divorcedSome] whileTrue ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> divorceSomeMachineCodeFramesWithMethod: cogMethod [ "Divorce at most one frame (since the divorce may cause the containing page to be split) and answer whether a frame was divorced." @@ -2325,7 +2327,7 @@ CoInterpreter >> divorceSomeMachineCodeFramesWithMethod: cogMethod [ ^divorcedSome ] -{ #category : #'send bytecodes' } +{ #category : 'send bytecodes' } CoInterpreter >> doRecordSendTrace [ @@ -2337,7 +2339,7 @@ CoInterpreter >> doRecordSendTrace [ super doRecordSendTrace ] ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> dumpPrimTraceLog [ "The prim trace log is a circular buffer of entries. If there is an entry at primTraceLogIndex \\ PrimTraceLogSize it has entries. @@ -2353,7 +2355,7 @@ CoInterpreter >> dumpPrimTraceLog [ [:i | self printPrimLogEntryAt: i; cr] ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> dumpTraceLog [ "The trace log is a circular buffer of pairs of entries. If there is @@ -2369,7 +2371,7 @@ CoInterpreter >> dumpTraceLog [ [:i| self printLogEntryAt: i] ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> encodedNativePCOf: mcpc cogMethod: cogMethod [ "Encode the mcpc in cogMethod as a value that can be stashed in a context. Mapping native pcs to bytecode pcs is quite expensive, requiring a search @@ -2386,7 +2388,7 @@ CoInterpreter >> encodedNativePCOf: mcpc cogMethod: cogMethod [ ^objectMemory integerObjectOf: cogMethod asInteger - mcpc ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> ensureAllContextsWithMethodHaveBytecodePCs: methodObj [ "Map all native pcs to bytecoded pcs in all contexts on methodObj. Used to implement primitiveVoidVMStateForMethod." @@ -2397,7 +2399,7 @@ CoInterpreter >> ensureAllContextsWithMethodHaveBytecodePCs: methodObj [ [self widowOrForceToBytecodePC: oop]] ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> ensureContextHasBytecodePC: aContext [ "Make sure the context has a byetcode pc. Can only be used on single contexts." | pc | @@ -2410,7 +2412,7 @@ CoInterpreter >> ensureContextHasBytecodePC: aContext [ objectMemory storePointerUnchecked: InstructionPointerIndex ofObject: aContext withValue: pc] ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> ensureContextIsExecutionSafeAfterAssignToStackPointer: aContext [ "Safety to give the JIT lattitude in calling convention. Conceptually, returning a value to a context involves pushing that value onto the stack. This is used @@ -2435,7 +2437,7 @@ CoInterpreter >> ensureContextIsExecutionSafeAfterAssignToStackPointer: aContext self ensureContextHasBytecodePC: aContext ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> ensureMethodIsCogged: methodObj maybeClosure: maybeClosure [ "Ensure that methodObj has been cogged. It may be a FullBlockMethod if maybeClosure is a FullBlockClosure." @@ -2459,7 +2461,7 @@ CoInterpreter >> ensureMethodIsCogged: methodObj maybeClosure: maybeClosure [ ^cogMethod ] -{ #category : #enilopmarts } +{ #category : 'enilopmarts' } CoInterpreter >> ensurePushedInstructionPointer [ "We're about to make some transition to a machine code method which requires the instructionPointer must be on the stack. We could have come @@ -2480,7 +2482,7 @@ CoInterpreter >> ensurePushedInstructionPointer [ self push: instructionPointer] ] -{ #category : #initialization } +{ #category : 'initialization' } CoInterpreter >> enterSmalltalkExecutiveImplementation [ "Main entry-point into the interpreter at each execution level, where an execution level is either the start of execution or reentry for a callback. Capture the C stack @@ -2503,7 +2505,7 @@ CoInterpreter >> enterSmalltalkExecutiveImplementation [ ^0 ] -{ #category : #enilopmarts } +{ #category : 'enilopmarts' } CoInterpreter >> executeCogMethod: cogMethod fromLinkedSendWithReceiver: rcvr [ "Execute a CogMethod from a linked send. The receiver, @@ -2528,7 +2530,7 @@ CoInterpreter >> executeCogMethod: cogMethod fromLinkedSendWithReceiver: rcvr [ "NOTREACHED" ] -{ #category : #enilopmarts } +{ #category : 'enilopmarts' } CoInterpreter >> executeCogMethod: cogMethod fromUnlinkedSendWithReceiver: rcvr [ "Execute a CogMethod from an unlinked send. The receiver, arguments and return address are on the Smalltalk stack. First @@ -2552,7 +2554,7 @@ CoInterpreter >> executeCogMethod: cogMethod fromUnlinkedSendWithReceiver: rcvr "NOTREACHED" ] -{ #category : #enilopmarts } +{ #category : 'enilopmarts' } CoInterpreter >> executeCogPIC: cogPIC fromLinkedSendWithReceiver: rcvr andCacheTag: cacheTag [ "Execute a closed PIC from a linked send, to redispatch based on the rcvr. @@ -2585,7 +2587,7 @@ CoInterpreter >> executeCogPIC: cogPIC fromLinkedSendWithReceiver: rcvr andCache "NOTREACHED" ] -{ #category : #enilopmarts } +{ #category : 'enilopmarts' } CoInterpreter >> executeFullCogBlock: cogMethod closure: closure mayContextSwitch: mayContextSwitch [ "Execute a FullBlockClosure with a CogMethod. The caller has already pushed the block and any arguments and the return pc. First push the return-to-interpreter trampoline, @@ -2607,7 +2609,7 @@ CoInterpreter >> executeFullCogBlock: cogMethod closure: closure mayContextSwitc "NOTREACHED" ] -{ #category : #'message sending' } +{ #category : 'message sending' } CoInterpreter >> executeNewMethod: eagerlyCompile [ "if not primitive, or primitive failed, activate the method" @@ -2629,7 +2631,7 @@ CoInterpreter >> executeNewMethod: eagerlyCompile [ self activateNewMethod ] ] -{ #category : #'return bytecodes' } +{ #category : 'return bytecodes' } CoInterpreter >> externalAboutToReturn: resultOop through: aContext [ | ourContext | @@ -2646,7 +2648,7 @@ CoInterpreter >> externalAboutToReturn: resultOop through: aContext [ numArgs: 2 ] -{ #category : #'return bytecodes' } +{ #category : 'return bytecodes' } CoInterpreter >> externalCannotReturn: resultOop from: aContext [ self push: aContext. @@ -2661,7 +2663,7 @@ CoInterpreter >> externalCannotReturn: resultOop from: aContext [ numArgs: 1 ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> fastLogPrim: aSelectorOrImmediate [ "Fast tracing of named primitives. primTraceLogIndex is a byte variable. aSelectorOrImmediate is a selector oop or one of TraceCodeCompaction et al. @@ -2671,7 +2673,7 @@ CoInterpreter >> fastLogPrim: aSelectorOrImmediate [ self primTraceLogIndex: primTraceLogIndex + 1 ] -{ #category : #'message sending' } +{ #category : 'message sending' } CoInterpreter >> findNewMethodInClassTag: classTagArg [ "Find the compiled method to be run when the current messageSelector is sent to the given classTag, setting the values of newMethod and primitiveIndex." @@ -2683,7 +2685,7 @@ CoInterpreter >> findNewMethodInClassTag: classTagArg [ selector: messageSelector ] ] -{ #category : #'message sending' } +{ #category : 'message sending' } CoInterpreter >> findNewMethodOrdinary [ "Find the compiled method to be run when the current messageSelector is sent to the given class, setting the values of newMethod and primitiveIndex." @@ -2695,19 +2697,19 @@ CoInterpreter >> findNewMethodOrdinary [ selector: messageSelector ] ] -{ #category : #'method lookup cache' } +{ #category : 'method lookup cache' } CoInterpreter >> flushAtCache [ "There is no atCache in the CoInterpreter." ] -{ #category : #'object memory support' } +{ #category : 'object memory support' } CoInterpreter >> flushBecommedClassesInMethodZone [ cogit unlinkSendsLinkedForInvalidClasses ] -{ #category : #'plugin primitive support' } +{ #category : 'plugin primitive support' } CoInterpreter >> flushExternalPrimitiveOf: methodObj [ "methodObj is a CompiledMethod containing an external primitive. Flush the function address and session ID of the CM. Override @@ -2722,7 +2724,7 @@ CoInterpreter >> flushExternalPrimitiveOf: methodObj [ to: #primitiveExternalCall] ] -{ #category : #'method lookup cache' } +{ #category : 'method lookup cache' } CoInterpreter >> flushMethodCache [ "Flush the method cache. The method cache is flushed on every programming change and garbage collect." @@ -2730,7 +2732,7 @@ CoInterpreter >> flushMethodCache [ cogit unlinkAllSends ] -{ #category : #'message sending' } +{ #category : 'message sending' } CoInterpreter >> followForwardedFieldsInCurrentMethod [ @@ -2746,13 +2748,13 @@ CoInterpreter >> followForwardedFieldsInCurrentMethod [ ifFalse: [ super followForwardedFieldsInCurrentMethod ] ] -{ #category : #'object memory support' } +{ #category : 'object memory support' } CoInterpreter >> followForwardedMethodsInMethodZone [ cogit followForwardedMethods ] -{ #category : #'object memory support' } +{ #category : 'object memory support' } CoInterpreter >> followForwardingPointersInStackZone: theBecomeEffectsFlags [ "Spur's become: is lazy, turning the becommed object into a forwarding object to the other. The read-barrier is minimised by arranging that forwarding pointers will fail a method cache @@ -2847,7 +2849,7 @@ CoInterpreter >> followForwardingPointersInStackZone: theBecomeEffectsFlags [ theSP := theSP + objectMemory wordSize]]] ] -{ #category : #'process primitive support' } +{ #category : 'process primitive support' } CoInterpreter >> forceInterruptCheckFromHeartbeat [ "Force an interrupt check ASAP. This version is the entry-point to forceInterruptCheck for the heartbeat @@ -2863,7 +2865,7 @@ CoInterpreter >> forceInterruptCheckFromHeartbeat [ [self forceInterruptCheck]] ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> frameCallerContext: theFP [ "In the StackInterpreter the saved ip field of a base frame holds the base frame's caller context. But in the Cog VM the first word on the @@ -2880,7 +2882,7 @@ CoInterpreter >> frameCallerContext: theFP [ ^callerContextOrNil ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> frameCallerContext: theFP put: aValue [ "In the StackInterpreter the saved ip field of a base frame holds the base frame's caller context. But in the Cog VM the first word on the @@ -2897,7 +2899,7 @@ CoInterpreter >> frameCallerContext: theFP put: aValue [ put: aValue ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> frameHasContext: theFP [ @@ -2906,7 +2908,7 @@ CoInterpreter >> frameHasContext: theFP [ ifFalse: [self iframeHasContext: theFP] ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> frameIsBlockActivation: theFP [ "" @@ -2915,7 +2917,7 @@ CoInterpreter >> frameIsBlockActivation: theFP [ "" ifFalse: [self iframeIsBlockActivation: theFP] ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> frameMethodObject: theFP [ @@ -2924,7 +2926,7 @@ CoInterpreter >> frameMethodObject: theFP [ ifFalse: [self iframeMethod: theFP] ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> frameNumArgs: theFP [ "See encodeFrameFieldHasContext:numArgs:" @@ -2935,14 +2937,14 @@ CoInterpreter >> frameNumArgs: theFP [ ifFalse: [ self iframeNumArgs: theFP ] ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> frameNumTemps: theFP [ "For subclasses to redefine to implement different closure semantics." ^0 ] -{ #category : #'trampoline support' } +{ #category : 'trampoline support' } CoInterpreter >> framePointerAddress [ @@ -2950,7 +2952,7 @@ CoInterpreter >> framePointerAddress [ inSmalltalk: [cogit simulatedReadWriteVariableAddress: #framePointer in: self] ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> frameReceiver: theFP [ @@ -2959,7 +2961,7 @@ CoInterpreter >> frameReceiver: theFP [ ifFalse: [self iframeReceiver: theFP] ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> frameReceiverLocation: theFP [ @@ -2968,7 +2970,7 @@ CoInterpreter >> frameReceiverLocation: theFP [ ifFalse: [theFP + FoxIFReceiver] ] -{ #category : #'object memory support' } +{ #category : 'object memory support' } CoInterpreter >> freeUnmarkedMachineCode [ "Free machine-code methods whose compiled methods are unmarked (or open PICs whose selectors are not marked). @@ -2978,7 +2980,7 @@ CoInterpreter >> freeUnmarkedMachineCode [ cogit freeUnmarkedMachineCode ] -{ #category : #'plugin primitives' } +{ #category : 'plugin primitives' } CoInterpreter >> functionForPrimitiveExternalCall: methodObj [ "Arrange to call the external primitive directly. The complication is arranging that the call can be flushed, given that it is embedded in machine code." @@ -3003,7 +3005,7 @@ CoInterpreter >> functionForPrimitiveExternalCall: methodObj [ ^functionPointer ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> functionPointerForCompiledMethod: methodObj primitiveIndex: primIndex [ @@ -3017,69 +3019,69 @@ CoInterpreter >> functionPointerForCompiledMethod: methodObj primitiveIndex: pri ^functionPointer ] -{ #category : #'object memory support' } +{ #category : 'object memory support' } CoInterpreter >> gcMode [ ^gcMode ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CoInterpreter >> gcMode: anInteger [ gcMode := anInteger ] -{ #category : #'internal interpreter access' } +{ #category : 'internal interpreter access' } CoInterpreter >> getBlockCompilationCount [ ^ cogit getBlockCompilationCount ] -{ #category : #'internal interpreter access' } +{ #category : 'internal interpreter access' } CoInterpreter >> getBlockCompilationMSecs [ ^ cogit getBlockCompilationMSecs ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> getCheckAllocFiller [ ^checkAllocFiller ] -{ #category : #'internal interpreter access' } +{ #category : 'internal interpreter access' } CoInterpreter >> getCodeCompactionCount [ ^objectMemory integerObjectOf: statCodeCompactionCount ] -{ #category : #'internal interpreter access' } +{ #category : 'internal interpreter access' } CoInterpreter >> getCodeCompactionMSecs [ ^objectMemory integerObjectOf: statCodeCompactionUsecs + 500 // 1000 ] -{ #category : #'internal interpreter access' } +{ #category : 'internal interpreter access' } CoInterpreter >> getCogCodeSize [ ^objectMemory integerObjectOf: cogCodeSize ] -{ #category : #'internal interpreter access' } +{ #category : 'internal interpreter access' } CoInterpreter >> getCogCodeZoneThreshold [ ^cogit getCogCodeZoneThreshold ] -{ #category : #'internal interpreter access' } +{ #category : 'internal interpreter access' } CoInterpreter >> getCogMethodCount [ ^objectMemory integerObjectOf: (cogMethodZone numMethodsOfType: CMMethod) ] -{ #category : #'internal interpreter access' } +{ #category : 'internal interpreter access' } CoInterpreter >> getCogVMFlags [ "Answer an array of flags indicating various properties of the Cog VM. These are the same as the image header flags shifted right two bits (excluding float order and full screen flags). @@ -3094,7 +3096,7 @@ CoInterpreter >> getCogVMFlags [ + (imageHeaderFlags >> 2 bitClear: 2 + 4 + 16 + 32) ] -{ #category : #'interpreter shell' } +{ #category : 'interpreter shell' } CoInterpreter >> getCurrentBytecode [ "currentBytecode will be private to the main dispatch loop in the generated code. This method allows the currentBytecode to be retrieved from global variables. @@ -3106,18 +3108,18 @@ CoInterpreter >> getCurrentBytecode [ ifFalse: [-1] ] -{ #category : #'internal interpreter access' } +{ #category : 'internal interpreter access' } CoInterpreter >> getDesiredCogCodeSize [ ^objectMemory integerObjectOf: desiredCogCodeSize ] -{ #category : #'object memory support' } +{ #category : 'object memory support' } CoInterpreter >> getGCMode [ ^gcMode ] -{ #category : #'image save/restore' } +{ #category : 'image save/restore' } CoInterpreter >> getImageHeaderFlags [ "Answer the flags that are contained in the 7th long of the image header." @@ -3126,21 +3128,21 @@ CoInterpreter >> getImageHeaderFlags [ ifFalse: [ 0 ]) ] -{ #category : #'internal interpreter access' } +{ #category : 'internal interpreter access' } CoInterpreter >> getMethodCompilationCount [ ^ cogit getMethodCompilationCount ] -{ #category : #'internal interpreter access' } +{ #category : 'internal interpreter access' } CoInterpreter >> getMethodCompilationMSecs [ ^ cogit getMethodCompilationMSecs ] -{ #category : #'message sending' } +{ #category : 'message sending' } CoInterpreter >> handleForwardedSendFaultForReceiver: forwardedReceiver stackDelta: stackDelta [ "Handle a send fault that may be due to a send to a forwarded object. Unforward the receiver on the stack and answer it." @@ -3163,7 +3165,7 @@ CoInterpreter >> handleForwardedSendFaultForReceiver: forwardedReceiver stackDel ^rcvr ] -{ #category : #'message sending' } +{ #category : 'message sending' } CoInterpreter >> handleMNU: selectorIndex InMachineCodeTo: rcvr classForMessage: classForMessage [ "A message send from either an open PIC or an unlinked send has not been understood. Create a message and execute the relevant resulting MNU method. @@ -3195,7 +3197,7 @@ CoInterpreter >> handleMNU: selectorIndex InMachineCodeTo: rcvr classForMessage: "NOTREACHED" ] -{ #category : #'message sending' } +{ #category : 'message sending' } CoInterpreter >> ifAppropriateCompileToNativeCode: aMethodObj selector: selector [ | methodHeader cogMethod | @@ -3212,7 +3214,7 @@ CoInterpreter >> ifAppropriateCompileToNativeCode: aMethodObj selector: selector ifFalse: [self maybeFlagMethodAsInterpreted: aMethodObj]] ] -{ #category : #'jump bytecodes' } +{ #category : 'jump bytecodes' } CoInterpreter >> ifBackwardsCheckForEvents: offsetToJumpBytecode [ "Backward jump means we're in a loop. - check for possible interrupts. @@ -3251,7 +3253,7 @@ CoInterpreter >> ifBackwardsCheckForEvents: offsetToJumpBytecode [ put: backwardJumpCountByte ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> ifValidWriteBackStack: theCFP Pointers: theCSP Save: savedFPP To: savedSPP [ "This is for low-level error reporting. If either of the C stack pointers are pointing into the stack zone then write them back to framePointer and/or @@ -3273,7 +3275,7 @@ CoInterpreter >> ifValidWriteBackStack: theCFP Pointers: theCSP Save: savedFPP T [stackPointer := theCSP] ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> iframeBackwardBranchByte: theFP [ "See encodeFrameFieldHasContext:numArgs: and ifBackwardsCheckForEvents:" @@ -3281,7 +3283,7 @@ CoInterpreter >> iframeBackwardBranchByte: theFP [ ^stackPages byteAt: theFP + (VMBIGENDIAN ifTrue: [FoxIFrameFlags + objectMemory wordSize - 1] ifFalse: [FoxIFrameFlags]) ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> iframeBackwardBranchByte: theFP put: aByte [ "See encodeFrameFieldHasContext:numArgs: and ifBackwardsCheckForEvents:" @@ -3291,7 +3293,7 @@ CoInterpreter >> iframeBackwardBranchByte: theFP put: aByte [ put: aByte ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> iframeHasContext: theFP [ "See encodeFrameFieldHasContext:numArgs:" @@ -3299,14 +3301,14 @@ CoInterpreter >> iframeHasContext: theFP [ ^(stackPages byteAt: theFP + FoxIFrameFlags + 2) ~= 0 ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> iframeIsBlockActivation: theFP [ "" ^(stackPages byteAt: theFP + FoxIFrameFlags + 3) ~= 0 ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> iframeNumArgs: theFP [ "See encodeFrameFieldHasContext:numArgs:" @@ -3314,14 +3316,14 @@ CoInterpreter >> iframeNumArgs: theFP [ ^stackPages byteAt: theFP + FoxIFrameFlags + 1 ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> iframeReceiver: theFP [ ^stackPages unsignedLongAt: theFP + FoxIFReceiver ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> iframeReceiverLocation: theFP [ @@ -3329,20 +3331,20 @@ CoInterpreter >> iframeReceiverLocation: theFP [ ^ theFP + FoxIFReceiver ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> iframeSavedIP: theFP [ ^stackPages unsignedLongAt: theFP + FoxIFSavedIP ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> iframeSavedIP: theFP put: savedIP [ self assert: (self isMachineCodeFrame: theFP) not. stackPages unsignedLongAt: theFP + FoxIFSavedIP put: savedIP ] -{ #category : #initialization } +{ #category : 'initialization' } CoInterpreter >> initStackPagesAndInterpret [ self sqMakeMemoryNotExecutableFrom: objectMemory getMemoryMap startOfObjectMemory asUnsignedInteger @@ -3351,7 +3353,7 @@ CoInterpreter >> initStackPagesAndInterpret [ ^ super initStackPagesAndInterpret ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> instVar: offset ofContext: aContext [ "Fetch an instance variable from a maybe married context. If the context is still married compute the value of the @@ -3382,7 +3384,7 @@ CoInterpreter >> instVar: offset ofContext: aContext [ ^value ] -{ #category : #'trampoline support' } +{ #category : 'trampoline support' } CoInterpreter >> instructionPointerAddress [ @@ -3390,7 +3392,7 @@ CoInterpreter >> instructionPointerAddress [ inSmalltalk: [cogit simulatedReadWriteVariableAddress: #instructionPointer in: self] ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> instructionPointerForFrame: spouseFP currentFP: currentFP currentIP: instrPtr [ "Answer the bytecode pc object (i.e. SmallInteger) for an active frame. The bytecode pc is derived from the frame's pc. If the frame is the top frame on the current stack @@ -3418,7 +3420,7 @@ CoInterpreter >> instructionPointerForFrame: spouseFP currentFP: currentFP curre ifFalse: [value] ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> internalMustMapMachineCodePC: theIP context: aOnceMarriedContext [ "Must externalize before calling mustMapMachineCodePC:context: because it may cause a code compaction." @@ -3426,7 +3428,7 @@ CoInterpreter >> internalMustMapMachineCodePC: theIP context: aOnceMarriedContex ^ self mustMapMachineCodePC: theIP context: aOnceMarriedContext ] -{ #category : #'trampoline support' } +{ #category : 'trampoline support' } CoInterpreter >> interpretAddress [ "This is used for asserts that check that inline cache editing results in valid addresses. In the C VM interpret is presumed to come before any primitives and so it constitutes @@ -3438,7 +3440,7 @@ CoInterpreter >> interpretAddress [ inSmalltalk: [objectMemory getMemoryMap startOfObjectMemory] ] -{ #category : #'message sending' } +{ #category : 'message sending' } CoInterpreter >> interpretMethodFromMachineCode [ "Execute a method interpretively from machine code. We assume (require) that newMethod messageSelector, primitiveFunctionPointer and argumentCount have been set in the caller. @@ -3475,7 +3477,7 @@ CoInterpreter >> interpretMethodFromMachineCode [ ^ nil ] ] -{ #category : #'stack pages' } +{ #category : 'stack pages' } CoInterpreter >> interpreterAllocationReserveBytes [ "At a rough approximation we may need to allocate up to a couple of page's worth of contexts when switching stack pages, assigning @@ -3489,7 +3491,7 @@ CoInterpreter >> interpreterAllocationReserveBytes [ ^maxFramesPerPage * LargeContextSlots * objectMemory bytesPerOop * numStackPages ] -{ #category : #'internal interpreter access' } +{ #category : 'internal interpreter access' } CoInterpreter >> is: fieldIndex methodAssignmentToContextWithMachineCodePC: anOop [ "If the method is assigned, any machine code pc must be mapped to a bytecode one before the method is changed." @@ -3500,18 +3502,18 @@ CoInterpreter >> is: fieldIndex methodAssignmentToContextWithMachineCodePC: anOo and: [objectMemory isIntegerObject: thePC]] ] -{ #category : #'internal interpreter access' } +{ #category : 'internal interpreter access' } CoInterpreter >> isCog [ ^true ] -{ #category : #'process primitive support' } +{ #category : 'process primitive support' } CoInterpreter >> isCogCompiledCodeCompactionCalledFor [ "For in-image tests" ^cogCompiledCodeCompactionCalledFor ] -{ #category : #'compiled methods' } +{ #category : 'compiled methods' } CoInterpreter >> isCogMethodReference: methodHeader [ self assert: ((objectMemory isIntegerObject: methodHeader) @@ -3520,14 +3522,14 @@ CoInterpreter >> isCogMethodReference: methodHeader [ ^objectMemory isNonIntegerObject: methodHeader ] -{ #category : #testing } +{ #category : 'testing' } CoInterpreter >> isInstructionPointerInInterpreter: anIP [ ^ (self isMachineCodeIP: anIP asUnsignedInteger) not ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> isMachineCodeFrame: theFP [ @@ -3535,12 +3537,12 @@ CoInterpreter >> isMachineCodeFrame: theFP [ (stackPages unsignedLongAt: theFP + FoxMethod) asUnsignedInteger ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> isMachineCodeIP: anInstrPointer [ ^anInstrPointer asUnsignedInteger < objectMemory getMemoryMap startOfObjectMemory ] -{ #category : #'message sending' } +{ #category : 'message sending' } CoInterpreter >> justActivateNewMethod: mustBeInterpreterFrame [ @@ -3615,7 +3617,7 @@ CoInterpreter >> justActivateNewMethod: mustBeInterpreterFrame [ ^ methodHeader ] -{ #category : #simulation } +{ #category : 'simulation' } CoInterpreter >> lookupAddress: address [ "If address appears to be that of a Symbol or a few well-known objects (such as classes) answer it, otherwise answer nil. For code disassembly" @@ -3626,7 +3628,7 @@ CoInterpreter >> lookupAddress: address [ ^nil ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> lookupMNU: selector receiver: rcvr [ "Lookup selector in rcvr, without doing MNU processing, and answer either a @@ -3645,7 +3647,7 @@ CoInterpreter >> lookupMNU: selector receiver: rcvr [ ^newMethod ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> lookupOrdinary: selector receiver: rcvr [ "Lookup selector in rcvr, without doing MNU processing, and answer either a @@ -3662,13 +3664,13 @@ CoInterpreter >> lookupOrdinary: selector receiver: rcvr [ ^newMethod ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> mMethodClass [ ^self methodClassOf: (self mframeHomeMethod: framePointer) methodObject ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> makeBaseFrameFor: aContext [ "" "Marry aContext with the base frame of a new stack page. Build the base frame to reflect the context's state. Answer the new page. Override to @@ -3830,14 +3832,14 @@ CoInterpreter >> makeBaseFrameFor: aContext [ "" ^page ] -{ #category : #'object memory support' } +{ #category : 'object memory support' } CoInterpreter >> mapMachineCode: theGCMode [ "Update all references to objects in machine code." cogit mapObjectReferencesInMachineCode: theGCMode ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> mapPrimTraceLog [ "The prim trace log is a circular buffer of selectors. If there is an entry at primTraceLogIndex - 1 \\ PrimTraceBufferSize it has entries. @@ -3860,7 +3862,7 @@ CoInterpreter >> mapPrimTraceLog [ [primTraceLog at: i put: (objectMemory remapObj: selector)]] ] -{ #category : #'object memory support' } +{ #category : 'object memory support' } CoInterpreter >> mapStackPages [ @@ -3949,7 +3951,7 @@ CoInterpreter >> mapStackPages [ stackPages recordLivePagesOnMapping: numLivePages ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> mapTraceLog [ "The trace log is a circular buffer of pairs of entries. If there is an entry at traceLogIndex - 3 \\ TraceBufferSize it has entries. @@ -3970,13 +3972,13 @@ CoInterpreter >> mapTraceLog [ [traceLog at: i + 1 put: (objectMemory remapObj: selectorOrMethod)]] ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> mapTraceLogs [ self mapTraceLog. self mapPrimTraceLog ] -{ #category : #'object memory support' } +{ #category : 'object memory support' } CoInterpreter >> mapVMRegisters [ "Map the oops in the interpreter's vm ``registers'' to their new values during garbage collection or a become: operation." @@ -3996,7 +3998,7 @@ CoInterpreter >> mapVMRegisters [ [newMethod := objectMemory remapObj: newMethod] ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> markActiveMethodsAndReferents [ | thePage | @@ -4008,14 +4010,14 @@ CoInterpreter >> markActiveMethodsAndReferents [ [self markCogMethodsAndReferentsOnPage: thePage]] ] -{ #category : #'gc -- mark and sweep' } +{ #category : 'gc -- mark and sweep' } CoInterpreter >> markAndTraceMachineCodeMethod: aCogMethod [ objectMemory markAndTrace: aCogMethod methodObject ] -{ #category : #'object memory support' } +{ #category : 'object memory support' } CoInterpreter >> markAndTraceMachineCodeOfMarkedMethods [ "Deal with a fulGC's effects on machine code. Mark and trace oops in marked machine code methods. The stack @@ -4025,7 +4027,7 @@ CoInterpreter >> markAndTraceMachineCodeOfMarkedMethods [ cogit markAndTraceMachineCodeOfMarkedMethods ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> markAndTracePrimTraceLog [ "The prim trace log is a circular buffer of selectors. If there is an entry at primTraceLogIndex - 1 \\ PrimTraceBufferSize it has entries. @@ -4048,7 +4050,7 @@ CoInterpreter >> markAndTracePrimTraceLog [ [objectMemory markAndTrace: selector]] ] -{ #category : #'object memory support' } +{ #category : 'object memory support' } CoInterpreter >> markAndTraceStackPage: thePage [ | theSP theFP frameRcvrOffset callerFP oop | @@ -4097,7 +4099,7 @@ CoInterpreter >> markAndTraceStackPage: thePage [ theSP := theSP + objectMemory wordSize] ] -{ #category : #'object memory support' } +{ #category : 'object memory support' } CoInterpreter >> markAndTraceTraceLog [ "The trace log is a circular buffer of pairs of entries. If there is an entry at traceLogIndex - 3 \\ TraceBufferSize it has entries. If there is something at @@ -4118,7 +4120,7 @@ CoInterpreter >> markAndTraceTraceLog [ [objectMemory markAndTrace: oop]] ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> markCogMethodsAndReferentsOnPage: thePage [ | theFP callerFP | @@ -4135,20 +4137,20 @@ CoInterpreter >> markCogMethodsAndReferentsOnPage: thePage [ [theFP := callerFP] ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> marryFrameCopiesTemps [ "Answer whether marryFrame:SP: copies non-argument temporaries." ^false ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> maxLookupNoMNUErrorCode [ ^SelectorCannotInterpret max: SelectorDoesNotUnderstand ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> maybeFixClonedCompiledMethod: objOop [ "Make sure a cloned method doesn't reference its originals Cog method, if any." | rawHeader | @@ -4160,7 +4162,7 @@ CoInterpreter >> maybeFixClonedCompiledMethod: objOop [ put: (self cCoerceSimple: rawHeader to: #'CogMethod *') methodHeader] ] -{ #category : #'compiled methods' } +{ #category : 'compiled methods' } CoInterpreter >> maybeFlagMethodAsInterpreted: aMethod [ "The flag bit can be used to flag methods that are interpreted, if it has been requested from the image header flags." @@ -4176,14 +4178,14 @@ CoInterpreter >> maybeFlagMethodAsInterpreted: aMethod [ ifFalse: [objectMemory storePointerUnchecked: 0 ofObject: aMethod withValue: realHeader]] ] -{ #category : #'compiled methods' } +{ #category : 'compiled methods' } CoInterpreter >> maybeMethodHasCogMethod: anOop [ ^(objectMemory isNonImmediate: anOop) and: [(objectMemory isCompiledMethod: anOop) and: [self isCogMethodReference: (self rawHeaderOf: anOop)]] ] -{ #category : #'return bytecodes' } +{ #category : 'return bytecodes' } CoInterpreter >> maybeReturnToMachineCodeFrame [ "If the frame we're returning to is a machine code one, then return to it. Otherwise, if it's an interpreter frame, load the saved ip." @@ -4195,7 +4197,7 @@ CoInterpreter >> maybeReturnToMachineCodeFrame [ instructionPointer := self pointerForOop: (self iframeSavedIP: framePointer) ] ] -{ #category : #'stack bytecodes' } +{ #category : 'stack bytecodes' } CoInterpreter >> maybeTraceBlockCreation: newClosure [ cogit recordSendTrace ifTrue: [ @@ -4205,7 +4207,7 @@ CoInterpreter >> maybeTraceBlockCreation: newClosure [ source: TraceIsFromInterpreter ] ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> maybeTraceStackOverflow [ cogit recordOverflowTrace ifTrue: [self recordTrace: TraceStackOverflow @@ -4217,7 +4219,7 @@ CoInterpreter >> maybeTraceStackOverflow [ [self fastLogPrim: TraceStackOverflow] ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> mcprimFunctionForPrimitiveIndex: primIndex [ primIndex = PrimNumberHashMultiply ifTrue: @@ -4226,27 +4228,27 @@ CoInterpreter >> mcprimFunctionForPrimitiveIndex: primIndex [ ^nil ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> methodCacheAddress [ ^self cCode: [methodCache] inSmalltalk: [methodCache address] ] -{ #category : #'compiled methods' } +{ #category : 'compiled methods' } CoInterpreter >> methodHasCogMethod: aMethodOop [ self assert: (objectMemory isNonImmediate: aMethodOop). ^self isCogMethodReference: (self rawHeaderOf: aMethodOop) ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> methodNeedsLargeContext: methodObj [ ^self methodHeaderIndicatesLargeFrame: (objectMemory methodHeaderOf: methodObj) ] -{ #category : #'compiled methods' } +{ #category : 'compiled methods' } CoInterpreter >> methodShouldBeCogged: aMethodObj [ (self methodWithHeaderShouldBeCogged: (objectMemory methodHeaderOf: aMethodObj)) ifTrue: @@ -4255,7 +4257,7 @@ CoInterpreter >> methodShouldBeCogged: aMethodObj [ ^false ] -{ #category : #'compiled methods' } +{ #category : 'compiled methods' } CoInterpreter >> methodWithHeaderShouldBeCogged: methodHeader [ "At the moment jit any method with less than N literals, where N defaults to 60. See e.g. SimpleStackBasedCogit class>>initialize. @@ -4280,21 +4282,21 @@ CoInterpreter >> methodWithHeaderShouldBeCogged: methodHeader [ ifFalse: [(objectMemory literalCountOfMethodHeader: methodHeader) <= maxLiteralCountForCompile] ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> mframeCogMethod: theFP [ "Answer the Cog method for a machine code frame" ^self cCoerceSimple: (self mframeMethod: theFP) to: #'CogMethod *' ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> mframeHasContext: theFP [ ^((self frameMethodField: theFP) bitAnd: MFMethodFlagHasContextFlag) ~= 0 ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> mframeHomeMethod: theFP [ "Answer the home method for a machine code frame. From a block frame we find the home method through the block's homeOffset field which is the delta to it. @@ -4307,41 +4309,41 @@ CoInterpreter >> mframeHomeMethod: theFP [ ^self cCoerceSimple: (methodField bitAnd: MFMethodMask) to: #'CogMethod *' ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> mframeHomeMethodExport [ ^self mframeHomeMethod: framePointer ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> mframeIsBlockActivation: theFP [ "" ^((self frameMethodField: theFP) bitAnd: MFMethodFlagIsBlockFlag) ~= 0 ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> mframeMethod: theFP [ ^(self frameMethodField: theFP) bitAnd: MFMethodMask ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> mframeNumArgs: theFP [ ^(self mframeCogMethod: theFP) cmNumArgs ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> mframeReceiver: theFP [ ^stackPages longAt: theFP + FoxMFReceiver ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> minimumUnusedHeadroom [ "Traverse all stack pages looking for non-zero bytes in the headroom part of each page. Answer the minimum size of unused headroom (zero bytes) in the pages. This is for @@ -4363,7 +4365,7 @@ CoInterpreter >> minimumUnusedHeadroom [ ^minUnused ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> mnuCompilationBreak: selectorOop point: selectorLength [ > mnuCompilationBreak: selectorOop point: selectorLength [ ifFalse: [i := 0]]] ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> mnuCompilationBreakpointFor: selectorOop [ suppressHeartbeatFlag := true. @@ -4392,7 +4394,7 @@ CoInterpreter >> mnuCompilationBreakpointFor: selectorOop [ inSmalltalk: [self halt: 'Compilation for MNU of ', breakSelector] ] -{ #category : #'message sending' } +{ #category : 'message sending' } CoInterpreter >> mnuMethodOrNilFor: rcvr [ "Lookup the doesNotUnderstand: selector in the class of the argument rcvr. Answer either the matching method (cogged if appropriate), or nil, if not found." @@ -4421,7 +4423,7 @@ CoInterpreter >> mnuMethodOrNilFor: rcvr [ ^ nil ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> moveFramesIn: oldPage through: theFP toPage: newPage [ "Move frames from the hot end of oldPage through to theFP to newPage. This has the effect of making theFP a base frame which can be stored into. @@ -4495,7 +4497,7 @@ CoInterpreter >> moveFramesIn: oldPage through: theFP toPage: newPage [ ^newFP ] -{ #category : #'internal interpreter access' } +{ #category : 'internal interpreter access' } CoInterpreter >> mtemporary: offset in: theFP [ @@ -4511,7 +4513,7 @@ CoInterpreter >> mtemporary: offset in: theFP [ + (frameNumArgs - offset * objectMemory wordSize) ] ] -{ #category : #'internal interpreter access' } +{ #category : 'internal interpreter access' } CoInterpreter >> mtemporary: offset in: theFP put: valueOop [ "Temporary access for a machine code frame only." "See StackInterpreter class>>initializeFrameIndices" @@ -4525,7 +4527,7 @@ CoInterpreter >> mtemporary: offset in: theFP put: valueOop [ put: valueOop ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> mustMapMachineCodePC: theIP context: aOnceMarriedContext [ "Map the native pc theIP into a bytecode pc integer object and answer it. See contextInstructionPointer:frame: for the explanation." @@ -4553,7 +4555,7 @@ CoInterpreter >> mustMapMachineCodePC: theIP context: aOnceMarriedContext [ ^objectMemory integerObjectOf: bcpc + 1 ] -{ #category : #'trampoline support' } +{ #category : 'trampoline support' } CoInterpreter >> newMethodAddress [ @@ -4561,7 +4563,7 @@ CoInterpreter >> newMethodAddress [ inSmalltalk: [cogit simulatedReadWriteVariableAddress: #newMethod in: self] ] -{ #category : #'method lookup cache' } +{ #category : 'method lookup cache' } CoInterpreter >> newMethodInLookupCacheAt: selector and: classTag [ "Answer if classTag x messageSelector => newMethod is in the lookup cache. This is for assert checking to check that open PICs find entries." @@ -4580,13 +4582,13 @@ CoInterpreter >> newMethodInLookupCacheAt: selector and: classTag [ ^false ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> nextProfileTick [ ^nextProfileTick ] -{ #category : #'trampoline support' } +{ #category : 'trampoline support' } CoInterpreter >> nextProfileTickAddress [ @@ -4602,25 +4604,25 @@ CoInterpreter >> nextProfileTickAddress [ cogit simulatedReadWriteVariableAddress: #nextProfileTickLow in: self]] ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> nextProfileTickHigh [ ^nextProfileTick bitShift: -32 ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> nextProfileTickLow [ ^nextProfileTick bitAnd: 16rFFFFFFFF ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> nilUncoggableMethods [ lastCoggableInterpretedBlockMethod := lastUncoggableInterpretedBlockMethod := nil ] -{ #category : #'compiled methods' } +{ #category : 'compiled methods' } CoInterpreter >> noAssertHeaderOf: methodPointer [ | methodHeader | @@ -4630,7 +4632,7 @@ CoInterpreter >> noAssertHeaderOf: methodPointer [ ifFalse: [methodHeader] ] -{ #category : #'object memory support' } +{ #category : 'object memory support' } CoInterpreter >> postBecomeAction: theBecomeEffectsFlags [ "Clear the gcMode var and let the Cogit do its post GC checks." @@ -4644,7 +4646,7 @@ CoInterpreter >> postBecomeAction: theBecomeEffectsFlags [ gcMode := 0 ] -{ #category : #'object memory support' } +{ #category : 'object memory support' } CoInterpreter >> postGCAction: gcModeArg [ "Attempt to shrink free memory, signal the gc semaphore and let the Cogit do its post GC thang" @@ -4655,14 +4657,14 @@ CoInterpreter >> postGCAction: gcModeArg [ gcMode := 0 ] -{ #category : #'object memory support' } +{ #category : 'object memory support' } CoInterpreter >> preBecomeAction [ "Need to set gcMode var (to avoid passing the flag through a lot of the updating code)" super preBecomeAction. gcMode := GCModeBecome ] -{ #category : #'object memory support' } +{ #category : 'object memory support' } CoInterpreter >> preGCAction: gcModeArg [ "Need to write back the frame pointers unless all pages are free (as in snapshot). @@ -4682,13 +4684,13 @@ CoInterpreter >> preGCAction: gcModeArg [ self fastLogPrim: traceType] ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> primErrTable [ ^objectMemory splObj: PrimErrTableIndex ] -{ #category : #'trampoline support' } +{ #category : 'trampoline support' } CoInterpreter >> primFailCodeAddress [ @@ -4696,7 +4698,7 @@ CoInterpreter >> primFailCodeAddress [ inSmalltalk: [cogit simulatedReadWriteVariableAddress: #primFailCode in: self] ] -{ #category : #'compiled methods' } +{ #category : 'compiled methods' } CoInterpreter >> primNumberExternalCall [ "Answer if the method is an external primtiive call (prim 117)." @@ -4704,40 +4706,40 @@ CoInterpreter >> primNumberExternalCall [ ^PrimNumberExternalCall ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CoInterpreter >> primTraceLog [ ^ primTraceLog ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> primTraceLogAddress [ ^self cCode: [primTraceLog] inSmalltalk: [primTraceLog offset * objectMemory wordSize] ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CoInterpreter >> primTraceLogEntries [ ^ PrimTraceLogSize ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> primTraceLogIndex [ ^primTraceLogIndex ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> primTraceLogIndex: aValue [ "N.B. primTraceLogIndex is 8-bits" ^primTraceLogIndex := aValue bitAnd: 16rFF ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> primTraceLogIndexAddress [ @@ -4746,7 +4748,7 @@ CoInterpreter >> primTraceLogIndexAddress [ inSmalltalk: [cogit simulatedReadWriteVariableAddress: #primTraceLogIndex in: self] ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CoInterpreter >> primitiveAccessorDepthTable [ @@ -4754,7 +4756,7 @@ CoInterpreter >> primitiveAccessorDepthTable [ ^ primitiveAccessorDepthTable ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CoInterpreter >> primitiveAccessorDepthTable: aCollection [ @@ -4762,7 +4764,7 @@ CoInterpreter >> primitiveAccessorDepthTable: aCollection [ primitiveAccessorDepthTable := aCollection ] -{ #category : #'trampoline support' } +{ #category : 'trampoline support' } CoInterpreter >> primitiveFailAddress [ "This is used for asserts that check that inline cache editing results in valid addresses. In the C VM interpret is presumed to come before any primitives and so it constitutes @@ -4774,14 +4776,14 @@ CoInterpreter >> primitiveFailAddress [ inSmalltalk: [objectMemory getMemoryMap startOfObjectMemory] ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> primitiveFunctionPointer: oop [ "Apparently not sent but is used in the simulator." primitiveFunctionPointer := oop ] -{ #category : #'debug printing' } +{ #category : 'debug printing' } CoInterpreter >> printCogMethod: cogMethod [ @@ -4818,7 +4820,7 @@ CoInterpreter >> printCogMethod: cogMethod [ self cr ] -{ #category : #'debug printing' } +{ #category : 'debug printing' } CoInterpreter >> printFrame: theFP WithSP: theSP [ | theMethod theMethodEnd numArgs numTemps rcvrAddress topThing | @@ -4917,7 +4919,7 @@ CoInterpreter >> printFrame: theFP WithSP: theSP [ at: addr]]] ] -{ #category : #'debug printing' } +{ #category : 'debug printing' } CoInterpreter >> printFrameFlagsForFP: theFP [ | address it | @@ -4943,7 +4945,7 @@ CoInterpreter >> printFrameFlagsForFP: theFP [ cr ] -{ #category : #'debug printing' } +{ #category : 'debug printing' } CoInterpreter >> printFrameMethodFor: theFP [ | address it homeMethod obj | @@ -4966,7 +4968,7 @@ CoInterpreter >> printFrameMethodFor: theFP [ self shortPrintOop: obj ] -{ #category : #'debug printing' } +{ #category : 'debug printing' } CoInterpreter >> printFrameThing: name at: address extra: extraValue [ | it len | @@ -4989,7 +4991,7 @@ CoInterpreter >> printFrameThing: name at: address extra: extraValue [ self space; printNum: extraValue; cr ] -{ #category : #'debug printing' } +{ #category : 'debug printing' } CoInterpreter >> printFrameThing: name at: address extraString: extraStringOrNil [ | it len | @@ -5014,7 +5016,7 @@ CoInterpreter >> printFrameThing: name at: address extraString: extraStringOrNil self cr ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> printLogEntryAt: i [ | intOrClass selectorMethodOrProcess source | @@ -5050,7 +5052,7 @@ CoInterpreter >> printLogEntryAt: i [ self cr ] -{ #category : #'debug printing' } +{ #category : 'debug printing' } CoInterpreter >> printMethodCacheFor: thing [ | n | @@ -5092,7 +5094,7 @@ CoInterpreter >> printMethodCacheFor: thing [ [self printNum: n; cr] ] -{ #category : #'debug printing' } +{ #category : 'debug printing' } CoInterpreter >> printMethodFieldForPrintContext: aContext [ | meth | @@ -5108,7 +5110,7 @@ CoInterpreter >> printMethodFieldForPrintContext: aContext [ self shortPrintOop: meth] ] -{ #category : #'debug printing' } +{ #category : 'debug printing' } CoInterpreter >> printMethodHeaderOop: anOop [ "Print the CogMethod and its header if this is a CogMethod reference." @@ -5124,7 +5126,7 @@ CoInterpreter >> printMethodHeaderOop: anOop [ ^ super printMethodHeaderOop: anOop ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> printPrimLogEntryAt: i [ | intOrSelector | @@ -5150,13 +5152,13 @@ CoInterpreter >> printPrimLogEntryAt: i [ ifFalse: [objectMemory safePrintStringOf: intOrSelector]] ] -{ #category : #'debug printing' } +{ #category : 'debug printing' } CoInterpreter >> printSends [ ^cogit printOnTrace ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> quickPrimitiveConstantFor: aQuickPrimitiveIndex [ ^aQuickPrimitiveIndex caseOf: { @@ -5169,7 +5171,7 @@ CoInterpreter >> quickPrimitiveConstantFor: aQuickPrimitiveIndex [ [263] -> [ConstTwo] } ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> quickPrimitiveGeneratorFor: aQuickPrimitiveIndex [ @@ -5186,19 +5188,19 @@ CoInterpreter >> quickPrimitiveGeneratorFor: aQuickPrimitiveIndex [ otherwise: [#genQuickReturnInstVar] ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> quickPrimitiveInstVarIndexFor: primIndex [ ^primIndex - 264 ] -{ #category : #'compiled methods' } +{ #category : 'compiled methods' } CoInterpreter >> rawHeaderOf: methodPointer [ ^objectMemory fetchPointer: HeaderIndex ofObject: methodPointer ] -{ #category : #'compiled methods' } +{ #category : 'compiled methods' } CoInterpreter >> rawHeaderOf: methodOop put: cogMethodOrMethodHeader [ "Since methods may be updated while forwarding during become, make the assert accomodate this." @@ -5209,19 +5211,19 @@ CoInterpreter >> rawHeaderOf: methodOop put: cogMethodOrMethodHeader [ withValue: cogMethodOrMethodHeader ] -{ #category : #'internal interpreter access' } +{ #category : 'internal interpreter access' } CoInterpreter >> receiver [ ^stackPages longAt: framePointer + FoxIFReceiver ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> recordContextSwitchFrom: aProcess in: sourceCode [ cogit recordEventTrace ifTrue: [self recordTrace: TraceContextSwitch thing: aProcess source: sourceCode] ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> recordTrace: classOrInteger thing: selector source: source [ traceLog at: traceLogIndex put: classOrInteger. traceLog at: traceLogIndex + 1 put: selector. @@ -5229,7 +5231,7 @@ CoInterpreter >> recordTrace: classOrInteger thing: selector source: source [ traceLogIndex := traceLogIndex + 3 \\ TraceBufferSize ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> reportMinimumUnusedHeadroom [ "Report the stack page size and minimum unused headroom to stdout." @@ -5246,7 +5248,7 @@ CoInterpreter >> reportMinimumUnusedHeadroom [ cr] ] -{ #category : #'callback support' } +{ #category : 'callback support' } CoInterpreter >> restoreCStackStateForCallbackContext: vmCallbackContext [ cogit @@ -5256,7 +5258,7 @@ CoInterpreter >> restoreCStackStateForCallbackContext: vmCallbackContext [ super restoreCStackStateForCallbackContext: vmCallbackContext ] -{ #category : #enilopmarts } +{ #category : 'enilopmarts' } CoInterpreter >> return: returnValue toExecutive: inInterpreter [ "We have made a context switch, either when interpreting or from machine code. Effectively return to the current frame, either by entering machine code, or @@ -5281,13 +5283,13 @@ CoInterpreter >> return: returnValue toExecutive: inInterpreter [ ^nil ] -{ #category : #trampolines } +{ #category : 'trampolines' } CoInterpreter >> returnToExecutive: inInterpreter [ self return: self popStack toExecutive: inInterpreter ] -{ #category : #enilopmarts } +{ #category : 'enilopmarts' } CoInterpreter >> returnToExecutive: inInterpreter postContextSwitch: switchedContext [ "Return to the current frame, either by entering machine code, or longjmp-ing back to the interpreter or simply returning, depending on where we are. To know whether to return or @@ -5336,7 +5338,7 @@ CoInterpreter >> returnToExecutive: inInterpreter postContextSwitch: switchedCon ^nil ] -{ #category : #'return bytecodes' } +{ #category : 'return bytecodes' } CoInterpreter >> returnToMachineCodeFrame [ "Return to the previous context/frame after assigning localIP, localSP and localFP." @@ -5359,7 +5361,7 @@ CoInterpreter >> returnToMachineCodeFrame [ "NOTREACHED" ] -{ #category : #'method lookup cache' } +{ #category : 'method lookup cache' } CoInterpreter >> rewriteMethodCacheEntryForExternalPrimitiveToFunction: localPrimAddress [ "Rewrite an existing entry in the method cache with a new primitive function address. Used by primitiveExternalCall to make direct calls to found external prims, or quickly @@ -5383,7 +5385,7 @@ CoInterpreter >> rewriteMethodCacheEntryForExternalPrimitiveToFunction: localPri localPrimAddress ] -{ #category : #'callback support' } +{ #category : 'callback support' } CoInterpreter >> saveCStackStateForCallbackContext: vmCallbackContext [ vmCallbackContext @@ -5392,20 +5394,20 @@ CoInterpreter >> saveCStackStateForCallbackContext: vmCallbackContext [ super saveCStackStateForCallbackContext: vmCallbackContext ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> scavengeThreshold [ ^objectMemory scavengeThreshold ] -{ #category : #'internal interpreter access' } +{ #category : 'internal interpreter access' } CoInterpreter >> setCogCodeZoneThreshold: threshold [ ^cogit setCogCodeZoneThreshold: threshold ] -{ #category : #'internal interpreter access' } +{ #category : 'internal interpreter access' } CoInterpreter >> setCogVMFlags: flags [ "Set an array of flags indicating various properties of the Cog VM. Bit 0: if set, implies the image's Process class has threadId as its 3rd inst var (zero relative) @@ -5422,19 +5424,19 @@ CoInterpreter >> setCogVMFlags: flags [ "noThreadingOfGUIThread := flags anyMask: 8.. specific to CoInterpreterMT" ] -{ #category : #'internal interpreter access' } +{ #category : 'internal interpreter access' } CoInterpreter >> setDesiredCogCodeSize: dccs [ desiredCogCodeSize := dccs ] -{ #category : #'object memory support' } +{ #category : 'object memory support' } CoInterpreter >> setGCMode: mode [ gcMode := mode ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> setIFrameHasContext: theFP [ "See encodeFrameFieldHasContext:numArgs:" @@ -5442,7 +5444,7 @@ CoInterpreter >> setIFrameHasContext: theFP [ stackPages byteAt: theFP + FoxIFrameFlags + 2 put: 1 ] -{ #category : #'image save/restore' } +{ #category : 'image save/restore' } CoInterpreter >> setImageHeaderFlagsFrom: headerFlags [ "Set the flags that are contained in the 7th long of the image header." imageHeaderFlags := headerFlags. "so as to preserve unrecognised flags." @@ -5453,13 +5455,13 @@ CoInterpreter >> setImageHeaderFlagsFrom: headerFlags [ "noThreadingOfGUIThread := headerFlags anyMask: 32. specific to CoInterpreterMT" ] -{ #category : #'internal interpreter access' } +{ #category : 'internal interpreter access' } CoInterpreter >> setMethod: aMethodObj [ self assert: aMethodObj asUnsignedInteger >= objectMemory getMemoryMap startOfObjectMemory. super setMethod: aMethodObj ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> setUpForUseByFacade: aCurrentImageCoInterpreterFacade [ "Set up variables with default values so that other initializations work. numStackPages needs to be initialized so that interpreterAllocationReserveBytes @@ -5468,7 +5470,7 @@ CoInterpreter >> setUpForUseByFacade: aCurrentImageCoInterpreterFacade [ numStackPages := 0 ] -{ #category : #'debug printing' } +{ #category : 'debug printing' } CoInterpreter >> shortPrintFrame: theFP [ @@ -5499,7 +5501,7 @@ CoInterpreter >> shortPrintFrame: theFP [ self shortPrintOop: rcvr "shortPrintOop: adds a cr" ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> siglong: aJumpBuf jmp: returnValue [ "Hack simulation of sigsetjmp/siglongjmp. Signal the exception that simulates a longjmp back to the interpreter." @@ -5510,7 +5512,7 @@ CoInterpreter >> siglong: aJumpBuf jmp: returnValue [ ] -{ #category : #'runtime support' } +{ #category : 'runtime support' } CoInterpreter >> sigset: aJumpBuf jmp: sigSaveMask [ "Hack simulation of sigsetjmp/siglongjmp. Assign to reenterInterpreter the exception that when @@ -5522,7 +5524,7 @@ CoInterpreter >> sigset: aJumpBuf jmp: sigSaveMask [ ^result ] -{ #category : #'primitive support' } +{ #category : 'primitive support' } CoInterpreter >> slowPrimitiveResponse [ "Invoke a normal (non-quick) primitive. Called under the assumption that primFunctionPointer has been preloaded. @@ -5532,7 +5534,7 @@ CoInterpreter >> slowPrimitiveResponse [ ^super slowPrimitiveResponse ] -{ #category : #'trampoline support' } +{ #category : 'trampoline support' } CoInterpreter >> stackLimitAddress [ @@ -5540,7 +5542,7 @@ CoInterpreter >> stackLimitAddress [ inSmalltalk: [cogit simulatedVariableAddress: #stackLimitFromMachineCode in: self] ] -{ #category : #'stack pages' } +{ #category : 'stack pages' } CoInterpreter >> stackLimitOffset [ "Answer the amount of slots needed to fit a new frame at the point the stack limit is checked. A frame looks like this at the point the stack limit is checked: @@ -5566,7 +5568,7 @@ CoInterpreter >> stackLimitOffset [ ^(IFrameSlots + 64) * objectMemory wordSize ] -{ #category : #'stack pages' } +{ #category : 'stack pages' } CoInterpreter >> stackPageHeadroom [ "Return a minimum amount of headroom for each stack page (in bytes). In the interpreter we don't actually need any headroom. In a JIT the stack @@ -5576,7 +5578,7 @@ CoInterpreter >> stackPageHeadroom [ ^self osCogStackPageHeadroom ] -{ #category : #initialization } +{ #category : 'initialization' } CoInterpreter >> stackPagesInitializedAt: theStackMemory totalSize: stackPagesBytes pageSize: stackPageBytes [ @@ -5587,7 +5589,7 @@ CoInterpreter >> stackPagesInitializedAt: theStackMemory totalSize: stackPagesBy self assert: self minimumUnusedHeadroom = stackPageBytes. ] -{ #category : #'trampoline support' } +{ #category : 'trampoline support' } CoInterpreter >> stackPointerAddress [ @@ -5595,14 +5597,14 @@ CoInterpreter >> stackPointerAddress [ inSmalltalk: [cogit simulatedReadWriteVariableAddress: #stackPointer in: self] ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> stackPointerIndexForFrame: theFP WithSP: theSP numArgs: numArgs [ "Return the 1-based index rel to the given machine code frame" "In the StackInterpreter stacks grow down." ^(((self frameReceiverLocation: theFP) - theSP) >> objectMemory shiftForWord) + numArgs ] -{ #category : #'return bytecodes' } +{ #category : 'return bytecodes' } CoInterpreter >> tearDownAndRebuildFrameForCannotReturnBaseFrameReturnFrom: contextToReturnFrom to: contextToReturnTo returnValue: returnValue [ "Handle the cannot return response for a base frame return to an invalid context. Build a new base frame for the context in the cannot resume state ready for the @@ -5637,7 +5639,7 @@ CoInterpreter >> tearDownAndRebuildFrameForCannotReturnBaseFrameReturnFrom: cont instructionPointer := cogit ceCannotResumePC ] -{ #category : #'internal interpreter access' } +{ #category : 'internal interpreter access' } CoInterpreter >> temporary: offset in: theFP [ @@ -5646,7 +5648,7 @@ CoInterpreter >> temporary: offset in: theFP [ ifFalse: [ self itemporary: offset in: theFP ] ] -{ #category : #'internal interpreter access' } +{ #category : 'internal interpreter access' } CoInterpreter >> temporary: offset in: theFP put: valueOop [ ^(self isMachineCodeFrame: theFP) @@ -5654,18 +5656,18 @@ CoInterpreter >> temporary: offset in: theFP put: valueOop [ ifFalse: [self itemporary: offset in: theFP put: valueOop] ] -{ #category : #simulation } +{ #category : 'simulation' } CoInterpreter >> transcript [ ^Transcript ] -{ #category : #'image save/restore' } +{ #category : 'image save/restore' } CoInterpreter >> unknownShortOrCodeSizeInKs [ ^desiredCogCodeSize + 1023 // 1024 ] -{ #category : #'code compaction' } +{ #category : 'code compaction' } CoInterpreter >> updateStackZoneReferencesToCompiledCodePreCompaction [ @@ -5699,7 +5701,7 @@ CoInterpreter >> updateStackZoneReferencesToCompiledCodePreCompaction [ theFP := callerFP]]] ] -{ #category : #'debug support' } +{ #category : 'debug support' } CoInterpreter >> validInstructionPointer: instrPointer inMethod: aMethod framePointer: fp [ @@ -5726,7 +5728,7 @@ CoInterpreter >> validInstructionPointer: instrPointer inMethod: aMethod framePo ^super validInstructionPointer: theInstrPointer inMethod: aMethod framePointer: fp ] -{ #category : #'stack pages' } +{ #category : 'stack pages' } CoInterpreter >> validStackPageBaseFrame: aPage [ "Check that the base frame in the stack page has a valid sender and saved context." @@ -5751,7 +5753,7 @@ CoInterpreter >> validStackPageBaseFrame: aPage [ ^true ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> varBaseAddress [ @@ -5759,7 +5761,7 @@ CoInterpreter >> varBaseAddress [ inSmalltalk: [cogit fakeVarBaseAddress] ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> voidVMStateForSnapshotFlushingExternalPrimitivesIf: flushExtPrims [ "Make sure that all VM state that affects the heap contents is voided so that the heap is ready to be snapshotted. If flushExtPrims is true, flush references to external @@ -5772,21 +5774,21 @@ CoInterpreter >> voidVMStateForSnapshotFlushingExternalPrimitivesIf: flushExtPri ^activeContext ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> warning: aString [ self transcript cr; nextPutAll: aString; flush ] -{ #category : #'debug printing' } +{ #category : 'debug printing' } CoInterpreter >> whereIs: anOop [ (cogit whereIsMaybeCodeThing: anOop) ifNotNil: [:somewhere| ^somewhere]. ^super whereIs: anOop ] -{ #category : #'frame access' } +{ #category : 'frame access' } CoInterpreter >> widowOrForceToBytecodePC: ctxt [ "Either widow the context or map its pc to a bytecode one. Used to implement primitiveVoidVMStateForMethod." @@ -5801,7 +5803,7 @@ CoInterpreter >> widowOrForceToBytecodePC: ctxt [ [self ensureContextHasBytecodePC: ctxt] ] -{ #category : #'cog jit support' } +{ #category : 'cog jit support' } CoInterpreter >> writeBackHeadStackPointer [ self assert: (stackPointer < stackPage baseAddress and: [stackPointer > (stackPage realStackLimit - (LargeContextSlots * objectMemory bytesPerOop))]). diff --git a/smalltalksrc/VMMaker/CoInterpreterPrimitives.class.st b/smalltalksrc/VMMaker/CoInterpreterPrimitives.class.st index 0f72773707..19e4d2c563 100644 --- a/smalltalksrc/VMMaker/CoInterpreterPrimitives.class.st +++ b/smalltalksrc/VMMaker/CoInterpreterPrimitives.class.st @@ -1,10 +1,12 @@ Class { - #name : #CoInterpreterPrimitives, - #superclass : #CoInterpreter, - #category : #'VMMaker-JIT' + #name : 'CoInterpreterPrimitives', + #superclass : 'CoInterpreter', + #category : 'VMMaker-JIT', + #package : 'VMMaker', + #tag : 'JIT' } -{ #category : #'object access primitives' } +{ #category : 'object access primitives' } CoInterpreterPrimitives >> frameIsMarked: theFPInt [ | methodField | methodField := stackPages longAt: theFPInt + FoxMethod. @@ -13,7 +15,7 @@ CoInterpreterPrimitives >> frameIsMarked: theFPInt [ ifFalse: [((stackPages longAt: theFPInt + FoxIFrameFlags) bitAnd: 2) ~= 0] ] -{ #category : #'object access primitives' } +{ #category : 'object access primitives' } CoInterpreterPrimitives >> markFrame: theFPInt [ | methodField | methodField := stackPages unsignedLongAt: theFPInt + FoxMethod. @@ -28,7 +30,7 @@ CoInterpreterPrimitives >> markFrame: theFPInt [ put: ((stackPages longAt: theFPInt + FoxIFrameFlags) bitOr: 2)] ] -{ #category : #'arithmetic primitives' } +{ #category : 'arithmetic primitives' } CoInterpreterPrimitives >> mcprimHashMultiply: receiverArg [ "Machine code primitive for hash multiply. c.f. primitiveHashMultiply. mcprims consume receiver and arguments as parameters and answer the @@ -48,7 +50,7 @@ CoInterpreterPrimitives >> mcprimHashMultiply: receiverArg [ ^objectMemory integerObjectOf: (value * HashMultiplyConstant bitAnd: 16rFFFFFFF) ] -{ #category : #'object access primitives' } +{ #category : 'object access primitives' } CoInterpreterPrimitives >> pathTo: goal using: stack followWeak: followWeak [ "Trace objects and frames from the root, marking visited objects, pushing the current path on stack, until goal is found. If found, unmark, leaving path in stack, and answer 0. Otherwise answer an error: @@ -134,7 +136,7 @@ CoInterpreterPrimitives >> pathTo: goal using: stack followWeak: followWeak [ stackp := stackp - 2] repeat ] -{ #category : #'method introspection support' } +{ #category : 'method introspection support' } CoInterpreterPrimitives >> pcDataFor: cogMethod [ | cm nSlots nEntries data | @@ -150,7 +152,7 @@ CoInterpreterPrimitives >> pcDataFor: cogMethod [ ^data ] -{ #category : #'method introspection primitives' } +{ #category : 'method introspection primitives' } CoInterpreterPrimitives >> primitiveAllMethodsCompiledToMachineCode [ @@ -168,7 +170,7 @@ CoInterpreterPrimitives >> primitiveAllMethodsCompiledToMachineCode [ self pop: 1 thenPush: arrayObj ] -{ #category : #'process primitives' } +{ #category : 'process primitives' } CoInterpreterPrimitives >> primitiveCollectCogCodeConstituents [ "Answer the contents of the code zone as an array of pair-wise element, address in ascending address order. Answer a string for a runtime routine or abstract label (beginning, end, etc), @@ -189,7 +191,7 @@ CoInterpreterPrimitives >> primitiveCollectCogCodeConstituents [ self pop: argumentCount + 1 thenPush: constituents ] -{ #category : #'indexing primitives' } +{ #category : 'indexing primitives' } CoInterpreterPrimitives >> primitiveContextXray [ "Lift the veil from a context and answer an integer describing its interior state. Used for e.g. VM tests so they can verify they're testing what they think they're testing. @@ -222,7 +224,7 @@ CoInterpreterPrimitives >> primitiveContextXray [ self pop: 1 thenPush: (objectMemory integerObjectOf: flags) ] -{ #category : #'system control primitives' } +{ #category : 'system control primitives' } CoInterpreterPrimitives >> primitiveFlushCacheByMethod [ "The receiver is a compiledMethod. Clear all entries in the method lookup cache that refer to this method, presumably because it has been redefined, overridden or removed. @@ -231,7 +233,7 @@ CoInterpreterPrimitives >> primitiveFlushCacheByMethod [ cogit unlinkSendsTo: self stackTop andFreeIf: false ] -{ #category : #'system control primitives' } +{ #category : 'system control primitives' } CoInterpreterPrimitives >> primitiveFlushCacheBySelector [ "The receiver is a message selector. Clear all entries in the method lookup cache with this selector, presumably because an associated method has been redefined. @@ -251,7 +253,7 @@ CoInterpreterPrimitives >> primitiveFlushCacheBySelector [ isMNUSelector: (selector = (objectMemory splObj: SelectorDoesNotUnderstand)) ] -{ #category : #'trampoline support' } +{ #category : 'trampoline support' } CoInterpreterPrimitives >> primitiveFunctionPointerAddress [ @@ -259,7 +261,7 @@ CoInterpreterPrimitives >> primitiveFunctionPointerAddress [ inSmalltalk: [cogit simulatedReadWriteVariableAddress: #primitiveFunctionPointer in: self] ] -{ #category : #'process primitives' } +{ #category : 'process primitives' } CoInterpreterPrimitives >> primitiveLongRunningPrimitiveSemaphore [ "Primitive. Install the semaphore to be used for collecting long-running primitives, or nil if no semaphore should be used." @@ -294,7 +296,7 @@ CoInterpreterPrimitives >> primitiveLongRunningPrimitiveSemaphore [ [self siglong: reenterInterpreter jmp: ReturnToInterpreter] ] -{ #category : #'method introspection primitives' } +{ #category : 'method introspection primitives' } CoInterpreterPrimitives >> primitiveMethodPCData [ | methodReceiver data | @@ -311,7 +313,7 @@ CoInterpreterPrimitives >> primitiveMethodPCData [ self pop: 1 thenPush: data ] -{ #category : #'method introspection primitives' } +{ #category : 'method introspection primitives' } CoInterpreterPrimitives >> primitiveMethodProfilingData [ | methodReceiver data | @@ -328,7 +330,7 @@ CoInterpreterPrimitives >> primitiveMethodProfilingData [ self pop: 1 thenPush: data ] -{ #category : #'indexing primitives' } +{ #category : 'indexing primitives' } CoInterpreterPrimitives >> primitiveMethodXray [ "Lift the veil from a method and answer an integer describing the interior state @@ -384,13 +386,13 @@ CoInterpreterPrimitives >> primitiveMethodXray [ self pop: 1 thenPush: (objectMemory integerObjectOf: flags) ] -{ #category : #'other primitives' } +{ #category : 'other primitives' } CoInterpreterPrimitives >> primitiveMinimumUnusedHeadroom [ self methodReturnValue: (self integerObjectOf: self minimumUnusedHeadroom) ] -{ #category : #'object access primitives' } +{ #category : 'object access primitives' } CoInterpreterPrimitives >> primitiveObjectAt [ "Defined for CompiledMethods only" | thisReceiver rawHeader realHeader index | @@ -411,7 +413,7 @@ CoInterpreterPrimitives >> primitiveObjectAt [ ifFalse: [objectMemory fetchPointer: index - 1 ofObject: thisReceiver]) ] -{ #category : #'object access primitives' } +{ #category : 'object access primitives' } CoInterpreterPrimitives >> primitiveObjectAtPut [ "Store a literal into a CompiledMethod at the given index. Defined for CompiledMethods only." | thisReceiver rawHeader realHeader index newValue | @@ -443,7 +445,7 @@ CoInterpreterPrimitives >> primitiveObjectAtPut [ self pop: 3 thenPush: newValue ] -{ #category : #'process primitives' } +{ #category : 'process primitives' } CoInterpreterPrimitives >> primitiveProfileSemaphore [ "Primitive. Install the semaphore to be used for profiling, or nil if no semaphore should be used. @@ -478,7 +480,7 @@ CoInterpreterPrimitives >> primitiveProfileSemaphore [ [self siglong: reenterInterpreter jmp: ReturnToInterpreter] ] -{ #category : #'method introspection primitives' } +{ #category : 'method introspection primitives' } CoInterpreterPrimitives >> primitiveResetCountersInMethod [ @@ -490,7 +492,7 @@ CoInterpreterPrimitives >> primitiveResetCountersInMethod [ [cogit resetCountersIn: (self cogMethodOf: methodReceiver)] ] -{ #category : #'process primitives' } +{ #category : 'process primitives' } CoInterpreterPrimitives >> primitiveSignal [ "Synchronously signal the semaphore. This may change the active process as a result." @@ -505,7 +507,7 @@ CoInterpreterPrimitives >> primitiveSignal [ [self forProcessPrimitiveReturnToExecutivePostContextSwitch: inInterpreter] ] -{ #category : #'system control primitives' } +{ #category : 'system control primitives' } CoInterpreterPrimitives >> primitiveSnapshot [ "Save a normal snapshot under the same name as it was loaded unless it has been renamed by the last primitiveImageName. @@ -521,7 +523,7 @@ CoInterpreterPrimitives >> primitiveSnapshot [ "NOTREACHED" ] -{ #category : #'control primitives' } +{ #category : 'control primitives' } CoInterpreterPrimitives >> primitiveTerminateTo [ "Primitive. Terminate up the context stack from the receiver up to but not including the argument, if previousContext is on my Context stack. Make previousContext my @@ -700,7 +702,7 @@ CoInterpreterPrimitives >> primitiveTerminateTo [ self assert: stackPage = stackPages mostRecentlyUsedPage ] -{ #category : #'system control primitives' } +{ #category : 'system control primitives' } CoInterpreterPrimitives >> primitiveVoidVMState [ "Void all internal VM state in the stack and machine code zones @@ -713,7 +715,7 @@ CoInterpreterPrimitives >> primitiveVoidVMState [ "NOTREACHED" ] -{ #category : #'system control primitives' } +{ #category : 'system control primitives' } CoInterpreterPrimitives >> primitiveVoidVMStateForMethod [ "The receiver (or first argument) must be a compiledMethod. The optional (or second) argument must be a boolean. Clear all VM state associated with the method, including any machine code, or machine code pcs @@ -770,7 +772,7 @@ CoInterpreterPrimitives >> primitiveVoidVMStateForMethod [ self pop: argumentCount ] -{ #category : #'method introspection support' } +{ #category : 'method introspection support' } CoInterpreterPrimitives >> profilingDataFor: cogMethod [ | cm nSlots nEntries data | @@ -786,7 +788,7 @@ CoInterpreterPrimitives >> profilingDataFor: cogMethod [ ^data ] -{ #category : #'object access primitives' } +{ #category : 'object access primitives' } CoInterpreterPrimitives >> unmarkAllFrames [ | thePage theFP methodField flags | diff --git a/smalltalksrc/VMMaker/CogARMCompiler.class.st b/smalltalksrc/VMMaker/CogARMCompiler.class.st index 4b62542f47..1ca623e086 100644 --- a/smalltalksrc/VMMaker/CogARMCompiler.class.st +++ b/smalltalksrc/VMMaker/CogARMCompiler.class.st @@ -7,8 +7,8 @@ The Architecture Reference Manual used is that of version 5, which includes some This class does not take any special action to flush the instruction cache on instruction-modification. " Class { - #name : #CogARMCompiler, - #superclass : #CogAbstractInstruction, + #name : 'CogARMCompiler', + #superclass : 'CogAbstractInstruction', #instVars : [ 'conditionOrNil' ], @@ -83,50 +83,52 @@ Class { 'VS', 'XorOpcode' ], - #category : #'VMMaker-JIT' + #category : 'VMMaker-JIT', + #package : 'VMMaker', + #tag : 'JIT' } -{ #category : #accessing } +{ #category : 'accessing' } CogARMCompiler class >> IPReg [ "Answer the number of the general temp reg in the ARM APCS convention, IP" ^ConcreteIPReg ] -{ #category : #translation } +{ #category : 'translation' } CogARMCompiler class >> ISA [ "Answer the name of the ISA the receiver implements." ^#ARMv5 ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMCompiler class >> PCReg [ ^ConcretePCReg ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMCompiler class >> VarBaseReg [ "Answer the number of the reg we use to hold the base address of CoInterpreter variables" ^ConcreteVarBaseReg ] -{ #category : #translation } +{ #category : 'translation' } CogARMCompiler class >> defaultCompilerClass [ ^CogOutOfLineLiteralsARMCompiler ] -{ #category : #translation } +{ #category : 'translation' } CogARMCompiler class >> filteredInstVarNames [ "Edit such that conditionOrNil is amongst the char size vars opcode machineCodeSize and maxSize." ^(super filteredInstVarNames copyWithout: 'conditionOrNil') copyReplaceFrom: 5 to: 4 with: #('conditionOrNil') ] -{ #category : #translation } +{ #category : 'translation' } CogARMCompiler class >> identifyingPredefinedMacros [ ^#('__ARM_ARCH_5__' '__ARM_ARCH_6__' '__ARM_ARCH_7__' '__arm__' '__arm32__' 'ARM32' '_M_ARM') ] -{ #category : #'class initialization' } +{ #category : 'class initialization' } CogARMCompiler class >> initialize [ "Initialize various ARM instruction-related constants." @@ -212,7 +214,7 @@ CogARMCompiler class >> initialize [ in: thisContext method ] -{ #category : #'class initialization' } +{ #category : 'class initialization' } CogARMCompiler class >> initializeAbstractRegisters [ "Assign the abstract registers with the identities/indices of the relevant concrete registers." @@ -269,43 +271,43 @@ CogARMCompiler class >> initializeAbstractRegisters [ NumFloatRegisters := 8 ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler class >> isAbstract [ ^self == CogARMCompiler ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler class >> isRISCTempRegister: reg [ "For tests to filter-out bogus values left in the RISCTempRegister, if any." ^reg = ConcreteIPReg ] -{ #category : #translation } +{ #category : 'translation' } CogARMCompiler class >> machineCodeDeclaration [ "Answer the declaration for the machineCode array. ARM instructions are 32-bits in length." ^{#'unsigned int'. '[', self basicNew machineCodeWords printString, ']'} ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMCompiler class >> orOpcode [ ^OrOpcode ] -{ #category : #'class initialization' } +{ #category : 'class initialization' } CogARMCompiler class >> specificOpcodes [ "Answer the processor-specific opcodes for this class. They're all in an Array literal in the initialize method." ^(self class >> #initialize) literals detect: [:l| l isArray and: [l includes: #LDMFD]] ] -{ #category : #translation } +{ #category : 'translation' } CogARMCompiler class >> wordSize [ "This is a 32-bit ISA" ^4 ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> add: destReg rn: srcReg imm: immediate ror: rot [ "Remember the ROR is doubled by the cpu so use 30>>1 etc. ADD destReg, srcReg, #immediate ROR #rot - ARM_ARM v7 DDI10406 p. A8-23" @@ -313,7 +315,7 @@ CogARMCompiler >> add: destReg rn: srcReg imm: immediate ror: rot [ ^self type: 1 op: AddOpcode set: 0 rn: srcReg rd: destReg shifterOperand: ((rot>>1) <<8 bitOr: immediate) ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> add: destReg rn: srcReg rm: addReg [ "return an ADD destReg, srcReg, addReg instruction ADD destReg, srcReg, addReg - ARM_ARM v7 DDI10406 p. A8-24" @@ -321,7 +323,7 @@ CogARMCompiler >> add: destReg rn: srcReg rm: addReg [ ^self type: 0 op: AddOpcode set: 0 rn: srcReg rd: destReg shifterOperand: addReg ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> adds: destReg rn: srcReg imm: immediate ror: rot [ "Remember the ROR is doubled by the cpu so use 30>>1 etc ADDS destReg, srcReg, #immediate ROR #rot - ARM_ARM v7 DDI10406 p. A8-23" @@ -329,7 +331,7 @@ CogARMCompiler >> adds: destReg rn: srcReg imm: immediate ror: rot [ ^self type: 1 op: AddOpcode set: 1 rn: srcReg rd: destReg shifterOperand: ((rot>>1) <<8 bitOr: immediate) ] -{ #category : #simulation } +{ #category : 'simulation' } CogARMCompiler >> aeabiDiv: dividend Mod: divisor [ "simulate the __aeabi_idivmod call" @@ -344,7 +346,7 @@ CogARMCompiler >> aeabiDiv: dividend Mod: divisor [ ^result ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> aeabiDivModFunctionAddr [ "Answer the address of the __aeabi_idivmod() call provided by the ARM low level libs to do an integer divide that returns the quo in R0 and rem in R1. A word on the somewhat strange usage of idivmod herein; we need a declaration for the _aeabi_idivmod helper function, despite the fact that in a simple C program test, you don't. @@ -358,7 +360,7 @@ CogARMCompiler >> aeabiDivModFunctionAddr [ ^self cCode: '(usqInt)__aeabi_idivmod' inSmalltalk:[#aeabiDiv:Mod:] ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> and: destReg rn: srcReg imm: immediate ror: rot [ "Remember the ROR is doubled by the cpu so use 30>>1 etc AND destReg, srcReg, #immediate ROR #rot - ARM_ARM v7 DDI10406 p. A8-34" @@ -366,7 +368,7 @@ CogARMCompiler >> and: destReg rn: srcReg imm: immediate ror: rot [ ^self type: 1 op: AndOpcode set: 0 rn: srcReg rd: destReg shifterOperand: ((rot>>1) <<8 bitOr: immediate) ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> ands: destReg rn: srcReg imm: immediate ror: rot [ "Remember the ROR is doubled by the cpu so use 30>>1 etc ANDS destReg, srcReg, #immediate ROR #rot - ARM_ARM v7 DDI10406 p. A8-34" @@ -374,7 +376,7 @@ CogARMCompiler >> ands: destReg rn: srcReg imm: immediate ror: rot [ ^self type: 1 op: AndOpcode set: 1 rn: srcReg rd: destReg shifterOperand: ((rot>>1) <<8 bitOr: immediate) ] -{ #category : #'register allocation' } +{ #category : 'register allocation' } CogARMCompiler >> availableRegisterOrNoneFor: liveRegsMask [ "Answer an unused abstract register in the liveRegMask. Subclasses with more registers can override to answer them. @@ -389,7 +391,7 @@ CogARMCompiler >> availableRegisterOrNoneFor: liveRegsMask [ ^super availableRegisterOrNoneFor: liveRegsMask ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> b: offset [ "return a B offset instruction; offset is signed 24bits of WORD offset, so +_32Mbyte range B offset - ARM_ARM v7 DDI10406 pp. A8-44-5" @@ -397,7 +399,7 @@ CogARMCompiler >> b: offset [ ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> bics: destReg rn: srcReg imm: immediate ror: rot [ "Remember the ROR is doubled by the cpu so use 30>>1 etc BICS destReg, srcReg, #immediate ROR #rot - ARM_ARM v7 DDI10406 pp. A8-50-1" @@ -405,7 +407,7 @@ CogARMCompiler >> bics: destReg rn: srcReg imm: immediate ror: rot [ ^self type: 1 op: BicOpcode set: 1 rn: srcReg rd: destReg shifterOperand: ((rot>>1) <<8 bitOr: immediate) ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> bl: offset [ "return a BL offset instruction; offset is signed 24bits of WORD offset, so +_32Mbyte range. Return address is in LR BL offset - ARM_ARM v7 DDI10406 pp. A8-58-9" @@ -413,7 +415,7 @@ CogARMCompiler >> bl: offset [ ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> blx: targetReg [ "Branch&link to the address in targetReg. Return address is in LR BLX targetReg - ARM_ARM v7 DDI10406 pp. A8-60-1" @@ -422,7 +424,7 @@ CogARMCompiler >> blx: targetReg [ ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> bx: targetReg [ "Branch to address in targetReg. BX targetReg BX targetReg - ARM_ARM v7 DDI10406 pp. A8-62-3" @@ -431,31 +433,31 @@ CogARMCompiler >> bx: targetReg [ ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> byteReadsZeroExtend [ ^true ] -{ #category : #abi } +{ #category : 'abi' } CogARMCompiler >> cResultRegister [ "Answer the register through which C funcitons return integral results." ^R0 ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMCompiler >> cStackPointer [ ^ SP ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMCompiler >> callInstructionByteSize [ "ARM calls and jumps span +/- 32 mb, more than enough for intra-zone calls and jumps." ^4 ] -{ #category : #'inline cacheing' } +{ #category : 'inline cacheing' } CogARMCompiler >> callTargetFromReturnAddress: callSiteReturnAddress [ "Answer the address that the call immediately preceding callSiteReturnAddress will jump to." "this is also used by #jumpLongTargetBeforeFollowingAddress:." @@ -467,31 +469,31 @@ CogARMCompiler >> callTargetFromReturnAddress: callSiteReturnAddress [ ^callSiteReturnAddress + 4 + callDistance signedIntFromLong ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> canDivQuoRem [ ^true ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> canMulRR [ "we can do a MulRR be we can't simulate it correctly for some reason. More bug-fixing in the simulator one day" ^true ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> canPushPopMultipleRegisters [ ^true ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMCompiler >> codeGranularity [ "Answer the size in bytes of a unit of machine code." ^4 ] -{ #category : #'generate machine code' } +{ #category : 'generate machine code' } CogARMCompiler >> computeMaximumSize [ "Because we don't use Thumb, each ARM instruction has 4 bytes. Many abstract opcodes need more than one instruction. Instructions that refer @@ -705,7 +707,7 @@ CogARMCompiler >> computeMaximumSize [ ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMCompiler >> concreteCalleeSavedRegisterMask [ "According to IHI0042E ARM Architecture Procedure Calling Standard, in section 5.1.1: A subroutine must preserve the contents of the registers r4-r8, r10, r11 and SP (and r9 in PCS variants that designate r9 as v6). @@ -713,7 +715,7 @@ CogARMCompiler >> concreteCalleeSavedRegisterMask [ ^2r0000110111110000 ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMCompiler >> concreteCallerSavedRegisterMask [ "According to IHI0042E ARM Architecture Procedure Calling Standard, in section 5.1.1: A subroutine must preserve the contents of the registers r4-r8, r10, r11 and SP (and r9 in PCS variants that designate r9 as v6). @@ -723,7 +725,7 @@ CogARMCompiler >> concreteCallerSavedRegisterMask [ ^2r1001000001111 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeAddRdRd [ "Will get inlined into concretizeAt: switch." @@ -736,7 +738,7 @@ CogARMCompiler >> concretizeAddRdRd [ ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeAlignmentNops [ "fill any slots with NOPs - in this case mov r0, r0 - which is the NOP I always used to use" @@ -745,7 +747,7 @@ CogARMCompiler >> concretizeAlignmentNops [ [:p| self machineCodeAt: p put: 16rE1A00000] ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeAndCqRR [ "Will get inlined into concretizeAt: switch." "AND is very important since it's used to mask all sorts of flags in the jit. We take special care to try to find compact ways to make the masks" @@ -775,7 +777,7 @@ CogARMCompiler >> concretizeAndCqRR [ ^0 "to keep Slang happy" ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeArithmeticShiftRightCqR [ "Will get inlined into concretizeAt: switch." "this is an unfortunate waste of an instruction in most cases since the shift can usually be done in a subsequent arithmetic instruction. @@ -790,7 +792,7 @@ CogARMCompiler >> concretizeArithmeticShiftRightCqR [ ^machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeArithmeticShiftRightRR [ "Will get inlined into concretizeAt: switch." "this is an unfortunate waste of an instruction in most cases since the shift can usually be done in a subsequent arithmetic instruction. @@ -805,7 +807,7 @@ CogARMCompiler >> concretizeArithmeticShiftRightRR [ ^machineCodeSize := 4 ] -{ #category : #'generate machine code' } +{ #category : 'generate machine code' } CogARMCompiler >> concretizeAt: actualAddress [ "Generate concrete machine code for the instruction at actualAddress, setting machineCodeSize, and answer the following address." @@ -814,7 +816,7 @@ CogARMCompiler >> concretizeAt: actualAddress [ ^super concretizeAt: actualAddress ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeCMPSMULL [ "Generate a CMP a, b, ASR #31 instruction, specifically for comparing the resutls of SMULLs in genMulR:R:" | hiReg loReg | @@ -828,7 +830,7 @@ CogARMCompiler >> concretizeCMPSMULL [ ^machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeCall [ "Will get inlined into concretizeAt: switch." @@ -842,7 +844,7 @@ CogARMCompiler >> concretizeCall [ ^machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeCallFull [ "Will get inlined into concretizeAt: switch." "Sizing/generating calls. @@ -860,7 +862,7 @@ CogARMCompiler >> concretizeCallFull [ ^machineCodeSize := instrOffset + 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeCmpRdRd [ "Will get inlined into concretizeAt: switch." @@ -874,7 +876,7 @@ CogARMCompiler >> concretizeCmpRdRd [ ] -{ #category : #'generate machine code' } +{ #category : 'generate machine code' } CogARMCompiler >> concretizeConditionalInstruction [ "Concretize the current instruction, but with a condition." @@ -890,7 +892,7 @@ CogARMCompiler >> concretizeConditionalInstruction [ self machineCodeAt: i put: (instr bitOr: (conditionOrNil bitAnd: 16rF)<<28)] ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeConditionalJump: conditionCode [ "Will get inlined into concretizeAt: switch." "Sizing/generating jumps. @@ -905,7 +907,7 @@ CogARMCompiler >> concretizeConditionalJump: conditionCode [ ^machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeConvertRRd [ "Will get inlined into concretizeAt: switch." @@ -919,7 +921,7 @@ CogARMCompiler >> concretizeConvertRRd [ ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeDataOperationCqR: armOpcode [ "Will get inlined into concretizeAt: switch." "4 == Add, 2 == Sub, Xor == 1, And == 0, Or == 12, Bic == 14" @@ -948,7 +950,7 @@ CogARMCompiler >> concretizeDataOperationCqR: armOpcode [ ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeDataOperationCwR: armOpcode [ "Will get inlined into concretizeAt: switch." "Load the word into the RISCTempReg, then cmp R, RISCTempReg" @@ -963,7 +965,7 @@ CogARMCompiler >> concretizeDataOperationCwR: armOpcode [ ^machineCodeSize := instrOffset + 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeDataOperationRR: armOpcode [ "Will get inlined into concretizeAt: switch." "Load the word into the RISCTempReg, then op R, RISCTempReg" @@ -977,7 +979,7 @@ CogARMCompiler >> concretizeDataOperationRR: armOpcode [ ^machineCodeSize := 4. ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeDivRdRd [ "Will get inlined into concretizeAt: switch." @@ -990,7 +992,7 @@ CogARMCompiler >> concretizeDivRdRd [ ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeFPConditionalJump: conditionCode [ "Will get inlined into concretizeAt: switch." @@ -1003,14 +1005,14 @@ CogARMCompiler >> concretizeFPConditionalJump: conditionCode [ ^machineCodeSize := 8 ] -{ #category : #'generate machine code' } +{ #category : 'generate machine code' } CogARMCompiler >> concretizeFill32 [ "fill with operand 0 according to the processor's endianness" self machineCodeAt: 0 put: (operands at: 0). ^machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeInvertibleDataOperationCqR: armOpcode [ "Will get inlined into concretizeAt: switch." "Xor == 1, And == 0, Or == 12, Bic == 14" @@ -1045,7 +1047,7 @@ CogARMCompiler >> concretizeInvertibleDataOperationCqR: armOpcode [ ^0 "to keep Slang happy" ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeJumpFull [ "Will get inlined into concretizeAt: switch." "A JumpFull is used when we need to jump to anywhere in 32bit address space rather than somewhere known to be in code-space. It also must be relocatable and non-varying with the jump range. On ARM this means using the build-long-const + BX sequence." @@ -1059,7 +1061,7 @@ CogARMCompiler >> concretizeJumpFull [ ^machineCodeSize := instrOffset + 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeJumpR [ "Will get inlined into concretizeAt: switch." "Sizing/generating jumps. @@ -1074,7 +1076,7 @@ CogARMCompiler >> concretizeJumpR [ ^machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeLoadEffectiveAddressMwrR [ "Will get inlined into concretizeAt: switch." "destReg = srcReg (which contains an address) + offset" @@ -1098,7 +1100,7 @@ CogARMCompiler >> concretizeLoadEffectiveAddressMwrR [ ^machineCodeSize "to keep Slang happy" ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeLogicalShiftLeftCqR [ "Will get inlined into concretizeAt: switch." "this is an unfortunate waste of an instruction in most cases since the shift can usually be done in a subsequent arithmetic instruction. @@ -1112,7 +1114,7 @@ CogARMCompiler >> concretizeLogicalShiftLeftCqR [ ^machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeLogicalShiftLeftRR [ "Will get inlined into concretizeAt: switch." "this is an unfortunate waste of an instruction in most cases since the shift can usually be done in a subsequent arithmetic instruction. @@ -1127,7 +1129,7 @@ CogARMCompiler >> concretizeLogicalShiftLeftRR [ ^machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeLogicalShiftRightCqR [ "Will get inlined into concretizeAt: switch." "this is an unfortunate waste of an instruction in most cases since the shift can usually be done in a subsequent arithmetic instruction. @@ -1142,7 +1144,7 @@ CogARMCompiler >> concretizeLogicalShiftRightCqR [ ^machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeLogicalShiftRightRR [ "Will get inlined into concretizeAt: switch." "this is an unfortunate waste of an instruction in most cases since the shift can usually be done in a subsequent arithmetic instruction. @@ -1157,7 +1159,7 @@ CogARMCompiler >> concretizeLogicalShiftRightRR [ ^machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeMSR [ "Generate an MSR CPSR_f, #flags instruction. Note that we only have business with the NZCV flags so we use @@ -1172,7 +1174,7 @@ You don't want to mess with this too much." ^machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeMoveAbR [ "Will get inlined into concretizeAt: switch." @@ -1189,7 +1191,7 @@ CogARMCompiler >> concretizeMoveAbR [ ^machineCodeSize := instrOffset + 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeMoveAwR [ "Will get inlined into concretizeAt: switch." @@ -1206,7 +1208,7 @@ CogARMCompiler >> concretizeMoveAwR [ ^machineCodeSize := instrOffset + 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeMoveCqR [ "Will get inlined into concretizeAt: switch." "If the quick constant is in fact a shiftable 8bit, generate the apropriate MOV, otherwise do what is necessary for a whole word." @@ -1232,14 +1234,14 @@ CogARMCompiler >> concretizeMoveCqR [ ^0 "to keep Slang happy" ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeMoveCwR [ "Will get inlined into concretizeAt: switch." ^machineCodeSize := self loadCwInto: (operands at: 1) ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeMoveM16rR [ "Will get inlined into concretizeAt: switch." "ldrh destReg, [srcReg, #immediate], @@ -1266,7 +1268,7 @@ CogARMCompiler >> concretizeMoveM16rR [ ^0 "to keep Slang happy" ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeMoveM64rRd [ "Will get inlined into concretizeAt: switch." @@ -1281,7 +1283,7 @@ CogARMCompiler >> concretizeMoveM64rRd [ ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeMoveMbrR [ "Will get inlined into concretizeAt: switch." "ldrb destReg, [srcReg, #immediate] or ldrb destReg, [srcReg, ConcreteIPReg]" @@ -1310,7 +1312,7 @@ CogARMCompiler >> concretizeMoveMbrR [ ^0 "to keep Slang happy" ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeMoveMwrR [ "Will get inlined into concretizeAt: switch." @@ -1333,7 +1335,7 @@ CogARMCompiler >> concretizeMoveMwrR [ ^0 "to keep Slang happy" ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeMoveRAb [ "Will get inlined into concretizeAt: switch." "LEA ConcreteIPReg @@ -1352,7 +1354,7 @@ CogARMCompiler >> concretizeMoveRAb [ ^machineCodeSize := instrOffset + 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeMoveRAw [ "Will get inlined into concretizeAt: switch." "LEA ConcreteIPReg @@ -1371,7 +1373,7 @@ CogARMCompiler >> concretizeMoveRAw [ ^machineCodeSize := instrOffset + 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeMoveRM16r [ "Will get inlined into concretizeAt: switch." @@ -1400,7 +1402,7 @@ CogARMCompiler >> concretizeMoveRM16r [ ^0 "to keep Slang happy" ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeMoveRMbr [ "Will get inlined into concretizeAt: switch." @@ -1428,7 +1430,7 @@ CogARMCompiler >> concretizeMoveRMbr [ ^0 "to keep Slang happy" ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeMoveRMwr [ "Will get inlined into concretizeAt: switch." @@ -1451,7 +1453,7 @@ CogARMCompiler >> concretizeMoveRMwr [ ^0 "to keep Slang happy" ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeMoveRR [ "Will get inlined into concretizeAt: switch." @@ -1463,7 +1465,7 @@ CogARMCompiler >> concretizeMoveRR [ ^machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeMoveRXbrR [ "Will get inlined into concretizeAt: switch." "Write the word in R(src) into memory at address (base+1*index)" @@ -1478,7 +1480,7 @@ CogARMCompiler >> concretizeMoveRXbrR [ ^machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeMoveRXwrR [ "Will get inlined into concretizeAt: switch." "Write the word in R(src) into memory at address (base+4*index)" @@ -1493,7 +1495,7 @@ CogARMCompiler >> concretizeMoveRXwrR [ ^machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeMoveRdM64r [ "Will get inlined into concretizeAt: switch." @@ -1508,7 +1510,7 @@ CogARMCompiler >> concretizeMoveRdM64r [ ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeMoveXbrRR [ "Will get inlined into concretizeAt: switch." @@ -1523,7 +1525,7 @@ CogARMCompiler >> concretizeMoveXbrRR [ ^machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeMoveXwrRR [ "Will get inlined into concretizeAt: switch." @@ -1538,7 +1540,7 @@ CogARMCompiler >> concretizeMoveXwrRR [ ^machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeMulRdRd [ "Will get inlined into concretizeAt: switch." @@ -1551,7 +1553,7 @@ CogARMCompiler >> concretizeMulRdRd [ ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeNegateR [ "Will get inlined into concretizeAt: switch." @@ -1562,7 +1564,7 @@ CogARMCompiler >> concretizeNegateR [ ^machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeNegateableDataOperationCqR: armOpcode [ "Will get inlined into concretizeAt: switch." "4 == Add, 2 == Sub, 10 = Cmp" @@ -1598,7 +1600,7 @@ CogARMCompiler >> concretizeNegateableDataOperationCqR: armOpcode [ ^0 "to keep Slang happy" ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeNop [ "Will get inlined into concretizeAt: switch." @@ -1608,7 +1610,7 @@ CogARMCompiler >> concretizeNop [ ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizePopR [ "Will get inlined into concretizeAt: switch." @@ -1619,7 +1621,7 @@ CogARMCompiler >> concretizePopR [ ^machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizePrefetchAw [ "Will get inlined into concretizeAt: switch." @@ -1634,7 +1636,7 @@ CogARMCompiler >> concretizePrefetchAw [ ^machineCodeSize := instrOffset + 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizePushCq [ "Will get inlined into concretizeAt: switch." @@ -1655,7 +1657,7 @@ CogARMCompiler >> concretizePushCq [ ^machineCodeSize := instrOffset + 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizePushCw [ "Will get inlined into concretizeAt: switch." @@ -1680,7 +1682,7 @@ CogARMCompiler >> concretizePushCw [ ^machineCodeSize := instrOffset + 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizePushOrPopMultipleRegisters: doPush [ self assert: (operands at: 0) ~= 0. machineCode at: 0 put: AL << 28 @@ -1692,7 +1694,7 @@ CogARMCompiler >> concretizePushOrPopMultipleRegisters: doPush [ ^machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizePushR [ "Will get inlined into concretizeAt: switch." @@ -1703,7 +1705,7 @@ CogARMCompiler >> concretizePushR [ ^machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeRetN [ "Will get inlined into concretizeAt: switch." @@ -1720,7 +1722,7 @@ CogARMCompiler >> concretizeRetN [ ^machineCodeSize := 8 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeSMULL [ | srcA srcB hiResultReg loResultReg | "Generate an SMULL loResultReg, hiResultReg, srcA, srcB instruction" @@ -1736,7 +1738,7 @@ CogARMCompiler >> concretizeSMULL [ ^machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeSqrtRd [ "Will get inlined into concretizeAt: switch." @@ -1748,14 +1750,14 @@ CogARMCompiler >> concretizeSqrtRd [ ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeStop [ self machineCodeAt: 0 put: self stop. ^machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeSubCqR [ "Will get inlined into concretizeAt: switch." "Try whether the quick constant is a small negative number. If it is, optimize." @@ -1779,7 +1781,7 @@ CogARMCompiler >> concretizeSubCqR [ ^0 "to keep Slang happy" ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeSubRdRd [ "Will get inlined into concretizeAt: switch." @@ -1792,7 +1794,7 @@ CogARMCompiler >> concretizeSubRdRd [ ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMCompiler >> concretizeTstCqR [ "Will get inlined into concretizeAt: switch." @@ -1805,7 +1807,7 @@ CogARMCompiler >> concretizeTstCqR [ ^0 "to keep Slang happy" ] -{ #category : #encoding } +{ #category : 'encoding' } CogARMCompiler >> cond: c br: link offset: offset [ "c : 4 bit, opcode = 10 bitOr: link, offset >>2, limited to 24 bits (which are sign-extended, shifted left 2 and added to 8 + pc to make the resulting address)" "single instr Branch, no link" @@ -1813,7 +1815,7 @@ CogARMCompiler >> cond: c br: link offset: offset [ ^ c << 28 bitOr: (((2r1010 bitOr: (link bitAnd: 1)) << 24) bitOr: (offset >> 2 bitAnd: 16r00FFFFFF)) ] -{ #category : #encoding } +{ #category : 'encoding' } CogARMCompiler >> cond: c bx: link target: targetReg [ "c : 4 bit, opcode = 10 bitOr: link, offset >>2, limited to 24 bits (which are sign-extended, shifted left 2 and added to 8 + pc to make the resulting address)" "BX targetReg or BLX targetReg" @@ -1821,7 +1823,7 @@ CogARMCompiler >> cond: c bx: link target: targetReg [ ^ c << 28 bitOr: ( (16r12FFF10 bitOr: (link bitAnd: 1) <<5 ) bitOr: targetReg) ] -{ #category : #encoding } +{ #category : 'encoding' } CogARMCompiler >> cond: c type: t op: o set: s [ "c : 4 bit, t: 3 bit, o: 4 bit, s: 1bit" "cccctttoooos + oxFFFFF - the leftmost 12bits of (most) ARM instruction. The other 20 bits get built elsewhere" @@ -1829,7 +1831,7 @@ CogARMCompiler >> cond: c type: t op: o set: s [ ^ c << 28 bitOr: ((t << 25) bitOr: ((o << 21) bitOr: (s << 20))) ] -{ #category : #encoding } +{ #category : 'encoding' } CogARMCompiler >> cond: conditionCode type: type op: flagsOrOpcode set: doUpdateStatusRegister rn: sourceRegister rd: targetRegister [ "build an instruction - cccctttoooo + source + target" @@ -1837,32 +1839,32 @@ CogARMCompiler >> cond: conditionCode type: type op: flagsOrOpcode set: doUpdate bitOr: (sourceRegister << 16 bitOr: targetRegister << 12) ] -{ #category : #encoding } +{ #category : 'encoding' } CogARMCompiler >> cond: conditionCode type: type op: flagsOrOpcode set: doUpdateStatusRegister rn: sourceRegister rd: targetRegister shifterOperand: so [ "build an instruction - cccctttoooo + source + target + shifter op" ^(self cond: conditionCode type: type op: flagsOrOpcode set: doUpdateStatusRegister rn: sourceRegister rd: targetRegister) bitOr: (so bitAnd: 16rFFF) ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> conditionIsNotNever: instr [ "test for the NV condition code; this isn't allowed as an actual condition and is used to encdoe many of the newer instructions" ^instr >> 28 < 16rF ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMCompiler >> conditionOrNil [ "has to be named oddly like this to satisfay i-var code gen translating rules" ^conditionOrNil ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMCompiler >> conditionOrNil: condCode [ "has to be named oddly like this to satisfay i-var code gen translating rules" ^conditionOrNil := condCode ] -{ #category : #simulation } +{ #category : 'simulation' } CogARMCompiler >> configureStackAlignment [ @@ -1875,7 +1877,7 @@ CogARMCompiler >> configureStackAlignment [ cogit setStackAlignment: 8 expectedSPOffset: 0 expectedFPOffset: 0. ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> dataOpType: armOpcode rd: destReg rn: srcReg rm: addReg lsr: shft [ "return an {opcode} destReg, srcReg, addReg lsl #shft" "important detail - a 0 shft requires setting the shift-type code to 0 to avoid potential instruction confusion" @@ -1884,7 +1886,7 @@ CogARMCompiler >> dataOpType: armOpcode rd: destReg rn: srcReg rm: addReg lsr: s ifFalse:[^self type: 0 op: armOpcode set: 1 rn: srcReg rd: destReg shifterOperand: ((shft <<7 bitOr: 32) bitOr: addReg)] ] -{ #category : #'generate machine code' } +{ #category : 'generate machine code' } CogARMCompiler >> dispatchConcretize [ "Attempt to generate concrete machine code for the instruction at address. This is the inner dispatch of concretizeAt: actualAddress which exists only @@ -2011,7 +2013,7 @@ CogARMCompiler >> dispatchConcretize [ [ MovePatcheableC32R ] -> [ ^ self concretizeMovePatcheableC32R ]} ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> extractOffsetFromBL: instr [ "we are told this is a BL instruction, so work out the offset it encodes" @@ -2023,7 +2025,7 @@ CogARMCompiler >> extractOffsetFromBL: instr [ ^relativeJump ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> faddd: destReg with: srcReg [ "FADDD or VADD instruction to add double srcReg to double destReg and stick result in double destReg FADDD destReg, destReg, srcReg - ARM_ARM v5 DDI 01001.pdf pp. C4-6 @@ -2032,7 +2034,7 @@ VADD.F64 destReg, destReg, srcReg - ARM_ARM v7 DDI10406.pdf pp. A8-536-7" ^((2r11101110001100000000101100000000 bitOr: destReg<<16 ) bitOr: destReg<<12) bitOr: srcReg ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> fcmpFrom: regA to: regB [ "FCMPD or VCMP instruction to compare two fpu double registers. FCMPD regA, regB - ARM_ARM v5 DDI 01001.pdf pp. C4-10 @@ -2041,7 +2043,7 @@ VCMP.F64 regA, regB - ARM_ARM v7 DDI10406 -1" ^(2r11101110101101000000101101000000 bitOr:(regA <<12)) bitOr: regB ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> fcmpeFrom: regA to: regB [ "FCMPED or VCMPE instruction to compare two fpu double registers. FCMPED regA, regB - ARM_ARM v5 DDI 01001.pdf pp. C4-12 @@ -2050,7 +2052,7 @@ VCMPE.F64 regA,regB - ARM_ARM v7 DDI10406 pp. 570-1" ^(2r11101110101101000000101111000000 bitOr: (regA <<12)) bitOr: regB ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> fdivd: dividend by: divisor [ "FDIVD or VDIV instruction to divide double dividend by double divisor and stick result in double dividend FDIVD dividend, dividend, divisor - ARM_ARM v5 DDI 01001.pdf pp. C4-32 @@ -2059,7 +2061,7 @@ VDIV.F64 dvidend, dividend, divisor - ARM_ARM v7 DDI10406 pp. A8-584-5" ^((2r11101110100000000000101100000000 bitOr: dividend<<16 ) bitOr: dividend<<12) bitOr: divisor ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> fldd: destReg rn: srcReg plus: u imm: immediate8bitValue [ "FLDD or VLDR instruction to move a value from address in an ARM srcReg +/- offset<<2 to an fpu double destReg FLDD ARM_ARM v5 DDI 01001.pdf pp. C4-36 @@ -2072,7 +2074,7 @@ VLDR.64 ARM_ARM v7 DDI10406 pp. A8-622-3" ^(((2r11101101000100000000101100000000 bitOr:(srcReg <<16)) bitOr: destReg<<12) bitOr: u<<23) bitOr: immediate8bitValue ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> fmsrFrom: regA to: regB [ "FMSR or VMOV instruction to move a value from an ARM reg to an fpu double register ready for conversion FMSR regB, regA - ARM_ARM v5 DDI 01001.pdf pp. C4-68 @@ -2084,7 +2086,7 @@ VMOV regB, regA - ARM_ARM v7 DDi10406 pp. A8-462-3" ^(2r11101110000000000000101000010000 bitOr:(regA <<12)) bitOr: destReg ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> fmstat [ "FMSTAT or VMRS unconditional transfer FP status to cpsr to choose jumps etc. FMSTAT r15, FPSCR - ARM_ARM v5 DDI 01001.pdf pp. C4-72 @@ -2093,7 +2095,7 @@ VMRS APSR_nzcv, FPSCR - ARM_ARM v7 DDI10406 pp. A8-652-3" ^2r11101110111100011111101000010000 ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> fmuld: destReg with: srcReg [ "FMULD or VMUL instruction to multiply double srcReg by double destReg and stick result in double destReg FMULD destReg, destReg, srcReg - ARM_ARM v5 DDI 01001.pdf pp. C4-73 @@ -2102,7 +2104,7 @@ VMUL.F64 destReg, destReg, srcReg - ARM_ARM v7 DDI10406 pp A8-658-9" ^((2r11101110001000000000101100000000 bitOr: destReg<<16 ) bitOr: destReg<<12) bitOr: srcReg ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> fsitodFrom: regA to: regB [ "FSITOD or VCVT instruction to move convert an integer value to an fpu double FSITOD regB, regA - ARM_ARM v5 DDI 01001.pdf pp. C4-95 @@ -2114,7 +2116,7 @@ VCVTW. regB, regA - ARM_ARM v7 DDI10406.pdf pp. A8-576-8" ^(2r11101110101110000000101111000000 bitOr: srcReg ) bitOr: regB<<12 ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> fsqrtd: destReg [ "FSQRTD or VSQRT instruction to square root double dividend destReg and stick result in double destReg ARM_ARM v5 DDI 01001.pdf pp. C4-97 @@ -2123,7 +2125,7 @@ VSQRT.F64 destReg, destReg - ARM_ARM v7 DDI10406 pp. A8-756-7" ^((2r11101110101100010000101111000000 ) bitOr: destReg<<12) bitOr: destReg ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> fstd: fpReg rn: addrReg plus: u imm: immediate8bitValue [ "FSTD or VSTR instruction to move a value to address in an ARM addrReg +/- offset<<2 from an fpu double fpReg FSTD fpReg, addrReg, #offset - ARM_ARM v5 DDI 01001.pdf pp. C4-101 @@ -2136,7 +2138,7 @@ VSTR.64 fpReg, addrReg, #offset - ARM_ARM v7 DDI10406 pp. A8-780-1" ^(((2r11101101000000000000101100000000 bitOr:(addrReg <<16)) bitOr: fpReg<<12) bitOr: u<<23) bitOr: immediate8bitValue ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> fsubd: destReg with: srcReg [ "FSUBD or VSUB instruction to subtract double srcReg from double destREg and stick result in double destReg FSUBD destReg, destReg, srcReg - ARM_ARM v5 DDI 01001.pdf pp. C4-112 @@ -2145,7 +2147,7 @@ VSUB.F64 destReg, destReg, srcReg - ARM_ARM v7 DDI10406 pp. A8-784-5" ^((2r11101110001100000000101101000000 bitOr: destReg<<16 ) bitOr: destReg<<12) bitOr: srcReg ] -{ #category : #abi } +{ #category : 'abi' } CogARMCompiler >> fullCallsAreRelative [ "Answer if CallFull and/or JumpFull are relative and hence need relocating on method compation. If so, they are annotated with IsRelativeCall in methods and relocated in @@ -2153,7 +2155,7 @@ CogARMCompiler >> fullCallsAreRelative [ ^false ] -{ #category : #'abstract instructions' } +{ #category : 'abstract instructions' } CogARMCompiler >> genDivR: abstractRegDivisor R: abstractRegDividend Quo: abstractRegQuotient Rem: abstractRegRemainder [ "Currently no instruction level support for divide on ARM. See also #canDivQuoRem" | rDividend rDivisor rQuotient rRemainder divRemFunctionAddr | @@ -2191,7 +2193,7 @@ CogARMCompiler >> genDivR: abstractRegDivisor R: abstractRegDividend Quo: abstra ] -{ #category : #'smalltalk calling convention' } +{ #category : 'smalltalk calling convention' } CogARMCompiler >> genLoadCStackPointer [ "Load the stack pointer register with that of the C stack, effecting a switch to the C stack. Used when machine code calls into the @@ -2200,7 +2202,7 @@ CogARMCompiler >> genLoadCStackPointer [ ^0 ] -{ #category : #'smalltalk calling convention' } +{ #category : 'smalltalk calling convention' } CogARMCompiler >> genLoadCStackPointers [ "Load the frame and stack pointer registers with those of the C stack, effecting a switch to the C stack. Used when machine code calls into @@ -2210,7 +2212,7 @@ CogARMCompiler >> genLoadCStackPointers [ ^0 ] -{ #category : #'smalltalk calling convention' } +{ #category : 'smalltalk calling convention' } CogARMCompiler >> genLoadStackPointers [ "Switch back to the Smalltalk stack. Assign SPReg first because typically it is used immediately afterwards." @@ -2219,7 +2221,7 @@ CogARMCompiler >> genLoadStackPointers [ ^0 ] -{ #category : #abi } +{ #category : 'abi' } CogARMCompiler >> genMarshallNArgs: numArgs arg: regOrConst0 arg: regOrConst1 arg: regOrConst2 arg: regOrConst3 [ "Generate the code to pass up to four arguments in a C run-time call. Hack: each argument is either a negative number, which encodes a constant, or a non-negative number, that of a register. @@ -2251,7 +2253,7 @@ CogARMCompiler >> genMarshallNArgs: numArgs arg: regOrConst0 arg: regOrConst1 ar ifFalse: [cogit MoveR: regOrConst3 R: CArg3Reg] ] -{ #category : #'abstract instructions' } +{ #category : 'abstract instructions' } CogARMCompiler >> genMulR: regSource R: regDest [ "Use SMULL to produce a 64-bit result, explicitly in RISCTempReg,regDest. - ARM_ARM v7 DDI10406 pp. A8-354-5 By comparing RISCTempReg with regDest ASR 31(which effectively makes it 0 or -1) we know that the result being EQ means the hi reg and the top bit of the lo reg are the same - ie no overflow. The condition code can then be forced to oVerflow by use of MSR APSR_nzcvq, #1, lsl 28" @@ -2263,7 +2265,7 @@ CogARMCompiler >> genMulR: regSource R: regDest [ ^first ] -{ #category : #'generate machine code' } +{ #category : 'generate machine code' } CogARMCompiler >> genPopRegisterMask: registersToBeSavedMask [ ^registersToBeSavedMask = 0 @@ -2271,7 +2273,7 @@ CogARMCompiler >> genPopRegisterMask: registersToBeSavedMask [ ifFalse: [cogit gen: PopLDM operand: registersToBeSavedMask] ] -{ #category : #'smalltalk calling convention' } +{ #category : 'smalltalk calling convention' } CogARMCompiler >> genPushRegisterArgsForAbortMissNumArgs: numArgs [ "Ensure that the register args are pushed before the outer and inner retpcs at an entry miss for arity <= self numRegArgs. The @@ -2303,7 +2305,7 @@ CogARMCompiler >> genPushRegisterArgsForAbortMissNumArgs: numArgs [ cogit PushR: LinkReg ] -{ #category : #'smalltalk calling convention' } +{ #category : 'smalltalk calling convention' } CogARMCompiler >> genPushRegisterArgsForNumArgs: numArgs scratchReg: ignored [ "Ensure that the register args are pushed before the retpc for arity <= self numRegArgs." "This is easy on a RISC like ARM because the return address is in the link register. Putting @@ -2319,7 +2321,7 @@ CogARMCompiler >> genPushRegisterArgsForNumArgs: numArgs scratchReg: ignored [ [cogit PushR: Arg1Reg]]] ] -{ #category : #'generate machine code' } +{ #category : 'generate machine code' } CogARMCompiler >> genPushRegisterMask: registersToBeSavedMask [ ^registersToBeSavedMask = 0 @@ -2327,7 +2329,7 @@ CogARMCompiler >> genPushRegisterMask: registersToBeSavedMask [ ifFalse: [cogit gen: PushSTM operand: registersToBeSavedMask] ] -{ #category : #abi } +{ #category : 'abi' } CogARMCompiler >> genRemoveNArgsFromStack: n [ "This is a no-op on ARM since the ABI passes up to 4 args in registers and trampolines currently observe that limit." @@ -2335,28 +2337,28 @@ CogARMCompiler >> genRemoveNArgsFromStack: n [ ^0 ] -{ #category : #abi } +{ #category : 'abi' } CogARMCompiler >> genRestoreRegs: regMask [ "Restore the registers in regMask as saved by genSaveRegs:." ^self genPopRegisterMask: regMask ] -{ #category : #abi } +{ #category : 'abi' } CogARMCompiler >> genSaveRegForCCall [ "Save the general purpose registers for a call into the C run-time from a trampoline." "Save none, because the ARM ABI only defines callee saved registers, no caller-saved regs." "cogit gen: STMFD operand: 16r7F" ] -{ #category : #abi } +{ #category : 'abi' } CogARMCompiler >> genSaveRegs: regMask [ "Save the registers in regMask for a call into the C run-time from a trampoline" ^self genPushRegisterMask: regMask ] -{ #category : #'smalltalk calling convention' } +{ #category : 'smalltalk calling convention' } CogARMCompiler >> genSaveStackPointers [ "Save the frame and stack pointer registers to the framePointer and stackPointer variables. Used to save the machine code frame @@ -2366,14 +2368,14 @@ CogARMCompiler >> genSaveStackPointers [ ^0 ] -{ #category : #'abstract instructions' } +{ #category : 'abstract instructions' } CogARMCompiler >> genSubstituteReturnAddress: retpc [ ^cogit MoveCw: retpc R: LR ] -{ #category : #disassembly } +{ #category : 'disassembly' } CogARMCompiler >> generalPurposeRegisterMap [ "Answer a Dictionary from register getter to register index." @@ -2393,49 +2395,49 @@ CogARMCompiler >> generalPurposeRegisterMap [ #r12. R12 } ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> hasConditionRegister [ "Answer if the receiver supports, e.g., JumpOverflow after a regular AddRR" ^true ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> hasDoublePrecisionFloatingPointSupport [ "might be true, but is for the forseeable future disabled" ^true ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> hasLinkRegister [ ^true "lr" ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> hasPCDependentInstruction [ "e.g. B, BL: Branch, Branch and Link" ^true ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> hasPCRegister [ "Answer if the processor has a generally addressable pc register, which ARM does." ^true ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> hasThreeAddressArithmetic [ "Answer if the receiver supports three-address arithmetic instructions (currently only AndCqRR)" ^true ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> hasVarBaseRegister [ "Answer if the processor has a dedicated callee-saved register to point to the base of commonly-accessed variables. On ARM we use R10 for this." ^true "r10/sl" ] -{ #category : #'generate machine code' } +{ #category : 'generate machine code' } CogARMCompiler >> initialize [ "This method intializes the Smalltalk instance. The C instance is merely a struct and doesn't need initialization." @@ -2443,81 +2445,81 @@ CogARMCompiler >> initialize [ machineCode := CArrayAccessor on: (Array new: self machineCodeWords) ] -{ #category : #'inline cacheing' } +{ #category : 'inline cacheing' } CogARMCompiler >> inlineCacheTagAt: callSiteReturnAddress [ "Answer the inline cache tag for the return address of a send." ^self subclassResponsibility ] -{ #category : #'inline cacheing' } +{ #category : 'inline cacheing' } CogARMCompiler >> instructionAddressBefore: followingAddress [ "Answer the instruction address immediately preceding followingAddress." ^followingAddress -4 ] -{ #category : #'inline cacheing' } +{ #category : 'inline cacheing' } CogARMCompiler >> instructionBeforeAddress: followingAddress [ "Answer the instruction immediately preceding followingAddress." ^objectMemory uint32AtPointer: (self instructionAddressBefore: followingAddress) ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> instructionIsB: instr [ "is this a B instruction?" ^(self conditionIsNotNever: instr) and: [(instr bitAnd: (16rF<<24)) = (16rA<<24)] ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> instructionIsBL: instr [ "is this a BL instruction?" ^(self conditionIsNotNever: instr) and: [(instr bitAnd: (16rF<<24)) = (16rB<<24)] ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> instructionIsBLX: instr [ "is this a BLX instruction?" ^(self conditionIsNotNever: instr) and: [(instr bitAnd: 16r0FFFFFF0) = 16r12FFF30] ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> instructionIsBX: instr [ "is this a BX instruction?" ^(self conditionIsNotNever: instr) and: [(instr bitAnd: 16r0FFFFFF0) = 16r12FFF10] ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> instructionIsCMP: instr [ "is this a CMP instruction?" ^(self conditionIsNotNever: instr) and: [(instr >> 21 bitAnd: 16r7F) = CmpOpcode] ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> instructionIsLDR: instr [ "is this any kind of LDR instruction? c.f. memMxr:reg:base:u:b:l:imm:" ^(self conditionIsNotNever: instr) and: [(instr >> 20 bitAnd: 16rC5) = 16r41] "ldr r1, [r2, #+/-imm] or ldr r1, [r2, r3]" ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> instructionIsOR: instr [ "is this an ORR instruction?" ^(self conditionIsNotNever: instr) and:[(instr >> 21 bitAnd: 16r7F) = (16r10 bitOr: OrOpcode)] ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> instructionIsPush: instr [ "is this a push -str r??, [sp, #-4] - instruction?" ^(self conditionIsNotNever: instr) and: [(instr bitAnd: 16rFFF0FFF) = 16r52D0004] ] -{ #category : #disassembly } +{ #category : 'disassembly' } CogARMCompiler >> instructionSizeAt: pc [ "Answer the instruction size at pc.Simple on ARM ;-)" ^4 ] -{ #category : #'generate machine code - support' } +{ #category : 'generate machine code - support' } CogARMCompiler >> inverseOpcodeFor: armOpcode [ "Several of the opcodes are inverses. Answer the inverse for an opcode if it has one. See Table A3-2 in sec A3.4 Data-processing instructions of the AARM." @@ -2534,7 +2536,7 @@ CogARMCompiler >> inverseOpcodeFor: armOpcode [ -1] ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> is12BitValue: constant ifTrue: trueAlternativeBlock ifFalse: falseAlternativeBlock [ "For LDR and STR, there is an instruction allowing for one instruction encoding if the offset is encodable in signed 12 bit form. pass the trueBlock the value and a 1-bit flag to tell it the sign. The falseBlock can do whatever it needs to, typically building the constant as a full 32bit value and then ld/st with that as a register offset" @@ -2547,7 +2549,7 @@ CogARMCompiler >> is12BitValue: constant ifTrue: trueAlternativeBlock ifFalse: f ifFalse: [^falseAlternativeBlock value] ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> is8BitValue: constant ifTrue: trueAlternativeBlock ifFalse: falseAlternativeBlock [ "For extended LDR and STR for half & double, there is an instruction allowing for one instruction encoding if the offset is encodable in 8 bit." @@ -2559,7 +2561,7 @@ CogARMCompiler >> is8BitValue: constant ifTrue: trueAlternativeBlock ifFalse: fa ifFalse: falseAlternativeBlock ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> isAddressRelativeToVarBase: varAddress [ @@ -2569,12 +2571,12 @@ CogARMCompiler >> isAddressRelativeToVarBase: varAddress [ and: [varAddress - cogit varBaseAddress < (1 << 12)]] ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> isBigEndian [ ^false ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> isCallPrecedingReturnPC: mcpc [ "Assuming mcpc is a send return pc answer if the instruction before it is a call (not a CallFull)." "There are two types of calls: BL and/BLX encoding" @@ -2583,14 +2585,14 @@ CogARMCompiler >> isCallPrecedingReturnPC: mcpc [ ^(self instructionIsBL: call) or:[self instructionIsBLX: call] ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> isInImmediateJumpRange: operand [ "ARM calls and jumps span +/- 32 mb, more than enough for intra-zone calls and jumps." ^operand signedIntFromLong between: -16r2000000 and: 16r1FFFFFC ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> isJumpAt: pc [ | instr | instr := objectMemory long32At: pc. @@ -2598,14 +2600,14 @@ CogARMCompiler >> isJumpAt: pc [ or: [self instructionIsBX: instr] ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> isPCRelativeValueLoad: instr [ "add xx, pc, blah or sub xx, pc, blah" ^(instr >> 16) = 16rE28F or: [instr >> 16 = 16rE24F] ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMCompiler >> jumpLongByteSize [ " Branch/Call ranges. Jump[Cond] can be generated as short as possible. Call/Jump[Cond]Long must be generated in the same number of bytes irrespective of displacement since their targets may be updated, but they need only @@ -2616,18 +2618,18 @@ CogARMCompiler >> jumpLongByteSize [ ^4 ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMCompiler >> jumpLongConditionalByteSize [ ^self jumpLongByteSize ] -{ #category : #'inline cacheing' } +{ #category : 'inline cacheing' } CogARMCompiler >> jumpLongTargetBeforeFollowingAddress: mcpc [ "Answer the target address for the long jump immediately preceding mcpc" ^self callTargetFromReturnAddress: mcpc ] -{ #category : #disassembly } +{ #category : 'disassembly' } CogARMCompiler >> jumpTargetPCAt: pc [ | operand word | @@ -2640,53 +2642,53 @@ CogARMCompiler >> jumpTargetPCAt: pc [ inSmalltalk: [operand * 4 + pc + 8 bitAnd: cogit addressSpaceMask] ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> ldr: destReg rn: baseReg plus: u imm: immediate12bitValue [ " LDR destReg, [baseReg, immediate12bitValue] u=0 -> subtract imm; =1 -> add imm - ARM_ARM v7 DDI10406 pp. A8-120-1" ^self memMxr: AL reg: destReg base: baseReg u: u b: 0 l: 1 imm: immediate12bitValue ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> ldr: destReg rn: baseReg plusImm: immediate12bitValue [ " LDR destReg, [baseReg, +immediate12bitValue] - ARM_ARM v7 DDI10406 pp. A8-120-1" ^self memMxr: AL reg: destReg base: baseReg u: 1 b: 0 l: 1 imm: immediate12bitValue ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> ldr: destReg rn: baseReg rm: offsetReg [ " LDR destReg, [baseReg, + offsetReg] - ARM_ARM v7 DDI10406 pp. A8-124-5 The contents of offsetReg are assumed to be correctly signed" ^self memMxr: AL reg: destReg base: baseReg p: 1 u: 1 b: 0 w: 0 l: 1 rm: offsetReg ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> ldrb: destReg rn: baseReg plus: u imm: immediate12bitValue [ " LDRB destReg, [baseReg, 'u' immediate12bitValue] u=0 -> - ARM_ARM v7 DDI10406 pp. A8-128-9 Note that this is a very low level interface that does not check the sign of the immediate, nor validity. See for example #concretizeMoveMbrR" ^self memMxr: AL reg: destReg base: baseReg u: u b: 1 l: 1 imm: immediate12bitValue ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> ldrb: destReg rn: baseReg rm: offsetReg [ " LDRB destReg, [baseReg, + offsetReg] - ARM_ARM v7 DDI10406 pp. A8-132-3 The contents of offsetReg are assumed to be correctly signed" ^self memMxr: AL reg: destReg base: baseReg p: 1 u: 1 b: 1 w: 0 l: 1 rm: offsetReg ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> ldrh: destReg rn: baseReg plus: u imm: immediate8bitValue [ " LDRH destReg, [baseReg, 'u' immediate8bitValue] u=0 -> subtract imm; =1 -> add imm - ARM_ARM v7 DDI10406 pp. A8-152-3" ^self memM16xr: AL reg: destReg base: baseReg p: 1 u: u w: 0 l: 1 offset: immediate8bitValue ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> ldrh: destReg rn: baseReg rm: offsetReg [ " LDRH destReg, [baseReg, +offsetReg] - ARM_ARM v7 DDI10406 pp. A8-156-7 The contents of offsetReg are assumed to be correctly signed" ^self memM16xr: AL reg: destReg base: baseReg p: 1 u: 1 w: 0 l: 1 rm: offsetReg ] -{ #category : #abi } +{ #category : 'abi' } CogARMCompiler >> leafCallStackPointerDelta [ "Answer the delta from the stack pointer after a call to the stack pointer immediately prior to the call. This is used to compute the stack pointer @@ -2696,14 +2698,14 @@ CogARMCompiler >> leafCallStackPointerDelta [ ^0 ] -{ #category : #'inline cacheing' } +{ #category : 'inline cacheing' } CogARMCompiler >> literalBeforeInlineCacheTagAt: callSiteReturnAddress [ self notYetImplemented: 'Should implement access to the class in directed super sends for ARMv7'. ^ 0 ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMCompiler >> literalLoadInstructionBytes [ "Answer the size of a literal load instruction (which may or may not include the size of the literal). This differs between in-line and out-of-line literal generation." @@ -2711,7 +2713,7 @@ CogARMCompiler >> literalLoadInstructionBytes [ ^self subclassResponsibility ] -{ #category : #'generate machine code - support' } +{ #category : 'generate machine code - support' } CogARMCompiler >> loadCwInto: destReg [ "Load the operand into the destination register, answering the size of the instructions generated to do so." @@ -2736,7 +2738,7 @@ CogARMCompiler >> loadCwInto: destReg [ ^self moveCw: operand intoR: destReg ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMCompiler >> loadPICLiteralByteSize [ "Answer the byte size of a MoveCwR opcode's corresponding machine code when the argument is a PIC. This is for the self-reference at the end of a @@ -2744,21 +2746,21 @@ CogARMCompiler >> loadPICLiteralByteSize [ ^4 ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMCompiler >> machineCodeAt: anOffset [ "read aWord from machineCode, with little endian" ^machineCode at: anOffset // 4 ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMCompiler >> machineCodeAt: anOffset put: aWord [ "add aWord to machineCode, with little endian" machineCode at: anOffset // 4 put: aWord ] -{ #category : #'generate machine code' } +{ #category : 'generate machine code' } CogARMCompiler >> machineCodeBytes [ "Answer the maximum number of bytes of machine code generated for any abstract instruction. e.g. CmpCwR => @@ -2770,7 +2772,7 @@ CogARMCompiler >> machineCodeBytes [ ^20 ] -{ #category : #'generate machine code' } +{ #category : 'generate machine code' } CogARMCompiler >> machineCodeWords [ "Answer the maximum number of words of machine code generated for any abstract instruction. e.g. CmpCwR => @@ -2782,7 +2784,7 @@ CogARMCompiler >> machineCodeWords [ ^5 ] -{ #category : #encoding } +{ #category : 'encoding' } CogARMCompiler >> memM16xr: cond reg: destReg base: baseReg p: postpreoffset u: updown w: weirdstuff l: loadstore offset: offset8 [ "build an ARM [base +/- offset8] half-word memory instruction p -> pre-index (1) or post-index (0) the offset. Combines with W to do some odd things. @@ -2804,7 +2806,7 @@ CogARMCompiler >> memM16xr: cond reg: destReg base: baseReg p: postpreoffset u: bitOr: (offset8 bitAnd: 16rF))))))))))) ] -{ #category : #encoding } +{ #category : 'encoding' } CogARMCompiler >> memM16xr: cond reg: destReg base: baseReg p: postpreoffset u: updown w: weirdstuff l: loadstore rm: offsetReg [ "build an ARM [base +/- offsetReg] memory instruction p -> pre-index (1) or post-index (0) the offset. Combines with W to do some odd things. @@ -2825,7 +2827,7 @@ CogARMCompiler >> memM16xr: cond reg: destReg base: baseReg p: postpreoffset u: bitOr: offsetReg))))))))) ] -{ #category : #encoding } +{ #category : 'encoding' } CogARMCompiler >> memMxr: cond reg: destReg base: baseReg p: postpreoffset u: updown b: byteword w: weirdstuff l: loadstore imm: offset [ "build an ARM [base +/- offset] memory instruction p -> pre-index (1) or post-index (0) the offset. Combines with W to do some odd things. @@ -2844,7 +2846,7 @@ CogARMCompiler >> memMxr: cond reg: destReg base: baseReg p: postpreoffset u: up bitOr: (destReg << 12 bitOr: offset)))))))) ] -{ #category : #encoding } +{ #category : 'encoding' } CogARMCompiler >> memMxr: cond reg: destReg base: baseReg p: postpreoffset u: updown b: byteword w: weirdstuff l: loadstore rm: offsetReg [ "build an ARM [base +/- offsetReg] memory instruction p -> pre-index (1) or post-index (0) the offset. Combines with W to do some odd things. @@ -2864,7 +2866,7 @@ CogARMCompiler >> memMxr: cond reg: destReg base: baseReg p: postpreoffset u: up bitOr: (offsetReg bitAnd: 16rF))))))))) ] -{ #category : #encoding } +{ #category : 'encoding' } CogARMCompiler >> memMxr: cond reg: destReg base: baseReg p: postpreoffset u: updown b: byteword w: weirdstuff l: loadstore rmLsl2: offsetReg [ "build an ARM [base +/- offsetReg lsl #2] memory instruction - see also #memMxr:reg:base:p:u:b:w:l:rm: and keep them correlated properly p -> pre-index (1) or post-index (0) the offset. Combines with W to do some odd things. @@ -2885,7 +2887,7 @@ CogARMCompiler >> memMxr: cond reg: destReg base: baseReg p: postpreoffset u: up bitOr: (offsetReg bitAnd: 16rF)))))))))) ] -{ #category : #encoding } +{ #category : 'encoding' } CogARMCompiler >> memMxr: cond reg: destReg base: baseReg u: updown b: byteword l: loadstore imm: immediate12bitValue [ "This is the lowest level build of an ARM [base +/- immediate 12bit offset] memory instruction u -> up (1) or down (0) ie + or - for the offset @@ -2902,21 +2904,21 @@ l -> load (1) or store (0)" bitOr: (immediate12bitValue bitAnd: 16rFFF))))))) ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> mov: destReg imm: immediate8bitValue ror: rot [ "Remember the ROR is doubled by the cpu so use 30>>1 etc. MOV destReg, #immediate8BitValue ROR rot - ARM_ARM v7 DDI10406 pp. A8-194-5" ^self type: 1 op: MoveOpcode set: 0 rn: 0 rd: destReg shifterOperand: ((rot>>1) <<8 bitOr: immediate8bitValue) ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> mov: destReg rn: srcReg [ " MOV destReg, srcReg - ARM_ARM v7 DDI10406 pp. A8-196-7" ^self type: 0 op: MoveOpcode set: 0 rn: 0 rd: destReg shifterOperand: srcReg ] -{ #category : #'generate machine code - support' } +{ #category : 'generate machine code - support' } CogARMCompiler >> moveCw: constant intoR: destReg [ "Emit a load of aWord into destReg. Answer the number of bytes of machine code generated." @@ -2924,14 +2926,14 @@ CogARMCompiler >> moveCw: constant intoR: destReg [ ^self subclassResponsibility ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> movs: destReg rn: srcReg [ " MOVS destReg, srcReg - ARM_ARM v7 DDI10406 pp. A8-196-7" ^self type: 0 op: MoveOpcode set: 1 rn: 0 rd: destReg shifterOperand: srcReg ] -{ #category : #encoding } +{ #category : 'encoding' } CogARMCompiler >> msr: flags [ "Generate an MSR CPSR_f, #flags instruction. Note that @@ -2943,14 +2945,14 @@ b) We only have business with the NZCV flags so the generated instruction shifts + (flags bitAnd: 16rF) " to make sure we don't have silly values here" ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> mvn: destReg imm: immediate8bitValue ror: rot [ "Remember the ROR is doubled by the cpu so use 30>>1 etc. MVN destReg, #immediate8BitValue ROR rot - ARM_ARM v7 DDI10406 pp. A8-214-5" ^self type: 1 op: MoveNotOpcode set: 0 rn: 0 rd: destReg shifterOperand: ((rot>>1) <<8 bitOr: immediate8bitValue) ] -{ #category : #printing } +{ #category : 'printing' } CogARMCompiler >> nameForFPRegister: reg [ "" (reg between: 0 and: 7) ifTrue: @@ -2958,7 +2960,7 @@ CogARMCompiler >> nameForFPRegister: reg [ "" ^super nameForFPRegister: reg ] -{ #category : #printing } +{ #category : 'printing' } CogARMCompiler >> nameForRegister: reg [ "" | default | @@ -2972,7 +2974,7 @@ CogARMCompiler >> nameForRegister: reg [ "" [default] ] -{ #category : #'inline cacheing' } +{ #category : 'inline cacheing' } CogARMCompiler >> numICacheFlushOpcodes [ "ARM needs to do icache flushing when code is written" "for now return 0 to skip it and probably blow up" @@ -2980,19 +2982,19 @@ CogARMCompiler >> numICacheFlushOpcodes [ ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMCompiler >> numIntRegArgs [ ^4 ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> orr: destReg imm: immediate8bitValue ror: rot [ "Remember the ROR is doubled by the cpu so use 30>>1 etc. ORR destReg, #immediate8BitValue ROR rot - ARM_ARM v7 DDI10406 pp. A8-228-9" ^self type: 1 op: OrOpcode set: 0 rn: destReg rd: destReg shifterOperand: ((rot>>1) <<8 bitOr: immediate8bitValue) ] -{ #category : #'generate machine code' } +{ #category : 'generate machine code' } CogARMCompiler >> outputMachineCodeAt: targetAddress [ "Override to move machine code a word at a time." @@ -3001,7 +3003,7 @@ CogARMCompiler >> outputMachineCodeAt: targetAddress [ objectMemory uint32AtPointer: targetAddress + j put: (machineCode at: j // 4)] ] -{ #category : #'generate machine code' } +{ #category : 'generate machine code' } CogARMCompiler >> padIfPossibleWithStopsFrom: startAddr to: endAddr [ | nullBytes | nullBytes := (endAddr - startAddr + 1) \\ 4. @@ -3010,7 +3012,7 @@ CogARMCompiler >> padIfPossibleWithStopsFrom: startAddr to: endAddr [ do: [ :p | objectMemory byteAt: p put: 16rFF] ] -{ #category : #encoding } +{ #category : 'encoding' } CogARMCompiler >> pld: baseReg plus: u offset: immediate [ "hint to memory that we will want to read from baseReg +/- imediate sometime soon PLD baseReg, immediate - ARM_ARM v7 DDI10406 pp. A8-236-7" @@ -3018,14 +3020,14 @@ CogARMCompiler >> pld: baseReg plus: u offset: immediate [ ^ 2r11110101010100001111000000000000 bitOr: (baseReg<<16 bitOr:(u <<23 bitOr: immediate)) ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> popR: dstReg [ " pop word off TOS LDR srcReg, [sp] #4 - ARM_ARM v7 DDI10406 pp. A8-120-1" ^self memMxr: AL reg: dstReg base: SP p: 0 u: 1 b: 0 w: 0 l: 1 imm: 4 ] -{ #category : #'calling C function in Smalltalk stack' } +{ #category : 'calling C function in Smalltalk stack' } CogARMCompiler >> prepareStackToCallCFunctionInSmalltalkStack: anObject [ "ARMv5 should be aligned to 16 bytes" @@ -3039,19 +3041,19 @@ CogARMCompiler >> prepareStackToCallCFunctionInSmalltalkStack: anObject [ cogit MoveR: Extra2Reg R: SPReg. ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMCompiler >> pushLinkRegisterByteSize [ ^4 ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> pushR: srcReg [ " push word to TOS STR srcReg, [sp, #-4]! - ARM_ARM v7 DDI10406 pp. A8-382-3" ^self memMxr: AL reg: srcReg base: SP p: 1 u: 0 b: 0 w: 1l: 0 imm: 4 ] -{ #category : #'inline cacheing' } +{ #category : 'inline cacheing' } CogARMCompiler >> relocateCallBeforeReturnPC: retpc by: delta [ | instr distanceDiv4 | self assert: delta \\ 4 = 0. @@ -3063,14 +3065,14 @@ CogARMCompiler >> relocateCallBeforeReturnPC: retpc by: delta [ objectMemory uint32AtPointer: (self instructionAddressBefore: retpc ) put: ((instr bitAnd: 16rFF000000) bitOr: (distanceDiv4 bitAnd: 16rFFFFFF))] ] -{ #category : #'calling C function in Smalltalk stack' } +{ #category : 'calling C function in Smalltalk stack' } CogARMCompiler >> returnFromCallCFunctionInSmalltalkStack: anObject [ cogit MoveR: ClassReg R: SPReg. ] -{ #category : #'inline cacheing' } +{ #category : 'inline cacheing' } CogARMCompiler >> rewriteCPICJumpAt: addressFollowingJump target: jumpTargetAddr [ "Rewrite a jump instruction to call a different target. This variant is used to reset the jumps in the prototype CPIC to suit each use,. @@ -3081,7 +3083,7 @@ CogARMCompiler >> rewriteCPICJumpAt: addressFollowingJump target: jumpTargetAddr ^self rewriteTransferAt: addressFollowingJump target: jumpTargetAddr ] -{ #category : #'inline cacheing' } +{ #category : 'inline cacheing' } CogARMCompiler >> rewriteCallAt: callSiteReturnAddress target: callTargetAddress [ "Rewrite a call instruction to call a different target. This variant is used to link PICs in ceSendMiss et al,. @@ -3091,7 +3093,7 @@ CogARMCompiler >> rewriteCallAt: callSiteReturnAddress target: callTargetAddress ^self rewriteTransferAt: callSiteReturnAddress target: callTargetAddress ] -{ #category : #'inline cacheing' } +{ #category : 'inline cacheing' } CogARMCompiler >> rewriteCallFullAt: callSiteReturnAddress target: callTargetAddress [ "Rewrite a callFull instruction to jump to a different target. This variant is used to rewrite cached primitive calls where we load the target address into ip @@ -3105,7 +3107,7 @@ CogARMCompiler >> rewriteCallFullAt: callSiteReturnAddress target: callTargetAdd expectedInstruction: 16rE12FFF3C ] -{ #category : #'inline cacheing' } +{ #category : 'inline cacheing' } CogARMCompiler >> rewriteFullTransferAt: callSiteReturnAddress target: callTargetAddress expectedInstruction: expectedInstruction [ "Rewrite a CallFull or JumpFull instruction to transfer to a different target. This variant is used to rewrite cached primitive calls. Answer the extent @@ -3113,7 +3115,7 @@ CogARMCompiler >> rewriteFullTransferAt: callSiteReturnAddress target: callTarge ^self subclassResponsibility ] -{ #category : #'inline cacheing' } +{ #category : 'inline cacheing' } CogARMCompiler >> rewriteInlineCacheAt: callSiteReturnAddress tag: cacheTag target: callTargetAddress [ "Rewrite an inline cache to call a different target for a new tag. This variant is used to link unlinked sends in ceSend:to:numArgs: et al. Answer the extent of the code @@ -3122,7 +3124,7 @@ CogARMCompiler >> rewriteInlineCacheAt: callSiteReturnAddress tag: cacheTag targ ^self subclassResponsibility ] -{ #category : #'inline cacheing' } +{ #category : 'inline cacheing' } CogARMCompiler >> rewriteJumpFullAt: callSiteReturnAddress target: callTargetAddress [ "Rewrite a full jump instruction to jump to a different target. This variant is used to rewrite cached primitive calls where we load the target address into ip @@ -3136,7 +3138,7 @@ CogARMCompiler >> rewriteJumpFullAt: callSiteReturnAddress target: callTargetAdd expectedInstruction: 16rE12FFF1C ] -{ #category : #'inline cacheing' } +{ #category : 'inline cacheing' } CogARMCompiler >> rewriteJumpLongAt: callSiteReturnAddress target: callTargetAddress [ "Rewrite a jump instruction to call a different target. This variant is used to reset the jumps in the prototype CPIC to suit each use,. @@ -3146,7 +3148,7 @@ CogARMCompiler >> rewriteJumpLongAt: callSiteReturnAddress target: callTargetAdd ^self rewriteTransferAt: callSiteReturnAddress target: callTargetAddress ] -{ #category : #'inline cacheing' } +{ #category : 'inline cacheing' } CogARMCompiler >> rewriteTransferAt: callSiteReturnAddress target: callTargetAddress [ "Rewrite a call/jump instruction to call a different target. This variant is used to link PICs in ceSendMiss et al, and to rewrite call/jumps in CPICs. @@ -3174,7 +3176,7 @@ CogARMCompiler >> rewriteTransferAt: callSiteReturnAddress target: callTargetAdd ^4 ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> rotateable8bitBitwiseImmediate: constant ifTrue: trueAlternativeBlock ifFalse: falseAlternativeBlock [ "Invoke trueAlternativeBlock with shift, value and inverted if constant can be represented @@ -3200,7 +3202,7 @@ CogARMCompiler >> rotateable8bitBitwiseImmediate: constant ifTrue: trueAlternati ^falseAlternativeBlock value ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> rotateable8bitImmediate: constant ifTrue: trueAlternativeBlock ifFalse: falseAlternativeBlock [ "For data processing operands, there is the immediate shifter_operand variant, @@ -3216,7 +3218,7 @@ CogARMCompiler >> rotateable8bitImmediate: constant ifTrue: trueAlternativeBlock ^falseAlternativeBlock value ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> rotateable8bitSignedImmediate: constant ifTrue: trueAlternativeBlock ifFalse: falseAlternativeBlock [ "Invoke trueAlternativeBlock with shift, value and negated if constant can be represented @@ -3240,7 +3242,7 @@ CogARMCompiler >> rotateable8bitSignedImmediate: constant ifTrue: trueAlternativ ^falseAlternativeBlock value ] -{ #category : #abi } +{ #category : 'abi' } CogARMCompiler >> saveAndRestoreLinkRegAround: aBlock [ "If the processor's ABI includes a link register, generate instructions to save and restore it around aBlock, which is assumed to generate code." @@ -3252,7 +3254,7 @@ CogARMCompiler >> saveAndRestoreLinkRegAround: aBlock [ ^inst ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> setsConditionCodesFor: aConditionalJumpOpcode [ "to save Slang from having to be a real compiler (it can't inline switches that return)" "Answer if the receiver's opcode sets the condition codes correctly for the given conditional jump opcode. @@ -3267,7 +3269,7 @@ CogARMCompiler >> setsConditionCodesFor: aConditionalJumpOpcode [ otherwise: [self halt: 'unhandled opcode in setsConditionCodesFor:'. false] ] -{ #category : #testing } +{ #category : 'testing' } CogARMCompiler >> shiftSetsConditionCodesFor: aConditionalJumpOpcode [ "check what flags the opcdoe needs setting - ARM doesn't set V when simply MOVing" ^aConditionalJumpOpcode caseOf: @@ -3278,7 +3280,7 @@ CogARMCompiler >> shiftSetsConditionCodesFor: aConditionalJumpOpcode [ otherwise: [self halt: 'unhandled opcode in setsConditionCodesFor:'. false] ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMCompiler >> stackPageInterruptHeadroomBytes [ "Return a minimum amount of headroom for each stack page (in bytes). In a JIT the stack has to have room for interrupt handlers which will run on the stack. @@ -3286,71 +3288,71 @@ CogARMCompiler >> stackPageInterruptHeadroomBytes [ ^128 "32 words" ] -{ #category : #encoding } +{ #category : 'encoding' } CogARMCompiler >> stop [ "generate a BKPT ( - ARM_ARM v7 DDI10406 pp. A8-56) instruction. We could, given a good enough creative impulse and an over-active sense of humour, add some numerically encoded witticism to this instruction in bits 8-19 & 0-3. It has no effect on the execution but can be a way to specify which breakpoint has been hit etc." ^AL << 28 bitOr: (16r12 << 20 bitOr: (7 << 4)) ] -{ #category : #'generate machine code - support' } +{ #category : 'generate machine code - support' } CogARMCompiler >> stopsFrom: startAddr to: endAddr [ self assert: endAddr - startAddr + 1 \\ 4 = 0. startAddr to: endAddr by: 4 do: [:addr | objectMemory uint32AtPointer: addr put: self stop]. ] -{ #category : #'inline cacheing' } +{ #category : 'inline cacheing' } CogARMCompiler >> storeLiteral: literal beforeFollowingAddress: followingAddress [ "Rewrite the long constant loaded by the instruction sequence just before this address:" ^self subclassResponsibility ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> str: destReg rn: baseReg plus: u imm: immediate12bitValue [ " STR destReg, [baseReg, 'u' immediate12bitValue] u=0 -> subtract imm; =1 -> add imm - ARM_ARM v7 DDI10406 pp. A8-382-3 " ^self memMxr: AL reg: destReg base: baseReg u: u b: 0 l: 0 imm: immediate12bitValue ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> str: srcReg rn: baseReg plusImm: immediate12bitValue [ " STR srcReg, [baseReg, +immediate12bitValue] - ARM_ARM v7 DDI10406 pp. A8-382-3" ^self memMxr: AL reg: srcReg base: baseReg u: 1 b: 0 l: 0 imm: immediate12bitValue ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> str: srcReg rn: baseReg rm: offsetReg [ " STR srcReg, [baseReg, + offsetReg] - ARM_ARM v7 DDI10406 pp. A8-384-5 The contents of offsetReg are assumed to be correctly signed" ^self memMxr: AL reg: srcReg base: baseReg p: 1 u: 1 b: 0 w: 0 l: 0 rm: offsetReg ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> strb: destReg rn: baseReg plus: u imm: immediate12bitValue [ " STRB destReg, [baseReg, 'u' immediate12bitValue] u=0 -> subtract imm; =1 -> add imm - ARM_ARM v7 DDI10406 pp. A8-388-9" ^self memMxr: AL reg: destReg base: baseReg u: u b: 1 l: 0 imm: immediate12bitValue ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> strb: srcReg rn: baseReg rm: offsetReg [ " STRB srcReg, [baseReg, + offsetReg] - ARM_ARM v7 DDI10406 pp. A8-390-1 The contents of offsetReg are assumed to be correctly signed" ^self memMxr: AL reg: srcReg base: baseReg p: 1 u: 1 b: 1 w: 0 l: 0 rm: offsetReg ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> strh: destReg rn: baseReg plus: u imm: immediate8bitValue [ " STRH destReg, [baseReg, 'u' immediate8bitValue] u=0 -> subtract imm; =1 -> add imm - ARM_ARM v7 DDI10406 pp. A8-408-9" ^self memM16xr: AL reg: destReg base: baseReg p: 1 u: u w: 0 l: 0 offset: immediate8bitValue ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> strh: srcReg rn: baseReg rm: offsetReg [ " STRH srcReg, [baseReg, +offsetReg] - ARM_ARM v7 DDI10406 pp. A8-410-1" ^self memM16xr: AL reg: srcReg base: baseReg p: 1 u: 1 w: 0 l: 0 rm: offsetReg ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> sub: destReg rn: srcReg imm: immediate ror: rot [ " Remember the ROR is doubled by the cpu so use 30>>1 etc SUB destReg, srcReg, #immediate ROR rot - ARM_ARM v7 DDI10406 pp. A8-418-9" @@ -3358,7 +3360,7 @@ CogARMCompiler >> sub: destReg rn: srcReg imm: immediate ror: rot [ ^self type: 1 op: SubOpcode set: 0 rn: srcReg rd: destReg shifterOperand: ((rot>>1) <<8 bitOr: immediate) ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> subs: destReg rn: srcReg imm: immediate ror: rot [ " Remember the ROR is doubled by the cpu so use 30>>1 etc SUBS destReg, srcReg, #immediate ROR rot - ARM_ARM v7 DDI10406 pp. A8-418-9" @@ -3366,7 +3368,7 @@ CogARMCompiler >> subs: destReg rn: srcReg imm: immediate ror: rot [ ^self type: 1 op: SubOpcode set: 1 rn: srcReg rd: destReg shifterOperand: ((rot>>1) <<8 bitOr: immediate) ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMCompiler >> tst: ignored rn: srcReg imm: immediate ror: rot [ " Remember the ROR is doubled by the cpu so use 30>>1 etc" "also note that TST has no destReg @@ -3375,27 +3377,27 @@ CogARMCompiler >> tst: ignored rn: srcReg imm: immediate ror: rot [ ^self type: 1 op: TstOpcode set: 1 rn: srcReg rd: 0 shifterOperand: ((rot>>1) <<8 bitOr: immediate) ] -{ #category : #encoding } +{ #category : 'encoding' } CogARMCompiler >> type: type op: flagsOrOpcode set: doUpdateStatusRegister rn: sourceRegister rd: targetRegister [ ^(self cond: AL type: type op: flagsOrOpcode set: doUpdateStatusRegister) bitOr: (sourceRegister << 16 bitOr: targetRegister << 12) ] -{ #category : #encoding } +{ #category : 'encoding' } CogARMCompiler >> type: type op: flagsOrOpcode set: doUpdateStatusRegister rn: sourceRegister rd: targetRegister shifterOperand: so [ ^(self type: type op: flagsOrOpcode set: doUpdateStatusRegister rn: sourceRegister rd: targetRegister) bitOr: (so bitAnd: 16rFFF) ] -{ #category : #simulation } +{ #category : 'simulation' } CogARMCompiler >> wantsNearAddressFor: anObject [ "A hack hook to allow ARM to override the simulated address for the short-cut trampolines" ^anObject isSymbol and: [anObject beginsWith: 'ceShortCut'] ] -{ #category : #'inline cacheing' } +{ #category : 'inline cacheing' } CogARMCompiler >> zoneCallsAreRelative [ "Answer if Call and JumpLong are relative and hence need to take the caller's relocation delta into account during code compaction, rather than just the diff --git a/smalltalksrc/VMMaker/CogARMv8Compiler.class.st b/smalltalksrc/VMMaker/CogARMv8Compiler.class.st index 6256386b66..36f7d8bd19 100644 --- a/smalltalksrc/VMMaker/CogARMv8Compiler.class.st +++ b/smalltalksrc/VMMaker/CogARMv8Compiler.class.st @@ -1,6 +1,6 @@ Class { - #name : #CogARMv8Compiler, - #superclass : #CogAbstractInstruction, + #name : 'CogARMv8Compiler', + #superclass : 'CogAbstractInstruction', #instVars : [ 'conditionOrNil' ], @@ -96,51 +96,53 @@ Class { 'VS', 'XorOpcode' ], - #category : #'VMMaker-JIT' + #category : 'VMMaker-JIT', + #package : 'VMMaker', + #tag : 'JIT' } -{ #category : #accessing } +{ #category : 'accessing' } CogARMv8Compiler class >> IPReg [ "Answer the number of the general temp reg in the ARM APCS convention, IP" ^ConcreteIPReg ] -{ #category : #translation } +{ #category : 'translation' } CogARMv8Compiler class >> ISA [ "Answer the name of the ISA the receiver implements." ^#aarch64 ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMv8Compiler class >> PCReg [ ^ConcretePCReg ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMv8Compiler class >> VarBaseReg [ "Answer the number of the reg we use to hold the base address of CoInterpreter variables" ^ConcreteVarBaseReg ] -{ #category : #translation } +{ #category : 'translation' } CogARMv8Compiler class >> defaultCompilerClass [ ^CogOutOfLineLiteralsARMv8Compiler ] -{ #category : #translation } +{ #category : 'translation' } CogARMv8Compiler class >> filteredInstVarNames [ "Edit such that conditionOrNil is amongst the char size vars opcode machineCodeSize and maxSize." ^(super filteredInstVarNames copyWithout: 'conditionOrNil') copyReplaceFrom: 5 to: 4 with: #('conditionOrNil') ] -{ #category : #translation } +{ #category : 'translation' } CogARMv8Compiler class >> identifyingPredefinedMacros [ ^#('__aarch64__' '_M_ARM64') ] -{ #category : #'class initialization' } +{ #category : 'class initialization' } CogARMv8Compiler class >> initialize [ "Initialize various ARM instruction-related constants." @@ -254,7 +256,7 @@ CogARMv8Compiler class >> initialize [ in: thisContext method ] -{ #category : #'class initialization' } +{ #category : 'class initialization' } CogARMv8Compiler class >> initializeAbstractRegisters [ "Assign the abstract registers with the identities/indices of the relevant concrete registers." @@ -325,43 +327,43 @@ CogARMv8Compiler class >> initializeAbstractRegisters [ NumFloatRegisters := 8 ] -{ #category : #testing } +{ #category : 'testing' } CogARMv8Compiler class >> isAbstract [ ^self == CogARMv8Compiler ] -{ #category : #testing } +{ #category : 'testing' } CogARMv8Compiler class >> isRISCTempRegister: reg [ "For tests to filter-out bogus values left in the RISCTempRegister, if any." ^reg = ConcreteIPReg ] -{ #category : #translation } +{ #category : 'translation' } CogARMv8Compiler class >> machineCodeDeclaration [ "Answer the declaration for the machineCode array. ARM instructions are 32-bits in length." ^{#'unsigned int'. '[', self basicNew machineCodeWords printString, ']'} ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMv8Compiler class >> orOpcode [ ^OrOpcode ] -{ #category : #'class initialization' } +{ #category : 'class initialization' } CogARMv8Compiler class >> specificOpcodes [ "Answer the processor-specific opcodes for this class. They're all in an Array literal in the initialize method." ^(self class >> #initialize) literals detect: [:l| l isArray and: [l includes: #LDMFD]] ] -{ #category : #translation } +{ #category : 'translation' } CogARMv8Compiler class >> wordSize [ "This is a 64-bit ISA" ^8 ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMv8Compiler >> add: destReg rn: srcReg imm: immediate ror: rot [ self assert: rot = 0. @@ -373,7 +375,7 @@ CogARMv8Compiler >> add: destReg rn: srcReg imm: immediate ror: rot [ destinationRegister: destReg ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> addSize: is64Bits sourceRegister: sourceRegister shift: shift immediate12: immediate12bitValue destinationRegister: destinationRegister [ "C6.2.4 ADD (immediate) @@ -393,7 +395,7 @@ CogARMv8Compiler >> addSize: is64Bits sourceRegister: sourceRegister shift: shif bitOr: (destinationRegister bitAnd: 2r11111))))) ] -{ #category : #adding } +{ #category : 'adding' } CogARMv8Compiler >> addT: t q: q term1: vectorReg1 term2: vectorReg2 dest: vectorRegSum [ " @@ -414,7 +416,7 @@ CogARMv8Compiler >> addT: t q: q term1: vectorReg1 term2: vectorReg2 dest: vecto bitOr: (vectorRegSum bitAnd: 2r11111))))))) ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> addsExtendedSize: is64Bits leftRegisterMaybeSP: leftRegister shiftedRightRegister: rightRegister option: option shiftOffset: immediate3bitValue destinationRegister: destinationRegister [ "C6.2.7 ADDS (extended register) @@ -432,7 +434,7 @@ CogARMv8Compiler >> addsExtendedSize: is64Bits leftRegisterMaybeSP: leftRegister bitOr: (destinationRegister bitAnd: 16r1f)))))) ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> addsSize: is64Bits leftRegister: leftRegister shiftedRightRegister: rightRegister shiftType: shiftType shiftOffset: immediate6bitValue destinationRegister: destinationRegister [ "C6.2.9 ADDS (shifted register) @@ -456,7 +458,7 @@ CogARMv8Compiler >> addsSize: is64Bits leftRegister: leftRegister shiftedRightRe destinationRegister: destinationRegister ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CogARMv8Compiler >> addsSize: is64Bits sourceRegister: leftRegister immediate12BitValue: immediate12BitValue shifted: shiftedFlag destinationRegister: destinationRegister [ "C6.2.8 ADDS (immediate) @@ -474,7 +476,7 @@ CogARMv8Compiler >> addsSize: is64Bits sourceRegister: leftRegister immediate12B shifted: shiftedFlag destinationRegister: destinationRegister ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CogARMv8Compiler >> adrSignedImmediate21BitsValue: signedImmediate21bitValue destinationRegister: destinationRegister [ "C6.2.10 ADR @@ -500,7 +502,7 @@ CogARMv8Compiler >> adrSignedImmediate21BitsValue: signedImmediate21bitValue des bitOr: (destinationRegister bitAnd: 16r1f))) ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> andSetFlagsSize: is64Bits immediate13bitValue: logicalEncodedImmediate13BitValue sourceRegister: sourceRegister destinationRegister: destinationRegister [ "C6.2.14 ANDS (immediate) @@ -519,7 +521,7 @@ CogARMv8Compiler >> andSetFlagsSize: is64Bits immediate13bitValue: logicalEncode destinationRegister: destinationRegister ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> andSetFlagsSize: is64Bits shiftedRegister: shiftedRegister shiftType: shiftType shiftValue: immediate6bitValue withRegister: sourceRegister2 destinationRegister: destinationRegister [ "C6.2.15 ANDS (shifted register) @@ -542,7 +544,7 @@ CogARMv8Compiler >> andSetFlagsSize: is64Bits shiftedRegister: shiftedRegister s ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> andSize: is64Bits immediate13bitValue: logicalEncodedImmediate13BitValue sourceRegister: sourceRegister destinationRegister: destinationRegister [ "C6.2.12 AND (immediate) @@ -558,7 +560,7 @@ CogARMv8Compiler >> andSize: is64Bits immediate13bitValue: logicalEncodedImmedia bitOr: (destinationRegister bitAnd: 16r1f)))) ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> andSize: is64Bits shiftedRegister: shiftedRegister shiftType: shiftType shiftValue: immediate6bitValue withRegister: sourceRegister2 destinationRegister: destinationRegister [ "C6.2.13 AND (shifted register) @@ -579,7 +581,7 @@ CogARMv8Compiler >> andSize: is64Bits shiftedRegister: shiftedRegister shiftType ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> arithmeticImmediateSize: is64Bits isSubstraction: substractionFlag setFlags: setFlagsFlag sourceRegister: sourceRegister immediate12BitValue: immediate12BitValue shifted: shiftedFlag destinationRegister: destinationRegister [ "C4.1.2 Data Processing -- Immediate @@ -606,7 +608,7 @@ The Arithmetic (immediate) instructions that do not set Condition flags can read bitOr: (destinationRegister bitAnd: 2r11111))))))) ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> arithmeticShiftRightSize: is64bits sourceRegister: sourceRegister shiftRegister: shiftRegister destinationRegister: destinationRegister [ "C6.2.16 ASR (register) @@ -626,7 +628,7 @@ CogARMv8Compiler >> arithmeticShiftRightSize: is64bits sourceRegister: sourceReg ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CogARMv8Compiler >> arithmeticShiftRightSize: is64Bits sourceRegister: sourceRegister shiftValue: shiftValue destinationRegister: destinationRegister [ "C6.2.17 ASR (immediate) @@ -644,7 +646,7 @@ CogARMv8Compiler >> arithmeticShiftRightSize: is64Bits sourceRegister: sourceReg bitOr: (destinationRegister bitAnd: 16r1f)))))) ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> arithmeticShiftedRegisterSize: is64Bits isSubstraction: substractionFlag setFlags: setFlagsFlag leftRegister: leftRegister shiftedRightRegister: rightRegister shiftType: shiftType shiftOffset: immediate6bitValue destinationRegister: destinationRegister [ "C4.1.5 Data Processing -- Register @@ -668,7 +670,7 @@ CogARMv8Compiler >> arithmeticShiftedRegisterSize: is64Bits isSubstraction: subs bitOr: (destinationRegister bitAnd: 2r11111)))))))) ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CogARMv8Compiler >> assembleSubCq: quickValue R: registerToUse [ | fits12Bits | @@ -691,7 +693,7 @@ CogARMv8Compiler >> assembleSubCq: quickValue R: registerToUse [ ^ 0 ] -{ #category : #'register allocation' } +{ #category : 'register allocation' } CogARMv8Compiler >> availableRegisterOrNoneFor: liveRegsMask [ "Answer an unused abstract register in the liveRegMask. Subclasses with more registers can override to answer them. @@ -706,7 +708,7 @@ CogARMv8Compiler >> availableRegisterOrNoneFor: liveRegsMask [ ^super availableRegisterOrNoneFor: liveRegsMask ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> b: immediate26bitValue [ "C6.2.26 B @@ -722,7 +724,7 @@ CogARMv8Compiler >> b: immediate26bitValue [ ^ self b: immediate26bitValue withLink: false ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> b: immediate26bitValue withLink: aBoolean [ | twoComplement multiplier | @@ -748,7 +750,7 @@ CogARMv8Compiler >> b: immediate26bitValue withLink: aBoolean [ bitOr: twoComplement) ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> bl: immediate26bitValue [ "C6.2.33 BL @@ -763,7 +765,7 @@ CogARMv8Compiler >> bl: immediate26bitValue [ ^ self b: immediate26bitValue withLink: true ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> blr: registerToUse [ "C6.2.34 BLR @@ -775,7 +777,7 @@ CogARMv8Compiler >> blr: registerToUse [ ^ self br: registerToUse withLink: 1 ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMv8Compiler >> blx: targetReg [ "Branch&link to the address in targetReg. Return address is in LR BLX targetReg - ARM_ARM v7 DDI10406 pp. A8-60-1" @@ -784,7 +786,7 @@ CogARMv8Compiler >> blx: targetReg [ ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> br: registerToUse [ "C6.2.36 BR @@ -796,7 +798,7 @@ CogARMv8Compiler >> br: registerToUse [ ^ self br: registerToUse withLink: 0 ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> br: registerToUse withLink: withLink [ "Branch optionally with Link branches to Register calls a subroutine at an address in a register, setting register X30 to PC+4. @@ -810,7 +812,7 @@ CogARMv8Compiler >> br: registerToUse withLink: withLink [ bitOr: (registerToUse bitAnd: 16r1f) << 5)) ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> branchCondition: condition offset: immediate19bitValue [ "C6.2.25 B.cond @@ -837,31 +839,31 @@ CogARMv8Compiler >> branchCondition: condition offset: immediate19bitValue [ bitOr: (condition bitAnd: 16rf)) ] -{ #category : #testing } +{ #category : 'testing' } CogARMv8Compiler >> byteReadsZeroExtend [ ^true ] -{ #category : #abi } +{ #category : 'abi' } CogARMv8Compiler >> cResultRegister [ "Answer the register through which C funcitons return integral results." ^R0 ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMv8Compiler >> cStackPointer [ ^ SP ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMv8Compiler >> callInstructionByteSize [ "ARM calls and jumps span +/- 32 mb, more than enough for intra-zone calls and jumps." ^4 ] -{ #category : #'inline cacheing' } +{ #category : 'inline cacheing' } CogARMv8Compiler >> callTargetFromReturnAddress: callSiteReturnAddress [ "Answer the address that the call immediately preceding callSiteReturnAddress will jump to." "this is also used by #jumpLongTargetBeforeFollowingAddress:." @@ -876,18 +878,18 @@ CogARMv8Compiler >> callTargetFromReturnAddress: callSiteReturnAddress [ ^callAddress + callDistance signedIntFromLong ] -{ #category : #testing } +{ #category : 'testing' } CogARMv8Compiler >> canDivQuoRem [ ^true ] -{ #category : #testing } +{ #category : 'testing' } CogARMv8Compiler >> canMulRR [ "we can do a MulRR be we can't simulate it correctly for some reason. More bug-fixing in the simulator one day" ^true ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> cmnSize: is64bits immediate12BitValue: immediate12BitValue shiftFlag: shiftFlag register: registerToUse [ "C6.2.58 CMN (immediate) @@ -906,7 +908,7 @@ CogARMv8Compiler >> cmnSize: is64bits immediate12BitValue: immediate12BitValue s destinationRegister: 2r11111 ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> cmpExtendedRegisterSize: is64Bits leftRegisterMaybeSP: leftRegister option: option shiftOffset: immediate3bitValue destinationRegister: destinationRegister [ "C6.2.60 CMP (extended register) @@ -926,7 +928,7 @@ CogARMv8Compiler >> cmpExtendedRegisterSize: is64Bits leftRegisterMaybeSP: leftR destinationRegister: 2r11111 ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> cmpSize: is64bits immediate12BitValue: immediate12BitValue shiftFlag: shiftFlag register: registerToUse [ "C6.2.61 CMP (immediate) @@ -945,7 +947,7 @@ CogARMv8Compiler >> cmpSize: is64bits immediate12BitValue: immediate12BitValue s destinationRegister: 2r11111 ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> cmpSize: is64bits shiftedRegister: register1 shiftType: shiftType shiftValue: immediate6BitShiftValue secondRegister: register2 [ "C6.2.62 CMP (shifted register) @@ -967,14 +969,14 @@ CogARMv8Compiler >> cmpSize: is64bits shiftedRegister: register1 shiftType: shif bitOr: 2r11111))))) ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMv8Compiler >> codeGranularity [ "Answer the size in bytes of a unit of machine code." ^4 ] -{ #category : #'generate machine code' } +{ #category : 'generate machine code' } CogARMv8Compiler >> computeMaximumSize [ "Because we don't use Thumb, each ARM instruction has 4 bytes. Many abstract opcodes need more than one instruction. Instructions that refer @@ -1271,7 +1273,7 @@ CogARMv8Compiler >> computeMaximumSize [ ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeAddCqR [ @@ -1324,7 +1326,7 @@ CogARMv8Compiler >> concretizeAddCqR [ ^ self concretizeAddCwR. ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CogARMv8Compiler >> concretizeAddCwR [ self assert: dependent notNil. @@ -1342,7 +1344,7 @@ CogARMv8Compiler >> concretizeAddCwR [ ^ machineCodeSize := machineCodeSize + 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeAddRR [ | instruction destinationRegister leftRegister rightRegister | @@ -1375,7 +1377,7 @@ CogARMv8Compiler >> concretizeAddRR [ ^machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeAddRdRd [ "Will get inlined into concretizeAt: switch." @@ -1397,7 +1399,7 @@ CogARMv8Compiler >> concretizeAddRdRd [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeAlignmentNops [ "fill any slots with NOPs" @@ -1406,7 +1408,7 @@ CogARMv8Compiler >> concretizeAlignmentNops [ 0 to: machineCodeSize - 1 by: 4 do: [ :p | self machineCodeAt: p put: self nop ] ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeAndCqR [ @@ -1445,7 +1447,7 @@ CogARMv8Compiler >> concretizeAndCqR [ ^ 0 "to keep Slang happy" ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeAndCqRR [ "Will get inlined into concretizeAt: switch." @@ -1474,7 +1476,7 @@ CogARMv8Compiler >> concretizeAndCqRR [ ifNotPossible: [ self notYetImplemented ]. ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CogARMv8Compiler >> concretizeAndRR [ | srcReg dstReg | @@ -1492,7 +1494,7 @@ CogARMv8Compiler >> concretizeAndRR [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeArithmeticShiftRightCqR [ @@ -1510,7 +1512,7 @@ CogARMv8Compiler >> concretizeArithmeticShiftRightCqR [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeArithmeticShiftRightRR [ self @@ -1524,7 +1526,7 @@ CogARMv8Compiler >> concretizeArithmeticShiftRightRR [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code' } +{ #category : 'generate machine code' } CogARMv8Compiler >> concretizeAt: actualAddress [ "Generate concrete machine code for the instruction at actualAddress, setting machineCodeSize, and answer the following address." @@ -1533,7 +1535,7 @@ CogARMv8Compiler >> concretizeAt: actualAddress [ ^ super concretizeAt: actualAddress ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CogARMv8Compiler >> concretizeCMPMULOverflow [ | registerA destinationRegister registerB | @@ -1551,7 +1553,7 @@ CogARMv8Compiler >> concretizeCMPMULOverflow [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeCall [ "Will get inlined into concretizeAt: switch." @@ -1568,7 +1570,7 @@ CogARMv8Compiler >> concretizeCall [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeCallFull [ "Will get inlined into concretizeAt: switch." @@ -1588,14 +1590,14 @@ CogARMv8Compiler >> concretizeCallFull [ ^ machineCodeSize := instrOffset + 4 ] -{ #category : #'generate machine code' } +{ #category : 'generate machine code' } CogARMv8Compiler >> concretizeCmpC32R [ ^ self concretizeCmpCqR ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeCmpCqR [ @@ -1653,7 +1655,7 @@ CogARMv8Compiler >> concretizeCmpCqR [ ^ machineCodeSize := machineCodeSize + 4 ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CogARMv8Compiler >> concretizeCmpCwR [ self assert: dependent notNil. @@ -1672,7 +1674,7 @@ CogARMv8Compiler >> concretizeCmpCwR [ ^ machineCodeSize := 8 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeCmpRR [ @@ -1721,7 +1723,7 @@ CogARMv8Compiler >> concretizeCmpRR [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeCmpRdRd [ "Will get inlined into concretizeAt: switch." @@ -1738,7 +1740,7 @@ CogARMv8Compiler >> concretizeCmpRdRd [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeConditionalJump: conditionCode [ "Will get inlined into concretizeAt: switch." @@ -1757,7 +1759,7 @@ CogARMv8Compiler >> concretizeConditionalJump: conditionCode [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeConvertRRd [ "Convert an integer value into a double precision float value" @@ -1769,7 +1771,7 @@ CogARMv8Compiler >> concretizeConvertRRd [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeConvertRdRs [ "Convert a double precision float to a single precision float in a register" @@ -1787,7 +1789,7 @@ CogARMv8Compiler >> concretizeConvertRdRs [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeConvertRsRd [ "Convert a single precision float to a double precision float in a register" @@ -1805,14 +1807,14 @@ CogARMv8Compiler >> concretizeConvertRsRd [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeDataOperationCwR: armOpcode [ self notYetImplemented. ^ 0 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeDivRdRd [ "FP divide regLHS by regRHS and stick result in regLHS" @@ -1827,7 +1829,7 @@ CogARMv8Compiler >> concretizeDivRdRd [ ^ machineCodeSize := 4 ] -{ #category : #concretizing } +{ #category : 'concretizing' } CogARMv8Compiler >> concretizeDupRVr [ "Will get inlined into concretizeAt: switch." @@ -1851,7 +1853,7 @@ CogARMv8Compiler >> concretizeDupRVr [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeFPConditionalJump: conditionCode [ "Will get inlined into concretizeAt: switch." @@ -1859,7 +1861,7 @@ CogARMv8Compiler >> concretizeFPConditionalJump: conditionCode [ ^ self concretizeConditionalJump: conditionCode ] -{ #category : #concretizing } +{ #category : 'concretizing' } CogARMv8Compiler >> concretizeFaddSRvRvRv [ "Will get inlined into concretizeAt: switch." @@ -1886,7 +1888,7 @@ CogARMv8Compiler >> concretizeFaddSRvRvRv [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code' } +{ #category : 'generate machine code' } CogARMv8Compiler >> concretizeFill32 [ "fill with operand 0 according to the processor's endianness" @@ -1894,7 +1896,7 @@ CogARMv8Compiler >> concretizeFill32 [ ^ machineCodeSize := 4 ] -{ #category : #concretizing } +{ #category : 'concretizing' } CogARMv8Compiler >> concretizeFsubSRvRvRv [ "Will get inlined into concretizeAt: switch." @@ -1921,14 +1923,14 @@ CogARMv8Compiler >> concretizeFsubSRvRvRv [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeInvertibleDataOperationCqR: armOpcode [ self notYetImplemented. ^ 0 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeJumpFull [ "Will get inlined into concretizeAt: switch." @@ -1948,7 +1950,7 @@ CogARMv8Compiler >> concretizeJumpFull [ ^ machineCodeSize := instrOffset + 4 ] -{ #category : #'generate machine code' } +{ #category : 'generate machine code' } CogARMv8Compiler >> concretizeJumpLong [ | offset | @@ -1959,14 +1961,14 @@ CogARMv8Compiler >> concretizeJumpLong [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeJumpLongNonZero [ self notYetImplemented. ^ 0 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeJumpLongZero [ "There are no conditional long jumps in AARCH64. @@ -1991,7 +1993,7 @@ CogARMv8Compiler >> concretizeJumpLongZero [ ^ machineCodeSize := 8 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeJumpR [ "Will get inlined into concretizeAt: switch." @@ -2002,7 +2004,7 @@ CogARMv8Compiler >> concretizeJumpR [ ^ machineCodeSize := 4 ] -{ #category : #concretizing } +{ #category : 'concretizing' } CogARMv8Compiler >> concretizeLd1VrRMw [ "Will get inlined into concretizeAt: switch." @@ -2048,14 +2050,14 @@ CogARMv8Compiler >> concretizeLd1VrRMw [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeLiteral [ self subclassResponsibility ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeLoadEffectiveAddressMwrR [ "Will get inlined into concretizeAt: switch." @@ -2082,7 +2084,7 @@ CogARMv8Compiler >> concretizeLoadEffectiveAddressMwrR [ ifFalse: [ self notYetImplemented ]. ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeLogicalShiftLeftCqR [ "Will get inlined into concretizeAt: switch." @@ -2101,7 +2103,7 @@ CogARMv8Compiler >> concretizeLogicalShiftLeftCqR [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeLogicalShiftLeftRR [ self machineCodeAt: 0 @@ -2115,7 +2117,7 @@ CogARMv8Compiler >> concretizeLogicalShiftLeftRR [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeLogicalShiftRightCqR [ "Will get inlined into concretizeAt: switch." @@ -2134,14 +2136,14 @@ CogARMv8Compiler >> concretizeLogicalShiftRightCqR [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeLogicalShiftRightRR [ self notYetImplemented. ^ 0 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeMSUB [ @@ -2167,7 +2169,7 @@ CogARMv8Compiler >> concretizeMSUB [ ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CogARMv8Compiler >> concretizeMUL [ | registerA destinationRegister registerB | @@ -2184,7 +2186,7 @@ CogARMv8Compiler >> concretizeMUL [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeMoveAbR [ "Will get inlined into concretizeAt: switch." @@ -2214,7 +2216,7 @@ CogARMv8Compiler >> concretizeMoveAbR [ ^ machineCodeSize := instrOffset + 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeMoveAwR [ "Will get inlined into concretizeAt: switch." @@ -2256,14 +2258,14 @@ CogARMv8Compiler >> concretizeMoveAwR [ ^ machineCodeSize := instrOffset + 8 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeMoveC32R [ self subclassResponsibility ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeMoveCqR [ "Will get inlined into concretizeAt: switch." @@ -2274,7 +2276,7 @@ CogARMv8Compiler >> concretizeMoveCqR [ ^ self concretizeMoveC32R ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeMoveCwR [ "Will get inlined into concretizeAt: switch." @@ -2282,7 +2284,7 @@ CogARMv8Compiler >> concretizeMoveCwR [ ^ machineCodeSize := self loadCwInto: (operands at: 1) ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeMoveM16rR [ "Will get inlined into concretizeAt: switch." @@ -2313,7 +2315,7 @@ CogARMv8Compiler >> concretizeMoveM16rR [ ^0 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeMoveM32rR [ "Will get inlined into concretizeAt: switch." @@ -2362,7 +2364,7 @@ CogARMv8Compiler >> concretizeMoveM32rR [ ^ 0 "to keep Slang happy" ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeMoveM32rRs [ "Will get inlined into concretizeAt: switch." "Load a float from srcReg+offset into FP destReg" @@ -2385,7 +2387,7 @@ CogARMv8Compiler >> concretizeMoveM32rRs [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeMoveM64rRd [ "Will get inlined into concretizeAt: switch." "Load a float from srcReg+offset into FP destReg" @@ -2408,14 +2410,14 @@ CogARMv8Compiler >> concretizeMoveM64rRd [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeMoveMbrR [ self subclassResponsibility ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeMoveMwrR [ "Will get inlined into concretizeAt: switch." @@ -2464,7 +2466,7 @@ CogARMv8Compiler >> concretizeMoveMwrR [ ^ 0 "to keep Slang happy" ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeMoveRAb [ "Will get inlined into concretizeAt: switch." @@ -2492,7 +2494,7 @@ CogARMv8Compiler >> concretizeMoveRAb [ ^ machineCodeSize := instrOffset + 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeMoveRAw [ "Will get inlined into concretizeAt: switch." @@ -2539,7 +2541,7 @@ CogARMv8Compiler >> concretizeMoveRAw [ ^ machineCodeSize := instrOffset + 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeMoveRM16r [ @@ -2565,14 +2567,14 @@ CogARMv8Compiler >> concretizeMoveRM16r [ ^ 0 "to keep Slang happy" ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CogARMv8Compiler >> concretizeMoveRM32r [ self subclassResponsibility ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeMoveRMbr [ "Will get inlined into concretizeAt: switch." @@ -2596,14 +2598,14 @@ CogARMv8Compiler >> concretizeMoveRMbr [ ^ 0 "to keep Slang happy" ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CogARMv8Compiler >> concretizeMoveRMwr [ self subclassResponsibility ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeMoveRR [ "Will get inlined into concretizeAt: switch." @@ -2618,7 +2620,7 @@ CogARMv8Compiler >> concretizeMoveRR [ ^ machineCodeSize := 4 ] -{ #category : #concretize } +{ #category : 'concretize' } CogARMv8Compiler >> concretizeMoveRRd [ @@ -2635,7 +2637,7 @@ CogARMv8Compiler >> concretizeMoveRRd [ ^ machineCodeSize := 4 ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CogARMv8Compiler >> concretizeMoveRX32rR [ "Write the word in R(src) into memory at address (base+4*index)" @@ -2657,7 +2659,7 @@ CogARMv8Compiler >> concretizeMoveRX32rR [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeMoveRXbrR [ "Will get inlined into concretizeAt: switch." @@ -2673,7 +2675,7 @@ CogARMv8Compiler >> concretizeMoveRXbrR [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeMoveRXwrR [ "Will get inlined into concretizeAt: switch." @@ -2698,7 +2700,7 @@ CogARMv8Compiler >> concretizeMoveRXwrR [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeMoveRdM64r [ "Will get inlined into concretizeAt: switch." @@ -2721,7 +2723,7 @@ CogARMv8Compiler >> concretizeMoveRdM64r [ ^ machineCodeSize := 4 ] -{ #category : #concretize } +{ #category : 'concretize' } CogARMv8Compiler >> concretizeMoveRdR [ | sourceDoublePrecisionRegister destinationScalerRegister | @@ -2737,7 +2739,7 @@ CogARMv8Compiler >> concretizeMoveRdR [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeMoveRsM32r [ "Will get inlined into concretizeAt: switch." @@ -2760,7 +2762,7 @@ CogARMv8Compiler >> concretizeMoveRsM32r [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeMoveX32rRR [ "Will get inlined into concretizeAt: switch." @@ -2784,7 +2786,7 @@ CogARMv8Compiler >> concretizeMoveX32rRR [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeMoveXbrRR [ "Will get inlined into concretizeAt: switch." @@ -2800,7 +2802,7 @@ CogARMv8Compiler >> concretizeMoveXbrRR [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeMoveXwrRR [ "Will get inlined into concretizeAt: switch." @@ -2823,7 +2825,7 @@ CogARMv8Compiler >> concretizeMoveXwrRR [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeMulRdRd [ "FP multiply regLHS by regRHS and stick result in regLHS" @@ -2838,7 +2840,7 @@ CogARMv8Compiler >> concretizeMulRdRd [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeNegateR [ "Will get inlined into concretizeAt: switch." @@ -2852,7 +2854,7 @@ CogARMv8Compiler >> concretizeNegateR [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeNop [ @@ -2860,7 +2862,7 @@ CogARMv8Compiler >> concretizeNop [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeOrCqR [ @@ -2899,7 +2901,7 @@ CogARMv8Compiler >> concretizeOrCqR [ ^ 0 "to keep Slang happy" ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CogARMv8Compiler >> concretizeOrRR [ self machineCodeAt: 0 put: (self @@ -2911,7 +2913,7 @@ CogARMv8Compiler >> concretizeOrRR [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizePopR [ "Will get inlined into concretizeAt: switch." @@ -2923,7 +2925,7 @@ CogARMv8Compiler >> concretizePopR [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizePrefetchAw [ "Will get inlined into concretizeAt: switch." @@ -2954,7 +2956,7 @@ CogARMv8Compiler >> concretizePrefetchAw [ ^ machineCodeSize := instrOffset + 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizePushCq [ "Will get inlined into concretizeAt: switch." @@ -2976,7 +2978,7 @@ CogARMv8Compiler >> concretizePushCq [ ^ machineCodeSize := instrOffset + 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizePushCw [ "Will get inlined into concretizeAt: switch." @@ -2989,7 +2991,7 @@ CogARMv8Compiler >> concretizePushCw [ ^ machineCodeSize := instrOffset + 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizePushR [ "Will get inlined into concretizeAt: switch." @@ -3001,7 +3003,7 @@ CogARMv8Compiler >> concretizePushR [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeRetN [ "Will get inlined into concretizeAt: switch." @@ -3025,7 +3027,7 @@ CogARMv8Compiler >> concretizeRetN [ ^ machineCodeSize := 8 ] -{ #category : #concretize } +{ #category : 'concretize' } CogARMv8Compiler >> concretizeRotateLeftCqR [ @@ -3040,7 +3042,7 @@ CogARMv8Compiler >> concretizeRotateLeftCqR [ ^ machineCodeSize := 4 ] -{ #category : #concretize } +{ #category : 'concretize' } CogARMv8Compiler >> concretizeRotateRightCqR [ @@ -3055,7 +3057,7 @@ CogARMv8Compiler >> concretizeRotateRightCqR [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeSDIV [ @@ -3075,7 +3077,7 @@ CogARMv8Compiler >> concretizeSDIV [ ^ machineCodeSize := 4 ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CogARMv8Compiler >> concretizeSMULH [ | registerA destinationRegister registerB | @@ -3093,7 +3095,7 @@ CogARMv8Compiler >> concretizeSMULH [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeSqrtRd [ "Will get inlined into concretizeAt: switch." @@ -3107,7 +3109,7 @@ CogARMv8Compiler >> concretizeSqrtRd [ ^ machineCodeSize := 4 ] -{ #category : #concretizing } +{ #category : 'concretizing' } CogARMv8Compiler >> concretizeSt1VrRMw [ "Will get inlined into concretizeAt: switch." @@ -3153,14 +3155,14 @@ CogARMv8Compiler >> concretizeSt1VrRMw [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeStop [ self machineCodeAt: 0 put: self stop. ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeSubCqR [ "Will get inlined into concretizeAt: switch." @@ -3200,7 +3202,7 @@ CogARMv8Compiler >> concretizeSubCqR [ ^ machineCodeSize := machineCodeSize + 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeSubRR [ | instruction destReg leftReg rightReg | @@ -3249,7 +3251,7 @@ CogARMv8Compiler >> concretizeSubRR [ ^machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeSubRdRd [ "FP substract registerA from registerB and stick result in registerB" @@ -3264,7 +3266,7 @@ CogARMv8Compiler >> concretizeSubRdRd [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeTstCqR [ "Will get inlined into concretizeAt: switch." @@ -3283,7 +3285,7 @@ CogARMv8Compiler >> concretizeTstCqR [ ^ 0 "to keep Slang happy" ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CogARMv8Compiler >> concretizeXorCwR [ self moveCw: (operands at: 0) intoR: ConcreteIPReg. @@ -3297,7 +3299,7 @@ CogARMv8Compiler >> concretizeXorCwR [ ^ machineCodeSize := machineCodeSize + 4 ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CogARMv8Compiler >> concretizeXorRR [ | registerOne registerTwo | @@ -3313,7 +3315,7 @@ CogARMv8Compiler >> concretizeXorRR [ ^ machineCodeSize := 4 ] -{ #category : #'generate machine code - concretize' } +{ #category : 'generate machine code - concretize' } CogARMv8Compiler >> concretizeXorRdRd [ "FP XOR registerA by registerB and stick result in registerB" @@ -3329,7 +3331,7 @@ CogARMv8Compiler >> concretizeXorRdRd [ ^ machineCodeSize := 4 ] -{ #category : #encoding } +{ #category : 'encoding' } CogARMv8Compiler >> cond: c br: link offset: offset [ "c : 4 bit, opcode = 10 bitOr: link, offset >>2, limited to 24 bits (which are sign-extended, shifted left 2 and added to 8 + pc to make the resulting address)" "single instr Branch, no link" @@ -3337,7 +3339,7 @@ CogARMv8Compiler >> cond: c br: link offset: offset [ ^ c << 28 bitOr: (((2r1010 bitOr: (link bitAnd: 1)) << 24) bitOr: (offset >> 2 bitAnd: 16r00FFFFFF)) ] -{ #category : #encoding } +{ #category : 'encoding' } CogARMv8Compiler >> cond: c bx: link target: targetReg [ "c : 4 bit, opcode = 10 bitOr: link, offset >>2, limited to 24 bits (which are sign-extended, shifted left 2 and added to 8 + pc to make the resulting address)" "BX targetReg or BLX targetReg" @@ -3345,7 +3347,7 @@ CogARMv8Compiler >> cond: c bx: link target: targetReg [ ^ c << 28 bitOr: ( (16r12FFF10 bitOr: (link bitAnd: 1) <<5 ) bitOr: targetReg) ] -{ #category : #encoding } +{ #category : 'encoding' } CogARMv8Compiler >> cond: conditionCode type: type op: flagsOrOpcode set: doUpdateStatusRegister rn: sourceRegister rd: targetRegister [ "build an instruction - cccctttoooo + source + target" @@ -3353,32 +3355,32 @@ CogARMv8Compiler >> cond: conditionCode type: type op: flagsOrOpcode set: doUpda bitOr: (sourceRegister << 16 bitOr: targetRegister << 12) ] -{ #category : #encoding } +{ #category : 'encoding' } CogARMv8Compiler >> cond: conditionCode type: type op: flagsOrOpcode set: doUpdateStatusRegister rn: sourceRegister rd: targetRegister shifterOperand: so [ "build an instruction - cccctttoooo + source + target + shifter op" ^(self cond: conditionCode type: type op: flagsOrOpcode set: doUpdateStatusRegister rn: sourceRegister rd: targetRegister) bitOr: (so bitAnd: 16rFFF) ] -{ #category : #testing } +{ #category : 'testing' } CogARMv8Compiler >> conditionIsNotNever: instr [ "test for the NV condition code; this isn't allowed as an actual condition and is used to encdoe many of the newer instructions" ^instr >> 28 < 16rF ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMv8Compiler >> conditionOrNil [ "has to be named oddly like this to satisfay i-var code gen translating rules" ^conditionOrNil ] -{ #category : #accessing } +{ #category : 'accessing' } CogARMv8Compiler >> conditionOrNil: condCode [ "has to be named oddly like this to satisfay i-var code gen translating rules" ^conditionOrNil := condCode ] -{ #category : #simulation } +{ #category : 'simulation' } CogARMv8Compiler >> configureStackAlignment [ @@ -3391,7 +3393,7 @@ CogARMv8Compiler >> configureStackAlignment [ cogit setStackAlignment: 16 expectedSPOffset: 0 expectedFPOffset: 0. ] -{ #category : #'generate machine code' } +{ #category : 'generate machine code' } CogARMv8Compiler >> dispatchConcretize [ "Attempt to generate concrete machine code for the instruction at address. This is the inner dispatch of concretizeAt: actualAddress which exists only @@ -3546,7 +3548,7 @@ CogARMv8Compiler >> dispatchConcretize [ } ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> dupT: t q: q source: src dest: dest [ " @@ -3567,7 +3569,7 @@ CogARMv8Compiler >> dupT: t q: q source: src dest: dest [ bitOr: (dest bitAnd: 2r11111))))) ] -{ #category : #'immediate-encodings' } +{ #category : 'immediate-encodings' } CogARMv8Compiler >> encodeLogicalImmediate: immediate registerSize: registerSize ifPossible: aBlockWithEncoding ifNotPossible: aNotPossibleBlock [ "https://github.com/llvm-mirror/llvm/blob/5c95b810cb3a7dee6d49c030363e5bf0bb41427e/lib/Target/AArch64/MCTargetDesc/AArch64AddressingModes.h#L213 @@ -3623,7 +3625,7 @@ CogARMv8Compiler >> encodeLogicalImmediate: immediate registerSize: registerSize ^ aBlockWithEncoding value: ((n << 12) bitOr: (immr << 6 bitOr: (nimms bitAnd: 16r3f))) ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CogARMv8Compiler >> exclusiveOrSize: is64Bits firstRegister: firstRegister secondRegister: secondRegister destinationRegister: destinationRegister [ "C6.2.86 EOR (shifted register) @@ -3643,7 +3645,7 @@ CogARMv8Compiler >> exclusiveOrSize: is64Bits firstRegister: firstRegister secon destinationRegister: destinationRegister ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> exclusiveOrSize: is64Bits immediate13bitValue: logicalEncodedImmediate13BitValue sourceRegister: sourceRegister destinationRegister: destinationRegister [ "C6.2.85 EOR (immediate) @@ -3660,7 +3662,7 @@ CogARMv8Compiler >> exclusiveOrSize: is64Bits immediate13bitValue: logicalEncode destinationRegister: destinationRegister ] -{ #category : #patching } +{ #category : 'patching' } CogARMv8Compiler >> extractConditionFromB: instruction [ "Extract the offset inside a branch instruction of the formformat: @@ -3677,7 +3679,7 @@ CogARMv8Compiler >> extractConditionFromB: instruction [ ^ instruction bitAnd: 16rf. ] -{ #category : #patching } +{ #category : 'patching' } CogARMv8Compiler >> extractOffsetFromBL: instr [ "we are told this is a BL instruction, so work out the offset it encodes. @@ -3693,7 +3695,7 @@ CogARMv8Compiler >> extractOffsetFromBL: instr [ ^relativeJump ] -{ #category : #patching } +{ #category : 'patching' } CogARMv8Compiler >> extractOffsetFromConditionalBranch: instruction [ "Extract the offset inside a branch instruction of the formformat: @@ -3717,7 +3719,7 @@ CogARMv8Compiler >> extractOffsetFromConditionalBranch: instruction [ ifFalse: [ twoComplement << 2 ] ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> fConvertSourceRegister: sourceRegister toRegister: destRegister sourcePrecision: ftype toPrecision: opc [ "C7.2.69 FCVT @@ -3737,7 +3739,7 @@ CogARMv8Compiler >> fConvertSourceRegister: sourceRegister toRegister: destRegis ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> fDivFirstRegister: registerA secondRegister: registerB destinationRegister: destinationRegister [ "C7.2.98 FDIV (scalar) @@ -3755,7 +3757,7 @@ CogARMv8Compiler >> fDivFirstRegister: registerA secondRegister: registerB desti bitOr: (destinationRegister bitAnd: 16r1f)))))) ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> fEorFirstRegister: registerA secondRegister: registerB destinationRegister: destinationRegister [ "C7.2.41 EOR (vector) @@ -3771,7 +3773,7 @@ CogARMv8Compiler >> fEorFirstRegister: registerA secondRegister: registerB desti bitOr: (destinationRegister bitAnd: 16r1f)))) ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CogARMv8Compiler >> fMoveSize: is64Bits fromDoublePrecisionFloatRegister: sourceDoublePrecisionFloatRegister toScalarRegister: destinationScalarRegister [ ^ self @@ -3781,7 +3783,7 @@ CogARMv8Compiler >> fMoveSize: is64Bits fromDoublePrecisionFloatRegister: source destinationRegister: destinationScalarRegister ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CogARMv8Compiler >> fMoveSize: is64Bits fromScalarRegister: sourceScalarRegister toDoublePrecisionFloatRegister: destinationDoublePrecisionFloatRegister [ ^ self @@ -3791,7 +3793,7 @@ CogARMv8Compiler >> fMoveSize: is64Bits fromScalarRegister: sourceScalarRegister destinationRegister: destinationDoublePrecisionFloatRegister ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CogARMv8Compiler >> fMoveSize: is64Bits fromScalarToDoublePrecision: fromScalarToDoublePrecision sourceRegister: sourceRegister destinationRegister: destinationRegister [ "C7.2.131 FMOV (general) @@ -3810,7 +3812,7 @@ CogARMv8Compiler >> fMoveSize: is64Bits fromScalarToDoublePrecision: fromScalarT bitOr: ((destinationRegister bitAnd: 16r1f))))))) ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> fMulFirstRegister: registerA secondRegister: registerB destinationRegister: destinationRegister [ "C7.2.136 FMUL (Scalar) @@ -3828,7 +3830,7 @@ CogARMv8Compiler >> fMulFirstRegister: registerA secondRegister: registerB desti bitOr: (destinationRegister bitAnd: 16r1f)))))) ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> fSqrtd: sourceRegister destinationRegister: destinationRegister [ "C7.2.172 FSQRT (scalar) @@ -3846,7 +3848,7 @@ CogARMv8Compiler >> fSqrtd: sourceRegister destinationRegister: destinationRegis bitOr: (destinationRegister bitAnd: 16r1f))))) ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> fSubFirstRegister: registerA secondRegister: registerB destinationRegister: destinationRegister [ "C7.2.174 FSUB (scalar) @@ -3864,7 +3866,7 @@ CogARMv8Compiler >> fSubFirstRegister: registerA secondRegister: registerB desti bitOr: (destinationRegister bitAnd: 16r1f)))))) ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> faddSize: precision firstSourceRegister: registerA secondSourceRegister: registerB destinationRegister: destinationRegister [ "C7.2.50 FADD (scalar) @@ -3882,7 +3884,7 @@ CogARMv8Compiler >> faddSize: precision firstSourceRegister: registerA secondSou bitOr: (destinationRegister bitAnd: 16r1f)))))) ] -{ #category : #assembler } +{ #category : 'assembler' } CogARMv8Compiler >> fcmpFType: ftype leftRegister: firstRegister rightRegister: secondRegister [ "C7.2.66 FCMP @@ -3905,7 +3907,7 @@ CogARMv8Compiler >> fcmpFType: ftype leftRegister: firstRegister rightRegister: bitOr: ((firstRegister bitAnd: 16r1f) << 5))))) ] -{ #category : #concretize } +{ #category : 'concretize' } CogARMv8Compiler >> fillFrom: startMemoryAddr until: endMemoryAddr with: fillReg usingVr: vectorRegister [ | fillLoop | @@ -3921,7 +3923,7 @@ CogARMv8Compiler >> fillFrom: startMemoryAddr until: endMemoryAddr with: fillReg ^0 "Necessary to keep Slang happy" ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMv8Compiler >> fldd: destReg rn: srcReg plus: u imm: immediate8bitValue [ "FLDD or VLDR instruction to move a value from address in an ARM srcReg +/- offset<<2 to an fpu double destReg FLDD ARM_ARM v5 DDI 01001.pdf pp. C4-36 @@ -3934,7 +3936,7 @@ VLDR.64 ARM_ARM v7 DDI10406 pp. A8-622-3" ^(((2r11101101000100000000101100000000 bitOr:(srcReg <<16)) bitOr: destReg<<12) bitOr: u<<23) bitOr: immediate8bitValue ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMv8Compiler >> fmsrFrom: regA to: regB [ "FMSR or VMOV instruction to move a value from an ARM reg to an fpu double register ready for conversion FMSR regB, regA - ARM_ARM v5 DDI 01001.pdf pp. C4-68 @@ -3946,7 +3948,7 @@ VMOV regB, regA - ARM_ARM v7 DDi10406 pp. A8-462-3" ^(2r11101110000000000000101000010000 bitOr:(regA <<12)) bitOr: destReg ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMv8Compiler >> fmstat [ "FMSTAT or VMRS unconditional transfer FP status to cpsr to choose jumps etc. FMSTAT r15, FPSCR - ARM_ARM v5 DDI 01001.pdf pp. C4-72 @@ -3955,7 +3957,7 @@ VMRS APSR_nzcv, FPSCR - ARM_ARM v7 DDI10406 pp. A8-652-3" ^2r11101110111100011111101000010000 ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMv8Compiler >> fmuld: destReg with: srcReg [ "FMULD or VMUL instruction to multiply double srcReg by double destReg and stick result in double destReg FMULD destReg, destReg, srcReg - ARM_ARM v5 DDI 01001.pdf pp. C4-73 @@ -3964,7 +3966,7 @@ VMUL.F64 destReg, destReg, srcReg - ARM_ARM v7 DDI10406 pp A8-658-9" ^((2r11101110001000000000101100000000 bitOr: destReg<<16 ) bitOr: destReg<<12) bitOr: srcReg ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMv8Compiler >> fsitodFrom: regA to: regB [ "FSITOD or VCVT instruction to move convert an integer value to an fpu double FSITOD regB, regA - ARM_ARM v5 DDI 01001.pdf pp. C4-95 @@ -3976,7 +3978,7 @@ VCVTW. regB, regA - ARM_ARM v7 DDI10406.pdf pp. A8-576-8" ^(2r11101110101110000000101111000000 bitOr: srcReg ) bitOr: regB<<12 ] -{ #category : #'ARM convenience instructions' } +{ #category : 'ARM convenience instructions' } CogARMv8Compiler >> fsubd: destReg with: srcReg [ "FSUBD or VSUB instruction to subtract double srcReg from double destREg and stick result in double destReg FSUBD destReg, destReg, srcReg - ARM_ARM v5 DDI 01001.pdf pp. C4-112 @@ -3985,7 +3987,7 @@ VSUB.F64 destReg, destReg, srcReg - ARM_ARM v7 DDI10406 pp. A8-784-5" ^((2r11101110001100000000101101000000 bitOr: destReg<<16 ) bitOr: destReg<<12) bitOr: srcReg ] -{ #category : #abi } +{ #category : 'abi' } CogARMv8Compiler >> fullCallsAreRelative [ "Answer if CallFull and/or JumpFull are relative and hence need relocating on method compation. If so, they are annotated with IsRelativeCall in methods and relocated in @@ -3993,7 +3995,7 @@ CogARMv8Compiler >> fullCallsAreRelative [ ^false ] -{ #category : #abi } +{ #category : 'abi' } CogARMv8Compiler >> genCaptureCStackPointers: captureFramePointer [ "Save the register to a caller-saved register. @@ -4017,7 +4019,7 @@ CogARMv8Compiler >> genCaptureCStackPointers: captureFramePointer [ cogit RetN: 0. ] -{ #category : #'abstract instructions' } +{ #category : 'abstract instructions' } CogARMv8Compiler >> genDivR: abstractRegDenominator R: abstractRegNumerator Quo: abstractRegQuotient Rem: abstractRegRemainder [ cogit gen: SDIV operand: abstractRegNumerator operand: abstractRegDenominator operand: ConcreteIPReg. @@ -4026,7 +4028,7 @@ CogARMv8Compiler >> genDivR: abstractRegDenominator R: abstractRegNumerator Quo: ] -{ #category : #'abstract instructions' } +{ #category : 'abstract instructions' } CogARMv8Compiler >> genJumpMultiplyOverflow: jumpTarget [ @@ -4034,7 +4036,7 @@ CogARMv8Compiler >> genJumpMultiplyOverflow: jumpTarget [ ^cogit JumpNonZero: jumpTarget ] -{ #category : #'smalltalk calling convention' } +{ #category : 'smalltalk calling convention' } CogARMv8Compiler >> genLoadCStackPointer [ "Load the stack pointer register with that of the C stack, effecting a switch to the C stack. Used when machine code calls into the @@ -4043,7 +4045,7 @@ CogARMv8Compiler >> genLoadCStackPointer [ ^0 ] -{ #category : #'smalltalk calling convention' } +{ #category : 'smalltalk calling convention' } CogARMv8Compiler >> genLoadCStackPointers [ "Load the frame and stack pointer registers with those of the C stack, effecting a switch to the C stack. Used when machine code calls into @@ -4053,7 +4055,7 @@ CogARMv8Compiler >> genLoadCStackPointers [ ^0 ] -{ #category : #'smalltalk calling convention' } +{ #category : 'smalltalk calling convention' } CogARMv8Compiler >> genLoadStackPointers [ "Switch back to the Smalltalk stack. Assign SPReg first because typically it is used immediately afterwards." @@ -4062,7 +4064,7 @@ CogARMv8Compiler >> genLoadStackPointers [ ^0 ] -{ #category : #abi } +{ #category : 'abi' } CogARMv8Compiler >> genMarshallNArgs: numArgs arg: regOrConst0 arg: regOrConst1 arg: regOrConst2 arg: regOrConst3 [ "Generate the code to pass up to four arguments in a C run-time call. Hack: each argument is either a negative number, which encodes a constant, or a non-negative number, that of a register. @@ -4094,7 +4096,7 @@ CogARMv8Compiler >> genMarshallNArgs: numArgs arg: regOrConst0 arg: regOrConst1 ifFalse: [cogit MoveR: regOrConst3 R: CArg3Reg] ] -{ #category : #'abstract instructions' } +{ #category : 'abstract instructions' } CogARMv8Compiler >> genMulR: regSource R: regDest [ "In ARMv8 the multiplication operation (MUL) does not set the overflow flag. MUL multiplies two 64bit registers and produces the lower 64bit part of the 128bit result into a register. @@ -4118,7 +4120,7 @@ CogARMv8Compiler >> genMulR: regSource R: regDest [ ^ first ] -{ #category : #'smalltalk calling convention' } +{ #category : 'smalltalk calling convention' } CogARMv8Compiler >> genPushRegisterArgsForAbortMissNumArgs: numArgs [ "Ensure that the register args are pushed before the outer and inner retpcs at an entry miss for arity <= self numRegArgs. The @@ -4150,7 +4152,7 @@ CogARMv8Compiler >> genPushRegisterArgsForAbortMissNumArgs: numArgs [ cogit PushR: LinkReg ] -{ #category : #'smalltalk calling convention' } +{ #category : 'smalltalk calling convention' } CogARMv8Compiler >> genPushRegisterArgsForNumArgs: numArgs scratchReg: ignored [ "Ensure that the register args are pushed before the retpc for arity <= self numRegArgs." "This is easy on a RISC like ARM because the return address is in the link register. Putting @@ -4166,7 +4168,7 @@ CogARMv8Compiler >> genPushRegisterArgsForNumArgs: numArgs scratchReg: ignored [ [cogit PushR: Arg1Reg]]] ] -{ #category : #abi } +{ #category : 'abi' } CogARMv8Compiler >> genRemoveNArgsFromStack: n [ "This is a no-op on ARM since the ABI passes up to 4 args in registers and trampolines currently observe that limit." @@ -4174,7 +4176,7 @@ CogARMv8Compiler >> genRemoveNArgsFromStack: n [ ^0 ] -{ #category : #abi } +{ #category : 'abi' } CogARMv8Compiler >> genRestoreRegs: regMask [ "Restore the registers in regMask as saved by genSaveRegs:." @@ -4202,14 +4204,14 @@ CogARMv8Compiler >> genRestoreRegs: regMask [ ^0 ] -{ #category : #abi } +{ #category : 'abi' } CogARMv8Compiler >> genSaveRegForCCall [ "Save the general purpose registers for a call into the C run-time from a trampoline." "Save none, because the ARM ABI only defines callee saved registers, no caller-saved regs." "cogit gen: STMFD operand: 16r7F" ] -{ #category : #abi } +{ #category : 'abi' } CogARMv8Compiler >> genSaveRegs: regMask [ "Save the registers in regMask for a call into the C run-time from a trampoline" @@ -4235,7 +4237,7 @@ CogARMv8Compiler >> genSaveRegs: regMask [ ^0 ] -{ #category : #'smalltalk calling convention' } +{ #category : 'smalltalk calling convention' } CogARMv8Compiler >> genSaveStackPointers [ "Save the frame and stack pointer registers to the framePointer and stackPointer variables. Used to save the machine code frame @@ -4245,14 +4247,14 @@ CogARMv8Compiler >> genSaveStackPointers [ ^0 ] -{ #category : #'abstract instructions' } +{ #category : 'abstract instructions' } CogARMv8Compiler >> genSubstituteReturnAddress: retpc [ ^cogit MoveCw: retpc R: LR ] -{ #category : #disassembly } +{ #category : 'disassembly' } CogARMv8Compiler >> generalPurposeRegisterMap [ "Answer a Dictionary from register getter to register index." @@ -4272,43 +4274,43 @@ CogARMv8Compiler >> generalPurposeRegisterMap [ #r12. R12 } ] -{ #category : #testing } +{ #category : 'testing' } CogARMv8Compiler >> hasConditionRegister [ "Answer if the receiver supports, e.g., JumpOverflow after a regular AddRR" ^true ] -{ #category : #testing } +{ #category : 'testing' } CogARMv8Compiler >> hasDoublePrecisionFloatingPointSupport [ "might be true, but is for the forseeable future disabled" ^true ] -{ #category : #testing } +{ #category : 'testing' } CogARMv8Compiler >> hasLinkRegister [ ^true "lr" ] -{ #category : #testing } +{ #category : 'testing' } CogARMv8Compiler >> hasPCDependentInstruction [ "e.g. B, BL: Branch, Branch and Link" ^true ] -{ #category : #testing } +{ #category : 'testing' } CogARMv8Compiler >> hasThreeAddressArithmetic [ "Answer if the receiver supports three-address arithmetic instructions (currently only AndCqRR)" ^true ] -{ #category : #testing } +{ #category : 'testing' } CogARMv8Compiler >> hasVarBaseRegister [ "Answer if the processor has a dedicated callee-saved register to point to the base of commonly-accessed variables. On ARM we use R10 for this." ^true "r10/sl" ] -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } CogARMv8Compiler >> inclusiveOrSize: is64Bits firstRegister: firstRegister secondRegister: secondRegister destinationRegister: destinationRegister [ "C6.2.206 OOR (shifted register) @@ -4328,7 +4330,7 @@ CogARMv8Compiler >> inclusiveOrSize: is64Bits firstRegister: firstRegister secon destinationRegister: destinationRegister ] -{ #category : #'generate machine code' } +{ #category : 'generate machine code' } CogARMv8Compiler >> initialize [ "This method intializes the Smalltalk instance. The C instance is merely a struct and doesn't need initialization." @@ -4336,20 +4338,20 @@ CogARMv8Compiler >> initialize [ machineCode := CArrayAccessor on: (Array new: self machineCodeWords) ] -{ #category : #'inline cacheing' } +{ #category : 'inline cacheing' } CogARMv8Compiler >> inlineCacheTagAt: callSiteReturnAddress [ "Answer the inline cache tag for the return address of a send." ^self subclassResponsibility ] -{ #category : #'inline cacheing' } +{ #category : 'inline cacheing' } CogARMv8Compiler >> instructionAddressBefore: followingAddress [ "Answer the instruction address immediately preceding followingAddress." ^followingAddress -4 ] -{ #category : #'inline cacheing' } +{ #category : 'inline cacheing' } CogARMv8Compiler >> instructionBeforeAddress: followingAddress [ "Answer the instruction immediately preceding followingAddress." @@ -4357,58 +4359,58 @@ CogARMv8Compiler >> instructionBeforeAddress: followingAddress [ ^objectMemory uint32AtPointer: (self instructionAddressBefore: followingAddress) ] -{ #category : #testing } +{ #category : 'testing' } CogARMv8Compiler >> instructionIsB: instr [ "is this a B