Feb 25 2016 CogVM binaries as per VMMaker.oscog-eem.1700/r3632 General: Fix serious bug in jitted perform: primitive. Thanks to Stephane Rollandin for finding and to Levente Uzoni for diagnosing the bug. If the argument count is one greater than the max number of register arguments (2 in Spur, hence perform:with:with:) then the code to remove the receiver and arguments from the stack neglects to remove the receiver and selector. Spur: Fix special selector arithmetic and comparison in the 64-bit Cogit. My original code for genJumpNotSmallIntegersIn:andScratchReg: merely jumped if the tags differed, hence not jumping if both arguments were SmallFloat64s (or both Characters). The new code requires an additional scratch register; hence add genJumpNotSmallIntegersIn:andScratch:scratch:. Fix bug in markAndTraceWeaklingsFrom:. Fields of weaklings may be immediate so must use followOopField:ofObject: not followObjField:ofObject:. Fix https://pharo.fogbugz.com/f/cases/17536/VM-Crash-when-adding-an-iVar-to-a-subclass-of-SystemAnnouncement. When weaklings (and when ephemerons) are scan-marked forwarders must be coped with. 64-bit VMs: Fix a bug in printHex: for 64-bits (faulty arithmetic). ThreadedFFIPlugin: Fix the remaining 64-bit issues in the ThreadedFFIPlugin. The X64SysVFFIPlugin now passes the test suite. Hence include the FFI plugin in 64-bit VMs. Make the SqueakFFIPrims plugin internal in the Mac pharo builds. Mac VMs: Have the Mac OS X build install Localizable.strings. Add versions for Newspeak, Pharo and Squeak. Rename the key to SelectImagePanePrompt. Temporarily disable the Serial plugin in the Pharo Mac VM until we can track down the relevant platforms/iOS support for the Pharo extensions. Fix argument access on the iOS platform (Mac OS VMs). ------------------------------------------------------------------------ r3629 | eliot | 2016-02-23 11:46:31 -0800 (Tue, 23 Feb 2016) | 2 lines Include the FFI plugin in the 64-bit linux builds. ------------------------------------------------------------------------ r3628 | eliot | 2016-02-23 09:42:03 -0800 (Tue, 23 Feb 2016) | 42 lines CogVM source as per VMMaker.oscog-eem.1694 General: Fix a bug in printHex: for 64-bits (faulty arithmetic). ThreadedFFIPlugin: Fix compilation of ThreadedFFIPlugin subclasses as internal plugins. Speed up ffiIntegerValueOf: by adding a tag test (harmless in our current crop of VMs) and cppIf: SPURVM as appropriate. Fix the remaining 64-bit issues in the ThreadedFFIPlugin. The X64SysVFFIPlugin now passes the test suite. The issues addressed are: Masks for restricting and signing integral return values must be declared as at least long (again the fact that a manifest integer constat's type defaults to int causes problems). Cast 1 << foo to 1 asUnsignedLong << foo in one place where it is required. Use isFloatObject: rather than floatClass to test for floats since this works for both SmallFloat64 and BoxedFloat64 on 64-bit Spur. Several pointer declarations needed to be e.g. , not . Several casts to int of of firstIndexableField: (which has tyype void *) were discarded. ExternalAddresses and the like need to be created with BytesPerWord or (self sizeof: #'void *'),, not 4. Slang/ThreadedFFIPlugin: To fix shifts in 64 bits, modify Slang to cast a manifest constant that is the receiver of a shift to long (via postpending 'L' to the numeric string). Mac OS build: Make makeall scripts current. Nuke QuickTime framework in the 64-bit build; there is no 64-bit QuickTime. ------------------------------------------------------------------------ r3627 | eliot | 2016-02-22 11:11:27 -0800 (Mon, 22 Feb 2016) | 11 lines CogVM source as per VMMaker.oscog-eem.1692 ThreadedFFIPlugin fixes for 64 bits. Make ffiAddressOf:startingAt:size: & primitiveFFIIntegerAt[Put] 64-bit capable. Use signedMachineIntegerFor: to answer result of primitiveCreateManualSurface. Fix slips in testing for float and/or double in the ARM & X64 ffiCalloutTo:SpecOnStack:in: methods. Mac OS makefiles. Include dependencies to try and get plugins to be rebuilt when things change. ------------------------------------------------------------------------ r3625 | eliot | 2016-02-20 20:56:31 -0800 (Sat, 20 Feb 2016) | 5 lines CogVM sources as per VMMaker.oscog-eem.1690 Fix snafu in the previous commit of the StackInterpreter's followForwardingPointersInStackZone: ------------------------------------------------------------------------ r3624 | eliot | 2016-02-20 20:45:39 -0800 (Sat, 20 Feb 2016) | 13 lines CogVM source as per VMMaker.oscog-eem.1689 ThreadedFFIPlugin: Arrange that the plugin includes sqFFI.h, but defines ThreadedFFIPlugin as 1 before hand so as to prevent sqFFI.h from declaring the old API. This allows the preambleCCode to eliminate its declarations of the surface functions, which (of course) fall foul of using ints where longts must be used on 64-bits. Since sqFFI.h declares these functions and is included everywhere relevant it is the gospel here. StackInterpreter: Eliminate warnings from followForwardingPointersInStackZone: by following the approach taken by the CoInterpreter's version. ------------------------------------------------------------------------ r3621 | eliot | 2016-02-20 19:17:14 -0800 (Sat, 20 Feb 2016) | 13 lines CogVM source as per VMMaker.oscog-eem.1688 X64 Cogit: Make sure that literal32BeforeFollowingAddress: answrs unsigned. Otherwise 16rBABE1F1(5H) causes an assert faul in expectedClosedPICPrototype at startup. Introduce an abstraction for unlinked inline cache tags holding selector indices (when will I ever learn??). Unix makefiles: Add dependencies for cogit.c on the included cogitFoo.c's. Update a script. ------------------------------------------------------------------------ r3619 | eliot | 2016-02-20 13:25:18 -0800 (Sat, 20 Feb 2016) | 2 lines Include the FFI plugin in the 64-bit linux VMs. ------------------------------------------------------------------------ r3617 | eliot | 2016-02-20 12:20:49 -0800 (Sat, 20 Feb 2016) | 25 lines CogVM source as per VMMaker.oscog-eem.1687 Spur: Fix bug in markAndTraceWeaklingsFrom:. Fields of weaklings may be immediate so must use followOopField:ofObject: not followObjField:ofObject:. Slang: Emit constants before types to allow constant names to be used when defining types, e.g. for array extents. Threaded FFI plugin: Use above facility for neater declarations. First cut (untested) of FFI support for x86-64 on System V and WIN64, as X64SysVFFIPlugin.c & X64Win64FFIPlugin.c. Surface Plugin: Change int to long throughout parameter passing (but not the Surface struct itself) to solve issues on 64-bits. Mac OS: remember localizable strings versions for Pharo and Newspeak. Change some (int) casts to (long) or non casts in OpenGL and event code, again to avoid issues on 64-bits. ------------------------------------------------------------------------ r3615 | eliot | 2016-02-19 14:37:27 -0800 (Fri, 19 Feb 2016) | 8 lines Don't use lrintf to convert from NSPoint fields. In 64-bits NSPoint's fields are doubles, not floats. Simply use the default C conversion from floating-point to integers provided by assignment. Oversight from previous commit: Eliminate erroneous casts to (int) in assigning to fields of sqInputEvent in the platforms/iOS subsystem; (int) won't work with 64-bits. ------------------------------------------------------------------------ r3614 | eliot | 2016-02-19 14:23:01 -0800 (Fri, 19 Feb 2016) | 8 lines Have the Mac OS X build install Localizable.strings. Add versions for Newspeak, Pharo and Squeak. Rename the key to SelectImagePanePrompt. Temporarily disable the Serial plugin in the Pharo Mac VM until we can track down the relevant platforms/iOS support for the Pharo extensions. Modify sqSCCSVersion.h's version program to answer all keys when given TAGS as an arg to allow the edits in the Mac makefiles to be done via a loop over the keys. ------------------------------------------------------------------------ r3612 | eliot | 2016-02-15 21:35:08 -0800 (Mon, 15 Feb 2016) | 3 lines Fix argument access on the iOS platform. Comment the Pharo makefiles correctly. Use -DBUILDFOR_OSX=1 for convenience. ------------------------------------------------------------------------ r3606 | eliot | 2016-02-15 16:21:53 -0800 (Mon, 15 Feb 2016) | 8 lines CogVM source as per VMMaker.oscog-eem.1680 Spur. Fix https://pharo.fogbugz.com/f/cases/17536/VM-Crash-when-adding-an-iVar-to-a-subclass-of-SystemAnnouncement. When weaklings (and when ephemerons) are scan-marked forwarders must be coped with. ------------------------------------------------------------------------ r3602 | eliot | 2016-02-14 17:27:13 -0800 (Sun, 14 Feb 2016) | 5 lines Fix errors in the Newspeak Mac installer genrators. Fix a slip in platforms/Cross/vm/sqCogStackAlignment.h for the ARM's getsp. Eliminate non-spur and stack VMs from the ARM builds (it builds veerry slowly) Include 64-bit and Mac Pharo VMs in archives and uploads. ------------------------------------------------------------------------ r3601 | eliot | 2016-02-14 15:01:48 -0800 (Sun, 14 Feb 2016) | 2 lines Get the 64-bit Mac OS plugin list right. Tweak the linux ARM HowToBuild. ------------------------------------------------------------------------ r3599 | eliot | 2016-02-14 13:23:37 -0800 (Sun, 14 Feb 2016) | 2 lines Fix bug in unix configure script. ./getversion must be ${blddir}/getversion. ------------------------------------------------------------------------ r3598 | eliot | 2016-02-14 11:20:23 -0800 (Sun, 14 Feb 2016) | 5 lines More last minute build issues. 64-bit MIDI support is unavailable on Mac OS X from QuickTime. VOlunteers welcome to reimplement this above a more up-to-date API (CoreMIDI?). Fix slip in Newspeak installer fix. Get the Mac OS convenience scripts to look for error: not the old BUILD FAILED. ------------------------------------------------------------------------ r3597 | eliot | 2016-02-14 09:22:06 -0800 (Sun, 14 Feb 2016) | 6 lines Fix various build problems. The Newspeak installers need to install SqueakV50.sources and use CocoaFast.app. svn:ignore propertirs are missing in build.linux32ARM. Nice to build the Pharo VMs as part of makeproduct. Windows Makefiles need to put dll ancilliaries in the build dir and need to nuke the .lib files after linking both VM exes. ------------------------------------------------------------------------ r3596 | eliot | 2016-02-13 16:43:52 -0800 (Sat, 13 Feb 2016) | 5 lines Correct the Newspeak Info.plist file so the VM launches on Mac OS X. Provide mac-like mvm scripts for build.win32x86. Install a source file at the root level in the Mac newspeak builds. Don't hard set the VM in build.win32x86/common/Makefile ------------------------------------------------------------------------ r3595 | eliot | 2016-02-13 15:57:51 -0800 (Sat, 13 Feb 2016) | 7 lines CogVM plugin source as per VMMaker.oscog-eem.1678. Generate the plugin export tables aware of conditionally compiled prims. Add a simplified and shared build system for win32 and cygwin that follows the Mac OS X one. Add BochsX64Plugin to the win32 spur VM. Use the same scheme for the bochs support libraries as on Mac (build.win32x86/{bochsx86,bochsx64}). Fix the signatures of the MIDI plugin support files on unix and win32. ------------------------------------------------------------------------ r3592 | eliot | 2016-02-13 10:10:32 -0800 (Sat, 13 Feb 2016) | 2 lines Provide a proper mvm script. Correct a straggler's svn:ignore ------------------------------------------------------------------------ r3591 | eliot | 2016-02-12 19:33:43 -0800 (Fri, 12 Feb 2016) | 25 lines CogVM source as per VMMaker.oscog-eem.1677 NewspeakVM: Don't use cppIf: #NewspeakVM in VM code. It is appropriate only in plugin code. VM code should use the NewspeakVM variable from VMBasicConstants. Nuke the obsolete Newspeak interpreter src (nssrc). Slang: Fix nilOrBooleanConditionFor: to also work for symbol arguments (such as #Newspeak). Emit "# define FOO" for conditionally defined FOO instead of "#define FOO" which is nice for grepping. IMMUTABILITY: Fix the declaration/definition of ceCannotAssignTo:withIndex:valueToAssign: which needs to be included, but only if -DIMMUTABILITY=1. So modify Slang to output #if FOO && !BAR code around functions that include option: pragmas whose arguments are in namesDefinedAtCompileTime. This also fixes generation of Pharo-specific support code in the FilePlugin. MacOS X build Fix memory support for v3 VMs; sqMacV2Memory.[ch] must be in Common; sqUnixMemory should not be used. Fix stack backtrace for STACKVMs (no writeback of machine stack pointers). Fix makefiles to chose correct sources for stack VM builds. ------------------------------------------------------------------------ r3590 | eliot | 2016-02-12 11:45:55 -0800 (Fri, 12 Feb 2016) | 4 lines Mac OS makefiles. Touch the .app once it is made so it looks recently updated. Ignore installed sources. ------------------------------------------------------------------------ r3589 | eliot | 2016-02-12 11:32:34 -0800 (Fri, 12 Feb 2016) | 4 lines Mac OS X makefiles. Add support for installing sources either into the dir or the app. Fix dependency recognition by eliminating the BASEDIR nonsense. ------------------------------------------------------------------------ r3588 | eliot | 2016-02-11 16:14:11 -0800 (Thu, 11 Feb 2016) | 5 lines Mac OS X gnu makefiles. Factor out the installation of green icons for squeak cog into its own makefile. Add build.macos32x86/squeak+immutability.cog.spur to test IMMUATBILITY builds. Ignore LOG* files. ------------------------------------------------------------------------ r3587 | eliot | 2016-02-11 15:57:38 -0800 (Thu, 11 Feb 2016) | 3 lines Add support for signing the Mac .app bundle if SIGNING_IDENTITY is set, e.g. via export SIGNING_IDENTITY="Developer ID Application: Eliot Miranda" ------------------------------------------------------------------------ r3585 | eliot | 2016-02-11 12:54:30 -0800 (Thu, 11 Feb 2016) | 3 lines Move the macos64x64 builds to the new gnu makefiles Fix the signature of closeWindow in the iOS HostWindowPlugin ------------------------------------------------------------------------ r3584 | eliot | 2016-02-11 12:07:36 -0800 (Thu, 11 Feb 2016) | 8 lines Mac OS X gnu makefiles: Make the Newspeak VMs build (must include sound & host window plugins). Factor out the name mangling necessary to put spaces in the Newspeak exe & icns into common/Makefile.app.newspeak. Factor out chosing the relevant plugin Makefile into a function. Add a dummy ioDrainEventQueue to the iOS source. Freshen the spur VM source which was accidentally unofficial. ------------------------------------------------------------------------ r3583 | eliot | 2016-02-10 21:07:43 -0800 (Wed, 10 Feb 2016) | 6 lines Mac OS X gnu makefiles: Make the GdbARMPlugin make. Make the Makefiles default to CONFIGURATION=product, not debug. Allow CFLAGS to be extended. Correct the external plugin set. ------------------------------------------------------------------------ r3582 | eliot | 2016-02-10 18:35:00 -0800 (Wed, 10 Feb 2016) | 5 lines Mac OS X 32-bit builds. Nuke the old build structure and replace with the new gnu make based one. Simplify the iOS plugin makefiles to no longer set LIBOBJ. Add blue icons for Squeak Sista VMs. ------------------------------------------------------------------------ r3581 | eliot | 2016-02-10 16:23:41 -0800 (Wed, 10 Feb 2016) | 3 lines Mac OS X gnu makefiles: Complete the app bundle build by compiling in the MainMenu.nib. ------------------------------------------------------------------------ r3579 | eliot | 2016-02-10 12:52:25 -0800 (Wed, 10 Feb 2016) | 5 lines Mac OS X gnu makefiles: Fix Mpeg3Plugin by allowing Makefile to supply EXCLUDESRC to filter out files not to be built. Fix remaining external plugin link issues. 32-bit pharo.cog.spur now builds. ------------------------------------------------------------------------ r3578 | eliot | 2016-02-10 11:05:51 -0800 (Wed, 10 Feb 2016) | 6 lines Mac OS X gnu makefiles: Make clear the distinction between SRCDIRS (dirs searched for source files to compile) and INCDIRS (dirs searched for include files) in plugins. Make sure getversion is built before invoking Makefile.plugin. ------------------------------------------------------------------------ r3577 | eliot | 2016-02-10 10:09:25 -0800 (Wed, 10 Feb 2016) | 3 lines Add a build.macos32x86/pharo.cog.spur as first test for new mac makefiles. Add the Pharo & Newspeak icons to the iOS tree. ------------------------------------------------------------------------ r3576 | eliot | 2016-02-10 09:48:30 -0800 (Wed, 10 Feb 2016) | 16 lines First check-in of gnu make build system for Mac OS X. build.macos32x86/common includes makefiles for app vm and plugins. Makefiles for unusual plugins added to platforms/iOS/plugins subdirs. Trailing backslashes removed from various plugins.int files. platforms/iOS/vm/iPhone/sqDummyaio.h moved to platforms/iOS/vm/Common. platforms/iOS/vm/Common/aio.c nuked; it should be taken from platforms/ unix/vm. platforms/Cross/vm/sqSCCSVersion.h extended to make a more useful getversion program for use in makefiles. Still to do: Move build.macos32x86/squeak.cog.spur et al to use new makefiles (tested in test dirs, but not checked-in yet). Add Pharo icns files. Make sure that makefiles work with problems like spaces in Newspeak Virtual Machine ------------------------------------------------------------------------ r3574 | eliot | 2016-01-29 15:34:16 -0800 (Fri, 29 Jan 2016) | 21 lines CogVM source as per VMMaker.oscog-eem.1674 IMMUTABILITY: Now that isOopImmutable: is available through the plugin API, merge NewsqueakIA32ABIPlugin into IA32ABIPlugin and nuke NewsqueakIA32ABIPlugin. Change the Newspeak configurations to not output their own plugins. Modify the unix configure script to default plugins to src/plugins, not foosrc/plugins. Nuke the Newspeak plugins tree. Modify all the mvm scripts that specified plugins to no longer do this as the default suffices. WARNING CI Maintainers, this may require that you check-out http://www.squeakvm.org/svn/squeak/branches/Cog/src/ to get access to the plugin source in http://www.squeakvm.org/svn/squeak/branches/Cog/src/plugins. ------------------------------------------------------------------------ r3573 | eliot | 2016-01-24 21:51:28 -0800 (Sun, 24 Jan 2016) | 5 lines CogVM source as per VMMaker.oscog-eem.1670 Spur: Maintain the survivor count on scavenge (seems cost free). Nuke the special mark count variable; it's always zero anyway. ------------------------------------------------------------------------ r3572 | eliot | 2016-01-24 20:18:14 -0800 (Sun, 24 Jan 2016) | 5 lines CogVm source as per VMMaker.oscog-eem.1669 Fix regression in StackInterpreters from VMMaker.oscog-eem.1665. It's primitiveFail, not primitiveFailed... ------------------------------------------------------------------------ r3571 | eliot | 2016-01-24 19:02:30 -0800 (Sun, 24 Jan 2016) | 29 lines CogVM source as per VMMaker.oscog-eem.1668 General: Add vmParameter 20 (stolen from ikp's JITTER, forgive me Ian) to answer the utc microseconds at startup. Require ioUTCStartMicroseconds from the platform. StackInterpreter: Don't eneter an object into the atCache if it is 16-bit indexable (this is easier, or rather likely more efficient for non-16-bit access, than implementing 16-bit indexability in the atCache). Spur: Fix start up of images containing >= 16 segments. The old code assumed numSegments < 16 and failed to grow the segment records, resulting in objects in segments not entered into the segments to not be swizzled. Add a free space mode to the leak checked to help track down the Newspeak image startup crashes we've seen recently at Cadence. So checkFreeSpace is refactored to checkFreeSpace: gcMode. Insist on inlining objectAfter:limit:. Never inline prepareForSnapshot or writeImageFileIO (for C-level debugging). Spur Cogit: Support CompiledMethod indexing in genPrimitiveAt[Put]. Hence fix the regression in at:[put:] wherreby in Spur one could access the literals part of a method as bytes. Refactor to pull-out the num-literals access from genPrimitiveObjectAt. CoInterpreter: Remove the atCache from the CoInterpreter. It's of little benefit given the Cogit. ------------------------------------------------------------------------ r3566 | eliot | 2016-01-22 17:47:33 -0800 (Fri, 22 Jan 2016) | 12 lines CogVM source as per VMMaker.oscog-eem.1664 Slang: The previous fix surfaced a bug with addTypesFor:to:in: where it would misstate that a recursive method in the process of being typed could not be typed because the recursive call was as yet undetermined. The fix is simply to discount untyped recursive calls, since we're determining precisely that type and shouldn't abort. And the type inference algorithm can't cope with mutual recursion, so break the log jam by explicitly typing findMethodWithPrimitive:FromContext:UpToContext: which is mutually recursive with findMethodWithPrimitive:FromFP:UpToContext:. ------------------------------------------------------------------------ r3565 | eliot | 2016-01-22 16:34:50 -0800 (Fri, 22 Jan 2016) | 10 lines CogVM source as per VMMaker.oscog-eem.1662 Slang: Fix bad regression in type inference from VMMaker.oscog-eem.1587. returnTypeForSend:in: can only default return types to sqInt for unknown selectors. The rewrite in VMMaker.oscog-eem.1587 inadvertently defaulted the return type of known methods whose return type was yet to be determined to sqInt. The fix is to only default to sqInt if there is no known method for the given selector. This fixes, for instance, the weird flipping of the type of 32-bit Spur's headerWhileForwardingOf:,which should always be #sqLong. ------------------------------------------------------------------------ r3564 | eliot | 2016-01-21 17:28:22 -0800 (Thu, 21 Jan 2016) | 17 lines CogVM source as per VMMaker.oscog-eem.1661 Release Clement's IMMUTABILITY work. Make IMMUTABILITY something that is defined on the C compiler command line. Cogit IMMUTABILITY cleanups: Remove the need to map the primitive error code store bytecode by having mapFor:bcpc:performUntil:arg: skip the CallPrimitive & StoreTemp bytecoedes if present. Also avoid the set-up overhead when mapping the first bytecode by moving the first invocation early. Make the married context inst var assign methods deny immutability for their contexts. Plugins: Fix the FilePlugin's unnecessary fullGC on Spur. ------------------------------------------------------------------------ r3563 | eliot | 2016-01-19 18:33:22 -0800 (Tue, 19 Jan 2016) | 17 lines CogVM source as per VMMaker.oscog-eem.1656 Slang: Remember to remove the declaration for a local that is introduced for inlining where the inlining uses the parse tree, not the local. Otherwise, stale declarations can be left that will mistype subsequent inlines of a method with formals of the same name. This fixes quite a few assignment type warnings. Changes to interpreter bytecode dispatch (fetching next bytecode later) to support optional IMMUATBILITY primitiveStringReplace needs to check for immutability amd soon should support 16- and 64-bit access. Provide an error code for immediate replacement. primitiveStringReplace. Add immutability check to changeClassOf:to: for primitiveAdoptInstance et al. Cogit: Merge in ARM 16 bit write handling. ------------------------------------------------------------------------ r3562 | eliot | 2016-01-16 20:02:34 -0800 (Sat, 16 Jan 2016) | 7 lines CogVM source as per VMMaker.oscog-eem.1647 Newspeak 64-bit Cogit: x64 must define nsSendCacheAt: Unix: sqUnixMain.c must define accessing sp & fp on x64 linux. ------------------------------------------------------------------------ r3561 | eliot | 2016-01-16 19:12:08 -0800 (Sat, 16 Jan 2016) | 10 lines CogVM source as per VMMaker.oscog-eem.1646 Add a 64-bit Newspeak Cog Spur configuration. Fix the Unix vm makefile for 64 bits. It must not specify the processor-specific cogit files because they differ on 64-bit and 32-bit platforms. instead it can only specify cogit.c, the umbrella that includes the relevant cogitFOO.c. ------------------------------------------------------------------------ r3560 | eliot | 2016-01-16 10:28:32 -0800 (Sat, 16 Jan 2016) | 4 lines CogVM sources as per VMMaker.oscog-eem.1644 Fix normalizePositive: for 64-bit Spur. ------------------------------------------------------------------------ r3559 | eliot | 2016-01-16 08:48:03 -0800 (Sat, 16 Jan 2016) | 6 lines CogVM source as per VMMaker.oscog-eem.1643 Spur Cogit: Fix bugs in Spur 16 & 32-bit string access. Conversion to code from character must use Character conversion not SmallInteger conversion. ------------------------------------------------------------------------ r3558 | eliot | 2016-01-16 07:53:04 -0800 (Sat, 16 Jan 2016) | 6 lines CogVM source as per VMMaker.oscog-eem.1642 x64 Cogit: Fix at least some of the bounds checking issues in Spur's genPrimitiveStringAt[Put]. ------------------------------------------------------------------------ r3557 | eliot | 2016-01-15 21:33:04 -0800 (Fri, 15 Jan 2016) | 7 lines CogVm source as per VMMaker.oscog-eem.1641 Spur: Follow the stacked receiver (closure) of a block activation when handling send faults so that forwarded copied values are unforwarded for subsequent activations of the same closure. ------------------------------------------------------------------------ r3556 | eliot | 2016-01-15 20:45:20 -0800 (Fri, 15 Jan 2016) | 5 lines CogVM source as per VMMaker.oscog-eem.1640 Spur64-bit Cogit: Use the same approach for boxed float ops as for SmallFloat ops. ------------------------------------------------------------------------ r3555 | eliot | 2016-01-15 20:22:18 -0800 (Fri, 15 Jan 2016) | 17 lines CogVM source as per VMMaker.oscog-eem.1639 Cogit: Fix slip in immutability jumps. jumpTarget is not a selector. getJmpTarget is. 64-bit Spur Cogit: Generate cleaner SmallFloat arithmetic and comparison code by extracting arg tag once. Implement MoveRM[16|b]r for MIPSEL and correct machine code size of MoveMbrR/RMbrR. Spur: Add some commentary on default sizes, explaining why 64-bit Spur has the same default eden size as 32-bits. ------------------------------------------------------------------------ r3554 | eliot | 2016-01-15 14:02:25 -0800 (Fri, 15 Jan 2016) | 44 lines CogVM source as per VMMaker.oscog-eem.1636 CoInterpreter: ceSend: et al need to add looked up methods to the method cache, otherwise methods only found through machine code sends will not be jitted. Spur: Add 16-bit indexability to Spur. Generate slimmer code for positive32BitValueOf: on 64-bit Spur. Immutability: Fix a slip in commonAtPut: immutability testing. x64 Cogit: Use 32-bit register comparisons in CmpC32R so as to generate a 5 byte sequence for pic dispatch instead of 6, and hence brOng the pic dispatch jump into the short range when jumping to the abort for an MNU PIC dispatch. Fix bugs in X64's MoveRMbr, MoveRXbrR. Simplify rexw:r:x:b:. Add missing machine code primitives to 64-bit Spur. Move "Spur"'s primitiveStringAt down to "32BitSpur". 64-bit Spur x64 cogit now functional (at least on Mac OS X; albeit with Cursor management in Cocoa still broken due to arc issues). Cogits: Eliminate the bogus min/maxAbstractGeneralPurposeReg thang and use a register mask as Ryan suggested. Make the MirrorNewWithArg primitive do the class size check before accessing the format field. Fix bug with new PIC scheme. the offset to the frst jump in the PIC (the jump to the next case) is at firstCPICCaseOffset - backEnd jumpLongByteSize - backEnd loadLiteralByteSize, /not/ firstCPICCaseOffset - backEnd jumpLongByteSize - backEnd loadPICLiteralByteSize. (This affects only x64 and in-line literal ARM, hence no one's noticed yet). Fix the C type of compileFrameBuild ------------------------------------------------------------------------ r3553 | eliot | 2016-01-10 14:51:42 -0800 (Sun, 10 Jan 2016) | 13 lines CogVm source as per VMMaker.oscog-eem.1630 Cogit: Fix the bug in ceCaptureStackPointers caused by pushing VarBasReg to save it offsetting the stack pointer. Eliminate all the maybe*VarBase methods since we have hasVarBaseRegister and the few clients can test that and hnce not have to divine if maybeSaveVarBase pushed something or not. On Mac IS X modify the stack alignment definitions to reflect documented Apple policy. ------------------------------------------------------------------------ r3552 | eliot | 2016-01-10 13:49:21 -0800 (Sun, 10 Jan 2016) | 2 lines Fix min or slip in last commit. ------------------------------------------------------------------------ r3551 | eliot | 2016-01-10 13:29:07 -0800 (Sun, 10 Jan 2016) | 13 lines CogVm source as per VMMaker.oscog-eem.1628 Cogit: Have ceGetSP answer the SP prior to the call rather than after, hence eliminating the need for LEAF_CALL_STACK_ALIGN_BYTES in platforms/Cross/vm/sqCogStackAlignment.h. Also, given that we already define leafCallStackPointerDelta in each back end we can eliminate the various genGetLeafCallStackPointerFunction shims. Hence simplify the definitions in platforms/Cross/vm/sqCogStackAlignment.h Add SqueakV50.sources ------------------------------------------------------------------------ r3550 | eliot | 2016-01-10 11:22:21 -0800 (Sun, 10 Jan 2016) | 7 lines CogVm source as per VMMaker.oscog-eem.1627 Slang: Avoid having to mark quick methods as by providing #asSpecifiedOrQuick as an inlining policy. x64: Add relevant stack alignment deifnitions to sqCogStackAlignment.h. ------------------------------------------------------------------------ r3549 | eliot | 2016-01-09 12:37:15 -0800 (Sat, 09 Jan 2016) | 8 lines CogVM source as per VMMaker.oscog-eem.1626 x64 Cogit: ceCaptureCStackPointers cannot assume VarBaseReg is caller-saved and should save and restore it if used. Add support for dumping the register state on x86_64 Mac OS Cocoa. ------------------------------------------------------------------------ r3548 | eliot | 2016-01-09 10:55:57 -0800 (Sat, 09 Jan 2016) | 3 lines CogVM source as per VMMaker.oscog-eem.1625. Fix inclusion of SmallFloat prims. ------------------------------------------------------------------------ r3547 | eliot | 2016-01-09 08:25:07 -0800 (Sat, 09 Jan 2016) | 49 lines CogVM source as per VMMaker.oscog-eem.1623 Spur: Fix a bug with out-of-place two-way become, which got the hash copy the wrong way round. By default, the hash stays with the reference in two-way become. Fix what appears to be a compiler bug with in-place two-way-become by treating the headers to be swapped so that remembered flags are swapped and hash bits are swapped if required. Cogit: Execute the "abstract registers simply name concrete registers" coup. Now abstract registers are also non-negative values and all the negation nonsense with register masks is eliminated. Refactor primitive generation so that all primitives reside in CogObjectRepresentation and subclasses, except for genPrimitiveClosureValue and genPrimitivePerform. This eliminates the outer/inner distinction and the need for a separate compileFallbackToInterpreterPrimitive:. Eliminate the enabled function from a CogPrimitiveDescriptor, adding the enablement calls to the relevant primitives, and discarding the unused primitiveIndex arguments. MIPS Cogit: Implement I-cache flush with . Use signed shift when generating I-type instructions. Handle optional floating-point (i.e. the current MIPSEL) by adding to all floating point routines hence eliding them on MIPS. Misc Cogit: Eliminate some obsolete assignments to maxSize in computeFooSize methods. Implement machine code SmallFloat primitives. Fix conversion bug in maybeGenConvertIfSmallFloatIn:. Streamline genJumpNotSmallFloatValueBits:scratch:'s isolation of the exponent. Slang: Avoid computing variable and return types prematurely i.e. don't derive types from as-yet-untyped methods. sqConfig.h: Add NeverInline support for the Clang C compiler. Spur Bootstrap for Cuis: Cope with there being no methodClassAsociation: in MorphFloat.st ------------------------------------------------------------------------ r3544 | eliot | 2015-12-17 09:50:55 -0800 (Thu, 17 Dec 2015) | 22 lines CogVM source as per VMMaker.oscog-eem.1608 Cogit: Implement identifyingPredefinedMacros and therefore start generating C for MIPSEL alongside IA32 and ARMv5 (!!) Nuke incorrect uses of signedIntToLong on the results of callTargetFromReturnAddress: Refactor genLookupForPerformNumArgs: along the same lines as compileOpenPIC:numArgs: to use a base reg to access the method dict when outside the MoveMw:r:R: offset range. generateCaptureCStackPointers: must establish the VarBaseReg before accessing any of the stack pointer variables. x86 Cogit: Fix order of cmp in ArithCwR. Extend var base range to 1Mb Fix stupidities in concretize[Call|Jump]Full (move absolute value, not value referenced by absolute address). Fix REX byte slip in concretizeMoveCwR. Subversion: add more svn:ignore properties ------------------------------------------------------------------------ r3542 | eliot | 2015-12-16 16:51:26 -0800 (Wed, 16 Dec 2015) | 11 lines CogVM source as per VMMaker.oscog-eem.1602 Spur: Missing classArray export. Don't include sqMemoryAccess.h include explicitly since it's pulled in by sq.h anyway. Fix external declarations for several functions used in the interpreter that were previously undeclared. Fix include paths for the (moved) gdb ARM support files. ------------------------------------------------------------------------ r3541 | eliot | 2015-12-16 14:44:04 -0800 (Wed, 16 Dec 2015) | 26 lines CogVM source as per VMMaker.oscog-eem.1601 x64 Cogit: Rewrite some optional run-time routine generators to avoid generating empty functions. Add missing exports from SpurMemoryManager to cogits. On 64-bits defaulting to int foo(int bar) is not merely illegal in C99 but often disastrous. Refactor compileOpenPIC:numArgs: to pull three probe generation sequences out into a single method. Use a base register to point to the method cache if MoveMw:r:R: offsets aren't large enough to access the method cache (as may be the case on 64-bit systems). Add CogAbstractInstruction>>isWithinMwOffsetRange: to answer if offsets are within the MoveMw:r:R: range. Use the same base reg approach to dereference the class table in genGetClassObjectOfClassIndex:into:scratchReg:. Slang: Fix determining types for implicitly typed pointer variables. Fix indenting of some arithmetic expressions. Do a better job managing comment production in statement lists by adding variables to CCodeGenerator that track the last comment node and whether that comment was a comment from an inlining decision. ------------------------------------------------------------------------ r3537 | eliot | 2015-12-15 17:40:44 -0800 (Tue, 15 Dec 2015) | 4 lines Roll the version id since the iOS platform code has changed. Eliminate uses of the -mno-fused-add gcc flag (unsupported in clang). ------------------------------------------------------------------------ r3533 | eliot | 2015-12-15 11:48:51 -0800 (Tue, 15 Dec 2015) | 15 lines CogVM source as per VMMaker.oscog-eem.1597 Cogit: Fix regression in x86's register save/restore. Eliminate some warnings in cogitX64.c. Use the right conversions for computing 32-bit offsets in jumps and calls. Nuke genJump[Not]SmallInteger:scratch: in favour of genJump[Not]SmallInteger:scratchReg: Plugins: Fix the Alien plugins for 64-bits in the simulator which alas changes the C code to no effect. ------------------------------------------------------------------------ r3528 | eliot | 2015-12-14 11:04:52 -0800 (Mon, 14 Dec 2015) | 9 lines Fix the signature of signed32BitValueOf to answer int. In the mac 64- & 32-bit Cog Spur builds: Nuke unused prefix headers. Replace use of Carbon with Cocoa. Include the iOS config.h sqConfig.h & sqPlatformSpecific.h I note that sqPlatformSpecific.h lives in iPhone but sgould be in Common but editing so many project.pbxproj files makes this change hugely expensive. We should use Makefiles and discard this xcode crap. ------------------------------------------------------------------------ r3525 | eliot | 2015-12-13 17:36:08 -0800 (Sun, 13 Dec 2015) | 14 lines CogVM source as per VMMaker.oscog-eem.1594 Eliminate warnings for %.*s string length parameters in printf. Cogit: Don't inline AndCq:R:R: because its translation contains a jump and hence won't work in a statement list expression. Nuke genJump[Not]SmallInteger:scratch: in favour of genJump[Not]SmallInteger:scratchReg: Slang: Eliminate leaves in statement lists generated as expressions (to reduce warnings). ------------------------------------------------------------------------ r3524 | eliot | 2015-12-13 12:44:13 -0800 (Sun, 13 Dec 2015) | 14 lines CogVM source as per VMMaker.oscog-eem.1591 x64 Cogit: Changes to get cogitX64.c to compile and link. Use unalignedLong* methods to access literals embedded in x64 instructions. Slang: don't emit leaf statements to eliminate warnings in the cogit.c's. Make the inline primitive generation code #SistaVM only. Adjust MNU/interpret cPIC entries (i.e., jumps within the cPIC) during relocation when zone calls are absolute. 64-bit Spur on Mac OS X: exclude plugins not yet ready for prime time. ------------------------------------------------------------------------ r3523 | eliot | 2015-12-12 12:58:39 -0800 (Sat, 12 Dec 2015) | 8 lines CogVM source as per VMMaker.oscog-eem.1585 Cogit: Nuke unused Fill options. Better document the use of Fill32: so Ryan's objection is answered. iOS: Add 64-bit case for the "this is not ready for prime time" message. ------------------------------------------------------------------------ r3519 | eliot | 2015-12-12 10:27:51 -0800 (Sat, 12 Dec 2015) | 4 lines CogVm source as per VMMaker.oscog-eem.1582 Fix compilation from regressions in the previous commit. ------------------------------------------------------------------------ r3518 | eliot | 2015-12-12 00:23:17 -0800 (Sat, 12 Dec 2015) | 43 lines CogVM source as per VMMaker.oscog-eem.1580 Cogit: Add sources for the Spur Cog 64-bit VM on x64. Simplify Spur's Object>>at: and fix it for x64 (no byte read zero extend). Fill unused portions of methods with the stop instruction, not nop. Explicitly initialize the code zone with stops. Explicitly clear the reclaimed portion of the method zone after a compaction. Include the reclaimed portion of the method zone in the I-cache flush after a compaction: no point in leaving it in cache since it isn't a valid call/jump target. Introduce the "abstract register" NoReg and use it everywhere we used nil before to indicate no register. Rename selectors and temporaries of the form *registerOrNil*" to "*registerOrNone*". Rewrite all uses of reg ifNil: to be reg = NoReg ifTrue:. This is prior to the putsch to replace the use of -1 to -N for abstract registers, collapsing them down onto the same 0-N range used for concrete registers. Add a Microsoft moniker for ARM to its identifyingPredefinedMacros. Reorder genDoubleArithmetic:preOpCheck: to move the common case SmallInteger/SmallFloat conversion earlier in the method, before the failure code. Fix slip in maybeSelectorOfMethod: which will improve back traces including methods containing pragmas (including primitives). Interpreter: fix primitiveIsPinned, tweak primitivePin. Plugins: Take cryptographic plugins from http://www.squeaksource.com/Cryptography/CryptographyPlugins. FFI Plugins (temporary): reverted (again) the in-memory check for access objects through FFI. It was making structure access fail... needs futher investigation in the area. ------------------------------------------------------------------------ r3514 | eliot | 2015-12-05 18:06:01 -0800 (Sat, 05 Dec 2015) | 36 lines CogVM source as per VMMaker.oscog-eem.1558 Cogit: Refactor the logic to handle UnimplementedPrimitive and UnfailingPrimitive in a common routine, passing the result of the primtiiev generator to #compileFallbackToInterpreterPrimitive:. Add the notion of CompletePrimitive for primitives that may fail, but handle all the success cases, hence if a method including such a primitive doesn't use the error code the Cogit doesn't have to compile the call to the interpreter primitive as a fallback. Add genPrimitiveObjectAt to provide fast literal and header access on Spur. Streamline access to the tag patterns form the Cogit by using macros. CPIC relocation: fix conflation of unconditional and conditional jumps. Implement overflow checking for primitive div that works in 32- and 64-bits. Provide a convenience method to hide the inconvenience of checking for UndefinedOperation in uses of genJump[Not]SmallInteger:. Refactor to share genInnerPrimitiveStringAt: between 32- and 64-bit Spur obj reps. x64 Cogit: rationalise concretize"Op"RR into two routines in both x64 and x86. Avoid using isCallPrecedingReturnPC: for testing if compileInterpreterPrimitive used a CallFull or a JumpFull to invoke the prim, hence allowing isCallPrecedingReturnPC:to only have to apply to calls used for sends, and hence reuse x86's isCallPrecedingReturnPC: for x64. Fix genPrimitiveClosureValue for 64-bits (use genJumpImmediate: to exclude non-cogged methods). Plugins: Include the file sync prim in the FilePrims plugin. ------------------------------------------------------------------------ r3512 | eliot | 2015-12-02 12:56:33 -0800 (Wed, 02 Dec 2015) | 7 lines CogVM source as per VMMaker.oscog-eem.1543 Cogit: Fix the regression caused by the incorrect fix for skipping the primitive and primitive error code bytecodes. Handle the skip in compileMethodBody. Cache methodHeader in an inst var; it's used enough. ------------------------------------------------------------------------ r3511 | eliot | 2015-12-02 10:26:38 -0800 (Wed, 02 Dec 2015) | 13 lines CogVM source as per VMMaker.oscog-eem.1539 Cogit: Fix /horrible/ bug with primitive error codes and fixups. The adjustment of the initialPC to skip the primitive and error code, if any, was done after generating fixups for backward branches, and hence these branches were bogus. Object>>shallowCopy in Spur is subject to this, but amazingly enough it has not surfaced before now. Fix this by adjusting the initialPC before scanMethod scans for fixups. ARM builds: Revert inclusion of Squeak3D plugin until the code is in the src/plugins tree. ------------------------------------------------------------------------ r3510 | eliot | 2015-11-30 16:32:22 -0800 (Mon, 30 Nov 2015) | 18 lines CogVM source as per VMMaker.oscog-eem.1535 All: Fix maybeInlinePositive32BitIntegerFor: and hence positive64BitIntegerFor: for values that look like 32-bit negative SmallIntegers. Cogit: Move noteFollowingConditionalBranch: to catch branches created outside of Jump, and hence generate a lot less junk in the cogit c files. CPIC patching (architecture independent): fix call mistaken for a jump and conditional branch mistaken for a jump. BochsX64Plugin: back port a fix from Bochs v2.6.8 that fixes the sign of 64-bit divisions. Mac OS Spur build: preserve dates when copying resources into .app bundles. ------------------------------------------------------------------------ r3509 | eliot | 2015-11-30 12:53:12 -0800 (Mon, 30 Nov 2015) | 2 lines Get the icons & in-plist-ersion right for the Spur Cocoa build ------------------------------------------------------------------------ r3508 | eliot | 2015-11-30 12:14:11 -0800 (Mon, 30 Nov 2015) | 4 lines Implement full help and version information for the Cocoa VM. Copy rather than move the build .app when composing the VM .app (as yet 32-bit Spur build only). ------------------------------------------------------------------------ r3503 | eliot | 2015-11-24 15:10:56 -0800 (Tue, 24 Nov 2015) | 2 lines Add -fwrapv flag to Xcode iOS Spur build (needs to be in all other Xcode projects also). ------------------------------------------------------------------------ r3502 | eliot | 2015-11-24 14:58:27 -0800 (Tue, 24 Nov 2015) | 75 lines CogVM source as per VMMaker.oscog-rmacnak.1532 Cogit: Fix bug in Spur machine-code at:put: on 32-bit bits objects; method failed to fail for negative values. Change the generation of closed PICs; they are no longer compiled each time we make on or extend one, but rather copied from a prototype and updated as needed. Take a look at http://wiki.squeak.org/squeak/6205 for some explanations. Fixes a bad bug on ARM where we were generating class tags as instructions and getting away with it simply because class tags look like noops. Now that we generate all code in one go, out-of-line literals are no longer accidentally intermixed with the code. Changes due to as-yet-unreleased MIPSEL support. Branches are informed of their preceding instruction so that on MIPS the pair can be collapsed to a unitary compare-and-branch instruction. Implement the long conditional branch/long unconditional branch split necessitated by the MIPS processor in all of the closed PIC methods. Reorder CPIC instructions to suit MIPSEL, i.e. put the load before the compare and jump (the old code was there only to suit adjusting entries on x86, not for performance). Beef up the asserts in expectedClosedPICPrototype so that updating the class and method entries is tested. Changes due to as-yet-unreleased x64 support. Use CmpC32:R: to compare the class tag in CPICs to match in-line caches on 64-bit Spur. Add CmpC32R generation for X64. Refactor the gen[NS]Send: machinery to take selector indices instead of selector oops, to allow the x64/Spur64 JIT to use 32-bit in-line caches that hold selector indices, not selector oops. Scheme is commented in genLoadInlineCache:. Fix the use of 80 as a constant in the special selector machinery. This should be firstSpecialSelectorBytecodeOffset. Add [Alt]NumSpecialSelectors for range checking special selector indices, which are negative. Refactor context creation generation code in Spur object representations for sharing between 32 and 64 bits. Implement some 64-bit obj rep generation support. Clarify whether byte reads zero-extend by introducing CogAbstractInstruction>>byteReadsZeroExtend. Make sure the x86 does zero-extend and take the easy route with x64 having it not zero-extend. Slang: Make sure signed comparisons are used in the relevant isIntegerValue: implementations. Update Slang to collapse an ifTrue:ifFalse: if both arms are the same, to avoid the code duplication this introduces on the rest of the processors where conditional and unconditional branch offsets can be accessed in the same way. Fix Slang regression. TSendNode>>isSameAs: must take into account the receiver!! Include exported api variables (between Cogit and CoInterpreter) for better type checking and fewer warnings. Propagate types of actuals with other than the default sqInt type to untyped formals, hence fixing bogus inlining of genLoadHeaderIntoNewInstance: into genGetActiveContextLarge:inBlock:. Fix baaaad bug in node:typeCompatibleWith:inliningInto:in: which was looking up the type of the formal parameter in inlining in the target method, not the method being inlined! (bug surfaced by previous fix). Allow constant elimination for Const ifNil: [] ifNotNil: [], hence cleaning up uses of characterTable in the Spur VMs. Plugins: ThreadedFFIPlugin: - ExternalAddress now are taken correctly (nor as ByteArray or Alien, because they are different beasts). - allow pushing of pointers to any type (into a ByteArray, an ExternalAddress or an Alien), to allow passing parameters style int*, float*, etc. - allow reading in memory to allow read chunks of ByteArray Alien Plugins: Fix missing primitive failure for Alien typeAt: 0 [put:]. Add word accessors to Alien. ------------------------------------------------------------------------ r3484 | eliot | 2015-11-05 10:16:38 -0800 (Thu, 05 Nov 2015) | 3 lines Fix OpenGL compilation on case-sensitive Mac filesystems. Ignore the bochs build artifacts ------------------------------------------------------------------------ r3444 | eliot | 2015-09-24 12:19:28 -0700 (Thu, 24 Sep 2015) | 26 lines CogVM source as per VMMaker.oscog-eem.1468 Slang: Fix the NoDbgRegParams and NeverInline attributes. These need to be emitted immediately before the function name, not after the parameter list. After the parameter list was legal in older gcc's but as of about 4.7 or 4.8 gcc insists that function attributes preceed the name and are emitted both for forward declaration and definition. Cogit: Extend the abstract register scheme to include 8 scratch registers. Allow ARMv6 use one, and x64 use 6. Hence nuke the ill-thought-out GPRegMax GPRegMin, and coincidentally, the unused MulCqR MulCwR MulRR. Improve CogIA32Compiler>>computeMaximumSize's accuracy. Alien plugins: Remove some hardcoded word sizes from Alien. Plugins: Fix C compiler warnings by making sqAssert: answer its argument (as looked like the intent from the original version). Make sure the actual Smalltalk selector is included in error messages and the comment at the beginning of a generated C function. ------------------------------------------------------------------------ r3438 | eliot | 2015-09-15 16:26:22 -0700 (Tue, 15 Sep 2015) | 16 lines CogVM source as per VMMaker.oscog-eem.1455/Cog-eem.276 fix coercion problems on FFI plugin (IA32 & ARM) - character were not correctly mapped back - floats were not being well chequed - external addressed needs to be treated as aliens for the purpose of coercing them as pointers (bad regression by Eliot) Make sure the actual Smalltalk selector is included in error messages and the comment at the beginning of a generated C function. Fix C compiler warnings by making sqAssert: answer its argument (as looked to be the intent from the original version). Eliminate some compiler warnings in the generated processor plugins. ------------------------------------------------------------------------ r3436 | eliot | 2015-09-14 18:32:15 -0700 (Mon, 14 Sep 2015) | 9 lines CogVM source as per VMMaker.oscog-eem.1453/Cog-eem.275. Fix bugs with 4-byte long integers in the 64-bit or machine word on 64-bit signed integer conversion routines. Refactor BochsIA32Plugin to admit BochsX64Plugin below BochsPlugin. Use positiveMachineIntegerFor: when answering the address of the C++ instance. Avoid adding two header files to the Bochs plugins. Add BochsX64Alien. ------------------------------------------------------------------------ r3435 | eliot | 2015-09-14 16:00:42 -0700 (Mon, 14 Sep 2015) | 7 lines CogVM source as per VMMaker.oscog-eem.1451 Oops! The has hash arm of primitiveSetOrHasIdentityHash needs to return, not fall through. Fix a typo in the Matrix2x3Plugin (thanks Nicolai). ------------------------------------------------------------------------ r3434 | eliot | 2015-09-14 11:14:01 -0700 (Mon, 14 Sep 2015) | 11 lines CogVM source as per VMMaker.oscog-eem.1449 Fix positive32BitValueOf: & signed32BitValueOf: for 64-bit Spur; these must fail for SmallIntegers with digitLength > 4. Modify secret primtiive 161, primitiveSetIdentityHash so that with 0 args it answers whether an object has an identity hash. This is vacuously true for V3, but is meaningful in Spur. Update the Newspeak FilePlugin to be the same as the Smalltalk one. ------------------------------------------------------------------------ r3433 | eliot | 2015-09-11 09:29:40 -0700 (Fri, 11 Sep 2015) | 2 lines Fix heartbeat code signatures for 64-bits. Thnaks, Ryan. ------------------------------------------------------------------------ r3432 | eliot | 2015-09-10 16:20:00 -0700 (Thu, 10 Sep 2015) | 4 lines CogVM source as per VMMaker.oscog-eem.1448 Fix emit of PharoVM define in the FIlePlugin ------------------------------------------------------------------------ r3430 | eliot | 2015-09-01 12:13:23 -0700 (Tue, 01 Sep 2015) | 6 lines CogVM source as per VMMaker.oscog-eem.1447 Whoops! Several of the flags were inverted when computing the flag word written to the image header. Also, queueMourner: must check for an empty or full queue. ------------------------------------------------------------------------ r3429 | eliot | 2015-08-31 14:10:05 -0700 (Mon, 31 Aug 2015) | 39 lines CogVM source as per VMMaker.oscog-eem.1446 Spur: Implement ephemeron queue primitive. Add an image flag that controls the finalization support (StackInterpreter instVar newFinalization). If unset, finalization is as currently expected; WeakArray finalizes all WeakArrays in its registries on each finalization (which does not scale!). If set, then both fired ephemerons and bereaved weak arrays are added to the finalization queue and the finalization semaphore is signalled. In this regime the image is expected to send mourn to each element of the queue, and weak arrays will send themselves finalize in mourn, side-stepping the finalizeValues steps and rendering WeakArray's FinalizationDependents and WeakRegistry obsolete. The bit is set via Smalltalk vmParameterAt: 48 put: ((Smalltalk vmParameterAt: 48) bitOr: 64). Rename ephemeronQueue to mournQueue to reflect more general use of the queue. ThreadedFFIPlugin Added ThreadedFFIPlugin>>#primitiveLoadSymbolFromModule (copy and adapt from IA32ABIPlugin). Newspeak: Fix bug from refactoring in VMMaker.oscog-eem.1438 - lookupProtected:startingAt:rule: should return the actual lookup rule, not 0. Rename local variable lookupClass to currentClass in a few places to avoid confusion with instance variable lkupClass. The actual receiver of an MNU from an outer send is not necessarily the method receiver: Fix bug in MNU for cogged dynamic super sends - should start looking for #doesNotUnderstand: in the superclass not the receiver class. Unify MNU lookup between absent and present receiver sends as a result. Further fix outer send MNU by not confusing lkupClass and lkupClassTag. Push setting lkupClassTag down to clarify it is for new cache entries. ------------------------------------------------------------------------ r3427 | eliot | 2015-08-21 20:39:38 -0700 (Fri, 21 Aug 2015) | 14 lines CogVM source as per VMMaker.oscog-eem.1441 Modify Spur ImageSegment load to become the segmentWordArray into an Array of the loaded objects if load is successful, hence decoupling ImageSegment from the assumption that objects are allocated in order. Fix use count printing in printStackPagesInUse et al. Newspeak Use the isFooMethod: level method privacy accessors to test in two remaining lookup routines, restricting AccessModifierPublic et al to the inner accessors. Enable access control in 64-bit Newspeak VMs as well. ------------------------------------------------------------------------ r3426 | eliot | 2015-08-20 12:28:03 -0700 (Thu, 20 Aug 2015) | 3 lines Doh! The EnforceAccessControl define is already set-up for C compiler command- line override. Use this and nuke the nac versions of the New3speak sources. ------------------------------------------------------------------------ r3425 | eliot | 2015-08-19 16:57:42 -0700 (Wed, 19 Aug 2015) | 3 lines Add EnforceAccessControl=false versions of the Newspeak 32-bit Cog & Stack Spur VMs for Cadence use. Add builds to macos32x86 and linux32x86. ------------------------------------------------------------------------ r3424 | eliot | 2015-08-17 20:53:06 -0700 (Mon, 17 Aug 2015) | 14 lines CogVM source as per VMMaker.oscog-eem.1436 Fix the bug introduced by the fix to primitive function invocation in VMMaker.oscog-eem.1351 The fix correctly changd primitjve code to set the primitiveFunctionPointer appropriately when a jitted external primitive was rebound, but it didn't remember to void the jit's record of the offset of the assignment that sets the primitiveFunctionPointer when switching between profiling andf non-profiling regimes, so that the address from the wrong regime would remain and be used to smash prmitive code. The fix is simply to void the externalSetPrimOffsets in voidCogCompiledCode. This fixes the bug whose symptom is a hard VM crash when using AndreasSystemProfilier. ------------------------------------------------------------------------ r3423 | eliot | 2015-08-17 17:29:33 -0700 (Mon, 17 Aug 2015) | 15 lines CogVM source as per VMMaker.oscog-eem.1435 Fix negative 64-bit shift in the 64-bit Spur interpreter. Finally merge and refactor [Co]InterpreterStackPages into these plus a common superclass CogStackPages. Rename InterpreterStackPage to CogStackPage. Add stats to compute the average and maximum number of live pages at map. Make marshallAbsentReceiverSendArguments: use wordSize instead of BytesPerWord. Add the V46 source files to the sources collection. Make the Newspeak VM packager include the V50 sources file instead of V41. Ryan has already moved the Newspeak bootstrap to Squeak 5.0 Spur! ------------------------------------------------------------------------ r3420 | eliot | 2015-08-11 12:42:12 -0700 (Tue, 11 Aug 2015) | 9 lines CogVM source as per VMMaker.oscog-eem.1430 Get the fix for Integer receiver, float arg comparison right. Fix some C compilation warnings. Fix C99 code in SqueakSSL plugin (restrict keyword and for statement local iteration variable declaration) to compile under C89 as well. ------------------------------------------------------------------------ r3418 | eliot | 2015-08-10 10:49:36 -0700 (Mon, 10 Aug 2015) | 16 lines CogVM source as per VMMaker.oscog-eem.1429 Fix Integer receiver, float arg comparison with NaNs in the machine-code primitive. This has started failing in the FloatTest>>testNaNCompare since the new machine-code perform primitive invoked the machine-code version of the primitive. The Interpretewr code has always been correct and the old perform primitive would always run the Interpreter primitive if it exsted, since this would probably be faster. Refactor stack page list printing to include use counts. Newspeak: Fix MNU for cogged self and outer sends. Use the right paths in the Newspeak SSL Plugin builds. ------------------------------------------------------------------------ r3417 | eliot | 2015-07-29 18:55:26 -0700 (Wed, 29 Jul 2015) | 2 lines Integrate Marcel Taeumel & Tobias Pape's v2 SSL plugin changes. ------------------------------------------------------------------------ r3411 | eliot | 2015-07-20 23:18:27 -0700 (Mon, 20 Jul 2015) | 2 lines Do the Pahro/Squeak split for directory entry creation for the iOS platform. ------------------------------------------------------------------------ r3410 | eliot | 2015-07-18 19:15:20 -0700 (Sat, 18 Jul 2015) | 4 lines Make the ARM buold scripts explicit about compiling for armv6/pi 1. Maybe we should have a single point of configuration for armv6/Pi1 armv7/Pi2, but this will do for now. ------------------------------------------------------------------------ r3409 | eliot | 2015-07-18 18:39:04 -0700 (Sat, 18 Jul 2015) | 3 lines Include the Alien support in the Squeak ARM VMs now that it works to a fair extent in Newspeak. ------------------------------------------------------------------------ r3408 | eliot | 2015-07-18 14:59:56 -0700 (Sat, 18 Jul 2015) | 16 lines CogVM source as per VMMaker.oscog-eem.1427 Fix at least one set of 64-bit issues caused by Slang. In particular the integerObjectOf: code resulted in (objectMemory integerObjectOf: MillisecondClockMask) evaluating to the -1 object, instead of the 16r1FFFFFFF object, which was the cause of the initially nresponsive 64-bit image on the real VM. Don't use cppIf: NewspeakVM(et al) where possible, to avoid leaving #if NewspeakVM everywhere. Instead rely on generation-time dead code removal. Both Newspeak and Squeak VMs benefit from improved readability. Fix some primitiveFail[For:] calls in potential mirror primitives that did not return after falure, and could hence continue to do damage after detecting a failure condition. ------------------------------------------------------------------------ r3406 | eliot | 2015-07-16 13:00:51 -0700 (Thu, 16 Jul 2015) | 2 lines Provide optional logging along the input event processing chain. ------------------------------------------------------------------------ r3404 | eliot | 2015-07-16 08:25:58 -0700 (Thu, 16 Jul 2015) | 34 lines CogVM source as per VMMaker.oscog-eem.1423 All Cogits: Implement a machine code perform:[with:]* primitive. Eliminate the duplication of SimpleStackBasedCogit/StackToRegisterMappingCogit>>compileOpenPIC:numArgs: now that we have dead code elimination enabled. ARM Cogits: Use __aeabit_idivmod to implement machine code div/mod primitives on ARM. 64-bits: Change the type of the event buffer from int[8] to long[8]. Newspeak: Compile Newspeak self and super sends as clean sends as well. Slower in monomorphic case but net win for the larger benchmarks, presumably because it avoids I-cache flushes in the polymorphic case. Also means implementing polymorphic caches for clean sends will benefit all non-ordinary sends. DeltaBlue +8.2% Splay +7.6% ParserCombinators +4.7% Richards +0.5% SlotRead (replaced with self send) -17.6% Spill ReceiverResultReg before runtime call to fix pushEnclosingObject on ARM. (ReceiverResultReg is edx/caller-saved on IA32 but r7/callee-saved on ARM.) Fix the 64-bit Newspeak builds' plugins.ext Nuke obsolete newspeak.*.v3 build directories. ------------------------------------------------------------------------ r3403 | eliot | 2015-07-14 15:46:03 -0700 (Tue, 14 Jul 2015) | 30 lines CogVM source as per VMMaker.oscog-eem.1417 General: Change the type of the event buffer from int[8] to long[8], along with the matching event typedefs in sq.h. Add a fence before reading checkSignalRequests and useTideA in doSignalExternalSemaphores. Newspeak: Spill ReceiverResultReg before the runtime call to fix pushEnclosingObject on ARM. ReceiverResultReg is edx/caller-saved on IA32 but r7/callee-saved on ARM. Compile Newspeak self and super sends as clean sends as well. Slower in monomorphic case but net win for the larger benchmarks, presumably because it avoids I-cache flushes in the polymorphic case. Also means implem- enting polymorphic caches for clean sends will benefit all non-ordinary sends. DeltaBlue +8.2% Splay +7.6% ParserCombinators +4.7% Richards +0.5% SlotRead (replaced with self send) -17.6% ARM Cogit: Implement machine code div/mod primitives on ARM, calling __aeabit_idivmod for the implementation. Unix: Fix a warning in the drop plugin. ------------------------------------------------------------------------ r3402 | eliot | 2015-07-10 14:17:09 -0700 (Fri, 10 Jul 2015) | 16 lines CogVM source as per VMMaker.oscog-eem.1409 Integrate Ryan's code for ARM call-out and callback support in the Alien plugin. Fix slangification of ThreadedFFIPlugin. Eliminate a few warnings there-in. Make type of tenuringIncrementalGC agree with sqVirtualMachine.h. Provide a back door for the ARM division routines during simulation. Type FFI support routines ioLoadModuleOfLength & ioLoadSymbolOfLengthFromModule correctly in sqVirtualMachine.h. Make the Spur image upload script also upload the 64-bit image if it is newer than the 32-bit one. ------------------------------------------------------------------------ r3400 | eliot | 2015-07-08 11:28:29 -0700 (Wed, 08 Jul 2015) | 12 lines CogVM source as per VMMaker.oscog-eem.1408 ThreadedFFIPlugin: Allow ffiCreateIntegralResultOop:ofAtomicType:in: to be inlined. Reduce the number of tests leading to the common case of an integral return in ffiCalloutTo:SpecOnStack:in: etc. Refactor the remapOop:in: idiom up into InterpreterPlugin and use it in the ThreadedFFIPlugin. Use an official version of MiscPrimitivePlugin.c in Newspeak (no change). ------------------------------------------------------------------------ r3399 | eliot | 2015-07-07 13:53:26 -0700 (Tue, 07 Jul 2015) | 5 lines CogVM source as per VMMaker.oscog-eem.1407 Implement the relevant implicitReceiveCacheAt: for the ARM Cogits. Eliminate compile-time warnings from Newspeak ARM Cogit. ------------------------------------------------------------------------ r3397 | eliot | 2015-07-06 11:56:39 -0700 (Mon, 06 Jul 2015) | 7 lines CogVM source as per VMMaker.oscog-eem.1405 Spur: Make sure the post become action unforwards the Process in the activeProcess inst var up to date. Add some more asserts to check.Also follow the specialObjectsArray after a pin become. Generically use storePointerUnchecked: when storing nils into the process lists. ------------------------------------------------------------------------ r3395 | eliot | 2015-06-29 18:32:55 -0700 (Mon, 29 Jun 2015) | 5 lines CogVM source as per Name: VMMaker.oscog-eem.1403 Fix long-standing bug in primitiveVMParameter for setting, and hence allow Spur to set maxOldSpaceSize. ------------------------------------------------------------------------ r3394 | eliot | 2015-06-29 17:54:16 -0700 (Mon, 29 Jun 2015) | 2 lines Fix the syntax error due to edit droppings left at the end of a method. ------------------------------------------------------------------------ r3393 | eliot | 2015-06-29 16:59:01 -0700 (Mon, 29 Jun 2015) | 15 lines CogVM source as per VMMaker.oscog-eem.1401 Spur: Provide a limit to the size of old space on Spur. Access maxOldSpaceSize via vmParameterAt: 67 & command line parameter -maxoldspace. Cogit: Simplify pushRemoteTemp register management to be able to improve further the overall register management. Have optStatus hold onto the sim stack entry it is holding, if any. Sista Cogit: fixed trinaryInlined primitive which was forcing a reg to be ReceiverResult reg when it shouldn't. ------------------------------------------------------------------------ r3390 | eliot | 2015-06-26 21:28:55 -0700 (Fri, 26 Jun 2015) | 20 lines CogVM source as per VMMaker.oscog-eem.1388 Newspeak: Declare EnforceAccessControl so it can be overridden at compile time. Modify Slang to provide const:declareC: for this purpose. Add inline decls to the access modifier accessors and use the is[Public| Protected|Private]Method: forms. Use the class vars for the access codes. Set lkupClass when MNU because of protected method in lookupOrdinaryNoMNUEtcInClass:. Remove duplicate lookup in findNewMethodInClassTag:. Distinguish lookup for ordinary sends and for MNU processing in the JIT. Skip private methods and stop on protected methods in ordinary lookup. This should complete Newspeak access control. ARM Cogit: Add hardware FP support for ARM. Runs all SUnit tests and assorted benchmarks ok, makes nbody 3X faster. Probably some cleaning up to do, possibly more careful NaN handling etc. ------------------------------------------------------------------------ r3389 | eliot | 2015-06-25 13:55:14 -0700 (Thu, 25 Jun 2015) | 30 lines CogVM source as per VMMaker.oscog-eem.1380 Newspeak: Enforce Newspeak access control in the interpreter, and enable it in Stack VMs. Add a separate global lookup cache for non-ordinary sends. Do proper lookups for self and super send misses from cogged code. Do proper lookups for implicit receiver and outer send misses from cogged code. Spur: Add explicit read barriers to primitives which access an argument as the receiver (i.e. the mirror primitives). Don't check if the actual receiver is used. Simplify failure where appropriate because primitives will be retried. Fix bogus assert in extSendBytecode. Simplify SpurMemoryManager>>classForClassTag:; its assert is superfluous. General: Eliminate a double method cache flush on startrup. Sista Cogit: Fix the #== bug that was crashing the VM when the counter trips in some methods. Interesting register hack to avoid 1 move instruction in #== with forwarders. Slighlty change the code generation of #== in sista Jit to reduce the estimated size of abstract opcodes. The sista Jit uses 11 in instead of 10 in the regular jit due to the counter logic, but much better than the previous value of 14. ARM Cogit: Fix PIC parsing for out-of-line literals. Add an assert to the closed PIC prototype code to check all PIC parameters are accessible. Add a containsAddress: to abstract away the test for a target within the PIC. ------------------------------------------------------------------------ r3387 | eliot | 2015-06-21 14:26:01 -0700 (Sun, 21 Jun 2015) | 5 lines CogVM source as per VMMaker.oscog-eem.1371 Fix bogus assert in extSendBytecode. Simplify SpurMemoryManager>>classForClassTag:; its assert is superfluous. ------------------------------------------------------------------------ r3386 | eliot | 2015-06-20 15:42:13 -0700 (Sat, 20 Jun 2015) | 5 lines CogVM source as per VMMaker.oscog-eem.1370 Whoops! isForwarded: is the api, not isObjectForwarded:, which is V3 compaction-related. ------------------------------------------------------------------------ r3385 | eliot | 2015-06-20 12:52:45 -0700 (Sat, 20 Jun 2015) | 6 lines CogVM source as per VMMaker.oscog-eem.1369 Add explicit read barriers to primitives which access an argument as the receiver (i.e. the mirror primitives). Don't check if the actual receiver is used. Simplify failure where appropriate cuz the primitives will be retried. ------------------------------------------------------------------------ r3384 | eliot | 2015-06-19 20:36:45 -0700 (Fri, 19 Jun 2015) | 7 lines CogVM source as per VMMaker.oscog-eem.1367 Fix PIC parsing for out-of-line literals. Add an assert to the closed PIC prototype code to check all PIC parameters are accessible. Add a containsAddress: to abstract away the test for a target within the PIC. ------------------------------------------------------------------------ r3383 | eliot | 2015-06-19 11:13:41 -0700 (Fri, 19 Jun 2015) | 7 lines CogVM source as per VMMaker.oscog-eem.1366 ARM Cogit: Revise the outOfLineLiteralOpcodeLimit since more thna one hardware instruction can be emitted per abstracxt opcode. The old code fell foul of IntegerTest>> #testIntegerPadding which contains many literals but no jumps or returns. ------------------------------------------------------------------------ r3382 | eliot | 2015-06-19 10:08:36 -0700 (Fri, 19 Jun 2015) | 26 lines CogVM source as per VMMaker.oscog-eem.1365 Cogit: Fix regression in relocateMethodsPreCompaction in VMMaker.oscog-eem.1342. Fix multiple annotations on the same pc now that annotations are directly attached to instructions by annotating a Label with the second annotation. Affects e.g. calls through ceNonLocalReturnTrampoline. Neaten generateMapAt:start: by moving the byte write inside the new addToMap:instruction:byte:at:for:. Fix addressIsInCurrentCompilation: using youngReferrers as the upper limit. Revise initializeCodeZoneFrom:upTo: as a result. ARM Cogit: Fix relocating jumps in PICs by indirecting through the literalsManager to skip out-of-line literals as required. Set an out-of-line literal's opcodeIndex when dumping literals and revise the ARM's outOfLineLiteralOpcodeLimit up a bit. Add an assert to check that the pc offset is in range. Remember to nil the address on literal allocation. Make Literals not pc-dependent; only the instructions that reference them are. ------------------------------------------------------------------------ r3381 | eliot | 2015-06-18 14:08:45 -0700 (Thu, 18 Jun 2015) | 10 lines Cog VM source as per VMMaker.oscog-eem.1363 Move the Literal initialization code into CogAbstractInstruction and make sure they are fully initializaed (old code left bogus annotations). At least under X11 the OOLL ARM Cog VM now runs. Conditionalize the PlatformNoDbgRegParms defines to be x86 only to avoid warnings on ARM. ------------------------------------------------------------------------ r3380 | eliot | 2015-06-18 11:51:39 -0700 (Thu, 18 Jun 2015) | 11 lines CogVM source as per VMMaker.oscog-eem.1362 Fix initialization issues with the array of out-of-line literals by initializing each literal on allocation rather than early in a bzero call. Drop the unused parameter from resetLiterals: and hide the send of resetLiterals inside the two allocateOpcodes: methods, rewriting them in more conventional style, relying on inlining rather than a C macro ensure inlining into callers. Restore the --enable-fast-bitblt configurations to the Cog ARM VMs. ------------------------------------------------------------------------ r3379 | eliot | 2015-06-18 10:29:27 -0700 (Thu, 18 Jun 2015) | 3 lines Add -fwrapv to all linux gcc builds (to insist on 2's complement arithmetic) and add makeallclean, making makeall do the dirty build. ------------------------------------------------------------------------ r3378 | eliot | 2015-06-17 14:23:27 -0700 (Wed, 17 Jun 2015) | 3 lines Provide a -exitonwarn command line switch for the Mac and Unix VMs to allow for CI testing of asserts. ------------------------------------------------------------------------ r3377 | eliot | 2015-06-16 20:42:19 -0700 (Tue, 16 Jun 2015) | 44 lines CogVM source as per VMMaker.oscog-eem.1361 Cogit: Fix return type calculation for mapEntrySize (handle unsigned char + unsigned long). Fixes compilation of cogitIA32.c. Sista Cogit: Fix a warning in picDataFor:Annotation:Mcpc:Bcpc:Method: ARM Cogit: Fix growing literals. Can't use realloc cuz existing refs must be updated to new literals. Fix literalInstructionInRange: in C by making sure that literalOpcodeIndex is signed. Fix type errors and typos. ARM Cogit: Provide the rest of the literal scanning and update support required for out-of-line literals. Fix Slang translation. Revise object reference scanning in PICs to allow for out-of-line literals. Indirect through the literals manager to access obj refs and distinguish method literal and class obj refs. Rename the accessors to make clear they're for use only in closed PICs. Fix otherwise clause of inverseOpcodeFor:. Declare OutOfLineLiteralsManager' literals correctly. Slang: Modify typedef printing so that all class names from the concrete type through to the abstract type are renamed with a define if necessary. Hence fix compilation of cogitARMv5.c. (Still have CogOutOfLineLiteralsARMCompiler methods to implement to get it to link though). Fix the extern extern regression on generating plugins caused by the changes in VMMaker.oscog-eem.1349 Fix Slang for sends that return the result of a message send of a method containing value expansions. The old code would return the value of the first statement of each block expanded in a value expansion, instead of the last. Fixes CogARMCompiler>>computeMinimumSize. ------------------------------------------------------------------------ r3376 | eliot | 2015-06-15 19:42:34 -0700 (Mon, 15 Jun 2015) | 21 lines CogVM source as per VMMaker.oscog-eem.1354 Cogit: Fix bug in rewriting compiler primitives on module unload, etc. The old code didn't change the assignment to the primitiveFunctionPointer, which is needed for correct management of failing primitive calls on Spur. Simplify the post compile hook to eliminate the label parameter; this is local to the Cogit. ARM Cogit: Replace CogInLineLiteralsARMCompiler with CogOutOfLineLiteralsARMCompiler. Fix some bugs with PushCw, and AndCqR. Move the calculation of which address to annotate for an annotated instruction into the instruction, allowing CogOutOfLineLiteralsARMCompiler to annotate the out-of-line literal, rather than the instruction following, and implement literal update on GC for out-of-line literals. Slang: Eliminate blank lines coming from conditional dead code elimination. ------------------------------------------------------------------------ r3374 | eliot | 2015-06-11 16:02:50 -0700 (Thu, 11 Jun 2015) | 48 lines CogVm source as per VMMaker.oscog-eem.1349 Slang: Modify prototype output so that non-static functions are declared as extern. This to try and cure Cog crashes on compilers such as clang 3.4. Spur: Remember to count shrink requests Cogit: Changes for in-progress CogOutOfLineLiteralsARMCompiler code generator. Move annotations into instructions, where they sit more naturally anyway. But doing so makes it trivial to move annotations from the instructions referencing out-of-line literals to the literals themselves. Hence nuke CogInstructionAnnotation. Fix isAnInstruction for labels (methodLabel) and use it to guard addressIsInCurrentCompilation: calls where a label is involved. Move the assignment of maxSize out of computeMaximumSize and into computeMaximumSizes for concision. ARM Cogit: Introduce some more abstractions for rotateable constants so that it is easier to relate computeMaximumSize and dispatchConcetize in CogARMCompiler. Provide more opcode names and use them, and use inverseOpcodeFor: to calculate the inverse opcode when the inverse constant is used. Revise ARM getDefaultCogCodeSize given better estimates of relative code sizes. Simplify isPICDependent to eliminate Calls, which are not pc-dependent (since they always call out of the current compilaiton). Fix bugs in computeMaximumSize with AddCqR and SubCqR, and a bad slip in concretizePushCq. Nuke the unused BICCqR opcode. Add class vars to name all the opcodes passed to concretizeDataOperationCwR:. Make all the usages of flushICacheFrom:to: work with start-address to byte-after-end-address. Irrelevant to x86, perfect for ARM, matches most of the usage already in place. Sista Cogit: Added support for jumpOrPopIfNotInstanceOf: in cogit's scanner. Unix: restore the SCCS revision after the version number in -version output. ------------------------------------------------------------------------ r3371 | eliot | 2015-06-05 19:49:22 -0700 (Fri, 05 Jun 2015) | 2 lines Fix slip in ARM builf script (wrong install dir). ------------------------------------------------------------------------ r3370 | eliot | 2015-06-04 13:15:11 -0700 (Thu, 04 Jun 2015) | 17 lines CogVM source as per VMMaker.oscog-eem.1339 Spur Cogit: Fix Spur block performance now that we follow forwarded receivers in blocks; see VMMaker.oscog-eem.1334. Scan blocks for inst var usage, only unforwarding in the prologue of blocks that actually refer to inst vars. In a test Spur Squeak image only 12.5% of blocks do refer to inst vars. So this is definitely a win. Add a special purpose store check trampoline to store check the updated receiver. Make sure it's only called if the eceiuver is updated. Add state to CogBytecodeDescriptor, CogBlockStart and CogBlockMethod to track block inst var usage. Sista: Fix the bug where rcvrReg was nil in genEqualsEqualsnoBranch. ------------------------------------------------------------------------ r3369 | eliot | 2015-06-03 22:47:13 -0700 (Wed, 03 Jun 2015) | 4 lines CogVM source as per VMMaker.oscog-eem.1337 Fix defaultCogCodeSize to avoid exporting AbstractInstruction through cogit.h. ------------------------------------------------------------------------ r3368 | eliot | 2015-06-03 22:19:31 -0700 (Wed, 03 Jun 2015) | 33 lines CogVM source as per VMMaker.oscog-eem.1336. Fix the hack introduced in VMMaker.oscog-eem.1199 for Sista which merely stopped reclaiming closed PICs. In non-Sista VMs do the usual thing of decaying usage counts on PICs, as with methods, and reclaiming those least used. In Sista, retain PICs until the next cycle, identifying unused PICs as part of the compaction scan, reminiscent of tri-colour incremental GC. Move defaultCogCodeSize into the CogAbstractInstruction hierarchy so that e.g. CogARMCompiler can specify a larger default code zone. Merge with VMMaker.oscog-tpr.1335, keeping the -1's in the cache flush extent calculations. Enable the magic MULL instruction on ARM. Clean up flushICache usage Spur: Since the invariant is that the receiver is never forwarded, Spur must check for forwarding on block activation. A become between closure creation and closure evaluation can forward the receiver, and it must be unforwarded. Here we do so by checking for a forwarded receiver in the value[:] primitives. This is a major blow to block performance; e.g. the nfib block b := [:n| n <= 1 ifTrue: [1] ifFalse: [1 + (b value: n - 1) + (b value: n - 2)]]. slows down by 11%. So we can and will do better. We should scan for receiver usage in the JIT and optionally compile unforwarding code in the prolog depending on whether self is used or not. Cogit: Use the Tst-based generators for immediate and SmallInteger tests more widely to save a few more instructions. ------------------------------------------------------------------------ r3367 | eliot | 2015-06-03 09:00:39 -0700 (Wed, 03 Jun 2015) | 13 lines CogVM source as per VMMaker.oscog-eem.1333 Cogit: Fix assert-fails with absent receiver sends in Newspeak. Have the implicit and outer send lookup trampolines set the stacked receiver (when there is one) when setting the implciit receiver. Streamline send trampoline creation by refactoring trampoline name generation so that the two limits, NumSendTrampolines - 2 and numRegArgs are treated separately, and numArgsOrSendNumArgsReg: answers the relevant numArgs argument. This should clear up confusion between numRegArgs (which can be 0, 1 & 2) and NumSendTrampolines - 2, which is always 2. ------------------------------------------------------------------------ r3366 | eliot | 2015-06-02 11:10:30 -0700 (Tue, 02 Jun 2015) | 2 lines Fix VERSION_TAG format to agree with existing convention. ------------------------------------------------------------------------ r3365 | eliot | 2015-06-01 17:20:23 -0700 (Mon, 01 Jun 2015) | 11 lines CogVM source as per VMMaker.oscog-eem.1332 Newspeak Cogit: Fix the regression in implicit receiver sends caused by VMMaker.oscog-eem.1317 (fix to performance regression caused by using XCHG on x86). The implicit receiver cache uses SendNumArgsReg to refer to the cache object. Hence we must use TempReg for genPushRegisterArgsForNumArgs: in this case. So refactor to genPushRegisterArgsForNumArgs:scratchReg:, passing either TempReg or SendNumArgsReg as approprate. ------------------------------------------------------------------------ r3364 | eliot | 2015-06-01 11:53:32 -0700 (Mon, 01 Jun 2015) | 2 lines The Unix build needs an extra dependency. Add a convenience to make makefiles. ------------------------------------------------------------------------ r3363 | eliot | 2015-05-30 13:21:09 -0700 (Sat, 30 May 2015) | 2 lines Unix vm makefile needs dependencies to get cogit to recompile. ------------------------------------------------------------------------ r3362 | eliot | 2015-05-30 12:26:33 -0700 (Sat, 30 May 2015) | 22 lines CogVm source as per VMMaker.oscog-eem.1331 Cogit: Test the outerContext and method for sanity in the machine code closure value primitive(s). Spur must check to fail in the presence of forwarders. To support the primitive provide TstCqR support on x86 (already exists on ARM), and use it to implement genJumpImmediate: et al. Also refactor genGetFormatOf:into:baseHeaderIntoScratch: to genGetFormatOf:into: and implement it for SqueakV3. Use the new genJumpImmediate: et al in various basic access primitives. Good for a 5%-10% increase in 0 tinyBenchmarks on Spur. Spur: Spur must follow forwarders in machine code before it follows forwarders in stack pages (since stack page parsing examines methods). Further, closed PICs that refer to unmarked objects must be discarded in freeUnmarkedMachineCode. And closedPICRefersToUnmarkedObject: should guard against an immediate selector. ------------------------------------------------------------------------ r3361 | eliot | 2015-05-27 14:12:31 -0700 (Wed, 27 May 2015) | 6 lines Linux build: Add dependency to make sure getversion gets rebuilt whnen sqSCCSVersion.h changes, and hewnce version tag is current when install is performed. Delete unused DEVEL var from makefile. ------------------------------------------------------------------------ r3360 | eliot | 2015-05-27 13:42:53 -0700 (Wed, 27 May 2015) | 14 lines CogVM source as per VMMaker.oscog-eem.1329 Cogit: Fix cache tag access for ARM in cPICHasForwardedClass: Guard access to the inline cache tag in PICs in GC routines by inlineCacheTagsMayBeObjects. Mark inlineCacheTagsMayBeObjects as inline to eliminate dead code. Linux build: Fix creating the launch scripts given the removal of VM_VERSION et al from the autoconf subsystem. ------------------------------------------------------------------------ r3359 | eliot | 2015-05-27 10:09:50 -0700 (Wed, 27 May 2015) | 5 lines CogVM source as per VMMaker.oscog-eem.1328 Fix determination of the picInterpretAbortOffset on ARM in cogExtendPIC:CaseNMethod:tag:isMNUCase:. ------------------------------------------------------------------------ r3357 | eliot | 2015-05-26 10:24:44 -0700 (Tue, 26 May 2015) | 19 lines CogVM source as per VMMaker.oscog-eem.1325 Merge with Pharo (with VMMaker.oscog-EstebanLorenzano.1322). Changes are null to Squeak VM. Pulled in are conditionally compiled changes for directory & file creation (added ceration permissions) and to macro used to read image file (for iPhone). Cogit: Fix PIC creation on ARM to jive with new pc-relative addressing support (addressIsInCurrentCompilation:). Slang: Move comment containing method name from after opening brace to before function prototype, because otherwise it interferes with the var struct decl. Move the specifics of NoDbgRegParms out of VMMaker. Assume it is defined in the various sqPlatformSpecific.h (see r3356). ------------------------------------------------------------------------ r3356 | eliot | 2015-05-23 19:03:15 -0700 (Sat, 23 May 2015) | 10 lines Move definition of VM_VERSION out of various sqConfig.h files and into platforms/Cross/vm/sqVirtualMachine.h. Make unix autoconf oblivious of the VM_VERSION.VM_RELEASE version tag, allowing one to rebuild without a time-consuming configure if already configured. To support this add a main routine to platforms/Cross/vm/sqSCCSVersion.h that allows it to be compiled to answer the VM_VERSION.VM_RELEASE as defined by platforms/Cross/vm/{sqVirtualMachine.h,sqSCCSVersion.h}. Modify the linux makeproduct scripts to use makealldirty & add makeproductclean scripts. ------------------------------------------------------------------------ r3354 | eliot | 2015-05-21 12:54:19 -0700 (Thu, 21 May 2015) | 13 lines CogVM source as per VMMaker.oscog-eem.1318 Spur: Fix bad C bug in nextInSortedFreeListLink:given:. The result type must be usqInt, otherwise the list can be wrongly terminated and the second compaction pass can segfault. Change printFreeChunk:isNextChunk: to printFreeChunk:printAsTreeNode:, and use it to implement printSortedFreeList. Make checkTraversableSortedFreeList robust in presence of empty sorted free list. ------------------------------------------------------------------------ r3351 | eliot | 2015-05-20 22:06:22 -0700 (Wed, 20 May 2015) | 32 lines CogVM source as per VMMaker.oscog-eem.1317 Cogit: Fix the performance regression on x86 in r3308 VMMaker.oscog-eem.1178 through the use of the XCHG instruction in CogIA32Compiler>>genPushRegisterArgsForNumArgs:. Since SendNumArgsReg is not live with small arity sends it can be used instead of TempReg. Replace uses of the magic constant 2 with NumSendTrampolines - 2 (actually <= 2 => < (NumSendTrampolines - 1)) where appropriate. Hence NumSendTrampolines moved to CogCompilationConstants. Fix bug on ARM with pc-relative addressing. pc-relative addressing can only be used within a method because of relocation. The old code would use pc-relative addressing to access trampolines for methods close to the trampolines and then not for methods further away, causing changes in the code generated by compileInterpreterPrimitive:. To support this, rationalize the PIC compilation code, being sure to initialize and concretize methodLabel at the start of each PIC. Don't bother to pass PIC size as a parameter given we have PIC-specific header-filling routines now. Spur: Firm up the checkTraversableSortedFreeList assert routine to check that the list is traversable from lastFreeChunk, not just firstFreeChunk. Slang: Make promoteArithmeticTypes:and: obey C99's promotion rules more closely in an effort to generate more stable sources. Types were flipping between sqInt & usqInt for variables that were assigned both types, so that one generation would produce one type and a subsequent one another (Set/Dictionary hashing?). ------------------------------------------------------------------------ r3350 | eliot | 2015-05-18 18:13:54 -0700 (Mon, 18 May 2015) | 13 lines CogVM source as per VMMaker.oscog-eem.1315 Slang: Do a more thorough job of transforming complex to:[by:]do: loops so that the limit expression is only evaluated once, not on each iteration of the loop. Fix regression in read-before-written code when rewriting to only initialize simple types. Cogit: Fix ARM-only regression in StackToRegisterMappingCogit's PIC aborts when the SimpleStackBasedCogit was fixed. ------------------------------------------------------------------------ r3349 | eliot | 2015-05-17 18:20:04 -0700 (Sun, 17 May 2015) | 7 lines CogVM source as per VMMaker.oscog-eem.1313 Make accessor depth calculation more accurate by not considering fetchInteger:ofObject: and arraySize: et al as object accessors. Make the read-before-written initializer safer, only initialzing simple types. ------------------------------------------------------------------------ r3348 | eliot | 2015-05-17 16:03:01 -0700 (Sun, 17 May 2015) | 37 lines CogVM source as per VMMaker.oscog-eem.1311 General: Make the bounds check in primitiveObject:perform:... more restrictive and fix bugs in the commentary. Make stack pages a reasonable size. My math was wrong and the size was half as big as intended. Extend the fastPrimTrace scheme to trace stack overflow, prim failure and prim retry to help debug the phantom stack frame bug in Cog Spur. Cogit: Revamp icache flushing in the Cogit for ARM. Move icache flush for generated methods/pics to the fillIn*Header: routines. Make sure the cache is flushed in generateCaptureCStackPointers:. Flush the entire PIC when extending it. Spur: Fix ceActivateFailingPrimitiveMethod: to return properly after retrying a primitive after checkForAndFollowForwardedPrimitiveState. e.g. fixes | s | 1 to: 5 do: [:i| s := 'bar'. s becomeForward: 'bzzt' copy. 'foo' <= s] Fix bug in followForwardedFrameContents:stackPointer: so that arguments are actually followed. N.B. drives the above bug underground ;-). so that named constants (defines) are not elided. Newspeak: Remove landmine left from restructing implicit receiver and outer sends as clean sends. Slang: Fix constant elimination on arithmetic generation. Plugins: Regenerated because of changes in accessorDepth calculation, constant elimination, and read-before-use initialization. ------------------------------------------------------------------------ r3345 | eliot | 2015-05-15 13:18:50 -0700 (Fri, 15 May 2015) | 9 lines CogVM source as per VMMaker.oscog-eem.1306 Fix old bug in ceMNUFromPICMNUMethod:receiver: that has been masked by cacheing of MNU method in MNU PIC entries. ceMNUFromPICMNUMethod:receiver: must set up lkupClass before calling handleMNU:... Make ARM rotated 8bit constants actually be correct(er) ie 16r4000001 (SmallInteger 16r2000000) work. ------------------------------------------------------------------------ r3343 | eliot | 2015-05-14 19:30:41 -0700 (Thu, 14 May 2015) | 2 lines Add the new processor-specific cogits for the spursista variant. ------------------------------------------------------------------------ r3342 | eliot | 2015-05-14 19:16:22 -0700 (Thu, 14 May 2015) | 9 lines CogVM source as per VMMaker.oscog-eem.1303 Fix the regression with #== in the StackToRegisterMappingCogit; a spilled constant must still be dropped from the stack. Mark the genEnsure... stubs in CogObjRep as inline and fix a signature to eliminate warnings. ------------------------------------------------------------------------ r3341 | eliot | 2015-05-14 15:34:53 -0700 (Thu, 14 May 2015) | 6 lines CogVM source as per VMMaker.oscog-eem.1301 Cogit: Since the method zone does not scavenge PICs, the MNU method in an MNU PIC entry cannot be young. If it is, void the cache (load 0 instead of the method). ------------------------------------------------------------------------ r3336 | eliot | 2015-05-11 18:25:11 -0700 (Mon, 11 May 2015) | 10 lines CogVM source as per VMMaker.oscog-eem.1299 Clarify how to specify variadic primitives in the Cogit's primitive table initializer (it had confused me enough to cause a regression). Fix the regression in genPrmitiveClass. Implement the stream primtiives using genFastPrimFail which should speed up the stream prims noticeably. ------------------------------------------------------------------------ r3332 | eliot | 2015-05-10 17:44:48 -0700 (Sun, 10 May 2015) | 4 lines CogVM source as per VMMaker.oscog-eem.1298 Doh! primitiveClass needs to take > 0 args in Squeak too, for objectClass:. ------------------------------------------------------------------------ r3326 | eliot | 2015-05-10 10:44:53 -0700 (Sun, 10 May 2015) | 5 lines CogVM source as per VMMaker.oscog-eem.1297 Fix slip in primitiveClass. Fix Slang warning in Sista special selector #==. ------------------------------------------------------------------------ r3325 | eliot | 2015-05-10 09:24:15 -0700 (Sun, 10 May 2015) | 32 lines CogVM source as per VMMaker.oscog-eem.1296 NewspeakVM: Thread lookup rule through from bytecodes to internalFindNewMethod:. Fix genInnerPrimitiveMirrorNewWithArg:. Class's hash was being accessed twice, reusing variable holding jump instruction. Fix primitiveClass and genPrimitiveClass for mirror case (arg count = 1). Also fix Newspeak primitive table to allow nargs > 0 for genPrimitiveClass. General: Fix a regression in externalInstVar:ofContext:. The head frame pointers must be written back if we're going to map a machince code pc to a bytecode pc in case of code reclamation. Add asserts to the stack page enumerators to check that the head frame pointers have been written back. Use macros for the oop comparisons, avoiding cCoerce:, to get faster simulation and avoid the inliner not inlining in conditionals. Spur: Change computeRefCountToShrinkRT to - compute the ref counts and population in a single pass over the RT - determine the ref count for tenuring based on half the population of remembered objects, /not/ half the size of the RT. Sista: Remove the storeCheck in inlined pointer at:put: if the value stored is an unannotatable constant. Increased the opcode size heuristic in the SistaCogit. ------------------------------------------------------------------------ r3322 | eliot | 2015-05-06 18:37:40 -0700 (Wed, 06 May 2015) | 12 lines CogVM source as per VMMaker.oscog-eem.1292 Fix a regression in externalInstVar:ofContext:. The head frame pointers must be written back if we're going to map a machince code pc to a bytecode pc in case of code reclamation. Add asserts to the stack page enumerators to check that the head frame pointers have been written back. Use macros for the oop comparisons, avoiding cCoerce:, to get faster simulation and avoid the inliner not always inlining in conditionals. ------------------------------------------------------------------------ r3319 | eliot | 2015-05-05 22:28:32 -0700 (Tue, 05 May 2015) | 39 lines CogVM source as per VMMaker.oscog-eem.1288 Spur: Implement remembered table pruning via ref counts. The algorithm selectively tenures objects to reduce the remembered table, instead of merely tenuring everything. Be selective about remembering tenurted objects; actually scan their contents before remembering willy-nilly. Make the allOldMarkedWeakObjectsOnWeaklingStack assert an eassert: (it /is/ extremely expensive) and correct some typos in eassert:. Add an assert to insist that the receiver not be forwarded to mnuMethodOrNilFor: StackVM: Allow setting preemptionYields in the stack VM. Sista: trap callbacks have no argument any more. Forgot a -1 which was creating a segfault.... Reduced by 24 bytes the instructions generated by #== in SistaCogit in most cases. Fixed a bug in SistaCogit where a trampoline needed a specific register instead of an allocated one. CogARMCompiler: Catch some places where values need to be typed as signed ints. At the least this fixes a fun case where a lrd r7, [r11, #-12] became ldr 77, [r11, #4084]. Cogit: Remove all the "self flag: 'currently caller pushes result'." noise. This was the right decision given StackToRegisterMappingCogit. ------------------------------------------------------------------------ r3313 | eliot | 2015-04-22 11:36:16 -0700 (Wed, 22 Apr 2015) | 32 lines CogVM source as per VMMaker.oscog-eem.1241 Change source file output for the Cogit so that cogit.c includes cogitARMv5.c or cogitIA32.c as appropriate, using the same style as ThreadedFFIPlugin. Add builds for the ARMv5 Cogit. Changed the names of register allocation methods for more explict names, for instance, allocateOneReg -> allocateRegForStackTop. Cogit: Change map generation and interpretation so that the displacements are in codeGranularity units, and make the codeGranularity 4 on ARM. Comment machineCodeSize and maxSize. Introduce UnfailingPrimitive and use it to avoid generating the interpreter primitive call in Spur the Character>>asInteger primitive. Revise Call/Jump terminology using CallFull/JumpFull for calls/jumps anywhere in the address space. Makes no difference to x86 but is operative on ARM. ARM call/branch ranges use immediate call/jump for all intra-zone transfers, and 5 instruction sequences only for trampoline and interpreter primitive calls. - Change the code generation of == for Spur; only check for forwarders if operands differ. - Change the code generation of == for sistaCogit - change the counter reg to be allocated instead of being a fixed abstract reg - fix a C code gen bug in code gen of #== - fix a bug in #== where the arg was not unforwarded Use new register allocation in #== with V3 in order to limit register moves. ------------------------------------------------------------------------ r3312 | eliot | 2015-04-17 12:34:25 -0700 (Fri, 17 Apr 2015) | 8 lines CogVM source as per VMMaker.oscog-eem.1207 Head slap! Fix the copy-paste error that caused the regression in VMMaker.oscog-eem.1160/3308. And add the 64-bit Newspeak Stack 64-bit Spur VM for Ryan. ------------------------------------------------------------------------ r3311 | eliot | 2015-04-16 15:27:01 -0700 (Thu, 16 Apr 2015) | 9 lines CogVM source as per VMMaker.oscog-eem.1204 ifTrue:ype of AbstractInstruction opcode must be unsigned now that we have more than 128 opcodes (XCHGRR pushed things over the top). Fix some Slang generation-time warnings. Add types for arrays used in Sista machine code generation. ------------------------------------------------------------------------ r3310 | eliot | 2015-04-16 14:33:16 -0700 (Thu, 16 Apr 2015) | 92 lines CogVM source as per VMMaker.oscog-eem.1202 Cogits: Fix regression in map machinery due to adding AnnotationExtension scheme. findMapLocationForMcpc:inMethod: must not be confused by IsDisplacementX2N bytes. This is likely the cause of the recent crashes with r3308 and earlier. Lay the groundwork for 32-bit intra-zone jumps and calls on ARM by introducing CallFull and JumpFull (and rewrites thereof) that are expected to span the full address space, leaving Call/JumpLong to span merely the 16mb code zone. On x86 CallFull and JumpFull simply default to Call/JumpLong. Replace bytecode trapIfNotInstanceOf by jumpIfNotInstanceOfOrPop. Rewrote the JIT logic for traps to be able to write trap trampolines calls at the end of the cogMethod. Refactor the slot store and store check machinery to take an inFrame: argument and hence deal with the store check in genInnerPrimitiveAtPut: on ARM. Introduce marryFrameCopiesTemps and use it to not copy temps in Spur contect creation trampolines. Change initial usage counts to keep more recently jitted methods around for longer, and do *not* throw away PICs in freeOlderMethodsForCompaction, so that there's a better chance of Sista finding send and branch data for the tripping method. Don't save the header in a scratch register unless it is useful to do so in the Spur at:[put:] primitives. Fix limitation with MoveRXbrR; can only do movb from %al through %dl, so swap with %eax around movb. Fix mistake with genGetNumBytesOf:into: by refactoring genGetFormatOf:into:baseHeaderIntoScratch: into genGetBits:ofFormatByteOf:into:baseHeaderIntoScratch: and hence fetching and subtracting only odd bits of format. Fix slip in genGetNumBytesOf:into:. And notice that genGetFormatOf:into:baseHeaderIntoScratch: et al can use byte access to get at format, as intended in the Spur header design. Correct the in-line primitive SmallInteger comparisons; CmpXR is confusing ;-) Fix var op var unsafe byte at:. Result must be converted to SmallInteger. Correct the generated Slang for the new register allocation code by adding a read-before-written pass to C generation that initializes variables read-before-written with 0 (the C equivalent of nil). fix a bug where sometimes register allocation was marking ReceiverResultReg as dead whereas it was still alive. Added some abstraction over register allocation. This is now used in inline primitives. Fix unlinking dynamic super sends. Reduce false positives in access control violation reporting by marking the super send we actually use as privileged. Remove unused Newspeak bytecodes. Fix code generation bug surfaced by inline primitives. On x86 movb N(%reg),%rl can only store into al, bl, cl & dl, whereas movzbl can store into any reg. On ARM move byte also zero-extends. So change definition of MoveMbrR to always zero-extend, use movzbl on x86 and remove all the MoveCq: 0 R: used to zero the bits of the target of a MoveMb:r:R:. And now that we have genGetNumSlotsOf:into:, use it. Fix a slip in genTrinaryInlinePrimitive:, meet constraint that the target must be in ReceiverResultReg, and do a better job of register allocation there-in. Do dead code elimination for the branch following an inlined comparison (this is done in genBinaryInlineComparison:opFalse:destReg: copying the scheme in genSpecialSelectorEqualsEquals). Do register allocation in the right place in genUnaryInlinePrimitive:. Fix overflow slot access in genGetNumSlotsOf:into: et al. Fix several slips in inline primitive generation: Object>>at:put: needs to include a store check. Some register allocation code was wrong. Some results needed converting to SmallIntegers and recording results as pushed on the sim stack. extendedPushBytecode /does/ need a frame. Change callPrimitiveBytecode to genCallPrimitiveBytecode in the Cogit. remove the misnomer genConvertIntegerToSmallIntegerInScratchReg: ------------------------------------------------------------------------ r3308 | eliot | 2015-04-09 13:00:37 -0700 (Thu, 09 Apr 2015) | 44 lines CogVM source as per VMMaker.oscog-eem.1178 Plugins: Integrate Nicolas' fixes that use positiveMachineIntegerFor: for pointers. Newspeak: Print a warning in the method shared under multiple selectors scenario. Implement outer sends as clean sends just like implicit receiver sends. Add ObjectRepresentation>>illegalClassTag and use it for initializing and unlinking implicit and outer sends. Newspeak & Sista: The multiple bytecode set block initial nil counters need to be specific to the bytecode set in effect. Spur: Implement Clement's much better solution for the stale supersend problem. Place code at the send site for super sends to follow stale forwarded receivers. This parallels the interpreter implementation. Beef up the post-become scan of send sites to unlink all send sites that link to an invalid class tag. Cogit: Optimize StackToRegisterMappingCogit>>genReturnReceiver to not load ReceiverResultReg if it already contains self. Revise method map generation to provide multiple send type annotations. Add an IsAnnotationExtension annotation type that implicitly has a zero displacement and uses its displacement bits to extend the preceeding IsSendCall annotation. This allows us to eliminate all the exotic entry-points and keep only the checked and unchecked entries. Change IA32's genPushRegisterArgsForNumArgs: to not smash TempReg now that it is used in directed super send trampolines. Use PushCq to pass small integer constants in the trampolines instead of smashing TempReg, which is now used to hold the directed supersend argument. Add support for PushCq. Could use PushCw but on x86 PushCq is a lot shorter. Mac builds: Use UTC as the timezone for the build timestamp. Using the local timezone doesn't work :(. ------------------------------------------------------------------------ r3306 | eliot | 2015-04-02 11:57:11 -0700 (Thu, 02 Apr 2015) | 2 lines Nuke a troublesome priest^H^H^H^H^H^Hdirectory. ------------------------------------------------------------------------ r3305 | eliot | 2015-04-02 11:54:58 -0700 (Thu, 02 Apr 2015) | 10 lines CogVM source as per VMMaker.oscog-eem.1155 and fix that compiler warning properly. If one defines a function return type the arguments are typed there-in. Sista: Fix inline primitive for at: and at:put: to be 1 relative. This simplifies the JIT in 64 bits because the 1 relative correponds to the 1 word difference between baseHeader and first object field hence generating one less instruction. ------------------------------------------------------------------------ r3304 | eliot | 2015-04-02 11:11:56 -0700 (Thu, 02 Apr 2015) | 6 lines CogVM source as per VMMaker.oscog-eem.1153 Rename the inconsistently-named and hence confusing frameReceiverOffset: to frameReceiverLocation:. Fix the slip in followForwardingPointersInStackZone: that was due to this confusion. ------------------------------------------------------------------------ r3302 | eliot | 2015-04-02 10:02:47 -0700 (Thu, 02 Apr 2015) | 5 lines CogVM source as per VMMaker.oscog-eem.1152 Better living through compile-time type checking. Fix offset calculation in followForwardingPointersInStackZone: as indicated by a C compiler warning. ------------------------------------------------------------------------ r3301 | eliot | 2015-04-02 09:42:51 -0700 (Thu, 02 Apr 2015) | 7 lines CogVM source as per VMMaker.oscog-eem.1151 Include the directedSuperclassSend shared case in the right bytecode. Fix sqWin32Backtrace.c compilation; on Newspeak it must now include nsmethodcache.h. ------------------------------------------------------------------------ r3300 | eliot | 2015-04-01 16:03:46 -0700 (Wed, 01 Apr 2015) | 7 lines CogVM source as per VMMaker.oscog-eem.1148 Define startpc in closure creation jitting appropriately (and hence correctly for Sista). Nuke the squeak.sista.v3 builds; we're doing only sista.spur VMs. ------------------------------------------------------------------------ r3299 | eliot | 2015-04-01 15:38:58 -0700 (Wed, 01 Apr 2015) | 2 lines Doh! Commit nssendcache.h now it's used in the build. ------------------------------------------------------------------------ r3298 | eliot | 2015-04-01 15:35:49 -0700 (Wed, 01 Apr 2015) | 2 lines Update the GdbARMPlugin xcode proj file in the squeak.cog.v3 build. ------------------------------------------------------------------------ r3297 | eliot | 2015-04-01 15:16:03 -0700 (Wed, 01 Apr 2015) | 24 lines CogVM source as per VMMaker.oscog-eem.1147 Retract the decision to type the results of the bitwise operators as unsigned; it breaks at least the BitBlt plugin. Integrate primitiveIsBigEnder & Nicolas' fix for safer primitiveAdoptInstance & primitiveScanCharacters Refactor send generation to take the send table to use as an argument. rename sendTable to ordinarySendTable. Mark relevant feature test methods in CogAbstractInstruction as . Rename executeCogMethod:... to executeCogPIC:... Spur: Make sure that all stacked values are followed in CoInterpreter>> makeBaseFrameFor: for stale self refs in super sends. Make sure the stack is scanned after a pin operation that involves forwarding. Make sure that the unforwarding stack scan post-become (or post-pin) scans all of the stack contents in the CoInterpreter, since super sends have no read barrier. Newspeak: Add Ryan's new self-send bytecodes. Use NSSendCache for IRC representation. ------------------------------------------------------------------------ r3289 | eliot | 2015-03-25 13:25:29 -0700 (Wed, 25 Mar 2015) | 7 lines CogVM source as per VMMaker.oscog-eem.1119 Rescue Spur Cog compilations by removing the bogus pragma from headerForSlots:hash:format:classIndex:. Now that headerForSlots:hash:format:classIndex: exists, move identityHashFullWordShift up to SpurMemoryManager. ------------------------------------------------------------------------ r3288 | eliot | 2015-03-25 12:52:47 -0700 (Wed, 25 Mar 2015) | 13 lines CogVM source as per VMMaker.oscog-eem.1118 Work around a compiler bug in 64-bit gcc 4.4.7-4 on RedHat that elided one of the two assignments to a corpse's header in threading it onto a weak survivor list. Do so by, in 64-bits, performing a single assignment to the corpse's header, instead of two. Mark copyToOldSpace:bytes:format: as not to be inlined so as to avoid impacting copyAndForward's icache density. Simplify the macros in sqMemoryAccess.h to avoid the double cast on the oop argument of fooAtPointer[Put]. ------------------------------------------------------------------------ r3287 | eliot | 2015-03-24 17:18:37 -0700 (Tue, 24 Mar 2015) | 7 lines CogVM source as per VMMaker.oscog-eem.1117 Fix initialization of numPushNilsFunction and pushNilSizeFunction in Newspeak Spur VMs. Fix an assert in SpurSegmentManager>>insertSegmentFor: ------------------------------------------------------------------------ r3284 | eliot | 2015-03-23 13:04:06 -0700 (Mon, 23 Mar 2015) | 9 lines CogVM source as per VMMaker.oscog-eem.1113 Redo free space allocation on Spur image load. Provide a minimum ammount of free space, taking into account extant free space. Provisionally use extraVMMemory in the header, defaulting to growHeadroom if extraVMMemory is empty. This can be revised if folks protest. Provide a common sizeof: for SQSocket. Exclude dumpImage: from Spur (no seg support yet) ------------------------------------------------------------------------ r3283 | eliot | 2015-03-22 22:44:52 -0700 (Sun, 22 Mar 2015) | 21 lines CogVM source as per VMMaker.oscog-eem.1111 Fix misgeneration of saveAndRestoreLinkRegAround: by not marking as required methods in CogAbstractInstruction. Has the nice side-effect of deleting ~ 2000 lines of dead code from cogit.c. Revert the bogus fix to preGenerationHook:. Fix type coercion in propagateReturnIn: to not generate unnecessary casts. Do dead-code elimination on (expr and: [false]) ifTrue: and hence fix a few exprs in primitiveVMMarameter Merge in Nicolas' fixes for incorrect use of #|. Refactor the enilopmart creation machinery so that there is only one creation routine, adding a forCall: parameter to differentiate enter and call enilopmarts. Fix CogMethodZone>>whereIsMaybeCodeThing: which was testing the wrong boundary. ------------------------------------------------------------------------ r3282 | eliot | 2015-03-17 18:46:21 -0700 (Tue, 17 Mar 2015) | 5 lines CogVM source as per VMMaker.oscog-eem.1096 Fix regression in generateObjectRepresentationTrampolines. Of /course/ ceScheduleScavengeTrampoline needs to be a safe trampoline. ------------------------------------------------------------------------ r3281 | eliot | 2015-03-17 18:13:54 -0700 (Tue, 17 Mar 2015) | 7 lines CogVM source as per VMMaker.oscog-eem.1095 Fix assertClassOf:is: to handle immediates upstream of isClassOfNonImm:equalTo:. Fixes a potential crash when x or y is sent to immediates (bytecodePrimX/Y). Fix a spelling error with the schedule scavenge trampoline. ------------------------------------------------------------------------ r3276 | eliot | 2015-03-16 20:24:52 -0700 (Mon, 16 Mar 2015) | 2 lines Simple wrappng of ARMul_OSHandleSWI for Mac et al. ------------------------------------------------------------------------ r3273 | eliot | 2015-03-16 19:39:14 -0700 (Mon, 16 Mar 2015) | 6 lines Provide incomplete support for building the GdbARMPlugin on Mac OS X. We still have to deal with the wrapping of ARMul_OSHandleSWI that is implemented using a gcc mechanism on linux. Make the building of BochsIA32Plugin and GdbARMPlugin contingent on available support files (at least in squeak.cog.spur & squeak/cog.v3). ------------------------------------------------------------------------ r3269 | eliot | 2015-03-12 12:14:07 -0700 (Thu, 12 Mar 2015) | 8 lines Update unix configuration to expect gdb-7.6 ARM support to be build in processors/ARM/gdb-7.6. Add platforms/unix/plugins/GdbARMPlugin/acinclude.m4 to only attempt to build ARM plugin if libsim.a has been built in the expected place. Add GdbARMPlugin to the linux cog spur builds. Slight speedup to unix builds by make install-squeak install-plugins, excluding install-doc which is part of the default make install. ------------------------------------------------------------------------ r3268 | eliot | 2015-03-11 20:53:41 -0700 (Wed, 11 Mar 2015) | 18 lines CogVM source as per VMMaker.oscog-eem.1088 Squeak 5.0 release candidate. Speed up normalize methods in LargeIntegersPlugin by cacheing result of firstIndexableField. Simplify integer conversion routines by adding byteSizeOfBytes: which assumes argument is byte indexable (as LargeIntegers are). Make sure integer conversion routines consistently answer 0 on failure. Use 4-byte access where possible. Remove use of popInteger in AsFloat and integer comparison primitives (popStack idiom is inefficient since multiplke writes as opposed to the single write in the pop:thenPush: idiom). Revise SpurMemoryManager>>isClassOfNonImm:equalTo:compactClassIndex: for better dead code elimination. ------------------------------------------------------------------------ r3266 | eliot | 2015-03-05 11:49:02 -0800 (Thu, 05 Mar 2015) | 4 lines CogVM source as per VMMaker.oscog-eem.1085 Fix slip in LargeIntegersPlugin (thanks Nicolas). ------------------------------------------------------------------------ r3264 | eliot | 2015-03-03 13:29:31 -0800 (Tue, 03 Mar 2015) | 11 lines CogVM source as per VMMaker.oscog-eem.1083 Avoid duplication in fetching active process and scheduler in process-switch machinery. Take advantage of endianness for simpler large integer initialization. Slang: Fix inlining of (u)sqLong expressions bound to untyped formals; since the system expects untyped formals to be of type #sqInt the expr must be cast to #sqInt. ------------------------------------------------------------------------ r3263 | eliot | 2015-02-24 14:04:06 -0800 (Tue, 24 Feb 2015) | 23 lines CogVM source as per VMMaker.oscog-eem.1080 General: Fix a type declaration error uncvered by the new inlining. Simplify primitiveMakePoint. Include primitiveMethodXray Include freeMethod: in Cogit's api for method xray. Spur: Fix a typing bug in initializeOldSpaceFirstFree:. Newspeak: Move the Newspeak plugins to nsspursrc/plugins. Fix privacy violation checking for super sends. Fix some type warnings in Spur stack VMs. Slang: More improvement to type inferrence/propagation. Support ifTrue:ifFalse:. Better separate the passes in inferTypesForImplicitlyTypedVariablesAndMethods. Fix slip in nodeToCast:to:. Provide types for atan, et al. Avoid casting nil. Don't inline complex expressions that are bound to variables used in asserts. ------------------------------------------------------------------------ r3262 | eliot | 2015-02-22 16:31:15 -0800 (Sun, 22 Feb 2015) | 5 lines CogVM source as per VMMaker.oscog-eem.1074 Use maybeSelectorOfMethod: for more reliable printing of selector in Newspeak privacy check. ------------------------------------------------------------------------ r3261 | eliot | 2015-02-22 15:10:08 -0800 (Sun, 22 Feb 2015) | 9 lines CogVM source as per VMMaker.oscog-eem.1073 General: Add an option to control FailUnbalancedPrimitives and no longer burden the Stack VMs with the responsibility. Newspeak VM: Add an optional CheckPrivacyViolations option and obey it (thanks, Ryan). ------------------------------------------------------------------------ r3260 | eliot | 2015-02-20 22:09:27 -0800 (Fri, 20 Feb 2015) | 49 lines CogVM source as per VMMaker.oscog-eem.1072 Fix typing multiple assignments to a variable - promote the type to the largest integral type of all assignments (primitiveDecompressFromByteArray) - do /not/ promote a variable typed with integral type to a floating point type (transformColor:) Provide size of short int. Do a much better job at typeForArithmetic:in:; answering the longest type for integral types. In inferTypesForImplicitlyTypedVariablesIn:, observe assignments from both sends and typed vars. Comment the method better so that alreadyExplicitlyTyped's usage is clear(er). On type compatibility of inlined expressions, insist on signed compatibility or accept an untyped actual. Provide a return type for asFloat (so inlining in primitiveAsFloat still occurs) Provide an exception in unsignedTypeForBitwiseSend:in: for currentBytecode to preserve the nice constant inlining of currentBytecode & N in the bytecode cases. Improve the type inferrence machinery further to support pointer subtraction. Eliminate code duplication (determineTypeFor:in: now uses returnTypeForSend:, etc). Eliminate the funky code generation scheme for translated primitive plugins (MiscPrimitives et al) and use the same inlining and code generation path as normal plugins. Finally implement a time stamp checker that looks at the source method timestamps. Type some InterpreterProxy methods to generate valid signatures. ...and add type inference support for at: to rescue inlining in the Klatt plugin. Add support for type inferrence of simple arithmetic (+,-,*,/) but *not* >> << et al, so that inlining is still done for e.g. pointer arithmetic expressions. Fix a bug in TMethod>>typeFor:in: which was causing the failure to find the types of global variables. Change the heuristic for inlining expressions to include a maximum usage count. ------------------------------------------------------------------------ r3256 | eliot | 2015-02-13 18:19:04 -0800 (Fri, 13 Feb 2015) | 33 lines CogVM source as per VMMaker.oscog-eem.1064 Slang: Rescue translation of the non-64-bit Spur VMs by a) doing a better job of suoper expansions, handling expansions that are returning ifs as well as just returns correctly. b) transforming variable := expr ifTrue: [s1] ifFalse: [s2] into expr ifTrue: [variable := s1] ifFalse: [variable := s2] to allow inlining of s1 & s2. And take advantage of the better inlining in copyAndForward: General: Simplify primitiveDisplayString given isArray:. Refactor positive32BitIntegerFor: and signed32BitIntegerFor: in the realization that these reduce to essentially integerObjectOf: in 64-bit Spur. The idea is to inline if in 64-bit Spur but not if in the 32-bit VMs. Add notOption: processing to allow excluding noInlineSigned32BitIntegerFor: et al. Add hasSixtyFourBitImmediates to no longer assume that wordSize = 8 implies 64-bit immediates. Use positiveMachineIntegerFor: in place of positive32BitIntegerFor: in some plugins. Simplify two B3DAcceleratorPlugin prims given topRemappableOop and isArray: With these changes 64-bit Spur Stack Linux manages 3548 run, 3495 passes, 0 expected failures, 47 failures, 6 errors, 0 unexpected passes Builds: Nuke the newspeak.stack.v3 builds ------------------------------------------------------------------------ r3254 | eliot | 2015-02-12 11:20:06 -0800 (Thu, 12 Feb 2015) | 13 lines CogVM source as per VMMaker.oscog-eem.1060 Clip the argument in the 64-bit versions of primitiveTimesTwoPower and avoid the compiler warning with a cast. Be clever with the SmallFloat version to show how convenient the SmallFloat zeros are to work with. primitiveDoNamedPrimitiveWithArgs needs to follow the same convention re primitiveFunctionPointer as primitiveDoPrimitiveWithArgs et al on failure, otherwise checkForAndFollowForwardedPrimitiveState will be fatally confused. Add an assert to check the range of accessorDepth there-in. Linux: Make UTF-8 the default copy/paste encoding to match the help text. ------------------------------------------------------------------------ r3253 | eliot | 2015-02-11 14:20:23 -0800 (Wed, 11 Feb 2015) | 8 lines CogVM source as per VMMaker.oscog-eem.1055 Broaden primitiveBitXor, primitiveBitAnd and primitiveBitOr for Spur 64-bits. Make the bytecodes handle the common SmallInteger op SmallInteger case. Now there are no uses of popPos32BitInteger in Cog :-) Fix C code for Spur64BitMemoryManager>>fetchLong32:ofFloatObject: ------------------------------------------------------------------------ r3252 | eliot | 2015-02-11 11:21:48 -0800 (Wed, 11 Feb 2015) | 6 lines CogVM source as per VMMaker.oscog-eem.1053 Spur: Fix idiocy with image segment bit-position constants. Move the constants to class variables. Ensure all methods commented as being part of load or save. ------------------------------------------------------------------------ r3251 | eliot | 2015-02-10 19:01:24 -0800 (Tue, 10 Feb 2015) | 5 lines CogVM source as per VMMaker.oscog-eem.1051 ...and rescue compilation of the cogits given the change to checkIntegrityOfObjectReferencesInCode: in VMMaker.oscog-eem.1048 ------------------------------------------------------------------------ r3250 | eliot | 2015-02-10 18:46:48 -0800 (Tue, 10 Feb 2015) | 13 lines CogVM source as per VMMaker.oscog-eem.1050 Spur: It's the atCache, stupid. Flush the atCache after every become. Eliminate duplicate flush in flushExternalPrimitives. General: Clean up a few more flushAtCache duplicates Introduce lastPointerOfArray: and use it to slim down become checking. Simplify getErrorObjectFromPrimFailCode. Use lastPointerOfMethodHeader: in makeBaseFrameFor: to same effect. ------------------------------------------------------------------------ r3249 | eliot | 2015-02-10 15:19:26 -0800 (Tue, 10 Feb 2015) | 21 lines CogVM source as per VMMaker.oscog-eem.1048 Refactor leak checking code so that GCModes are flags and coincide with flags for what GC events to leak check. Hence ensure leak checking is actually run when requested. As part of this move the shrink action from postGCAction: into the memory managers and hence allow Spur to not shrink on scavenge. Fix bugs with immediate character printing. Allow printing the mark state of free chunks. Spur: Fix some dumb slips in the image segment code. Only copy-and-forward in remapObj: in the right cicumstance. Add an assert to remapObj:. Have lengthOf: answer 0 for ephemerons and something sensible for 64-bit indexable on 32-bits. Scavenging ephemerons should update the ephemeron's key with the scavenged key. ------------------------------------------------------------------------ r3248 | eliot | 2015-02-04 16:50:56 -0800 (Wed, 04 Feb 2015) | 4 lines CogVM source as per VMMaker.oscog-eem.1044 Nope. The fix is to make ensureBehaviorHash: inlineable. ------------------------------------------------------------------------ r3247 | eliot | 2015-02-04 16:15:02 -0800 (Wed, 04 Feb 2015) | 5 lines CogVM source as per VMMaker.oscog-eem.1042 fetchClassTagOf: also needs to be inlineable in ifs. Use << instead of bitShift: in Spur seg load. ------------------------------------------------------------------------ r3246 | eliot | 2015-02-04 15:48:12 -0800 (Wed, 04 Feb 2015) | 36 lines CogVM source as per VMMaker.oscog-eem.1041 Allow primitivePerformWithArgs to avoid fetchClassOf: in Spur by making the last arg to primitiveObject:perform:withArguments:lookedUpIn: lookupClassOrNil. Update Slang constant folding to include nil isNil/notNil. Eliminate NewspeakV3 support from the Newspeak Spur VMs. Fix commonSendAbsent's comment. Use numSlotsOfAny: to avoid unnecessary assert fails in some printing & testing code. Fix ... bug in longPrintOop: Spur: Like V3's, Spur's fetchClassOf: also needs to be inlineable in ifs. Never inline fetchClassOfNonImm: in Spur; it's a lot of code and should be rare, dynamically. Spur image segments: Offset class indices in objects in segment to avoid confusion with forwarders etc. Comment helper methods better. Add 32-bit byte swapping for 64-bit segment support. Don't expunge unmarked entries from the class table in the segment storage markObjects: invocation. Do 32-bit word reversal in 64-bit Spur and hence fix 64-bit image segment load. Make sure the leak checker is run when image segment leak checking is enabled. ------------------------------------------------------------------------ r3245 | eliot | 2015-02-01 18:24:35 -0800 (Sun, 01 Feb 2015) | 11 lines CogVM source as per VMMaker.oscog-eem.1035 Newspeak: Refactor absent receiver shuffling in the interpreter to get more common code. Spur: Comment more carefully the receiver and supersend forwarding invariants, and therefore eliminate internalForwardedReceiver. Update the newspeak AsynchFilePlugin as per VMMaker.oscog-eem.1031. ------------------------------------------------------------------------ r3244 | eliot | 2015-01-30 18:15:58 -0800 (Fri, 30 Jan 2015) | 8 lines CogVM source as per VMMaker.oscog-eem.1034 Spur: Clarify and ensure that we always follow receivers after any become to ensure that e.g. super sends on non-pointer receivers (which don't check) will have unforwarded receivers and hence any primitives that don't validate their receivers will function correctly. Better safe than sorry. ------------------------------------------------------------------------ r3241 | eliot | 2015-01-30 17:17:30 -0800 (Fri, 30 Jan 2015) | 9 lines CogVM source as per VMMaker.oscog-eem.1032 Eliminate some warnings in the B3DAcceleratorPlugin Fix 64-bit warnings in AsynchFilePlugin and in #Array parameters in the SmartSyntaxInterpreterPlugins. Fix a warning in the Alien plgins. ------------------------------------------------------------------------ r3240 | eliot | 2015-01-30 11:16:19 -0800 (Fri, 30 Jan 2015) | 2 lines Correct some printf type specs for srcLen in sqUnixOpenSSL.c ------------------------------------------------------------------------ r3236 | eliot | 2015-01-29 14:35:45 -0800 (Thu, 29 Jan 2015) | 17 lines CogVM source as per VMMaker.oscog-eem.1029 Spur: Make postBecomeAction's stack sweep only occur in Spur (fix regression). Refactor so that the scan is not inlined. Don't assume newMethod is non-immediate in post-become actions. Fix stack adjust slip in primitiveSmallFloatTimesTwoPower Make ensureBehaviorHash: fail for uninitialized behaviours and hence fix the Behavior basicNew basicNew hang. Fix word size assumption in assert in withoutSmallIntegerTags: LargeIntegersPlugin: Remove/fix assumption of 32-bit digit length in normalization routines. ------------------------------------------------------------------------ r3234 | eliot | 2015-01-22 17:06:16 -0800 (Thu, 22 Jan 2015) | 9 lines CogVM source as per VMMaker.oscog-eem.1026 Fix type regression in primitiveBitShift due to 64-bits. Reduce the max num literals in the alternate header format to 15, and steal the bit for the Sista optimized method flag. Spur: Optionalize some api methods the Spur Cogit doesn't use. ------------------------------------------------------------------------ r3233 | eliot | 2015-01-20 12:28:27 -0800 (Tue, 20 Jan 2015) | 9 lines CogVM source as per VMMaker.oscog-eem.1024 Newspeak: Integrate Ryan's newer absent receiver sends, which first apeared in VMMaker.oscog-eem.919, abandoned because of Glue issues now resolved. Includes nice refactoring of absent send argument marshalling into its own routine. Spur: Provide a validFreeTree checker. ------------------------------------------------------------------------ r3232 | eliot | 2015-01-18 19:36:05 -0800 (Sun, 18 Jan 2015) | 5 lines Fix stupid, stupid bug in copying vm profile samples between buffers when the circular buffer index has wrapped. No longer build the newspeak.cog.v3 installers. ------------------------------------------------------------------------ r3231 | eliot | 2015-01-17 17:07:07 -0800 (Sat, 17 Jan 2015) | 13 lines CogVM source as per VMMaker.oscog-eem.1023 Spur: Rename and correct ensureSemaphoreForwardedThroughContext: to ensureSemaphoreUnforwardedThroughContext:, its intended function. Make shouldRemapObj: filter-out objects already in newSpace since mapStackPages, via mapInterpreterOops, can visit objects twice in a scavenge, GC, compact sequence. General: Speed up assert engines by using addressIsInPage: instead of stackPageFor:. ------------------------------------------------------------------------ r3230 | eliot | 2015-01-15 13:47:03 -0800 (Thu, 15 Jan 2015) | 23 lines CogVM source as per VMMaker.oscog-eem.1022 Fix monumental blunder in jitted store-check code. The saved registers mask needs to be the *or* of the value reg and the caller-saved registers, not the *and*!! Bow to the inevitable and add a manual override for primitive accessor depth. Use it in at: & at:put:. If manual override is not used then the automatically computed depth is too deep because of context access. Slang: Eliminate null expressions in and: and or: if generateDeadCode is false. Sista: Added super calls in conditionnal jumps generation in order not to generate counters for optimized methods. Added unconditionnal single bytecode 217. This bytecode can be used in two case: - when a method is discarded, all its bytecodes are replaced by the unconditional trap and its cogVMState is flushed - in optimized methods, in a branch that wants to trigger dynamic deoptimization ------------------------------------------------------------------------ r3229 | eliot | 2015-01-14 16:03:32 -0800 (Wed, 14 Jan 2015) | 10 lines CogVM source as per VMMaker.oscog-eem.1017 Add an assert to check for forwarding in wakeHighestPriority to hunt bug CM sees Comment typo Fix slips in some sista build scripts (wrong install dir on linux, bad path for plist edit on mac). ------------------------------------------------------------------------ r3228 | eliot | 2015-01-13 10:10:05 -0800 (Tue, 13 Jan 2015) | 5 lines Add a processor-agnostic include file for alien callouts and callbacks. Needed for linux where host_cpu and build_cpu are not necessarily the target cpu. Add some support for identifying the presence of epoll_wait & epoll_pwait on linux. ------------------------------------------------------------------------ r3226 | eliot | 2015-01-09 14:03:52 -0800 (Fri, 09 Jan 2015) | 6 lines CogVM source as per VMMaker.oscog-eem.1016 Fix some type warnings in the Newspeak cogit. Fix the log file name confusion in the Mac build scripts. ------------------------------------------------------------------------ r3224 | eliot | 2015-01-09 13:02:25 -0800 (Fri, 09 Jan 2015) | 6 lines CogVm source as per VMMaker.oscog-eem.1015 Fix some C typing slips in recent Sista JIT code. Fix inclusion of reConfig.h in RePlugin's internal.h ------------------------------------------------------------------------ r3222 | eliot | 2015-01-09 12:30:33 -0800 (Fri, 09 Jan 2015) | 30 lines CogVM source as per VMMaker.oscog-eem.1014 Make the pin primitives Spur-only. General: Bow to the inevitable and add eassert: for those expensive asserts you just can't let go of. Spur: Make sure the caller (& saved) context(s) in base frames stack page are followed post-become in followForwardingPointersInStackZone:. Add an assert to Spur's shouldRemapObj: to verify that new space references are only visited once in a scavenge. Add asserts to check that contexts are not forwarded when marrying stable contexts. General: Never inline mapStackPages, for debugging. Add an assert to returnToExecutive:postContextSwitch: to ensure the instructionPointer is valid when checking for being at a send return pc. Spur: Fix bad bug introduced in become changes in VMMaker.oscog-eem.841 through 844. The class table contains puns, e.g. using Array and WeakArray. These class index puns must not mislead the allInstances primitive into concluding that the class in question is at multiple indices and wrongly purge it. ------------------------------------------------------------------------ r3218 | eliot | 2015-01-07 11:23:24 -0800 (Wed, 07 Jan 2015) | 3 lines Rename DOUBLE_WORD_ALIGNMENT to OBJECTS_32BIT_ALIGNED and use aligned access on Spur. Nuke HAVE_INTERP_H. Add iOS/vm/OSX/config.h. ------------------------------------------------------------------------ r3211 | eliot | 2015-01-06 14:58:47 -0800 (Tue, 06 Jan 2015) | 6 lines CogVM source as per VMMaker.oscog-eem.1010 Fix slip in primitivePin. Also be lenient w.r.t. unpinning married contexts. Move the check down into StackInterpreter's version. This allows e.g. self allObjectsDo: [:o| o unpin] ------------------------------------------------------------------------ r3205 | eliot | 2015-01-01 14:08:51 -0800 (Thu, 01 Jan 2015) | 6 lines CogVM source as per VMMaker.oscog-eem.1008 Third time luckyC in fixing the findUnwindThroughContext: regression? And remove a gcc compiler warning for printHexnp: ------------------------------------------------------------------------ r3204 | eliot | 2015-01-01 13:42:13 -0800 (Thu, 01 Jan 2015) | 9 lines CogVM source as per VMMaker.oscog-eem.1007 Fix stupid regression in findUnwindThroughContext:. Minor streamline to commonReturn in CoInterpreter. Add range check for 64-bit SmallInteger to Float conversion since in 64-bits this can overflow the exact float range. ------------------------------------------------------------------------ r3202 | eliot | 2014-12-31 14:38:14 -0800 (Wed, 31 Dec 2014) | 34 lines CogVM source as per VMMaker.oscog-eem.1004 Send cannotReturn for sideways return attemps when there's an unwind-protect. Old code would erroneously answer unwind-protect even if home could'nt be found. e.g. This should raise cannot return: | b | b := [ ^ 42 ]. [ [b value] ensure: [1] ] fork. Processor yield just as this does: | b | b := [ ^ 42 ]. [ b value ] fork. Processor yield Speed up non-local return processing by using the fact that 98% of the time returns are within the same page. The search for the home context following finding an unwind is unnecessary iff the home is married and on the same page. Refactor commonReturn to eiminate CoInterpreter's version, moving the divergence into maybeReturnToMachineCodeFrame. Ensure search for home through the block's closure uses followField:ofObject:. (related) Revisit the Sista bug fix for followed contexts during scavenging in VMMaker.oscog-eem.913 of 24 October 2014. Split isWidowedContext: into a more careful version, isWidowedContextDuringGC: for use only during scavenging. Sista: Added code for inline primitive comparison. ------------------------------------------------------------------------ r3199 | eliot | 2014-12-30 12:24:52 -0800 (Tue, 30 Dec 2014) | 2 lines Correct the volatile decls. C makes the rules, not me. ------------------------------------------------------------------------ r3197 | eliot | 2014-12-30 11:42:22 -0800 (Tue, 30 Dec 2014) | 2 lines Nuke obsolete RCS vrsion info ------------------------------------------------------------------------ r3196 | eliot | 2014-12-30 11:02:32 -0800 (Tue, 30 Dec 2014) | 8 lines Qualify the pointer used to determine the redzone size as volatile, otherwise newer gccs optimise it away (thanks Ryan). Rename sqWin32Intel.c to sqWin32Main.c to match the other platforms, and hence be e.g. grep-friendly. Fix warning about missing newline at end of generated win32 sqNamedPrims.h. ------------------------------------------------------------------------ r3195 | eliot | 2014-12-26 17:37:21 -0800 (Fri, 26 Dec 2014) | 40 lines CogVM source as per VMMaker.oscog-eem.1001 Mark externalInstVar:ofContext: as not to be inlined (otherwise it is inined into 64-bit primitiveSlotAtPut !!). Remove useless initPrimCalls from primitiveFloatAt[Put] and fix latter for potentially immediate receivers. Spur: Fix argument count slips in three primitives. Check for sufficient memory in two-way become. All: Fix checking of boolean arg in primitiveArrayBecomeOneWayCopyHash. Make primitiveSlotAt[Put] cope with non-pointer objects. Replace primitiveCharacterValue with primitiveImmediateAsInteger which provides SmallFloat64>>identityHash as well as Character>>asInteger. Refactor small float manipulations to introduce smallFloatBitsOf:. Provide printStackReferencesTo:. Fix slip in StackToRegisterMappingCogit>>genBinaryConstOpVarInlinePrimitive: Fix slip in shortPrint:. Change the pixel-touch-pixel prim to allow LPI arguments for the color values Sista: Added inlined primitive code for: byteNumByte pointerAt: byteAt: pointerAt:put: byteAt:put: ------------------------------------------------------------------------ r3193 | eliot | 2014-12-18 15:10:40 -0800 (Thu, 18 Dec 2014) | 2 lines Fix slip in thrlogidx declaration (affects only multithreaded VMs). ------------------------------------------------------------------------ r3192 | eliot | 2014-12-18 14:22:19 -0800 (Thu, 18 Dec 2014) | 18 lines CogVM source as per VMMaker.oscog-eem.992 64-bit Spur: Correct a few comparisons and shifts in small float code to make comparisons in generated C correct. Move loadFloatOrInt: into the ObjectMemory hierarchies to allow Spur64BitMemoryManager to generate better code. Make printOopShortInner: small-float savvy. Make printHexnp: 64-bit aware. Can now interact with a 64-bit Spur image. Unix: Fix missed signature change in sqUnixFBDev.c. ------------------------------------------------------------------------ r3190 | eliot | 2014-12-17 14:30:32 -0800 (Wed, 17 Dec 2014) | 26 lines CogVM source as per VMMaker.oscog-eem.991 Fix bitInvert32 for 64-bits. Now window border colours are correct in the 64-bit Spur Stack linux VM. Cast a left shift to long if in the 64-bit interpreter code. Fix printFreeListHeads Update the ScratchPlugin bilinear scaling prim to include the correct alpha channel value for non-transparent output pixels. Add boundary cases for isSmallFloatValue: Fix isSmallFloatValue: for the low boundary case. Fix generateIsIntegerObject:on:indent: for 64-bit Spur. Make primitiveFloatAt support immedate floats. Fix the regression of breakmnu (breakSelectorLength must be initialized early). Make shortPrintOop: print immediate floats. Double the stack page size for 64-bits. No longer build or upload the Newspeak V3 VMs, now superceded by Spur. ------------------------------------------------------------------------ r3185 | eliot | 2014-12-15 12:44:57 -0800 (Mon, 15 Dec 2014) | 8 lines CogVM source as per VMMaker.oscog-eem.986 Spur: Eliminate the erroneous and confusing setRawNumSlotsOf:to: and setOverflowNumSlotsOf:to:. Use rawNumSlotsOf:put: & rawOverflowSlotsOf:put: which match the getters. Hence fix 64-bit compaction. Remember to update the fixed UnixOSProcessPlugin in Newspeak-land. ------------------------------------------------------------------------ r3184 | eliot | 2014-12-15 09:43:51 -0800 (Mon, 15 Dec 2014) | 4 lines CogVM source as per VMMaker.oscog-eem.985 Fix slip in unreachableMethods. ------------------------------------------------------------------------ r3182 | eliot | 2014-12-12 20:15:40 -0800 (Fri, 12 Dec 2014) | 5 lines CogVM source as per VMMaker.oscog-eem.984 Hack fix generateIntegerObjectOf:on:indent: for 64 bits. Add code to dump register state on linux x64 ------------------------------------------------------------------------ r3181 | eliot | 2014-12-12 19:18:47 -0800 (Fri, 12 Dec 2014) | 3 lines Make sure the 64-bit SPur VMs are differentiated from the 32-bit ones in the -version & crash dump output. ------------------------------------------------------------------------ r3180 | eliot | 2014-12-12 18:53:22 -0800 (Fri, 12 Dec 2014) | 14 lines CogVM source as per VMMaker.oscog-eem.983 Merge with r3071 of http://squeakvm.org/svn/squeak/trunk Provide accessors in InterpreterPlugin to answer integer objects for positive and signed machine words. Use these to make the Alien plugins 64-bit capable. Fix unreachableMethods to do a proper tramsitive closure and answer methods instead of selectors, and to avoid including positiveMachineIntegerFor: et al in every plugin add a dead code removal pass. Hence all plugins regenerated, nearly all of whom lose unused msg sqAssert & getInterpreter defs. ------------------------------------------------------------------------ r3177 | eliot | 2014-12-12 11:56:33 -0800 (Fri, 12 Dec 2014) | 18 lines CogVM source as per VMMaker.oscog-eem.981 CHanges for 64-bit compilation. Eliminating warnings in B2DPlugin and the VMProfileLinuxSupportPlugin. Handle not in nilOrBooleanConstantReceiverOf:. Hence don't do the 32-bit swap in a 32-bit words object in 64-bit Spur. May have to do it in a 64-bit word obj in 64-bit Spur, but it can wait. Generate the right casts for left shift beyond the int range. Generate the right error code for negative arguments to primitiveSizeInBytesOfInstance Correctly translate constant arithmetic expressions that overflow the int range. The criterion for promoting a shifted constant to long was wrong. It needs to compare against sizeof(int) (the default type) not sizeof(long). ------------------------------------------------------------------------ r3173 | eliot | 2014-12-10 16:43:45 -0800 (Wed, 10 Dec 2014) | 3 lines Gaaahhhh, can't declare fileValueOf because it is defined in three different places. ------------------------------------------------------------------------ r3170 | eliot | 2014-12-10 16:32:13 -0800 (Wed, 10 Dec 2014) | 4 lines CogVM source as per VMMaker.oscog-eem.975 Fix 64-bit issues in BitBlt Drop MIDI and RE plugins. ------------------------------------------------------------------------ r3169 | eliot | 2014-12-10 15:25:38 -0800 (Wed, 10 Dec 2014) | 5 lines CogVM source as per VMMaker.oscog-eem.974 Fix 64-bit issues in the AsynchFilePlugin. Fix 64-bit issues with sqUnixMain.c, sqMemoryFence.h & sqVirtualMachine.c. ------------------------------------------------------------------------ r3166 | eliot | 2014-12-10 12:28:32 -0800 (Wed, 10 Dec 2014) | 21 lines Use the gcc/clang built-ins for CAS and atomic increment if available. A few more 64-bit changes to the Carbon implementation of the Mac subsystem, taking it as far as I can before admitting defeat and switching to the Cocoa implementation. Add a linux 64-bit build tree. Shed the old external platforms/iOS tree and import the latest pharovm tree (as of: commit 4feca169ed2abe8b3df0c0d0b9cd1f980a84e723 Merge: 447f247 3c7a588 Author: Esteban Lorenzano Date: Fri Dec 5 07:54:51 2014 +0100 Merge pull request #70 from nicolaihess/issue_14340 use the same value for charCode and keyValue for mousewheelevents) ------------------------------------------------------------------------ r3164 | eliot | 2014-12-06 17:38:11 -0800 (Sat, 06 Dec 2014) | 5 lines CogVm source as per VMMaker.oscog-eem.973 Fix regression caused by breakmnu changes due to mis-initialization of breakSelectorLength. ------------------------------------------------------------------------ r3163 | eliot | 2014-12-06 12:31:43 -0800 (Sat, 06 Dec 2014) | 41 lines CogVM source as per VMMaker.oscog-eem.972 Fix a devilishly tricky bug with 32-bit Spur and PICs in the Cogit. In 32-bit Spur only zero is a valid cache tag, that for Characters, due to SmallIntegers having both 2r11 and 2r01 as valid tags. The cache check prolog collapses these down onto 1 by anding with 1 and hence collapses Character's 2r10 to 0. The cache tag is also tested in the PIC abort routine to distinguish between an MNU abort and an interpret abort. A PIC MNU entry jumps to code that first zeros the cache tag (held in ClassReg) before calling the abort routine, which tests ClassReg and selects the relevant abort processing. Hence in 32-bit Spur if a send site is linked for Character and later extended to a PIC with an interpret case, that interpret case will instead invoke MNU processing. This is rare; first there needs to be a send to a CHaracter, then a send to something else which binds to something that must be interpreted. Ouch. The fix is simple; if a send site that was linked with a zero cache tag (which can only happen in 32-bit Spur) link to an open PIC instead of to a closed PIC, or in the case of an MNU do not link. Changes: Rename compilePICProlog:, mnuCall and interpretCall to the more accurate compilePICAbort:, picMNUAbort and picInterpretAbort. Coment compilePICAbort: and compileAbort. Name the zero value picAbortDiscriminatorValue to make the code more comprehensible/browsable. Assert that the cache tag is not zero in ceCPICMiss:... Refactor cogMNUPICSelector:methodOperand:numArgs: to add receiver: parameter for the check for a zero cache tag. Eliminate some duplication introduced in early versions of the ARM abort code. Specifically lose sendMissCall mnuCall interpretCall & interpretLabel. Fix type regression in cogMethodOf: with cCoerceSimple:to:; CogClass's version should be marked . Fix type warnings in primitiveCopyObject and printStackCallStackOf:. ------------------------------------------------------------------------ r3162 | eliot | 2014-12-05 20:31:14 -0800 (Fri, 05 Dec 2014) | 4 lines CogVM source as per VMMaker.oscog-eem.970 Revert those two cases; they were already covered. ------------------------------------------------------------------------ r3161 | eliot | 2014-12-05 19:12:21 -0800 (Fri, 05 Dec 2014) | 10 lines CogVM source as per VMMaker.oscog-eem.969 Two more cases where the mnu compilation break point needs to be checked. Use numBytesOf: for length of selector. Rename checkValidInlineCacheTag: to validInlineCacheTag:. Add a debug lookup routine that only looks up (and follows forwarding pointers). ------------------------------------------------------------------------ r3160 | eliot | 2014-12-05 15:14:12 -0800 (Fri, 05 Dec 2014) | 4 lines CogVM source as per VMMaker.oscog-eem.968 Extend the -breakmnu facility to break on creating MNU PIC entries, not just activating them. ------------------------------------------------------------------------ r3159 | eliot | 2014-12-05 12:27:02 -0800 (Fri, 05 Dec 2014) | 25 lines VMMaker.oscog-eem.966 Add a -breakmnu vm argument that calls warning on an mnu of a specific selector. Fix SmartSyntaxPlugin code generation for Spur of - asOop: old code assumed 4 byte oops & headers - Unsigned old code assumed 32-bit oops Affects AsyncFilePlugin, BochsIA32Plugin & FT2Plgin. Avoid duplication of effort in special selector send forwarding fault handling. Improve stack trace printing for Newspeak and Glue by providing something that assumes the penultimate literal is the selector or an AdditionalMethodState-like thing containing it. Reimplement primitiveCopyObject to work for both pointer and bits objects. This to support a good Object>>clone for Spur. Fix Spur's isWordsOrBytes[NonImm]:. More changes to the Mac platform subsystem for 64-bits. ------------------------------------------------------------------------ r3158 | eliot | 2014-12-03 14:25:05 -0800 (Wed, 03 Dec 2014) | 21 lines CogVM source as per VMMaker.oscog-eem.962 Improve stack trace printing for Newspeak and Glue by providing something that assumes the penultimate literal is the selector or an AdditionalMethodState-like thing containing it. Fix StackInterpreter>>isFloatObject: and primitiveVMParameter to use isFloatInstance:. Reimplement primitiveCopyObject to work for both pointer and bits objects. This to support a good Object>>clone for Spur. Fix shortPrint: and simulated use of dbgFloatValueOf:, moving it to the ObjectMemory hierarchy. Fix Spur's isWordsOrBytes[NonImm]:. Old code answered true for CompiledMethods. Fix several type issues in the Mac VM when compiling as 64-bits. Switch the Mac HostWindowPlugin support code ffrom old deprecated to current HIView based support. ------------------------------------------------------------------------ r3154 | eliot | 2014-11-27 16:08:50 -0800 (Thu, 27 Nov 2014) | 22 lines CogVM source as per VMMaker.oscog-eem.957 Fix regression in magnitude64BitIntegerFor:neg: Move dispdbg.h above cointerp.h & cogit.h in cogit.c otherwise NoDbgRegParms gets screwed up. Use asInteger instead of asUnsignedInteger in followForwardingPointersInStackZone: so simulation of Stack VM doesn't trigger the assert in asUnsignedInteger. Spur: Make instantiateClass:indexableSize: check for Float instantiation, failing for other than 2 words. Rewrite 32-bit coalesce:and: to use the raw slot accessors. Implement 64-bit coalesce:and:. Make printStackCallStackOf: accept contexts. Fix compilation warnings in SqueakFFIPrims. Nuke obsolete AddSmallFloat.st ------------------------------------------------------------------------ r3148 | eliot | 2014-11-24 12:21:59 -0800 (Mon, 24 Nov 2014) | 4 lines CogVM source as per VMMaker.oscog-eem.956 Fix brain fade in primitive[SmallFloat]Truncated ------------------------------------------------------------------------ r3147 | eliot | 2014-11-24 11:12:43 -0800 (Mon, 24 Nov 2014) | 4 lines CogVM source as per VMMaker.oscog-eem.954 Fix some warnings and some 64-bit issues with the ThreadedFFIPlugin. ------------------------------------------------------------------------ r3145 | eliot | 2014-11-21 18:27:30 -0800 (Fri, 21 Nov 2014) | 6 lines CogVM source as per VMMaker.oscog-eem.951 Fix positive64BitIntegerFor: by fixing new generateSignedShiftRight:on:indent:. Symptom is LargePositiveInteger results from primGetPosition: for SmallInteger values. ------------------------------------------------------------------------ r3144 | eliot | 2014-11-21 15:07:35 -0800 (Fri, 21 Nov 2014) | 7 lines CogVM source as per VMMaker.oscog-eem.950 Fix regression in new primitiveBitShift. Introduce >>> as an explicitly signed shift. 64-bit ize magnitude64BitIntegerFor:neg:, positive64BitIntegerFor: & signed64BitIntegerFor: ------------------------------------------------------------------------ r3143 | eliot | 2014-11-20 21:05:31 -0800 (Thu, 20 Nov 2014) | 2 lines Generate the BitBltPlugin from a clean VMMaker. ------------------------------------------------------------------------ r3138 | eliot | 2014-11-20 18:57:22 -0800 (Thu, 20 Nov 2014) | 22 lines CogVM source as per VMMaker.oscog-eem.948 Spur: Fix regression in primitiveNewWithArg from VMMaker.oscog-eem.859 which caused basicNew: on fixed classes to raise OutOfMemory instead of the relevant error. Have checkForAndFollowForwardedPrimitiveState follow other referencesin the frame if a forwarder is found on the stack. All: Add a first cut at the primitiveSlotAt[Put] primitives. Reimplement primitiveBitShift for 64-bits. Define areIntegers:and: for 64-bit Spur, and move it into the ObjectMemory hierarchies. Add maxSmallInteger and minSmallInteger and matching manifest constants. Use these in LargeIntegersPlugin and Matrix2x3Plugin. Use numBytesOf: instead of lengthOf: in the 64-bit integer conversion routines. Reorder cases in Spur's numBytesOf: to put common case first. ------------------------------------------------------------------------ r3137 | eliot | 2014-11-15 17:45:07 -0800 (Sat, 15 Nov 2014) | 2 lines Regenerate the Spur cogits given the correct initialzation of BaseHeaderSize. ------------------------------------------------------------------------ r3136 | eliot | 2014-11-15 11:54:55 -0800 (Sat, 15 Nov 2014) | 5 lines CogVM source as per VMMaker.oscog-eem.935 Restore the Spur initialization of BaseHeaderSize, which is still needed for correct C generation. ------------------------------------------------------------------------ r3133 | eliot | 2014-11-14 13:00:25 -0800 (Fri, 14 Nov 2014) | 26 lines CogVM source as per VMMaker.oscog-eem.934 Simulator/Slang: Refactor to allow 32-bit and 64-bit Spur to coexist in the simulator, thereby allowing a 64-bit bootstrap. Replace direct use of BytesPerWord, ShiftForWord, BytesPerOop and BaseHeaderSize with sends of wordSize, shiftForWord, bytesPerOop & baseHeaderSize respectively. Make sure these are still output as the manifest constants in the generated C. Eliminate use of bytesPerSlot in favour of bytesPerOop. The use of sends is similar to those in trunk VMMaker, but I don't have time to merge. Sorry :-(. Work-around use of sends for bytesPerOop in e.g. generateToByDo:on:indent: and users of isConstantNode:valueInto:. Do a better job at inlining via inlineCodeOrNilForStatement:in:. Comment in isNode:substitutableFor:inMethod:in: explains. Eliminate generic VM_LABEL support, labelling only the bytecodes in interpret. Eliminate use of LargeContextSize in the stack and cog VMs. Alas haven't yet eliminated the frame offset constants such as FoxCallerSavedIP et al. We only need one of the two word sizes of interpreter to be executable in the bootstrap. And remember to generate the GdbARMPlugin ------------------------------------------------------------------------ r3132 | eliot | 2014-11-13 19:43:01 -0800 (Thu, 13 Nov 2014) | 2 lines Add accessorDepths for the exported browser plugin primitives for Spur. ------------------------------------------------------------------------ r3130 | eliot | 2014-11-12 11:52:35 -0800 (Wed, 12 Nov 2014) | 4 lines Merge Levente's recent changes to DNS lookup on Windows and SSL on Unix. See http://squeakvm.org/cgi-bin/viewvc.cgi/squeak?view=revision&revision=2249 http://bugs.squeak.org/view.php?id=7824 ------------------------------------------------------------------------ r3129 | eliot | 2014-11-10 10:34:19 -0800 (Mon, 10 Nov 2014) | 2 lines Just another manic monday ------------------------------------------------------------------------ r3128 | eliot | 2014-11-10 10:15:29 -0800 (Mon, 10 Nov 2014) | 2 lines oops. getpw?? => getwd ------------------------------------------------------------------------ r3127 | eliot | 2014-11-10 10:12:05 -0800 (Mon, 10 Nov 2014) | 3 lines Have the Unix & Mac VMs print the process id and working directory when blocking on error or assert fail. Add scripts for the ARM VM archives. ------------------------------------------------------------------------ r3126 | eliot | 2014-11-05 12:48:12 -0800 (Wed, 05 Nov 2014) | 6 lines Add build directories linux32ARM squeak.stack.spur. Update configure to build the UnicodePlugin on linux. Include the Unicode plugin in linux Squeak VMs. Update the linux HowToBuild instructions with info on loading support packages. Thanks to Doug McPherson for getting all this to work. ------------------------------------------------------------------------ r3125 | eliot | 2014-11-04 17:12:31 -0800 (Tue, 04 Nov 2014) | 13 lines CogVM source as per VMMaker.oscog-eem.923 Back out of Ryan's recent absent receiver changes, while accumulating the other recent fixes. There's some incompatibility with the working classes machinery at Cadence and Ryan's recent changes which we don't have time to resolve now. The kept changes are: Fix asserts in addFreeSubTree: & addToFreeTree:bytes:. Fix possible forwarding of the receiver in implicit receiver sends. Eliminate some compiler warnings in the refactored instVar:ofContext: changes. ------------------------------------------------------------------------ r3124 | eliot | 2014-11-04 14:36:20 -0800 (Tue, 04 Nov 2014) | 7 lines CogVM source as per VMMaker.oscog-eem.922 Ancestors: VMMaker.oscog-eem.921 Fix a transcription slip in the new implicitReceiverFor:mixin:implementing:. Use followObjField: in findApplicationOfTargetMixin:startingAtBehavior:. Fix the assert in addFreeSubTree: similarly to that in addToFreeTree:bytes:. ------------------------------------------------------------------------ r3123 | eliot | 2014-11-03 21:35:18 -0800 (Mon, 03 Nov 2014) | 4 lines CogVM source as per VMMaker.oscog-eem.921 Spur: Fix possible forwarding of the receiver in implicit receiver sends. ------------------------------------------------------------------------ r3122 | eliot | 2014-11-03 15:52:54 -0800 (Mon, 03 Nov 2014) | 9 lines CogVM source as per VMMaker.oscog-eem.920 Fix an assert in addToFreeTree:bytes: Integrate Ryan's latest absent receiver sends. Includes nice refactoring of absent send argument marshalling into its own routine. Eliminate some compiler warnings in the refactored instVar:ofContext: changes. ------------------------------------------------------------------------ r3121 | eliot | 2014-11-02 18:55:09 -0800 (Sun, 02 Nov 2014) | 9 lines CogVM source as per VMMaker.oscog-eem.918 Fix bad bug in callPrimitiveBytecode. Old code skipped past next bytecode. This broke code depending on ContextPart>>restart, such as Exception>>retry. And include wchar.h in the interpreter for wint_t (Spur immediate character printing), since stddef doesn't always define it (on linux of course; elsewhere it seems to be present). ------------------------------------------------------------------------ r3120 | eliot | 2014-10-31 12:13:28 -0700 (Fri, 31 Oct 2014) | 16 lines CogVM source as per VMMaker.oscog-eem.916 Spur: Reimplement deriving the accessorDepth and retrying primitives on primitive failure machinery. Always take the primitive index from newMethod (setting newMethod to a SmallInteger for primitiveDoPrimitiveWithArgs. Have the Cogit always set primitiveFunctionPointer and newMethod for the retry. Add isNonInteger(Non)Immediate: and use it in several of the integer conversion routines that were missing code to exclude Character immediates, with fatal consequences. With these changes the Pharo 4 test suite runs without crashing on the latest Pharo Spur boot image. ------------------------------------------------------------------------ r3118 | eliot | 2014-10-30 17:33:06 -0700 (Thu, 30 Oct 2014) | 10 lines CogVM source as per VMMaker.oscog-eem.915 Spur: Fix processWeakSurvivor: so that it answers whether a weak object refers to a young object. The old version only scanned weak fields, igoring refs to young objs from strong fields. Move check for valid classes from findClassOfMethod: forReceiver: into findClassContainingMethod:startingAt:, hence making findClassOfMethod:forReceiver: et al more robust. ------------------------------------------------------------------------ r3117 | eliot | 2014-10-29 16:58:59 -0700 (Wed, 29 Oct 2014) | 28 lines CogVM source as per VMMaker.oscog-eem.914 Spur: Implement safe access to contexts and methods when creating image segments (since internally married contexts and jitted methods have hidden state encoded in odd ways). As a result: Fix baaad bug in SpurMemoryManager>>lastPointerOf: for contexts, caused by transcription from (New)ObjectMemory where the method works on a wing and a prayer because BaseHeaderSize = BytesPerOop. And I can't be arsed to fix it. Refactor decoding of context instruction pointers so there is only one copy of the code. Fix baaad bug in accessibleObjectAfter: and add an assert to primitiveNextObject to catch similar bugs. Can now enumerate objects in new space, which will sort-of work, but code should really use allObjects. Will fix at the image level as time allows. Eliminate isInSurvivorSpace: in favour of the identical isInPastSpace:. All: Fix the comments in loadImageSegmentFrom:outPointers:; the array is not truncated to zero length; it retains its version info. Fix storeShort16:ofObject:withValue: to accept negative values. ------------------------------------------------------------------------ r3114 | eliot | 2014-10-25 12:00:21 -0700 (Sat, 25 Oct 2014) | 2 lines Rescue the Windows build after integrating the ARM BitBlt changes. ------------------------------------------------------------------------ r3112 | eliot | 2014-10-24 21:39:07 -0700 (Fri, 24 Oct 2014) | 54 lines Finish integrating Doug McPherson's changes for building the Stack VM on ARM: Support building for ARM architecture 7-A (Cortex-A8, Cortex-A9, etc. see http://en.wikipedia.org/wiki/ARM_architecture) such as is used in BeagleBone Black, Parallella, countless smartphones, Chromebooks, etc, etc. Cog/platforms/Cross/vm/ 1. replace sqAtomicOps.h 2. replace sqMemoryFence.h Cog/platforms/unix/vm/ 1. replace sqUnixHeartbeat.c 2. replace sqUnixITimerHeartbeat.c 3. replace sqUnixITimerTickerHeartbeat.c Cog/ 1. rename build.linux32ARMv6 to build.linux32ARM Clean up building of BitBltPlugin and vm-display-X11 to compile/assemble only the required files based on 1) host_cpu=arm and 2) the presence of --enable-fast-bitblt option to unix/config/configure (for example in mvm scripts) Cog/platforms/unix/config/ 1. replace make.cfg.in 2. replace configure Cog/platforms/unix/plugins/BitBltPlugin/ 1. ******DELETE Makefile.in ******* 2. replace acinclude.m4 3. replace Makefile.inc Cog/platforms/Cross/plugins/BitBltPlugin/ - remove the conditional compile #if defined(ENABLE_FAST_BLT) which completely surrounds the content of each of these files. Each of these is now built or not built based on autoconf magic. 1. replace BitBltArm.c 2. replace BitBltArmLinux.c 3. replace BitBltArmOther.c 4. replace BitBltArmSimd.c 5. replace BitBltDispatch.c 6. replace BitBltGeneric.c Cog/platforms/unix/vm-display-X11/ - rename USE_FAST_BLT to ENABLE_FAST_BLT for consistency with BitBltPlugin 1. replace sqUnixX11.c 2. replace acinclude.m4 3. replace Makefile.inc Cog/build.linux32ARM/squeak.stack.v3/build/ 1. replace mvm 2. add SqueakSSL to plugins.ext 3. should do same edits for build.debug/ and build.assert/ (and add SqueakFFIPrims and SqueakSSL) Cog/platforms/unix/vm-display-null/ - Clean up harmless but annoying redundant compile flags in vm-display-null 1. replace Makefile.inc ------------------------------------------------------------------------ r3111 | eliot | 2014-10-24 15:52:56 -0700 (Fri, 24 Oct 2014) | 10 lines CogVM source as per VMMaker.oscog-eem.913 Fix baaaad bug in checking for still-married contexts in Spur. One *cannot* simply follow what is assumed to be the frameContext field of what is presumed to be a context. On Spur we need to *know* whether we have a valid frameContext field, and for that we have to know there is a valid frame. So refactor, moving isFrame:onPage: from StackInterpreterPrimitives to StackInterpreter, and use it to validate the frame pointer of a maybe married context before testing the context for being forwarded. ------------------------------------------------------------------------ r3110 | eliot | 2014-10-24 13:43:48 -0700 (Fri, 24 Oct 2014) | 4 lines CogVM source as per VMMaker.oscog-eem.912 Fix another assert fail case in ceInterpretMethodFromPIC:receiver: ------------------------------------------------------------------------ r3109 | eliot | 2014-10-24 11:53:45 -0700 (Fri, 24 Oct 2014) | 10 lines CogVm source as per VMMaker.oscog-eem.911 Avoid cogging methods containing unknown bytecodes early in scanMethod. Use a hack to avoid a test on the common path. Fix the return type of implicitReceiverCacheAddressAt:. Both of these together fix assert fails due to cogging mehtods containing unknown bytecodes. ------------------------------------------------------------------------ r3107 | eliot | 2014-10-23 17:37:55 -0700 (Thu, 23 Oct 2014) | 19 lines CogVM source as per VMMaker.oscog-eem.909 Spur: Refactor the Spur image segment code into smaller methods. Collect the classes in a segment at the start of the seg, immediately following the root obj, to ease postponing adding cxlasses in the seg to the class table until after validation. Byte swap image segments in the load primitive if required, as is expected by the ImageSegment code. Oops, markStack pop order is LIFO. Explicitly put the roots array first in the reachable objects array that populates a segment. testImageSegmentsShouldBeWritableToaFile now succeeds & the system stays alive. All: Print slots of word objects in longPrintOop: Unix: Quote the LD_LIBRARY_PATH setting to tolerate directory names with spaces. ------------------------------------------------------------------------ r3106 | eliot | 2014-10-21 19:17:13 -0700 (Tue, 21 Oct 2014) | 49 lines CogVM source as per VMMaker.oscog-eem.907 Spur: Implement image segments. Use Igor's idea of splitting the computation of the transitive closure from the writing of the image segment for simplicity, even if the two are together into a single primitive for backwards-compatibility. Status is that raw use of the primtiives works, but use in the context of ImageSegmentTest fails apparently because something somewhere changes the version stamp at teh start of a segment. Any clues appreciated. Rename markAccessibleObjects to markAccessibleObjectsAndFireEphemerons, rename markObjects to markObjects: flag, where flag is true if objects are known to be unmarked before hand. Move expungeDuplicateAndUnmarkedClasses: and nilUnmarkedWeaklingSlots into markObjects: from globalGarbageCollect. This is all to ensure that the mark phase of the storeImageSegment prim does process weaklings fully before computing the transitive closure. Extend the object shortening code to include word objects (for the image segment arrays) and make them deal with new space objects as well as old space objects. Have freeObject: attempt to coalesce to avoid fragmenting the largest free chunk all the time it is used for scratch storage). Nuke the abortive attempt to implement the Spur image segment code similarly to the V3 code. Simplify isHiddenObj: for leak checking to tolerate more punned scratch objects in new space. Add a flag to checkForLeaks to specifically check for leaks around the segment prims. Change readableFormat: so that on Spur there is as yet no acceptable compatibility version. All: Rewrite the two primitives to pass back an error code on failure, and rewrite the (New)ObjectMemory code to answer informative failure codes. Make findClassContainingMethod:startingAt: et al robust in the face of faulted-out classes (nil method dictionaries). No longer parenthesize BaseHeaderSize (and soon BytesPerOop and BytesPerWord) for upcoming 64-bit changes. Fix parenthesization bugs in validation code in some Alien plugin primtiives. Include the AioPlugin in the Newspeak linux VMs; recent reports indicate it's essential to good performance in recent versions of OSProcessPlugin. ------------------------------------------------------------------------ r3105 | eliot | 2014-10-14 12:54:42 -0700 (Tue, 14 Oct 2014) | 8 lines CogVM source as per VMMaker.oscog-eem.903 Rewrite implicit receiver lookup logic to follow and fix up forwarding pointers. Fixes occasional failures to locate correct implicit receiver which manifest as MNUs. And follow in enclosingObjectAt:withObject:withMixin: Rename hiddenRootsObj: to setHiddenRootsObj: for clang. ------------------------------------------------------------------------ r3104 | eliot | 2014-10-13 16:35:34 -0700 (Mon, 13 Oct 2014) | 9 lines CogVM source as per VMMaker.oscog-eem.900 Change a couple of between:and:'s that should be oop:isGreaterThanOrEqualTo: andLessThan:'s Fix signed/unsigned comparisons with freeStart in V3. Assert for empty remap buffer means Spur's accessor must be defined as a macro. ------------------------------------------------------------------------ r3103 | eliot | 2014-10-13 14:24:18 -0700 (Mon, 13 Oct 2014) | 2 lines Add ARMV7 defines for various support files. ------------------------------------------------------------------------ r3102 | eliot | 2014-10-13 13:51:55 -0700 (Mon, 13 Oct 2014) | 8 lines CogVM source as per VMMaker.oscog-eem.897 Fix old V3 NewObjectMemory bug in fullGC. sweepPhaseForFullGC failed to update freeStart at the end of its sweep which could leave a partial object between the last object and freeStart, causing subsequent crashes in enumeration. This fixes an occasional crash in muO's release process: MuODeployer makeImageRelease ------------------------------------------------------------------------ r3097 | eliot | 2014-10-08 12:18:05 -0700 (Wed, 08 Oct 2014) | 8 lines CogVM source as per VMMaker.oscog-eem.895 Compile the NewspeakV4 bytecode extPushPseudoVariableOrOuter frameless when pushing nil, true, false. This means the scanMethod and scanBlock: implementations must maintain extA and extB. Rename "explicit outer" foo to "enclosing object" foo ------------------------------------------------------------------------ r3096 | eliot | 2014-10-05 14:56:54 -0700 (Sun, 05 Oct 2014) | 6 lines CogVM source as per VMMaker.oscog-eem.891 Fix compilatiom of v3 VMs (fix v3 pinObject: type). Fix Squeak V3 checkValidInlineCacheTag: (SmallInteger 0 is a valid cache tag). ------------------------------------------------------------------------ r3095 | eliot | 2014-10-03 14:49:26 -0700 (Fri, 03 Oct 2014) | 8 lines Hack-fix platform-specific file selection for the IA32ABI and BitBltPlugin plugins on unix. Merge Doug McPherson's upgrade to mkmf to be able to compile .s as well as .S. Doug, apologies for the conflicts between your platforms/unix/plugins/BitBltPlugin/Makefile.in and my platforms/unix/plugins/BitBltPlugin/{Makefile.inc,acinclude.m4}. Hitting the ball back to you for your input. ------------------------------------------------------------------------ r3093 | eliot | 2014-10-03 09:45:17 -0700 (Fri, 03 Oct 2014) | 25 lines CogVM source as per VMMaker.oscog-eem.890 Spur: Fix one-way become for classes with and without copyHash, primarily by fixing allInstances. One-way become for classes causes duplicates in the class table (either that or an allInstances scan would be needed as part of the become to change instances referring to the deleted class index, which would be slow). So allInstances must be able to cope with duplicates. Hence split it into a fast path common case when the class in question is not duplicated, and a slower path when it is. Make both the marking phase of GC and allInstances check for and eliminate refereces to duplicate entries at wrong/obsolete class indices. Fix markAndShouldScan: to not scan the pun classes of non-objects on the heap such as implicit receiver caches and Sista counters. Eliminate the classTableBitmap premature optimization. All the information we need is in the cassTable and the class's hashes therein. Change pinObject: to answer 0 on failure and the (possibly moved) object on success. Much easier than having to check and follow forwarding pointer. The changes to platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c in r3092 in a Spur MT VM depend on this. Fix some C compilation warnings ------------------------------------------------------------------------ r3087 | eliot | 2014-09-30 16:39:10 -0700 (Tue, 30 Sep 2014) | 5 lines CogVM source as per VMMaker.oscog-eem.889 Fix the assert fail caused by a frameless method with an unaccessed temp. Move the assert check to genPushTemporaryVariable:. ------------------------------------------------------------------------ r3086 | eliot | 2014-09-30 10:23:24 -0700 (Tue, 30 Sep 2014) | 8 lines CogVM source as per VMMaker.oscog-eem.888 Fix bug in Cogit>>lookup:for:methodAndErrorSelectorInto: which if cogging a metod found through an MNU would set the cog method's selector to the original selector that was not understood instead of #doesNotUnderstand:. Fix the description of the blockonwarn flag (not blockonwarning). ------------------------------------------------------------------------ r3085 | eliot | 2014-09-29 18:16:34 -0700 (Mon, 29 Sep 2014) | 17 lines CogVM source as per VMMaker.oscog-eem.887 Install the callPrimitiveBytecode in the Interpreter's bytecodeDispatchTable on Spur. Modify callPrimitiveBytecode to not invoke unknownBytecode processing if at the first bytecode of a primitive method. Correct sign comparison of instructionPointer in justActivateNewMethod. Relax the validInstructionPointer:inMethod:framePointer: assert to accept any pc in initialPC to self size range now that callPrimitiveBytecode is more forgiving. Speed up primitiveMarkUnwindMethod & primitiveMarkHandlerMethod in the StackInterpreter by setting them to 0 in the primitive table. ------------------------------------------------------------------------ r3084 | eliot | 2014-09-25 16:12:18 -0700 (Thu, 25 Sep 2014) | 14 lines CogVM source as per VMMaker.oscog-eem.885 Fix regression in V# become youngReferrers management in VMMaker.oscog-eem.882. We /must/ prune young referrers if mapObjectReferencesInMachineCodeForBecome removes a cog method from youngReferrers because it may get added back and youngReferrers cannot contain duplicates. Fix potential bug in Spur become argument validation. Check for immediates needs to come /after/ following forwarders since an object can become-forward to an immediate. Fix cPICHasForwardedClass:; this did /not/ enumerate the classIndices in a Spur Closed PIC. ------------------------------------------------------------------------ r3083 | eliot | 2014-09-25 16:02:22 -0700 (Thu, 25 Sep 2014) | 12 lines CogVM source as per VMMaker.oscog-eem.886 Fix regression in V# become youngReferrers management in VMMaker.oscog-eem.882. We /must/ prune young referrers if mapObjectReferencesInMachineCodeForBecome removes a cog method from youngReferrers because it may get added back and youngReferrers cannot contain duplicates. Commit this separate from VMMaker.oscog-eem.885 to have it separate from the flush caches on Spur become changes from VMMaker.oscog-eem.883/884. To be clear, this is a branch. The head is 885. ------------------------------------------------------------------------ r3082 | eliot | 2014-09-25 10:53:41 -0700 (Thu, 25 Sep 2014) | 34 lines CogVM source as per VMMaker.oscog-eem.882 Spur: Fix bug in sweepToFollowForwardersForPigCompact which failed to update and answer lowest forwarder. Fixes numForwarders == 0 assert failures. Fix bug with become and class table not removing classes which become causes them to be unhashed. Fix bogus assert fail in synchronousSignal:. Refactor following code into ensureSemaphoreForwardedThroughContext: and fix the assert there-in. Use rawOverflowSlotsOf: in bytesInObject:. Make a little more progress on Spur image segment support. Provide a classTableEntriesDo: and use it to compute an arrayOfUnmarkedClasses. Cogit: Make sure voidImplicitReceiverCacheAt: sets codeModified if IRCs are inline. Make sure freeMethod: clears cmRefersToYoung Fix assert in cogitPostGCAction: that would fire erroneously in Spur become. Nuke some unneeded pruneYoungReferrers calls. Factor-out send-site unlinking into unlinkSendAt:targetMethod:sendTable: Sista: Rename ceClassTrap: et al to ceSistaTrap: given that Sista may trap in more cases than just unknown classes. Renumber the primitives in StackInterpreter>>callPrimitiveBytecode. ------------------------------------------------------------------------ r3079 | eliot | 2014-09-13 17:02:53 -0700 (Sat, 13 Sep 2014) | 4 lines CogVM source as per VMMaker.oscog-eem.881 Fix some conflicting return types (during generation). ------------------------------------------------------------------------ r3078 | eliot | 2014-09-13 16:20:54 -0700 (Sat, 13 Sep 2014) | 7 lines CogVM source as per VMMaker.oscog-eem.880 Move evaluation of Cogit primitive desacriptor enabled function from initialization to just-in-time, and add enablers on SmallInteger primitives to ensure they are applied only to SmallInteger receivers (falling back to interpreter prims if not). Hence fix Cog for 4.1 (e.g. MuO) images. ------------------------------------------------------------------------ r3077 | eliot | 2014-09-12 17:35:44 -0700 (Fri, 12 Sep 2014) | 5 lines CogVM source as per VMMaker.oscog-eem.879 Back out of saneMethodClassAssociation assert in initialPCForHeader:method:. Newspeak falls foul of this. ------------------------------------------------------------------------ r3076 | eliot | 2014-09-12 13:57:39 -0700 (Fri, 12 Sep 2014) | 5 lines CogVM source as per VMMaker.oscog-eem.878 Make sure that the method is set on returning from a callback. Fixes MNUs of atAddress: in exampleCqsort in the stack VMs. ------------------------------------------------------------------------ r3073 | eliot | 2014-09-09 10:59:11 -0700 (Tue, 09 Sep 2014) | 2 lines Fix bugs in scripts and Windows manifests. ------------------------------------------------------------------------ r3072 | eliot | 2014-09-08 15:20:18 -0700 (Mon, 08 Sep 2014) | 9 lines CogVM source as per VMMaker.oscog-eem.876 Regenerate sources after refactoring Slang code to ask classes what methods they want to include based on their initializationOptions inst var instead of the centralized VMMaker. Generate Spur Newspeak VMs with the new CompiledMethod header format. This will break the Newspeak Spur bootstrap until NOF generation and/or loading is fixed. ------------------------------------------------------------------------ r3070 | eliot | 2014-09-05 10:31:11 -0700 (Fri, 05 Sep 2014) | 8 lines CogVM source as per VMMaker.oscog-eem.870 Fix bad regression in FilePlugin>>primitiveFileSetPosition introduces around r2797 that breaks > 1Gb file access. Change manifest files on Windows to make app HIGHDPIAWARE. Create a manifest for the consolevm and include it in the archive. ------------------------------------------------------------------------ r3064 | eliot | 2014-08-26 01:52:44 -0700 (Tue, 26 Aug 2014) | 28 lines CogVM source as per VMMaker.oscog-eem.865 Sista: Fix primitiveSistaMethodPICAndCounterData after the VMMaker.oscog-eem.814 change moving counters to the heap. Add several modifications to the current image facade so we can get the send and branch data for an in-image compilation. Fix header printing of counters and IR caches. Implement genBinaryConstOpVarInlinePrimitive: & genBinaryVarOpConstInlinePrimitive: and correct genBinaryVarOpVarInlinePrimitive: for Slang. V3: Fix bug with become where duplicate entries in the input array would crash the system (thanks Igor). Spur: Add an assert to check for a valid mehtodClassAssociation in methods (arguably dubious) to help catch malformed methods in multiple bytecode shenannigans. Reduce the possibility for heisenbugs by providing noFixupFollowField:ofObject: and using it in debugging code. General: Make nameOfClass: more robust, in both the real and simulated VMs. ------------------------------------------------------------------------ r3063 | eliot | 2014-08-14 12:43:38 -0700 (Thu, 14 Aug 2014) | 39 lines CogVM source as per VMMaker.oscog-eem.860 (except for Newspeak VMs *). Spur: Convert Spur to use only the alternate CompiledMethod header format (65536 literals, primitive in a bytecode). 3+4 evaluated in the simulator. Update build scripts to set VM version number to 5.0 (V3 remain at 4.0). Fix system crash on using basicNew: on CompiledMethod. Have instantiateClass:indexableSize: refuse to instantiate a CompiledMethod, and add instantiateCompiledMethodClass:indexableSize:. Get the error code right for primitiveNew et al.` Alter the SqueakV3 Cogit bytecode table initializers to add the callPrimitiveBytecode: at 139 if in a Spur VM. Update the prim numbers for inlined prims in genCallPrimitiveBytecode to match the latest EncoderForSistaV1 class comment. Moved literal count methods from StackInterpreter hierarchy to ObjectMemories. Rename headerOf: to methodHeaderOf: & literalCountOfHeader: to literalCountOfMethodHeader: Abstract out lastPointerOfMethodHeader: Cogits: Fix offset of first special selector to not presume SqueakV3 and/or NewspeakV4. Sista: Update build scripts to set VM version number to 6.0 (Sista V3 i set ot 4.5). Partially implement genCallPrimitiveBytecode. Slang: Eliminate double negatives translating ifFalse: (for primErrorCode). Scripts: Update getGoodVM scripts, and add a maker for getting Newspeak VMs. Update envvars to use provided curl on Mac OS X instead of non-native wget. Add rev and tag args to the mkarchive and uploadvm scripts. Fix uploadvms script to upload Newspeak Spur Windows VM. *Newspeak Spur VMs appear funcitonal but not checking in because the bootstrap is not finished and taking too long to fix. ------------------------------------------------------------------------ r3061 | eliot | 2014-08-07 08:22:32 -0700 (Thu, 07 Aug 2014) | 20 lines CogVM source as per VMMaker.oscog-eem.848 Sista: Implement ceClassTrap. Fix argument access in inlinePrimitiveBytecode:. Refactor primitiveQuo to share code with inlinePrimitiveBytecode:. Provide a dummy genCallPrimitiveBytecode for now. Cogits: Implement genExtTrapIfNotInstanceOfBehaviorsBytecode for 32 bit Spur. Fix argument branches type & alloca in genExtTrapIfNotInstanceOfBehaviorsBytecode. Eliminate classFloatCompactIndex and just use ClassFloatCompactIndex directly. Fix comment typos and miscategorizations. Copy the readme to the paste buffer on Mac OS X in uploadvms ------------------------------------------------------------------------ r3060 | eliot | 2014-08-06 17:37:34 -0700 (Wed, 06 Aug 2014) | 19 lines CogVM source as per VMMaker.oscog-eem.844 Fix bad bug in interpreter to machine code frame conversion on backward branch. Old code would decrement branch even if backward branch checked for events and did a process switch, potentially converting frames at arbitrary unmappable pcs, not just backward branches. Neaten and comment the code. Neaten and update the pc mapping tests for multiple bytecode sets and for sets with extensions. Change default count to 40 from 10 to reduce number of startup methods jitted. Nuke obsolete PRIM_TABLE code form the sqGnu.h's. Spur: Eliminate expensive asserts in Spur allObjects/alInstances unnecessary in MarkObjectsForEnumerationPrimitives false regime. Sista: Implement genExtTrapIfNotInstanceOfBehaviorsBytecode for SqueakV3. And fix it and the interpreter's version to pop the value from the stack. ------------------------------------------------------------------------ r3059 | eliot | 2014-08-05 10:16:14 -0700 (Tue, 05 Aug 2014) | 4 lines CogVM source as per VMMaker.oscog-eem.843 Allow warnings to be treated as errors, adding -blockonwarn flag on Mac & Unix. ------------------------------------------------------------------------ r3058 | eliot | 2014-08-04 19:15:28 -0700 (Mon, 04 Aug 2014) | 4 lines CogVM source as per VMMaker.oscog-eem.842 Fix typo in initializeCTranslationDictionary and hence rescue Newspeak cogits ------------------------------------------------------------------------ r3057 | eliot | 2014-08-04 18:55:33 -0700 (Mon, 04 Aug 2014) | 56 lines CogVM source as per VMMaker.oscog-eem.841 Spur: Provide unpinObject: for InterpreterProxy. Fix initialization of the heap-resident remembered set added by VMMaker.oscog-eem.827. It must be created /after/ old space is initialized. Fix two become bugs surfaced when adding/removing inst vars to/from Association, Binding et al. First, the class table must be scanned to ensure there are no forwarders to classes (much cheaper than the full hierarchy walk to follow method dictionaries etc that was done). Second, machine code methods that gain a new reference through become must get added to the youngReferrers. Add a new become effect flag, OldBecameNew that captures this and respond to it in CoInterpreter>>postBecomeAction: by adding all methods to youngReferrers so that on the next scavenge all will be made right. Fix GC of machine code, which must follow forwarders when doing markAndTraceLiteral: and again add to youngReferrers if following gains a new ref. Refactoring of markAndTraceLiteral: into markAndTraceLiteral:in:at: et al required. Fix assert in addFreeSubTree:. General: Support the alternate bytecode set header in all VMs to ease testing of multiple bytecode sets. This means methods with the sign bit set have no primitive field and a larger num literals field, but no more. Fix longPrintOop: (actually printOopShortInner:) for global variable printing in face of new Environments. Cogit: Clean up adding to the youngReferrers by providing ensureInYoungReferrers:. Since there always is room on youngReferrers, nuke roomOnYoungReferrersList, canLinkToYoungClasses and caller code, simplifying ceSend:super:to:numArgs: etc. Fix assert in followForwardedLiteralsIn: General: Change the scanning for initial nils scheme in the StackToRegisterMappingCogit to answer the number of push nils in a bytecode, instead of whether the bytecode is a push nil. Refactor genReturnTopFromBlock into genBlockReturn. These changes accomodate Sista. Rationalize the length functions, deleting byteLengthOf:, fetchLong32LengthOf: & fetchWordLengthOf: and providing numBytesOf:, num16BitUnitsOf:, num32BitUnitsOf:, num64BitUnitsOf: and numBytesOf:. Provide fetch/storeShort16:ofObject:[withValue:] and fetch/storeLong64:ofObject:[withValue:]. Sista: Fix slip in CoInterpreter>>ceCounterTripped: that would break Spur (classForClassTag: instead of classTagForClass:). ------------------------------------------------------------------------ r3056 | eliot | 2014-07-24 10:12:40 -0700 (Thu, 24 Jul 2014) | 2 lines Fix linux's makeproduct script ------------------------------------------------------------------------ r3055 | eliot | 2014-07-24 10:11:23 -0700 (Thu, 24 Jul 2014) | 3 lines Add the time zone to the version info on Mac OS X and Win32. Nuke the win32 version.h wart and simplify & update win32's version.c. ------------------------------------------------------------------------ r3054 | eliot | 2014-07-24 01:23:09 -0700 (Thu, 24 Jul 2014) | 11 lines CogVM source as per VMMaker.oscog-eem.832 Spur: More rationalization of the class table management post become. Now no post become scan of the class table is necessary at all. Fix bug in assigning parameter 55 (growth ratio at which to do a global GC). Fix printStringOf: (used in e.g. frame print) to not print crs that would cause previous info to be overwritten. ------------------------------------------------------------------------ r3052 | eliot | 2014-07-22 10:45:31 -0700 (Tue, 22 Jul 2014) | 13 lines CogVM source as per VMMaker.oscog-eem.831 Spur: Fix bug with class table management and two-way become. Because two-way become may do an in-place swap obj1 & obj2 in SpurMemoryManager>>doBecome:and:copyHash: may not be forwarded after the inner become. Hence they should not be followed if not forwarded. The bug manifested as Object's identityHash changing: superclass is the first slot in a class. Following an unforwarded subclass of object yields Object. Setting the hash bits of the followed object smashes Object's identityHash. Thanks to Stephane Rollandin for finding the bug. ------------------------------------------------------------------------ r3051 | eliot | 2014-07-22 09:38:54 -0700 (Tue, 22 Jul 2014) | 41 lines CogVM source as per VMMaker.oscog-eem.830 In the wake of the inlining change below, split lookupInMethodCacheSel:classTag: into it and inlineLookupInMethodCacheSel:classTag:, and use the inline version in internalFindNewMethod. Add vmParameter 52 to answer the capacity of the root table (in Spur a.k.a. the rememberedSet). Delete all the explicit initializing to nil in primitiveVMParameter since the array is instantiated normally (filled with nil). Spur: Add vm parameter 53 to answer the number of segments. Move the rememberedSet into a pinned object in oldSpace. Allow it to grow on demand, starting at 1k entries, doubling on each grow. Make sure to abort if the attempt to grow the remembered set fails. Try to grow by another 1k slots if doubling fails, then abort. Revise markAndTrace: given that markAndShouldScan: is inlined within it (see Slang changes below). Move the ephemeron processing into markAndShouldScan: out of the now unused numStringSlotsOf:ephemeronInactiveIf: circumlocution. Add activeAndDeferredScan: and numStrongSlotsOfInephemeral: in place of the double negative inactiveOrFailedToDeferScan: and hence inline numStrongSlotsOfInephemeral:. Increase the traceImmediatelySlotLimit. These changes plus the 2 repeats for compaction speed up global GC by at least x2. Change the defaultEdenBytes to 4Mb. Allow the number of compaction passes to vary, 2 on GC, 3 on GC for snapshot. Slang: Add support for inlining into the condition of ifTrue:/ifFalse: when it is marked as inline. Transform expr1 ifTrue:/ifFalse: [^expr2] by inlining ^expr2 into expr1. Transform expr ifTrue:/ifFalse: [statements] by replacing ^boolean occurrences in expr with gotos. ------------------------------------------------------------------------ r3048 | eliot | 2014-07-18 17:42:28 -0700 (Fri, 18 Jul 2014) | 22 lines CogVM source as per VMMaker.oscog-eem.826 Fix the ZipPlugin (InflatePlugin&DeflatePlugin) to no longer depend on specific instance sizes for ReadStream and WriteStream which allows some leniency in redefining these classes. Fixes occasionaly Monticello commit bugs with large packages after loading Collections-eem.567. Fix compilation warnings in stringForCString: Add a -warnpid flag that causes warning to print the pid; useful in debugging multi-image tests (i.e. magma). Spur: Fix bad bug in remapObj: that confused the test for old vs new and hence tried to copyAndForward old objects. Fix bug in processWeaklings that could remember a weak object twice. Misc: Nuke the sistasrc/plugins directory that was a symbolic link to src/plugins. We deal with this in the makefiles these days. ------------------------------------------------------------------------ r3047 | eliot | 2014-07-16 17:21:34 -0700 (Wed, 16 Jul 2014) | 5 lines CogVM source as per VMMaker.oscog-eem.824 Mark the methods used by SpurMemoryManager>>globalGarbageCollect as inline: #never for profiling. ------------------------------------------------------------------------ r3043 | eliot | 2014-07-16 13:07:09 -0700 (Wed, 16 Jul 2014) | 10 lines CogVm source as per VMMaker.oscog-eem.823 Reimplement the backward count in interpreted methods, storing the count in IFrameFlags, hence eliminating the requirement that the jump happens consecutively N times in just that method with no backward jumps in any other method. The Chameneos benchmark has this pattern and so two mehtods don't get jitted. This eliminates lastBackwardJumpMethod & backwardJumpCount. Add support for not inlining in gcc under optimization (for profiling). ------------------------------------------------------------------------ r3042 | eliot | 2014-07-16 11:49:18 -0700 (Wed, 16 Jul 2014) | 4 lines CogVM source as per VMMaker.oscog-eem.822 Initialize numIRCs before checking for quick prims. ------------------------------------------------------------------------ r3041 | eliot | 2014-07-15 12:11:00 -0700 (Tue, 15 Jul 2014) | 46 lines CogVM source as per VMMaker.oscog-eem.820 Put the handling of the cloning of cogged methods in the clone: implementations, removing it from the primitive. Add it to the pinning clone too. Specialize the store check trampoline generation. Move it down to the relevant object representations. Move setting of isRemembered flag to true into SpurGenerationScavenger>> remember:. Inline possibleRootStoreInto: (given that remember: is /not/ inlined. Call remember directly from the ceStoreCheckTrampoline, and hence have remember: answer its argument. Fix localization bug. Variables in initialize methods were not considered references (cuz there are excluded). This caused VMMaker.oscog-eem.816's extraction of zero/false vars to StackInterpreter>>#initialize to cause nextPollUsecs to be localized to checkForEventsMayContextSwitch:. Spur: Fix bug in scanClassPostBecome:effects: with new lazy selector following policy by... throwing it all away. The read barriers on method lookup (of the methodClass association in super sends, of the superclass link, of method dictionaries, method dictionary arrays, selectors and methods is cheap. So replace scanning classes and method dictionaries in the class table post become with read marriewrs on methodClass, superclass and method dictionary etc on lookup. The read barrier on an object from which we are going to fetch state (such as a class or method dictionary) is essentially free on modern machines because the class index and the state very likely share a cache line, and the register code for testing is so cheap compared to memory access. Further the read barrier on selectors is cheap because the method lookup cache is effective in reducing the number of message lookups and because nil entries need no check. So nuke all the followNecessaryForwardingInMethod: machinery including the cmUsesMethodClass hack. Nuke scanClassPostBecome:effects:. Rip out the forwardingCount: measurement code. It causes bad performance regressions (due to failing inlines?) Clean up, e.g. replace followNonImmediateField:ofObject: uses with followObjField:ofObject:. canPinObjects can be inlined. ------------------------------------------------------------------------ r3040 | eliot | 2014-07-11 10:25:27 -0700 (Fri, 11 Jul 2014) | 27 lines CogVm source as per VMMaker.oscog-eem.816 Include the Systemd socket support by Max Leske & Nik Lutz on Unix and Mac OS X. Spur: Fix bugs in clone:; allocateSlots:... may fail and cloning compiled methods still needs a store check. Fix become performance issue of following possibly becommed selectors by adding a read barrier to lookupMethodInDictionary: et al. This is much cheaper than following all dictionaries in the classTable post become. Control the policy with a class var in the hope that an efficient eager solution can be found. Add stats that count the causes of followForwardedObjectFields:toDepth: (used to track down the above issue). Make optional via a class var. Move stringForCString: from StackInterpreter to the object memories. Reposition ensureNoForwardedLiteralsIn: and replace cePositive32BitIntegerFor: with positive32BitIntegerFor:. Remove the assert check in isForwarded: to make sure it is inined. Make sure possibleRootStoreInto: is not inlined. StackInterpreter: Extract the vars initialized to zero or false to an initialize method from initializeInterpreter:. ------------------------------------------------------------------------ r3039 | eliot | 2014-07-09 12:37:09 -0700 (Wed, 09 Jul 2014) | 4 lines CogVM source as per VMMaker.oscog-eem.812 Fix bogus assert fail due to signedness. ------------------------------------------------------------------------ r3038 | eliot | 2014-07-09 12:14:36 -0700 (Wed, 09 Jul 2014) | 25 lines CogVM source as per VMMaker.oscog-eem.811 Spur: Fix bug in old space GC processing of weaklings. Old code didn't trace strong references in weaklings to weaklings in markWeaklingsAndMarkAndFireEphemerons. Make sure nilUnmarkedWeaklingSlotsIn: can be inlined. Bug shows up as crashes in Pharo Spur, Pharo making much more use of weakness than Squeak or Newspeak. Move the scanning for young references in scavenger processing of weaklings into processWeakSurvivor:. Fix minor slips in allObjects & allInstancesOf: which should only empty weaklingStack if marking. Fix a couple of storePointer:ofObject:'s being applied to objStacks. Rename isReallyForwarded: to isUnambiguouslyForwarder: and add an assert to isForwarded: to catch accidental applications to free objects. Fix longPrintOop: for free referents. Slang: Assign complex expressions to loop variables in value: expansions. Old code would replace variable with expansion of actual parameter everywhere. ------------------------------------------------------------------------ r3037 | eliot | 2014-07-08 18:16:16 -0700 (Tue, 08 Jul 2014) | 5 lines CogVM source as per VMMaker.oscog-eem.810 Spur: Fix bug in nilUnmarkedWeaklingSlotsIn: which was not guarding the isForwarded: check with an isFreeObject: not check. Premature optimizations... ------------------------------------------------------------------------ r3034 | eliot | 2014-07-07 14:05:51 -0700 (Mon, 07 Jul 2014) | 18 lines CogVM source as per VMMaker.oscog-eem.808 Change implementation of the implicit receiver trampoline to cache the class tag, not the class object (thanks Ryan). Has a significant impact on Newspeak Spur performance. Refactor getInlineCacheClassTagFrom:into: into genGetInlineCacheClassTagFrom:into:forEntry: and add inlineCacheTagForClass: to support this. Change the V3 inline cache check to not shift the compact class index (thanks Tim). Saves a byte and an instruction from the entry sequence on x86. Issue a prefetch for Sista counters after frame build. Make genSmallIntegerComparison:orDoubleComparison: observe hasDoublePrecisionFloatingPointSupport (for ARM). Finally rename ClassInteger to ClassSmallInteger. ------------------------------------------------------------------------ r3033 | eliot | 2014-07-06 10:42:23 -0700 (Sun, 06 Jul 2014) | 4 lines CogVM source as per VMMaker.oscog-eem.805 Oops. resetCountersIn: must of course be optional. ------------------------------------------------------------------------ r3032 | eliot | 2014-07-05 21:01:13 -0700 (Sat, 05 Jul 2014) | 31 lines CogVM source as per VMMaker.oscog-eem.804 Cogit: Change the management of counters in Sista methods to hold the counters well away from code. This restores the performance of the Sista VMs on x86, where when counters are close to code the writes to counters flush the instruction cache and destroy performance. In V3 use malloc to allocate and free them (this means Sista V3 is not currently simulable). In Spur, store them in oldSpace in pinned objects (hence Sista Spur simulates just fine). Split the enilopmarts into those that are used in the context of a call (entering code as if from a call) and those used in other contexts (converting interpreted method to machine code method in loops, returning from interpreter method to machine code one, etc). This fixes enilopmarts on RISCs (i.e. ARM) where the ret pc must be popped into the LinkReg when entering machine code as if from a call, but not when entering in other contexts (returning from inter- preter to machine-code method, converting interpreter method to machine code in a loop, etc). Nuke a couple of unused variables in Cogit hierarchy. Spur: Fix bug in allocateSlotsForPinningInOldSpace:bytes:format:classIndex: and make sure answered object is actually pinned. Hence fix pinObject: & primitivePin. Plugins: Fix access to the characterTable in the ThreadedFFIPlugins. Replace characterTable at: with characterObjectOf:, and in Spur support wide characters. Fix divide-as-shift issue in BalloonEnginePlugin. ------------------------------------------------------------------------ r3031 | eliot | 2014-07-03 06:49:59 -0700 (Thu, 03 Jul 2014) | 7 lines CogVM source as per VMMaker.oscog-eem.800 Sort VM methods by class first, selector second, to group by coarse functionality (e.g. scavenger methods) for the benefit of the VMProfiler. Access missOffset via a macro (very minor speedup). ------------------------------------------------------------------------ r3029 | eliot | 2014-07-02 19:52:10 -0700 (Wed, 02 Jul 2014) | 4 lines CogVM source as per VMMaker.oscog-eem.797 Nuke a halt from testing the simulator... ------------------------------------------------------------------------ r3028 | eliot | 2014-07-02 19:16:19 -0700 (Wed, 02 Jul 2014) | 13 lines CogVM source as per VMMaker.oscog-eem.796 Spur: Implement forwarder following on primitive failure for sideways calls from machine code. Fix LargeIntegersPlugin>>isNormalized: for forwarders, no longer assuming that if its arg isn't a SmallInteger it must be a large integer. Squash an assert fail in lengthOf:format: on forwarders by using numSlotsOfAny:. Make sure a forwarder has an accurate slot count, bumping it to 1 if it was zero. ------------------------------------------------------------------------ r3026 | eliot | 2014-07-02 15:44:11 -0700 (Wed, 02 Jul 2014) | 12 lines CogVM source as per VMMaker.oscog-eem.794 Fix the shift for divide issues in the LargeIntegersPlugin. Add code to generateDivide:on:indent: to spit out checking asserts if required. Change the SmartSyntaxPluginCodeGenerator to generate code that ifdefs out the remapOop:in: rigmarole on Spur. Fix inline cache for Characters in Spur. Update mksistaarchives for new build structure on Mac (only). ------------------------------------------------------------------------ r3025 | eliot | 2014-07-01 20:12:22 -0700 (Tue, 01 Jul 2014) | 6 lines CogVM source as per VMMaker.oscog-eem.792 Fix potential liveness of ReceiverResultReg across counting jumps by reloading ReceiverResultReg before returning from the trampoline through which ceCounterTripped: is called. ------------------------------------------------------------------------ r3024 | eliot | 2014-07-01 08:39:10 -0700 (Tue, 01 Jul 2014) | 7 lines CogVM source as per VMMaker.oscog-eem.791 Rescue non-Spur builds by making accessorDepthForPrimitiveIndex: a Spur option. Factor out the type machinery in generateShiftRight:on:indent: and use it to ensure generateSignedBitShift:on:indent: will not cast 64-bit vars to ints. ------------------------------------------------------------------------ r3023 | eliot | 2014-06-30 20:09:58 -0700 (Mon, 30 Jun 2014) | 46 lines CogVM source as per VMMaker.oscog-eem.790 Implement following forwarders on primitive failure in machine code interpreter primitives (still have to implement this in sideways calls of named primitives). Allow the JIT to not compile primitiveDoNamedPrimitiveWithArgs to avoid any potential complications. Rewrite all the semaphore installing primitives to fail if the semaphore arg is neither a semaphore or nil instead of assuming if its not a semaphore it must be nil, so as to fail and retry when semaphores are forwarded (as they are when Semaphore is redefined). Implement isSemaphoreOop:/Obj: in the object memories to abstract away the code. Base Spur's on the class index of splObj: ClassSemaphore, avoiding the table lookup to derive the class. Make checkForEventsMayContextSwitch: treat all its semaphores consistently. Have spur's fetchClassOfNonImm: answer nilObj for forwarders to avoid assert fails. On Spur add read barriers to primitiveSuspend and synchronousSignal:'s myList access, because the process list manipulation routines do no checking. Add assert checks for forwarders in the process list manipulation routines. Fix slip in StackInterpreter>>actuallyFollowNecessaryForwardingInMethod:literalCount: that corrupts the methodClassAssociation. Abstract out the call machinery from compileTrampolineFor:numArgs:arg:arg:arg:- arg:saveRegs:pushLinkReg:resultReg: so it can be used by maybeCompileRetry:onPrimitiveFail: in implementing following forwarders on primitive failure in machine code, and the Open PIC miss call. Have bytecodePCFor:cogMethod:startBcpc: map any pc before the stackCheckOffset to the initialPC, which applies to primitives in progress. Fix assert fails in updateStateOfSpouseContextForFrame:WithSP: and elsewhere with forwarders. LargeIntegers Plugin: Fix a latent signed shift bug in cDigitSub:len:with:len:into: caused by VMMaker.oscog-eem.785's eliminating the divide-via-shift optimization. These changes allow Cog Spur to redefine Process and/or Semaphore and not hang. ------------------------------------------------------------------------ r3021 | eliot | 2014-06-28 19:57:50 -0700 (Sat, 28 Jun 2014) | 38 lines CogVM source as per VMMaker.oscog-eem.787 Fix mixup of old & young spaces in primitiveVMParameter, and comment some new parameters. Fix return types for positive[64/32]BitValueOf:. positive32BitValueOf: must answer a usqInt, positive64BitValueOf: must answer a usqLong. Use positiveMachineIntegerValueOf: to decode arg in primitiveNewWithArg and ensure positiveMachineIntegerValueOf: is inlined there-in. Spur: Fix sign and overflow issues in instantiating larger objects and determining the size of large instances. Fix some freeChunk accesses that used fetchPointer:ofObject:. Cog ARM: Fix prim return for compileInterpreterPrimitive: on RISCs. On return from interpreter prim, ret pc is in instructionPointer and must return to whence it came, which is the stack on CISC and the LinkReg on RISC. Hence restoring the receiver reg requires different offsets in the two cases. Rework the rotatable quick constant logic a little and clean up users. Fix concretizeMoveRXbrR to do byte not word loads. Fix concretizeConditionalJumpLong: to actually be conditional. Oops. Correct mistaken callersaved reg stuff for ARM Fix concretizedRetN to not over-bump the SP The method abort trampolines shouldn't pop anything, especially now we have the pushLinkreg: arg to manage the LinkReg more easily. Slang: Rip out the UseRightShiftForDivide optimization. It gets unsigned division wrong, and C compilers can and will optimize this correctly themselves. ------------------------------------------------------------------------ r3020 | eliot | 2014-06-26 10:29:55 -0700 (Thu, 26 Jun 2014) | 4 lines Set the IMAGE_FILE_LARGE_ADDRESS_AWARE flag in the image header of the Windows executables to allow e.g. Spur to allocate more than 2Gb. Set more ignore props on win build dirs. ------------------------------------------------------------------------ r3018 | eliot | 2014-06-25 14:06:58 -0700 (Wed, 25 Jun 2014) | 2 lines Fix snafu with the linux vm Makefile; got to add sqUnixSpurMemory.o to the mix. ------------------------------------------------------------------------ r3017 | eliot | 2014-06-25 13:21:12 -0700 (Wed, 25 Jun 2014) | 9 lines Rewrite Spur memory allocation on win32 similarly to unix. Can now allocate up to 1.8Gb on Windows XP (which has a 2Gb address space limit). Add a flag to indicate if the win32 exe is running as a console app and don't write to the in-window console if so. Fix a slip in sqWin32VMProfile.c. Fix access to revisionAsString in sqUnixHeartbeat.c (it should include sqSCCSVersion.h) and revert revisionAsString to static. ------------------------------------------------------------------------ r3016 | eliot | 2014-06-24 11:38:36 -0700 (Tue, 24 Jun 2014) | 3 lines Further simplification in platforms/unix/vm/sqUnixSpurMemory.c. Fix snafu in platforms/unix/vm/sqUnixMemory.c. ------------------------------------------------------------------------ r3015 | eliot | 2014-06-24 10:30:28 -0700 (Tue, 24 Jun 2014) | 7 lines Rewrite platforms/unix/vm/sqUnixSpurMemory.c to stand alone. Use it in place of sqMacMemory.c with Spur on Mac OS. Now Spur can grow the heap to 2.9Gb on both linux (CentOS 5.3) and Mac OS X (10.6.8). Move the nuking of version.o from the xcodeproj (where it was inoperative) to the makevm scripts. ------------------------------------------------------------------------ r3014 | eliot | 2014-06-23 19:18:33 -0700 (Mon, 23 Jun 2014) | 12 lines CogVM source as per VMMaker.oscog-eem.779 Rewrite memory allocation on linux for Spur. Arrange that the heap can grow above 2Gb without any large initial alloc. Fix some sign issues with free space tallying to allow Spur to shrink memory and answer via primitiveVMParameter heap sizes above 2Gb. Add longPrintInstancesOf:/longPrintInstancesWithClassIndex: for debugging. Add missing build scripts for itimer heartbeat Spur linux VMs. ------------------------------------------------------------------------ r3012 | eliot | 2014-06-21 21:00:44 -0700 (Sat, 21 Jun 2014) | 4 lines Make the spur image bootstrap work on linux. Suggest reading a suitable README when the linux VM fails to spawn the heartbeat thread. Make revisionAsString global to assist. ------------------------------------------------------------------------ r3007 | eliot | 2014-06-19 14:12:57 -0700 (Thu, 19 Jun 2014) | 9 lines CogVM source as per VMMaker.oscog-eem.776 Add parameter 54 on Spur to answer totalFreeOldSpace. Add checks to unix sqAllocateMemorySegmentOfSizeAboveAllocatedSizeInto to avoid MAP_FIXED wiping out existing mappings. Fix the odd syntax error in the image scripts. ------------------------------------------------------------------------ r3006 | eliot | 2014-06-16 13:42:34 -0700 (Mon, 16 Jun 2014) | 21 lines CogVM source as per VMMaker.oscog-eem.775 Rationalize the allocation check filler between V3 ObjMem and Spur. Make it applicable only to plugin prims and optional, via the checkAllocFiller flag. Add a prim failure code for this, PrimErrWritePastObject. Make the Cogit check and fail offending ext prims if the flag is set. Don't fill new space with the alloc check filler if the flag is not set. Provide a -checkpluginwrites command line flag to turn on the check. This is good for a -49% increase in the performance of e.g. [1 to: 1000000000 do: [:i| {nil}]] timeToRun on Spur. Refactor numStrongSlotsOf:ephemeronInactiveIf: and inline it in scavengeReferentsOf:, reusing the object format for the isWeakling test. Provide numStrongSlotsOfWeakling: for weakling nilling, and hence arrange that the numStrongSlotsOf:ephemeronInactiveIf: is always non-nil. Reorganize the StackInterpreter classes when building a VMMaker image. ------------------------------------------------------------------------ r3003 | eliot | 2014-06-15 15:17:31 -0700 (Sun, 15 Jun 2014) | 14 lines CogVM source as per VMMaker.oscog-eem.774 Remember to regenerate the cogit.c's from the non-Spur configurations to fix the "relocating call to invalid address" bug. Add a hack to link the XDisplayControlPlugin against vm-display-X11 (a hack because it assumes paths etc). But at least the plugin works. Add an initial revision of platforms/unix/plugins/UUIDPlugin/acinclude.m4 to search for uuid.h in either /usr/include/uuid or /usr/include and use either uuidgenerate or uuidgen. Spur: Restore accuracy of followForwarded:'s comment back to Igor's original. ------------------------------------------------------------------------ r3000 | eliot | 2014-06-13 20:36:18 -0700 (Fri, 13 Jun 2014) | 2 lines Add libcrypto and libssl to Linux and Mac builds of the SqueakSSL plugin. ------------------------------------------------------------------------ r2999 | eliot | 2014-06-13 19:52:51 -0700 (Fri, 13 Jun 2014) | 36 lines CogVM source as per VMMaker.oscog-eem.772 Spur: Fix fillObj: signedness for objects straddling the mid- point of the address space (quickly affects linux). Similarly for routines in pigCompact, to get asserts correct. Fix printOopsFrom:to:. for objects up to endOfMemory. Nuke unused SpurMemMgr inst var var. Declare lastFreeChunk and firstFreeChunk correctly. Fix numberOfForwarders: and printForwarders: for isForwarded:'s blindness towards freeChunks. Comment isForwarded: to be clear on the issue. Have the segment manager pass to sqAllocateMemorySegmentOfSize: the address of the first large enough gap in the address space, instead of the address of the end of the first segment. This allows e.g. linux to use MAP_FIXED and hence get past a 128Mb limit on mmapping. Fix bugs in isValidFreeObject: & printFreeTreeChunk: that caused bogus assert failures. Cog: Fix an abort (relocating call to invalid address) ue to an over-zealous check in relocateCallBeforeReturnPC:by:. Since we relocate e.g. calls to primitives there can be no effective range check there-in. Generate the XDisplayControlPlugin with the Cog conf. Fix a typo in a selector. Buildland: Fix all uses of trap in scripts, all of which lines incorrectly ended with 0. Add convenience scripts that just make the VMs that are uploaded. ------------------------------------------------------------------------ r2997 | eliot | 2014-06-13 00:19:51 -0700 (Fri, 13 Jun 2014) | 6 lines Add the XDisplayControlPlugin and include it (external) and the AioPlugin (internal) to the linux x86 builds. Fix the linux stack plugins.int list (were those from newspeak by mistake). Pass on any arguments from the linux makeall, makeallclean & makealldirty scripts to mvm. ------------------------------------------------------------------------ r2994 | eliot | 2014-06-11 21:09:48 -0700 (Wed, 11 Jun 2014) | 6 lines Phhh... remember to include the Spur moniker in the -version output on linux (damn). Add scripts to download the r2897 Cog & Spur VMs. Make envvars.sh compute the OS OSREL and CPU. ------------------------------------------------------------------------ r2987 | eliot | 2014-06-11 14:26:16 -0700 (Wed, 11 Jun 2014) | 5 lines CogVM source as per VMMaker.oscog-eem.769 Spur: checkTraversableSortedFreeList needs to be called through assert; it is expensive. And fix signed comparison in loop in checkTraversableSortedFreeList. ------------------------------------------------------------------------ r2981 | eliot | 2014-06-11 08:25:46 -0700 (Wed, 11 Jun 2014) | 5 lines Fix the defines to exclude VM labels on win32. Add HowToBuild files for the flat win32 and macos32 builds and nuke theobsolete ones there-in. Add missing rc and ico files to some win32 newspeak builds. Roll the SCCS version, as I hope this is (finally!) ready for VM builds. ------------------------------------------------------------------------ r2980 | eliot | 2014-06-11 07:02:34 -0700 (Wed, 11 Jun 2014) | 2 lines ELiminate a couple of compiler warnings in the win32 build. ------------------------------------------------------------------------ r2973 | eliot | 2014-06-10 15:59:41 -0700 (Tue, 10 Jun 2014) | 6 lines CogVM source as per VMMaker.oscog-eem.767 Spur: fix some compilation warnings in the cointerp. Newspeak linux builds: fix the plugins argument to configure. ------------------------------------------------------------------------ r2957 | eliot | 2014-06-08 09:36:51 -0700 (Sun, 08 Jun 2014) | 4 lines Fix compilation of the FFI plugin on win32 (exclude ARMFFIPlugin.c) Fix ioFindExternalFunctionInAccessorDepthInto when there's no accessorDepthPtr. Add the new flat build structure for win32. ------------------------------------------------------------------------ r2955 | eliot | 2014-06-07 15:16:52 -0700 (Sat, 07 Jun 2014) | 20 lines CogVM source as per VMMaker.oscog-eem.766 Add convenience scripts to the build.linux32x86 buids to make all configs. Remove some compilation warnings in cogit.c. Correct some decls in genEnsureOopInRegNotForwarded:scratchReg: Add a pushLinkReg arg to the core trampoline generation routines. This is true everywhere but in the nonLocalReturn and checkForInterrupts trampolines, which on RISCs write the link reg, and on CISCs pop the ret pc to instructionPointer. Remove the callJumpBar: parameter; this is always true. Remember to save and restore the link register around the call to ceCheckProfileTick in the primitive return machinery. Streamline the genPrimReturnEnterCogCodeEnilopmart. Streamline genExternalizePointersForPrimitiveCall ------------------------------------------------------------------------ r2950 | eliot | 2014-06-06 15:23:16 -0700 (Fri, 06 Jun 2014) | 14 lines CogVM source as per VMMaker.oscog-eem.759. Move the MULTIPLEBYTECODESETS define into interp.h (in the Newspeak VMs) to move it out of the build scripts. Include the first cut at the new build directory structure for linux32. Add a sources directory for packaging and include the Squeak4.1 sources. Move the ALSA sources into it (these are only used in Terf linux builds). Factor the image scripts to pull out env var defs into envvars.sh and downloading Squeak 4.5 into getsqueak45.sh. ------------------------------------------------------------------------ r2945 | eliot | 2014-06-05 10:44:38 -0700 (Thu, 05 Jun 2014) | 5 lines CogVM source as per VMMaker.oscog-eem.757 Fix a stupid slip in genSpecialSelectorEqualsEquals. The constant evaluation must remember to pop the simulation stack before it pushes the boolean result. ------------------------------------------------------------------------ r2944 | eliot | 2014-06-04 17:45:11 -0700 (Wed, 04 Jun 2014) | 4 lines CogVM source as per VMMaker.oscog-eem.756. Remember to check-in the sista source. ------------------------------------------------------------------------ r2943 | eliot | 2014-06-04 17:33:44 -0700 (Wed, 04 Jun 2014) | 4 lines CogVM source as per VMMaker.oscog-eem.756 Oops. Need a null genEnsureOopInRegNotForwarded:scratchReg: for Squeak V3. ------------------------------------------------------------------------ r2941 | eliot | 2014-06-04 17:11:55 -0700 (Wed, 04 Jun 2014) | 27 lines CogVM source as per VMMaker.oscog-eem.755 Spur: Implement unforwarding in inlined machine code #==. Hence rewrite the /horrible/ StackToRegisterMappingCogit>>genSpecialSelectorEqualsEquals. Unforward method literals in cog:selector: to ensure that all examinations of constants in the Cogit are of the actual objects. Have StackToRegisterMappingCogit>>genPushReceiverBytecode use ReceiverResultReg if it contains self. Speed up isForwarded: test by using the fact that the isForwarded class pun is a power of two. Fix a slip in an assert in unlinkSolitaryFreeTreeNode:. Comment out the checkFreeSpace check in copyToOldSpace:bytes:format:. Make the assert check in Spur32BitCoMemoryManager>>freeStart: more lenient to avoid bogus assert fails from machine code allocations. Fix the abort sequence for RISCs. The assert check on the sendMissCall requires that sendMissCall means the sendMissCall. But on RISCs we must push the link reg before calling it. Hence we need a sendMiss label. ------------------------------------------------------------------------ r2939 | eliot | 2014-06-02 08:09:52 -0700 (Mon, 02 Jun 2014) | 5 lines CogVM source as per VMMaker.oscog-eem.747 In the indirection vector initialization peephole check that the store temp index matches the indirect temp store index and accept long store temp bytecodes. ------------------------------------------------------------------------ r2938 | eliot | 2014-06-01 18:11:49 -0700 (Sun, 01 Jun 2014) | 13 lines CogVM source as per VMMaker.oscog-eem.746 Implement a peephole in the Spur Cogit for an indirection vector initialized with a single value Avoid initializing the slot in the array to nil and instead initialize it with the value. Refactor setting byte1, byte2 & byte3 into loadSubsequentBytesForDescriptor:at: for the peephole tryCollapseTempVectorInitializationOfSize:. No longer inline CoInterpreter>>pre/postGCAction: for VM profiling. Increase the number of trampoline table slots. ------------------------------------------------------------------------ r2937 | eliot | 2014-06-01 12:43:14 -0700 (Sun, 01 Jun 2014) | 5 lines CogVM source as per VMMaker.oscog-eem.745 In Spur refactor closure creation in the Cogit to not flush copied values to the stack, assigning them direct to the closure. Generates much more compact code. ------------------------------------------------------------------------ r2936 | eliot | 2014-06-01 10:18:37 -0700 (Sun, 01 Jun 2014) | 12 lines CogVM source as per VMMaker.oscog-eem.743 Refactor closure creation in the Cogit to move it into the object representations. In Spur allocate and initialize the closure inline. In Spur make sure to always use unsigned comparisons for allocation against scavenge threshold. Fix bugs in Spur object representation's context creation trampolines. Source and destination offsets for args were wrong. Destination offset for temps was wrong. Loop comparisons were wrong way round (CmpR:R: is weird). ------------------------------------------------------------------------ r2935 | eliot | 2014-05-31 22:32:34 -0700 (Sat, 31 May 2014) | 21 lines CogVM source as per VMMaker.oscog-eem.742 Refactor context creation in the Cogit, moving it to the object representations. In Spur allocate the context in one of four trampolines for block vs method and large vs small contexts. Refactor ceCreateNewArray & cePositive32BitInteger trampolines, moving them into the object representations as required (cePositive32BitInteger is only used in the Squeak obj rep). In the Spur obj rep inline allocation in pushNewArray bytecodes. Fix regression in primitiveUtcWithOffset, answer the correct local time offset. Fix code generation for ThreadedFFIPlugin by ensuring that target directory exists, addressing failures in http://build.squeak.org/job/CogVM/ code generation test. Fix ioSecondsNow to use the time now, not the heartbeat time. Fix initialization in the VM Simulation Workspace. ------------------------------------------------------------------------ r2933 | eliot | 2014-05-28 18:02:01 -0700 (Wed, 28 May 2014) | 34 lines CogVM source as per VMMaker.oscog-eem.735 Spur: Fix management of lastFreeChunk during compaction (in sweepToCoallesceFreeSpaceForPigCompactFrom: and freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact). lastFreeChunk's link was not being correctly terminated. Add asserts to chunk freers to check for free chunks overlapping, which caught the compaction bug. Make sure that endOfMemory is immediately below the last bridge. This is where it was set when adding a new segment, but on loading a snapshot it was mispositioned at the end of the last bridge. Add a check to checkSegments, and use it in a few more places. Eliminate bogus assert in sortedFreeListPairwiseReverseDo:. If free gets used then lastFreeChunk won't point to it any more. Nuke obsolete method (from old non-repeating compact). Cogit: Correct link register usage in various places. e.g. enilopmarts, checkForInterrupts trampoline. But especially, correct link register usage in the return sequence generators. Since Tim and I agree that RetN: returns to the LinkReg, and no longer pops the return address from the stack, genUpArrowReturn and genReturnTopFromBlock must explicitly pop the saved return address into LinkReg before RetN:. That means that all the RetN:'s in machine code primitives will do the right thing, allowing these to avoid pushing LinkReg on entry. Frame print: fix a typo. ------------------------------------------------------------------------ r2932 | eliot | 2014-05-28 08:19:56 -0700 (Wed, 28 May 2014) | 15 lines CogVM source as per VMMaker.oscog-eem.734 Spur: Fix bug in sortedFreeListPairwiseReverseDo:. Post block evaluation, free cannot be relied upon, so reconstruct the position in the enumeration from prevPrevFree and prevFree before moving on. Cogit: Make sure genMethodAbortTrampolineFor: has the same linkRegister code as genMethodAbortTrampoline. VMMaker: Add Timothy's CMake VMMaker build scripts to the image directory. ------------------------------------------------------------------------ r2931 | eliot | 2014-05-26 13:28:22 -0700 (Mon, 26 May 2014) | 3 lines Type the memory allocators as accepting and answering usqInts to give a chance at allocating more than 2Gb. ------------------------------------------------------------------------ r2930 | eliot | 2014-05-26 12:55:25 -0700 (Mon, 26 May 2014) | 43 lines CogVM source as per VMMaker.oscog-eem.733 Use unsigned comparisons when testing if there's sufficient heap space in readImageFromFile:HeapSize:StartingAt:. Leads to accurate failure message when failing to allocate large heap. Add an assert to check that all weaklinks are accessible (but the bug has already been found with the nextCorpse encoding bug). Spur: Implement primitives to get (primitiveIsPinned) and (un)set (primitivePin) per-object pinning. Fix traversal in sortedFreeListPairwiseReverseDo: when there is only one element in the sorted free list. Weak containers and ephemerons in new space must be processed after all strongly reachable objects have been scavenged. So when the scavenger reaches a weak container or ephemeron it copies it to future space, leaving behind a forwarding pointer in the corpse, but it does not yet scavenge its contents. The corpse is used to construct the list of scavenged weak/ephemeral objects. The corpse's forwarding pointer is already taken to point to the survivor. Instead, the list is constructed by having a list head variable, and linking the list through a value stored in some of the corpse's unused header fields (format & identityHash). 0 marks the end of the list. Of course this doesn't work if an object is the first object in newSpace as this offset will be computed to be zero, improperly teminating the list! Fix this by adding one to the corpse offset and substracting 1 when decoding. Implement a simple policy to deal with the fact that typically heap growth happens during tenuring, not after a failed allocation. If, after scavenging, the heap has grown by some factor of its size at the previous global GC, do a global GC. Default the factor to 0.333333. Provide VM parameter access to this value: 55 ratio of growth and image size at or above which a GC will be performed post scavenge Add a printFreeChunks debugging utility that sweeps through memory instead of traversing the free lists. Add a Newspeak linux Spur Cog build. ------------------------------------------------------------------------ r2928 | eliot | 2014-05-21 12:18:13 -0700 (Wed, 21 May 2014) | 6 lines CogVM source as per VMMaker.oscog-eem.730 Spur: Implement memory shrinkage. Check free space around SpurSegmentManager prepareForSnapshot & postSnapshot. ------------------------------------------------------------------------ r2927 | eliot | 2014-05-20 15:55:52 -0700 (Tue, 20 May 2014) | 6 lines CogVM source as per VMMaker.oscog-eem.727 Spur: Fix assert regression in allInstances/allObject from introducing MarkObjectsForEnumerationPrimitives=false ------------------------------------------------------------------------ r2926 | eliot | 2014-05-20 15:03:26 -0700 (Tue, 20 May 2014) | 5 lines CogVM source as per VMMaker.oscog-eem.726 Now Spur's object representation implements genInnerPrimitiveMirrorNew[WithArg]: we need defaults for the generic object representation in the Newspeak Cog VM. ------------------------------------------------------------------------ r2925 | eliot | 2014-05-20 14:28:29 -0700 (Tue, 20 May 2014) | 10 lines CogVM source as per VMMaker.oscog-eem.724 Slang/general: VMBIGENDIAN must *not* be defined during generation. It should be taken from platforms/??/vm/sqConfig.h. This should help fix Doug's issues on PPC. Spur: Don't mark on allInstances/allObjects. Use a class var to mark the choice so we can turn it back on if desired. ------------------------------------------------------------------------ r2922 | eliot | 2014-05-19 19:14:03 -0700 (Mon, 19 May 2014) | 46 lines CogVM source as per VMMaker.oscog-eem.723. Alphabetise protocols in Cog & VMMaker in the image build script. Leave it up to VMClass class>>initialize to add the useful expressions to the do... menu. Cogit: Refactor the code around pushing register arguments and switching between the Smalltalk and C stacks, moving the actual generators into backEnd (the special instance of the relevant CogAbstractInstruction subclass) . This allows CogARMInstruction to handle pushing the register args and hence handle the difference of having a link reg. Combine genSaveStackPointers & genLoadCStackPointers into Cogit>>genSmalltalkToCStackSwitch. Newspeak Spur: Provide machine code primitives for instantiateFixedClass: (a.k.a. a 1 arg basicNew) and instantiateVariableClass:withSize: (a.k.a. a 2 arg basicNew:). Spur: Make the MirrorNew prims option: #NewspeakVM Split the check heap loop between newSpace and oldSpace to improve leak map checking performance a little. Fix the assert in checkForAndFollowForwardedPrimitiveState and add support for primitive 218, primitiveDoNamedPrimitiveWithArgs. Nuke old fit compact code. Nuke unused inst vars (lastSubdividedFreeChunk, highestObjects). Update SpurMemoryManager class comment. Make compact update statCompactPassCount. Check free space after rebuildFreeListsForPigCompact. Slang: In non-production VMs add an attribute to disable register parameters (at least for GCC-compliant compilers), allowing all static functions to be called from gdb even in the -O1 assert VMs. Misc: Fix str:n:cmp: usage in printOopShortInner:. ------------------------------------------------------------------------ r2920 | eliot | 2014-05-10 08:56:23 -0700 (Sat, 10 May 2014) | 8 lines CogVM source as per VMMaker.oscog-eem.715 Get rid of the stupid validate macro hack. Fix the regression introduced by VMMaker.oscog-eem.709. When "adding" a method marked make sure that any inherited version of the method is removed. The old code also removed methods that weren't inherited. ------------------------------------------------------------------------ r2919 | eliot | 2014-05-10 08:08:04 -0700 (Sat, 10 May 2014) | 3 lines Correct syntax of inline assembler for byte and word swap operations in win32 16-bit displays. Thanks to Nicolai Hess! ------------------------------------------------------------------------ r2918 | eliot | 2014-05-10 07:57:27 -0700 (Sat, 10 May 2014) | 31 lines CogVM source as per VMMaker.oscog-eem.712 Spur: Revise pigCompact to maintain the doubly-linked free list after sweepToCoallesceFreeSpaceForPigCompactFrom:. This means pigCompact can now be repeated. Repeat pigCompact 3 times, which appears to compact well. This needs lots of profiling!! Move running of leak checker (which computes the leak map) to markObjects from clients and hence cure assert failures during GC in the Cogit. Revise unmarking and mapping during eliminateAndFreeForwardersForPigCompact. Instead of a scavenge merely mapInterpreterOops and explicitly (via added) unmarkSurvivingObjectsForPigCompact. Fix slip in fUOASACFSFPC. Fix remapObj: to not copyAndForward: unless a scavenge is in progress. Fix the assert fail on pigCompact. Since pastSpace is not voided, pastSpace must be swept to follow forwarders. Refactor mapMachineCode to mapMachineCode: theGCMode and hence call mapMachineCode: GCModeFull in eliminateAndFreeForwardersFor[Fit|Pig]Compact. With these changes the Newspeak bootstrap completes on the NS Spur Cog VM. General: Rename checkValidObjectReference: et al to checkValidOopReference: et al (since that's what they check) and add checkValidObjectReference: to check just that. ------------------------------------------------------------------------ r2917 | eliot | 2014-05-06 21:38:16 -0700 (Tue, 06 May 2014) | 42 lines CogVM source as per VMMaker.oscog-eem.706 ARM FFI: Fix bug in passing structure argument in the case where a struct would normally be split between registers and stack, but because of prior coprocessor register candidiate args having been pushed on the stack, the structure should not be split but pushed entirely on the stack. Spur: Fix the coallescing sweep in pig compact to start from the lowest of the first forwarder or the first free chunk. Do a tenuring scavenge to void eden in freeUnmarkedObjectsAndSortAndCoalesce- FreeSpaceForPigCompact to avoid any tenuring due to futureSpace overflow in the unmarking scavenge in eliminateAndFreeForwardersForPigCompact. Do this by adding the MarkOnTenure tenuring criterion. Change the use of shouldBeTenured: to allow it to be inlined into copyAndForward:. Add an assert to freeChunkWithBytes:at: to catch accidental freeing of non-oldSpace. Refactor SpurSegmentManager>>postSnapshot to not fall foul of this new assert. Add a check to totalFreeListBytes to catch double freeing (double freeing was caused by tenuring in the eAFFFPC scavenge growing memory to make room for tenuring, given free lists are not rebuilt at this point, and later in eAFFFPC this memory being freed again). Don't inline doScavenge: or scavengingGCTenuringIf:. Refactor eliminateAndFreeForwardersForFitCompact to extract the large loops. Add printForwarders for debugging. With these changes the StackInterpreter runs the Newspeak bootstrap to completion, albeit with one presumably bogus assert fail to do with a DependentsArray referring to forwarder contents. Cogit: Fix a double free bug in unlinkSendsOf:isMNUSelector:. Harmless cuz the result is only a bogus count of how many methods freed. Beef up the cog method integrity check to verify a its methodObject is a CompiledMethod. Plugins: Regenerate some that contain formatting changes due to VMMaker.oscog-eem.702/701. ------------------------------------------------------------------------ r2915 | eliot | 2014-05-04 17:52:47 -0700 (Sun, 04 May 2014) | 4 lines CogVM source as per VMMaker.oscog-eem.704. Fix compilation warnings re compaction memcpy calls. Fix stack backtrace printing when frameCallerContext is forwarded. ------------------------------------------------------------------------ r2914 | eliot | 2014-05-04 09:34:55 -0700 (Sun, 04 May 2014) | 7 lines CogVM source as per VMMaker.oscog-eem.702 Oops! Correct the collapsed generateWhile:loop:on:indent: which was missing the not operation. IIABDFI :-( And regenerate the plugins affected by the recent conditional indenting fix. ------------------------------------------------------------------------ r2913 | eliot | 2014-05-04 08:29:20 -0700 (Sun, 04 May 2014) | 21 lines CogVM source as per VMMaker.oscog-eem.701 Spur: Fix bug in generated C for pigCompact. If "free" is unsigned then "free - self allocationUnit" is large when free is zero, so move subtraction to addition on other side of the comparison. Fix a mis-write/typo bug in moveARunOfObjectsStartingAt:upTo:. Make sure all pointer comparisons in pigCompact are unsigned. Add forwardUnchecked:to: and use it to avoid the unnecessary store check in forwarding during compaction. Correct the return type of bytesInObject: to sqInt. Looking good. Snapshots are small at last. Slang: Fix indenting in while loops and sequential and and or exprs. ------------------------------------------------------------------------ r2912 | eliot | 2014-05-02 16:26:05 -0700 (Fri, 02 May 2014) | 10 lines CogVM source as per VMMaker.oscog-eem.699 VM: Fix instantiation of large non-byte objects. The old code for sufficientSpaceToInstantiate:indexableSize: stupidly subtracted BytesPerWord instead of ShiftForWord from LongSizeNumBits in determining the max size (mea culpa). Slang: fix indent of expressions in do whiles. ------------------------------------------------------------------------ r2911 | eliot | 2014-05-01 11:40:52 -0700 (Thu, 01 May 2014) | 12 lines CogVM source as per VMMaker.oscog-eem.696 Slang: Fix generation of expressions in while forever with break and do while loops. Hence rescue compilability of Spur VMs. Spur: Remove redundant test from moveARunOfObjectsStartingAt:upTo: Rename the 64-bit accessors in sqMemoryAccess.h from longLongAt... to long64At... to reflect the change in the Spur hierarchy. ------------------------------------------------------------------------ r2910 | eliot | 2014-05-01 10:16:01 -0700 (Thu, 01 May 2014) | 53 lines CogVM source as per VMMaker.oscog-eem.695 VMMaker image: Don't file-in patches in the trunk image fixed in trunk. Add an expression to output one or more plugins to the Workspace. VM: Use the option: approach to organize the numRegArgs implementations, which allows inlining and the necessary dead code elimination in CoInterpreter to avoid implementing the register enilopmarts in SimpleStackBasedCogit. Hence fix regression in inlining numRegArgs in CoInterpreter. Fix slip bug in ObjectMemory>>isContextHeader: externalSetStackPageAndPointersForSuspendedContextOfProcess: must be marked to be reliably inlined in transferTo:/transfer:to: et al. Fix the return type of convertToMachineCodeFrame:bcpc: to match the change to answer the absolute pc, not the relative pc of the backward jump done in VMMaker.oscog-eem.674. Fix a slip and a bug in printObjectsFrom:to: Cogit: Add inline pragmas to the concretize methods that were lacking them. Spur: Implement "pig compact", a much more functional compaction algorithm that works by doubly-linking free chunks in address order, therefore allowing e.g. easy enumeration of the objects between the penultimate and ultimate free chunks. Hence the algorithm moves all the objects it can at the end of memory to free chunks at lower addresses. It is piggish for several reasons: 1. it is greedy, using parts of a free chunk, not looking for a best or perfect fit. 2. it is greedy trying to move a run of objects at a time 3. it deals with large objects ("pigs") by searching the free list for a free chunk large enough to hold the pig. (and what constitutes a pig remains to be tuned; currently it is 8 * the average object size. Write the totalFreeOldSpace to the image header immediately following the size of the first segment. This to allow better determination of how much free space to allocate on startup. Use cCode:inSmalltalk: to encapsulate the printing of the gc stages, and delete the overrides in the simulator subclasses. Make sure the last bridge is marked to simplify coallesceFreeChunk: Rename averageObjectSize to averageObjectSizeInBytes. Add printOopsFrom:to: ------------------------------------------------------------------------ r2908 | eliot | 2014-04-29 13:37:34 -0700 (Tue, 29 Apr 2014) | 11 lines CogVM source as per VMMaker.oscog-djm.688 ARM32FFIPlugin: Change dummyFloatFunction to loadFloatRegs since it is a better name. Define this function elsewhere (platforms/Cross/plugins/SqueakFFIPrims/sqFFIPlugin.c) so that the C optimizer cannot optimize it away. This fixes a problem when calling out to functions taking float parameters when compiling with optimization level > 0. VMMaker image: Add an expression to the workspace to generate plugins. ------------------------------------------------------------------------ r2906 | eliot | 2014-04-28 16:39:31 -0700 (Mon, 28 Apr 2014) | 7 lines sqUnixX11.c: Include the right X11 include file to pull in the def for XK_equal (keysym.h vs keysymdef.h). Don't define BytesPerOop or BaseHeaderSize; these should be taken from interp.h. Add the XDisplayControlPlugin to the plugins loaded by the image build script. ------------------------------------------------------------------------ r2905 | eliot | 2014-04-28 12:25:13 -0700 (Mon, 28 Apr 2014) | 7 lines CogVM source as per VMMaker.oscog-eem.686. Fix the module name in ThreadedFFIPlugin. It needs to answer the generic name (SqueakFFIPrims), not the specific platform name (e.g. IA32FFIPlugin) under which each plugin is generated. ------------------------------------------------------------------------ r2904 | eliot | 2014-04-24 14:29:08 -0700 (Thu, 24 Apr 2014) | 4 lines Integrate Philippe Back's fix for numberic keypads on X11; see https://pharo.fogbugz.com/f/cases/11352/. Add relevant lines for the Raspberry Pi to the squeak startup script. ------------------------------------------------------------------------ r2894 | eliot | 2014-04-14 15:32:11 -0700 (Mon, 14 Apr 2014) | 20 lines CogVM source as per VMMaker.oscog-eem.674 Deal with the pc ambiguity of conditional branches followed by backward branches (conditional branches map to the following pc, backward branches to themselves) by providing and using mcPCForBackwardBranch:startBcpc:in: when converting interpreted frames containing loops to machine code frames. This eliminates a bogus mustBeBoolean when converting interpreter loops in Sista. Change mcPCFor[BackwardBranch]:startBcpc:in: to answer the absolute mcpc (as was commented) rather than the relative mcpc. This requires a 5-argument perform in mapFor:bcpc:performUntil:arg:. Refactor to add an isBackwardBranch argument to the function perfomed in all clients. For performance, specify that mapFor:[bcpc:]performUntil:arg: are inlined, eliminating the perform/indirect function call. This adds of the order of 3% to the size of a cogit.o's text seg so is acceptable. Fix a bug in printing frame flags (order was the wrong way around). ------------------------------------------------------------------------ r2893 | eliot | 2014-04-11 12:55:48 -0700 (Fri, 11 Apr 2014) | 9 lines CogVM source as per VMMaker.oscog-eem.673 Sista: We cannot back-up the machine-code pc in ceCounterTripped: because there isn't always a send preceeding the jump (e.g. in and: [] and or: [] chains). Instead, prevent subsequent counter trips (to reduce the number of necessary skipBackBeforeJump sends in the image) by nilling out SelectorCounterTripped. The image-level optimization code will both restore the selector and back-up the pc. ------------------------------------------------------------------------ r2892 | eliot | 2014-04-11 11:50:26 -0700 (Fri, 11 Apr 2014) | 5 lines CogVM source as per VMMaker.oscog-eem.672 Implement the new Spur interpreterProxy API for ObjectMemory (of course pinObject: fails, and isCharacterValue: has a smaller range). ------------------------------------------------------------------------ r2891 | eliot | 2014-04-10 11:41:54 -0700 (Thu, 10 Apr 2014) | 10 lines CogVM source as per VMMaker.oscog-eem.671 Sista: Revise counter tripping so that ceCounterTripped: repositions the context's pc after the send preceeding the conditional branch, instead of it being done by slower Smalltalk code (skipBackAfterJump which for convenience may parse from the beginning of the method). Make sure findUnofficialFiles looks in the sista dirs. ------------------------------------------------------------------------ r2890 | eliot | 2014-04-09 12:32:17 -0700 (Wed, 09 Apr 2014) | 33 lines CogVM source as per VMMaker.oscog-eem.670 CoInterpreter: Garbage collect/remap the primTraceLog correctly. If a GC happens very early in start-up the log circular buffer may not be full and the existing code assumed it always was. Cogit: Fix bug in unlinkSendsOf:isMNUSelector: (primitiveFlushCacheBySelector) where old code could free the method of an active frame. Fix an assert fail in mapFor:bcpc:performUntil:arg: (this for primitiveClass where the class table reference can be the first map entry). Newspeak: Fix a bug in remapIfObjectRef:pc:hasYoung: with dynamic super sends which could compute an invalid target method. Rename pushExplicitOuterSendReceiverBytecode et al to pushExplicitOuterReceiverBytecode et al. These are not sends. Sista: Cope with doubleExtendedDoAnythingBytecodes which /may/ be sends or not, and hence are problematic for gathering send data. Generate correct counting code for #==, which implies it can't be frameless in Sista. Annotate the right address (the return address of the ceMustBeBooleanFoo call) in counting genJump:if:. Add Spur support for Sista (shorten:toIndexableSize: et al). Implement instantiation in picDataFor:into: in terms of eeInstantiateClassIndex:format:numSlots:. ------------------------------------------------------------------------ r2889 | eliot | 2014-04-04 16:23:49 -0700 (Fri, 04 Apr 2014) | 14 lines CogVM source as per VMMaker.oscog-eem.666; devilishly good ;) Sista: Fix several bugs in the primitiveSistaMethodPICAndCounterData primitive. Fix consistency between monomorphic and polymorphic send tuples, always answering pc, class, method/selector. Fix collecting data from PICs with MNU cases. Remove a stray halt. Make sure primitive fail points return. not continue on. Eliminate dead conditional branch elimination so that the send and branch data collection is not confused by branches for which no counting code was produced. Cogit: since the annotation arg is no longer used, refactor targetMethodAndSendTableFor:annotation:into: to targetMethodAndSendTableFor:into: ------------------------------------------------------------------------ r2888 | eliot | 2014-04-03 17:20:08 -0700 (Thu, 03 Apr 2014) | 12 lines CogVM source as per VMMaker.oscog-eem.665 Sista: Not understanding what I'm doing has caused confusion and delay. The return from ceCounterTripped: should indeed jump to the retry of the first counter decrement. But the result comes in through cResultRegister, which may be the same as TempReg which the code uses to hold the boolean tbeing tested. So TempReg should /not/ be reloaded with ReceiverResultReg. Remember to count the untaken branch in inlined special selector comparisons. ------------------------------------------------------------------------ r2887 | eliot | 2014-04-02 19:28:25 -0700 (Wed, 02 Apr 2014) | 13 lines CogVM source as per VMMaker.oscog-eem.663 Fix pc-mapping for NewspeakV4. Dynamic super sends should /not/ be annotated with IsNSSendCall, but wth the vanilla IsSendCall. This fixes a bug converting an interpreter activation of a method with a loop and a duynamic super send to a machine code frame. Sista: Add sistasrc & sistamacbuild. It's time ;-). Reload TempReg from ReceiverResultReg on return from counter trip, so that branch retry tests the right value. Add a primitive to reset branch counters in a method. ------------------------------------------------------------------------ r2886 | eliot | 2014-03-28 16:11:48 -0700 (Fri, 28 Mar 2014) | 2 lines Use pthread_atfork to reinstall the heartbeat thread post fork. ------------------------------------------------------------------------ r2885 | eliot | 2014-03-28 12:19:16 -0700 (Fri, 28 Mar 2014) | 16 lines CogVM source as per VMMaker.oscog-eem.659 Allow vmParameterAt: 26 put: 0 to disable the heartbeat itimer. Fix compilation warnings in cogit.c by moving callerSavedRegMask up to Cogit.c, accessing it in CogObjectRepresentation store check via a macro and eliminating the hideous copying of the backEnd variable (whose removal in CogObjectRepresentation was losing its type decl in Cog class>>declareCVarsIn:). Make primitivePathToUsing work on Spur also. Add ImmX11Plugin to generated plugins (but not to builds). Addmissing SA_ONSTACK to itimer sigaction in sqUnixITimerTickerHeartbeat.c. ------------------------------------------------------------------------ r2883 | eliot | 2014-03-24 17:48:45 -0700 (Mon, 24 Mar 2014) | 32 lines CogVM source as per VMMaker.oscog-eem.656 Fix store check call from machine code which in Spur was showing that ClassReg (%ecx, a caller-saved reg) was not being saved when calling ceStoreCheck:. This /could/ be the cause of crashes in the clang build (or at least one major cause). It didn't show in the classic VM because the store check is simpler. Provide __stringify[Num] even when NDEBUG=1 for manual hacking in of warnings. Fix revertIfEssentiallyUnchanged for OSProcess plugins. A few plugins have been regenerated with the new array literal index prefixes. Spur: Ugh, what a bug hunt. Move the expungeDuplicateAndUnmarkedClasses: send from markObjects to globalGarbageCollect where it belongs and hence prevent allObjects and allInstancesOf from breaking the class table. Rationalize all but one of the various sends of runLeakCheckerForFullGC:exclude- UnmarkedNewSpaceObjs:classIndicesShouldBeValid: to runLeakCheckerForFullGC: Streamline copyAndForward: and forward[Survivor]:to: and clients of setFormatOf:to: & setClassIndexOf:to:. Fix copyAndForward: to add tenured objects to weak and ephemeron lists if required. Because the weak and ephemeron lists are threaded through forwarding corpses they can indeed refer to old objects, and just cuz a weak/ewphemeron object is tenured doesn't mean it doesn't need to be scanned post-scavenge. Relax the leak-check in Spur fullGC to allow invalid class indices at any point except after fullGC, at which point the classTable should have been purged. ------------------------------------------------------------------------ r2882 | eliot | 2014-03-20 10:01:24 -0700 (Thu, 20 Mar 2014) | 50 lines CogVM Spur sources as per VMMaker.oscog-eem.652. Add AioPlugin to Mac VMs. Delete and ignore all the xcodeproject mode and pbxuser files. Implement whereIs: to provide better debugging of weak containers. Allow inlining when parameters include structure accessors for e.g. isInFutureSpace: in whereIsMaybeHeapThing:. Print (nil) next to the selector for cog methods with a nil selector. Fix inferring types assigned from the kernel selectors, and hence correctly evaluate testBecome in Spur. Fix primitiveArrayBecome (the two-way become); it should /not/ specify copyHash. ObjectMemory ignores the copyHash flag when doing a two-way become, hence the wrong sense of the flag had no effect. Hence in Spur correctly evaluate testBecomeIdentityHash. Make CoInterpreter>>printFrame: not mislead as to the number of temps in a block activation. Rationalize signed[32|64]BitIntegerFor:. Fix odd bytes calculation in Spur>>allocateBytes:classIndex:. Rewrite checkIfValidObjectRefAndTarget:pc:cogMethod: to use the new accessors, but the assert for a cacheTag is still wrong for Spur. Spur: Prune youngReferrers amd flush icache after freeUnmarkedMachineCode. Protect byteSizeOfInstanceOf:withIndexableSlots: against integer overflow. Fix nilling of weak fields in old space. The old space GC must follow forwarders just as the scavenger does. Fix class table management for two-way become of classes when one has a hash and the other doesn't. Prune young referrers in followForwardedMethods. Avoid remembering bit objects in inPlaceBecome:and:copyHashFlag:. Fix method access for assert in followForwardedFrameContents:stackPointer: Refactor the Spur leak checker so that references to garbage-collected classes are tolerated mid-way through GC but not before or after. ------------------------------------------------------------------------ r2881 | eliot | 2014-03-13 17:45:37 -0700 (Thu, 13 Mar 2014) | 8 lines CogVM source as per VMMaker.oscog-eem.641 Spur: Revise interface between GC and machine-code for Spur's ephemerons. We can't mark and free in a single pass with ephemerons because a machine-code method reachable only from the stack could refer to something referred to from an ephemeron. So all machine code must be marked before freeing. ------------------------------------------------------------------------ r2880 | eliot | 2014-03-13 15:38:52 -0700 (Thu, 13 Mar 2014) | 18 lines CogVM source as per VMMaker.oscog-eem.640 Author: eem Time: 13 March 2014, 3:29:13.957 pm UUID: b52d099d-350b-40ce-8ef3-0bbf96ca7539 Ancestors: VMMaker.oscog-eem.639 Now that Slang inline block support is better rewrite the machine-code scanning routines to use two new control structures, offsetCacheTagAndCouldBeObjectAt:annotation:into: & targetMethodAndSendTableFor:annotation:into:. Hence eliminate all the duplication between Newspeak and Squeak in the scanning routines, such as markNSYoungObjects:pc:method:. Inline methodAfter: & roundUpLength: (the latter via a macro, sigh). Spur: Update primitiveSizeInBytesOfInstance to work with CompiledMethods. ------------------------------------------------------------------------ r2879 | eliot | 2014-03-13 10:26:37 -0700 (Thu, 13 Mar 2014) | 2 lines Eliminate the annoying error message from sqMakeMemoryNotExecutableFromTo ------------------------------------------------------------------------ r2877 | eliot | 2014-03-11 19:12:10 -0700 (Tue, 11 Mar 2014) | 24 lines CogVM source as per VMMaker.oscog-eem.638 Add primitiveAllInstances and modify primitiveAllObjects so that both will grow memory to guarantee their results. Modify Objectmemory/SpurMemoryManager>>allObjects & allInstancesOf: to answer the count of objects when they run out of space so that the primitives can grow and retry. Change the time primtiives to access the time now, not the time as updated by the heartbeat (but /don't/ change the time basis for event checking. This for performance because use of gettimeofday in e.g. stack overflow can be a signficant performance overhead. Move the simulated time implementations (ioSeconds et al) up to StackInterpreter to reduce duplication. Add ioSecondsNow et al to the platform code to support this. Spur: Assert that the markStack and weaklingStack are empty at system startup and at start of GC (allInstancesOf: et al went though a buggy phase where weaklingStack was left full). Fix assert in popObjStack: now that isValidObjStack: checks slots in hiddenRootsObj. ------------------------------------------------------------------------ r2876 | eliot | 2014-03-10 16:54:08 -0700 (Mon, 10 Mar 2014) | 5 lines CogVm source as per VMMaker.oscog-eem.637 Fix genSmallIntegerComparison:orDoubleComparison: (which lies behind SmallInteger>>#= primitive 6) for Spur which has immediate Characters. ------------------------------------------------------------------------ r2875 | eliot | 2014-03-10 13:26:23 -0700 (Mon, 10 Mar 2014) | 8 lines CogVM source as per VMMaker.oscog-eem.636 Fix byteFormatForNumBytes: and hence fix the new version of positive64BitIntegerFor:. Spur: Make sure expungeDuplicateAndUnmarkedClasses: resets classTableIndex for nil entries. ------------------------------------------------------------------------ r2874 | eliot | 2014-03-09 12:17:15 -0700 (Sun, 09 Mar 2014) | 23 lines CogVM source as per VMMaker.oscog-eem.635 Spur: Fix decoding the per-segment bridge span/seg size info on load and successfully load a multi-segment Newspeak bootstrap image. Finally! Rename writeImageToFile: to writeImageSegmentsToFile:. Don't write out empty segments on snapshot. Make various of the segment snapshot i/o rouitnes not inline for debugging Newspeak bootstrap load crash. Make segmentContainingObj: available for debugging. Fix assert in inClassTableBitmapSet:. Make sure adjustAllOopsBy: only sets bits in the classTableBitmap for classes, not class index puns. Provide a free tree printer. ------------------------------------------------------------------------ r2872 | eliot | 2014-03-06 12:51:00 -0800 (Thu, 06 Mar 2014) | 21 lines CogVM source as per VMMaker.oscog-eem.630 Revamp primitiveVMParameter to avoid overflow in values such as total heap size. Make statProcessSwitch, statIOProcessEvents, statForceInterruptCheck, statCheckForEvents, statStackOverflow & statStackPageDivorce 64-bit to avoid wrapping. Make sure that positive64BitIntegerFor: will not cause a GC just as positive32BitIntegerFor: doesn't. Fix startPCOrNilOfLiteral:in: (for scanForCleanBlocks) for newspeak accessors in Spur. Add eeInstantiateSmallClassIndex:format:numSlots: for afap allocation of small objects. Fix slip in objCouldBeClassObj:; objectMemory rawHashBitsOf: objOop should read objectMemory rawHashBitsOf: fieldOop. Use neater expression for determining Spur size of large free chunk and add an assert to freeTreeNodesDo: to try and track down appearance of small chunk in free chunk tree. ------------------------------------------------------------------------ r2871 | eliot | 2014-03-01 07:54:53 -0800 (Sat, 01 Mar 2014) | 19 lines CogVM source as per VMMaker.oscog-eem.624 Comment and coordinate the various examplePlugins.int/ext files. Spur: Instance printing should not print free chunks ;-) Remember to invoke markAndTraceOrFreeMachineCode: in the mark phase of full GC. Add classOrNilAtIndex: and use it in places where a nil return is unacceptable (fetchClassOf:, especially for isKindOfClass: when given garbage in printOop:). Improve spread in Spur's identity hash from 64% to 75%. Make primitiveSizeInBytesOfInstance accept 2 args in Newspeak for VMMirror. Use followForward: when accessing the elements of the array(s) in become, since there's nothing that ensures uniqueness and/or disjointness in the elements. Hence explicitly filter-out an object becomming itself. ------------------------------------------------------------------------ r2869 | eliot | 2014-02-19 18:06:56 -0800 (Wed, 19 Feb 2014) | 20 lines CogVM source as per VMMaker.oscog-eem.620 Make primitiveClone cope with variable args, cloning its last argument. This for the Newspeak VMMirror. Fix an assert fail in findSPOrNilOf:on:startingFrom:. Spur: Fix scanClassPostBecome:effects: for the bogus temp classes the Newspeak bootstrap creates. Get obj stack swizzling correct. Update firstFreeChunk correctly when it is allocated in the compaction routines. Break out of the search loop sooner in allocateOldSpaceChunkOfBytes:suchThat:. Make Spur snapshot avoid writing trailing free space in each segment to the image file. ------------------------------------------------------------------------ r2866 | eliot | 2014-02-07 11:21:40 -0800 (Fri, 07 Feb 2014) | 58 lines CogVM source as per VMMaker.oscog-eem.612 Author: eem Time: 7 February 2014, 11:07:27.365 am UUID: 54335642-7834-48fb-936d-b567fb9857b3 Ancestors: VMMaker.oscog-eem.611 Fix the at cache for wide strings in Spur given that Spur supports the String at:[put:] primitives on WideString. Fix isWordsOrBytesNonImm: to answer false for forwarders. Fix fixedFieldsOf:format:length: to fall through to an assert fail for forwarders. Prettify the primitiveAccessorDepthTable literal so I can see what's what. Fix slip in StackInterpreter>>postBecomeAction:. Must follow receivers after every become (even if become effects flags are 0) since e.g. a becommed string can be the receiver in a super send, and so, because super sends don't trap, must be unforwarded. Add some asserts to catch this error in *activateNewMethod & slowPrimitiveResponse. Make StackInterpreterPrimitives>>primitiveObjectPointsTo correct for both Spur and SqueakV3. Fix Spur's changeClassOf:to: Following forwarders in Spur markAndTrace: requires a store check. Fix bad bug in Spur>>firstIndexableField: that shifted by wordSize instead of shiftForWord. Change some uses of wordSize to bytesPerSlot. Fix NewObjectMemory>>shorten:toIndexableSize: for large arrays (3 word header) and make it work for variable objects with fixed fields. Change return value to be number of bytes freed, to permit sender to check for success. Fix method comment in ObjectMemory>>lengthOf:baseHeader:format: Add primitiveAllObjects, adapted from VMMaker-dtl.339.mcz Add primitiveTestShortenIndexableSize for testing shorten:toIndexableSize: from the image. Make ObjectMemory>>allObjectsDo: use objectAfter: instead of objectAfterWhileForwarding:. Introduce allObjectsDoSafely: to use objectAfterWhileForwarding:. Add a compatibility method to Sour. Use allObjectsDoSafely: where appropriate. Refactor InterpreterPrimitives>>primitiveAllObjects to move creation and enumeration into objectMemory. Improve ObjectMemory>>allObjects by using fact that allocated object is always last object in heap. Implement SpurMemoryManager>>allObjects. For this, implement small/largeObjectBytesForSlots: and hence move allocateSlots:format:classIndex: et al up into SpurMemoryManager. ------------------------------------------------------------------------ r2865 | eliot | 2014-01-31 17:04:05 -0800 (Fri, 31 Jan 2014) | 8 lines CogVM source as per VMMaker.oscog-eem.600 Revert bogus assert change. Remember to follow the specialObjectsOop during scavenges. Fix a typo in a selector. ------------------------------------------------------------------------ r2864 | eliot | 2014-01-31 10:41:22 -0800 (Fri, 31 Jan 2014) | 2 lines Add Newspeak Spur stack src & macbuild. ------------------------------------------------------------------------ r2862 | eliot | 2014-01-30 17:44:08 -0800 (Thu, 30 Jan 2014) | 2 lines And omit the date diplication. ------------------------------------------------------------------------ r2861 | eliot | 2014-01-30 17:42:13 -0800 (Thu, 30 Jan 2014) | 2 lines And add Date as one of platforms/Cross/vm/sqSCCSVersion.h's svn:keywords (sigh). ------------------------------------------------------------------------ r2860 | eliot | 2014-01-30 17:38:01 -0800 (Thu, 30 Jan 2014) | 34 lines CogVM source as per VMMaker.oscog-eem.598 Author: eem Time: 30 January 2014, 5:06:23.221 pm UUID: b85d7330-2ddc-4d90-8592-4e37234f4ac2 Ancestors: VMMaker.oscog-eem.597 Add the revision date to the sourceVersionString. This may make those annoying "your VM is out of date" warnings go away when Cog is used for Pharo. Eliminate declarations for non-existent vars in ScratchPlugin>>primitiveFisheye. Fix markAndTraceStackPage: for Spur. Stack references to forwarders must be followed before calling markAndTrace:. Fix eliminateAndFreeForwarders; it assumed that no forwarder can reference a new object after scavenge. That's not true due to transitive references. Fix SpurMemoryManager>>become:with:twoWay:copyHash: to follow the specialObjectsOop if it has been forwarded. Plugins (and the form print prim): Fix some egregious oop + 4 and oop + 8 references with the correct oop + BaseHeaderSize. Reduce the use of isIntegerObject:. isWords:, isBytes: et al fail for immediates anyway. Use var:type: where appropriate and use symbols for 'char *' et al. Replace some uses of cCode: 'aFunction(args)' with a send of the equivalent albeit non-existent selector. This may allow simulation at some point in the future. Fix the isValidSegmentBridge: assert for the last bridge. Add printLikelyImplementorsOfSelector: for help during debugging. ------------------------------------------------------------------------ r2859 | eliot | 2014-01-28 17:37:18 -0800 (Tue, 28 Jan 2014) | 8 lines CogVM source as per VMMaker.oscog-eem.595 Fix PIC entry alignment in Newspeak VMs. It's been working so far only because entry-point alignment covered up the bug. Allow more opcodes for the trampolines. The implicit receiver trampoline is larger in Spur (alignment? need to check). ------------------------------------------------------------------------ r2855 | eliot | 2014-01-28 15:05:51 -0800 (Tue, 28 Jan 2014) | 8 lines CogVM source as per VMMaker.oscog-eem.594. Stabilize generation so that implicitly default options cause the same dead code elimination as explicit defaults. Regenerate the CameraPlugin, ScratchPlugin, UnicodePlugin & WeDoPlugin with the Spur metadata. ------------------------------------------------------------------------ r2853 | eliot | 2014-01-25 12:25:52 -0800 (Sat, 25 Jan 2014) | 4 lines CogVM source as per VMMaker.oscog-eem.593. Fix the Spur Stack VM source. ------------------------------------------------------------------------ r2852 | eliot | 2014-01-24 17:04:32 -0800 (Fri, 24 Jan 2014) | 9 lines CogVM source as per MMaker.oscog-eem.592 Author: eem Time: 24 January 2014, 4:52:54.33 pm UUID: 98758c41-4bb5-4d45-87c9-77e5cf416120 Ancestors: VMMaker.oscog-eem.591 Fix regression in mapProfileState committed in VMMaker.oscog-eem.380/r2796. Causes segfaults on GC after running the AndreasSystemProfiler. ------------------------------------------------------------------------ r2851 | eliot | 2014-01-24 13:07:34 -0800 (Fri, 24 Jan 2014) | 7 lines CogVM source as per VMMaker.oscog-eem.591 Fix the regression in CoInterpreter>>validInstructionPointer:inMethod:framePointer: by accepting an instruction pointer pointing just before the first bytecode in StackInterpreter>>validInstructionPointer:inMethod:framePointer: and reverting CoInterpreter's method. This affects only debug and assert VMs. ------------------------------------------------------------------------ r2850 | eliot | 2014-01-23 11:24:54 -0800 (Thu, 23 Jan 2014) | 22 lines CogVM source as per VMMaker.oscog-eem.590. Fix bug in Cogit>>unlinkSendsOf:isMNUSelector:, used by primitiveFlushCacheBySelector. The method could leave sends linked to freed MNU PICs. Spur: Fix valid instruction pointer asserts for instructionPointer pointing at byte before first bytecode. Fix GC of classes, piggy-backing on classTableBitmap. So rename expungeDuplicateClasses to expungeDuplicateAndUnmarkedClasses:. Add some asserts to check that entries in the classTable are classes. Revise class table become management. Don't include methods in "unforwarded zone". Hence add followObjField:ofObject: & fix bug in fixFollowedField:ofObject:withInitialValue:. Add a read barrier to fetching newMethod from a method dictionary. Add a read barrier to fetching a method dictionary from a class. Don't inline any of the methods into fullGC. ------------------------------------------------------------------------ r2847 | eliot | 2014-01-16 10:49:26 -0800 (Thu, 16 Jan 2014) | 12 lines CogVM source as per VMMaker.oscog-eem.585 Fix become on compiled methods in Spur. followForwardedMethods must use isForwarded:/followForwarded: not shouldRemapObj: because the latter will confuse methods in newSpace for forwarded methods. Rename the interpreter followForwardedMethods' to followForwardedMethodsInMethodZone. Add CogMethodZone>>printCogYoungReferrers. Better svn:ignore pattern for . to ignore spur linux installs. ------------------------------------------------------------------------ r2846 | eliot | 2014-01-13 18:14:07 -0800 (Mon, 13 Jan 2014) | 11 lines CogVM source as per VMMaker.oscog-eem.584 Make sure SIGALRM is unblocked if using the interval timer heartbeat on linux. Spur: Fix swizzling on startup. Enumerate up to freeOldSpaceStart, not endOfMemory. Fixes startup of e.g. bootstrapped Squeak4.3 image. Admin: Move SqueakSSLPlugin to VMMaker from SqueakSSL. ------------------------------------------------------------------------ r2843 | eliot | 2014-01-10 13:57:32 -0800 (Fri, 10 Jan 2014) | 15 lines CogVM source as per VMMaker.oscog-eem.581. Add primitive accessor depth support for external primitives. Output accessor depth for external primitives in the form of per-primitive signed chars named primitiveFooAccessorDepth that hold the depth for primitiveFoo. Fix the signatures of floatObjectOf:, positive64BitIntegerFor: & signed64BitIntegerFor:. Change ^nil to ^self in some logging routines to get return type void. Add build directories for Cog Spur on linux. ------------------------------------------------------------------------ r2840 | eliot | 2014-01-06 14:10:21 -0800 (Mon, 06 Jan 2014) | 17 lines CogVM source as per VMMaker.oscog-eem.577. Implement following primitive args to "primitive accessor depth" on primitive failure in Spur. Hide the primitive accessor depth for internal named primitives in a hidden byte after the function name string, hence preserving the ability to share generated plugin C files between SqueakV3 and Spur. Fix assert in mapStackPages on SqueakV3. Can't check for being married with SqueakV3 obj mem since when compacting it moves bodies after updating pointers. Add Scratch plugins: CameraPlugin, ScratchPlugin, WeDoPlugin, & UnicodePlugin. Add Nicolas Cellier's bitblt speedups, reference: Mantis issue 7802: Fast-up BitBlt rgbAdd rule Mantis issue 7803: Fast-up BitBlt alpha blending rules ------------------------------------------------------------------------ r2837 | eliot | 2013-12-24 21:01:29 -0800 (Tue, 24 Dec 2013) | 5 lines CogVM source as per VMMaker.oscog-eem.570. Fix references to memory for use-a-structure configurations to match the change made to ObjectMemory class>>mustBeGlobal: in VMMaker.oscog-eem.547. ------------------------------------------------------------------------ r2836 | eliot | 2013-12-24 20:06:57 -0800 (Tue, 24 Dec 2013) | 23 lines CogVM source as per VMMaker.oscog-eem.569 Fix Spur's machine-code identityHash primitive for Character receivers. Refactor into the conventional cogit/objRep split genPrimitiveFoo/genInnerPrimitiveFoo. Nuke the now-unused isHashSetOnInstanceCreation. Fix Spur's machine-code == & ~~ primitives for potentially forwarded arguments. Implement machine-code primitives for Character>>value and SmallInteger>>asCharacter/Character class>>value:. Check for valid bitmap in primitivePixelValueAt aka BitBltSimulation>> primitivePixelValueAtX:y: Fix provided by Nicolas Cellier. Reference Mantis 7799 Revert/change Spur entry-code: a) 4 byte entry-point alignment is as good as 8-byte on Core i7 b) the older backward-branching for immediates entry-point code is significantly faster for non-immediates and because we expect most SmallInteger code to be performed in-line it is better to prefer non-immediate send performance. ------------------------------------------------------------------------ r2834 | eliot | 2013-12-20 11:21:10 -0800 (Fri, 20 Dec 2013) | 10 lines CogVM source as per VMMaker.oscog-eem.565. Rescue the Stack VM by refactoring the snapshot bereavement code to be CoInterpreter-agnostic. Give CoInterpreter its own method cache print routine for the same reason. Make the Spur instantiation primtives fail for format 7 (forwarded format) and name this for use as the format of immediate classes. ------------------------------------------------------------------------ r2833 | eliot | 2013-12-16 15:52:11 -0800 (Mon, 16 Dec 2013) | 13 lines VMMaker.oscog-eem.563 Author: eem Time: 16 December 2013, 3:41:22.598 pm UUID: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247 Ancestors: VMMaker.oscog-eem.562 Avoid including the instructionPointer in the context when marrying the top frame during divorceAllFrames for voidVMState..If:. (how did this ever work??) Fix bogus assert failure in checkIfValidObjectRef:pc:cogMethod: in Newspeak VM. Fix Spur initial alloc on Mac OS. ------------------------------------------------------------------------ r2832 | eliot | 2013-12-12 14:53:13 -0800 (Thu, 12 Dec 2013) | 11 lines CogVM source as per VMMaker.oscog-eem.561 Simplify StackInterpreter>>arrayValueOf: (isWordsOrBytes: already filters-out immediates). Remove RPATH spec from unix builds. Spur: Fix swizzling of Spur objStacks on start-up. Spur now snapshots and resumes. Beef up the objStack asserts and printing to identify my prior malfeasance. ------------------------------------------------------------------------ r2830 | eliot | 2013-12-11 16:37:38 -0800 (Wed, 11 Dec 2013) | 6 lines CogVM source as per VMMaker.oscog-eem.560 Also have to swizzle along the chain of free objStack pages. Print value of topX field when printing objStacks. ------------------------------------------------------------------------ r2829 | eliot | 2013-12-11 16:07:34 -0800 (Wed, 11 Dec 2013) | 5 lines CogVM source as per VMMaker.oscog-eem.559 Fix snafu in Spur markAndTraceObjStack:andContents: that spun marking first free page in an objStack. ------------------------------------------------------------------------ r2828 | eliot | 2013-12-11 15:17:12 -0800 (Wed, 11 Dec 2013) | 6 lines CogVM source as per VMMaker.oscog-eem.558. Implement Spur snapshot & fix freeChunk swizzlng on load. Internal refactoring of snapshot preparation. ------------------------------------------------------------------------ r2824 | eliot | 2013-12-10 17:31:20 -0800 (Tue, 10 Dec 2013) | 5 lines CogVM source as per VMMaker.oscog-eem.555 Rescue compilation of the "classic" VMs by making sure the relevant forwarding code is considered dead code. ------------------------------------------------------------------------ r2823 | eliot | 2013-12-10 16:45:24 -0800 (Tue, 10 Dec 2013) | 6 lines CogVM source as per VMMaker.oscog-eem.554. Fix a bug in BitBltPlugin>>lockSurfaces. Internal changes for Spur (see the Monticello package history from 546 on). ------------------------------------------------------------------------ r2820 | eliot | 2013-12-06 14:44:48 -0800 (Fri, 06 Dec 2013) | 14 lines CogVM source as per VMMaker.oscog-eem.545. Fix setting of endOfMemory on load in SqueakV3 VMs. Spur: Slight streamlining in followForwardingPointersInStackZone:, plus fixingfollowjng of frameMethodObject vs frameMethod in machine-code frames. Fix the concatenation of the assert-failure reason in isValidObjStackPage:myIndex:firstPage: so that it works in C. Slang: Generate the CoInterpreter *before* the Cogit so that the objectMemory andinterpreter classes have initialized *before* the Cogit is generated. Otherwisethe Cogit can be generated with values from the wrong interpreter/objectMemory. ------------------------------------------------------------------------ r2819 | eliot | 2013-12-05 15:21:33 -0800 (Thu, 05 Dec 2013) | 5 lines CogVM source as per VMMaker.oscog-eem.537. Fix ObjectMemory's isForwarded:/isOopForwarded: macros, rescuing compilation of the "classic" VMs. ------------------------------------------------------------------------ r2818 | eliot | 2013-12-05 12:14:48 -0800 (Thu, 05 Dec 2013) | 60 lines Cog VM source as per VMMaker.oscog-eem.536. All changes internal (no external bug fixes). Most important change is generation of to:do: loops. Add printCogMethodsWithPrimitive: as api. Change printAllStacks to enumerate heap for suspended processes last, and to use class indices on Spur, and to follow potentially forwarded fields. Simplify primitiveShortAtPut (isWordsOrBytes: filters-out immediates anyway). Fix type of theIP in CoInterpreter>>makeBaseFrameFor: which was causing mis-identification of machine-code pcs in contexts. Refactor validStackPageBaseFrames into validStackPageBaseFrame: and use latter in makeBaseFrameFor:'s asserts to speed-up debug VM. Indicate ceReturnToInterpreterPC in CoInterpreter frame printing. Make CogMethodZone>>freeStart a macro to give unfettered access to the memory manager's freeStart in gdb. Add several missing printing methods to SpurMemMgr. Make printMethodCache translate so as to include it in the real VM. Refactor compactCompiledCode: to compactCompiledCode to get the null header initialized correctly. Implement following of potentially forwarded literal variables in the Cogit. Fix several SpurMemoryManager bugs with compaction, segment management, etc. Fix Spur machine-code indexing and instantiation primitives and access scavengeThreshold as a constant. Fix evolutiuon of send site linked to closed PIC into site linked to open PIC to enforce invariant that cache tags of sites linked to open PICs are selectors; this for checkIfValidObjectRef:pc:cogMethod:'s cache tag checks. Simplify the setHeapBase:memoryLimit:endOfMemory: logic in CoInterpreter>>readImageFromFile:HeapSize:StartingAt:. Slang: Fix to:do: loops with unsigned limits hence if limit is unsigned and zero, avoiding the overflow resulting from i <= (limit - 1). Fix implicit typing of variables assigned the result of an method. Reverse the ill-considered decision to output wordSize as BytesPerWord in VMMaker.oscog-eem.363. Fix Integer << Integer to cast to 64-bits if the shift overflows 32-bits. Make sure dead code is not removed from plugin sources (if they're shared they can't be prematurely optimized). Do a better job at generating integer literals for flags. ------------------------------------------------------------------------ r2817 | eliot | 2013-11-22 16:51:45 -0800 (Fri, 22 Nov 2013) | 29 lines CogVM source as per VMMaker.oscog-eem.517 Move the defines for BaseHeaderSize BytesPerWord BytesPerOop out of interpreter, cogit or plugin source and into interp.h, and fix generateCPtrAsOop:on:indent: to print BaseHeaderSize symbolically so that plugin source can be safely shared. Include the executable name in the crash.dmp report. Fix uninitialization of newTargetMethodOrNil & errorSelectorOrNil in ceCPICMiss:receiver:. Do a better job of dead code removal, accepting constant comparisons. Lots of changes to Spur, find in Monticello but not relevant here as Spur is not yet ready for general consumption. Add the Cog Spur source to accompany the build dirs (doh!). Internal: Rewrite markLiteralsAndUnlinkIfUnmarkedSend:pc:method: & markLiteralsAndUnlinkIfUnmarkedSendOrPushImplicit:pc:method: so that markAndTraceLiteral: is only invoked with literal args and cacheTagIsMarked: is only applied to cache tags. This allows Spur to answer true for cacheTagIsMarked:. Refactor (pop)storeLiteralVariable in the StackInterpreter so that all such bytecodes use storeLiteralVariable:withValue:. JFK RIP. ------------------------------------------------------------------------ r2816 | eliot | 2013-11-19 15:53:24 -0800 (Tue, 19 Nov 2013) | 3 lines Fix snafu in changing unix configure script to allow specifying of different plugins dir. Judiciously apply some svn:ignore properties. ------------------------------------------------------------------------ r2815 | eliot | 2013-11-19 14:23:16 -0800 (Tue, 19 Nov 2013) | 7 lines Cog Spur VM source as per VMMaker.oscog-eem.516. Add a Spur Cog Mac OS build. Add a sqAllocateMemorySegmentOfSizeAboveAllocatedSizeInto for Unix, and add the heartbeat file to the Unix build. ------------------------------------------------------------------------ r2806 | eliot | 2013-11-13 18:20:08 -0800 (Wed, 13 Nov 2013) | 8 lines Fix sqAllocateMemorySegmentOfSizeAboveAllocatedSizeInto given that VirtualAlloc answers low memory, at keast on Windows XP. Add Spur to the -version VM description on win32. Munge unix/config's automake to build a stack vm. Add spurstackbuild/unixbuild. Add cleanall to spurstackbuild/cygwinbuild/Makefile ------------------------------------------------------------------------ r2805 | eliot | 2013-11-13 14:27:21 -0800 (Wed, 13 Nov 2013) | 9 lines Spur Stack VM src and OSPlugin src as per VMMaker.oscog-eem.510. See VMMaker.oscog-eem.510 history for Spur VM changes (this is not ready for any kind of use). Add spur stack unix build. Add win32 alloc for Spur memory segments. Fix the Spur cygwinbuild. ------------------------------------------------------------------------ r2798 | eliot | 2013-11-02 14:15:39 -0700 (Sat, 02 Nov 2013) | 11 lines CogVM source as per VMMaker.oscog-eem.498 Add the compression prims to the Newspeak VM's ZipPlugin. Regenerate the Newspeak VM plugins after recent Slang changes. Rescue the translated primitives by adding the missing removeFinalReturnIn: to statementsFor:varName: Spur: Work-around Slang limitations with the new shouldBeTenured:; mark it as . ------------------------------------------------------------------------ r2797 | eliot | 2013-11-02 12:45:39 -0700 (Sat, 02 Nov 2013) | 26 lines CogVM source as per VMMaker.oscog-eem.496. Improve dead-code elimination to exprs like false or: [false]. Fix nasty bug in MessageNode>>asTranslatorNodeIn: that left extra arguments in args for ifTrue:, and: et al, and hence confused the new nilOrBooleanConstantReceiverOf:. Spur: Fix global GC bug where stack pages containing marked contexts were being freed. Bug was that objects marked in newSpace were not being unmarked after GC. Add a DontTenureButDoUnmark tenuring policy to unmark newSpace objects. N.B. perhaps this should be used *before* the GC. But for now, with no incremental GC, we don't need to. Fix markAndTraceStackPages: to iterate while next page is untraced rather than unreached. Add some frames-on-page printing utilities. Rescue plugin generation by removing final ^self & computing ret type in VMPluginCodeGenerator>>compileToTMethodSelector:in:. Also, checkedDeclarationAt:put:in: needs to look at definingClass's inst vars for translated plugins. ------------------------------------------------------------------------ r2796 | eliot | 2013-11-01 19:56:58 -0700 (Fri, 01 Nov 2013) | 56 lines Cog VM source as per VMMaker.oscog-eem.493. Functionality: Fix stack backtrace printing on Mac & Unix to not segfault when invoked from error(char *msg) function. Fix roomToPushNArgs:; the Cog VMs can be more lenient because of the use of a stack instead of contexts. Fixes some valueWithArguments: failures. Integrate Nice's improved SmallInteger generated primitives that support int x float comparison, & hence speed-up int x float comparison enormously. Integrate VMMaker-dtl.328 (failure of primitiveDisplayString to advance destX). Integrate 2792, fix memory leaks in SqueakSSL on unix. Integrate VMMaker-tpr.325 7247: BitBlt Bug in alphaSourceBlendBits8. Integrate VMMaker-tpr.326, Fix a single-bit constant error in BitBltSimulation>>copyBits:Fallback: - change 16r3FFF to 16r7FFF to correct tallyIntoMap behaviour for Scratch using BenBlt on the Pi. Restrict at-cache to bytecodePrimAt[Put], eliminating it from primitive[String]At[Put]. Sionara the explicit noAtCache at:[put:] machinery in CoInterpreter now that the atCache is confined to the interpreter's special selector at:[put:] bytecodes. Speeds up Stack VM signfiicantly, e.g. a compile of Compiler package falls from 1.6s to 1.4s on 2.2GHz Intel Core i7 MacBook Pro. Internals: Many cosmetic changes now VM mates to SpurMemoryManager as well as ObjectMemory. Add Spur-specific interpreter proxy functions for immediate character and pinning access (not available in ObjectMemory VMs). Restrict at-cache to bytecodePrimAt[Put], eliminating it from primitive[String] At[Put]. Undoes need for fix in VMMaker-oscog.44 of 7 January 2011: "Fix leaking of objects into the atCache due to ceSend:super:to:numArgs:'s use of executeNewMethod without always setting messageSelector." This renders messageSelector and lkupClass ephemeral, since they are live only during message lookup and because createActualMessageTo will not cause a GC these cannot change during message lookup. Hence eliminate them from markAndTraceInterpreterOops: & mapVMRegisters. Do not generate dead code by default. Fix off-by-one bug in findSelectorOfMethod:. Replace metaclassSizeBits with metaclassNumSlots. Fix printActivationNameFor:receiver:isBlock:firstTemporary: for anon methods. Fix bug in shortPrintFrameAndCallers: (filter-out base frames). Slang: only output VM_LABELs in interpret. Change mac Stack VM builds to define VM_LABEL as null in the debug VMs, restoring interpret's debuggability. ------------------------------------------------------------------------ r2779 | eliot | 2013-08-26 11:51:34 -0700 (Mon, 26 Aug 2013) | 2 lines CogVm source as per VMMaker.oscog-eem.336. Fix arg count for primPCREExecfromto ------------------------------------------------------------------------ r2778 | eliot | 2013-08-23 11:55:42 -0700 (Fri, 23 Aug 2013) | 5 lines CogVM source as per VMMaker.oscog-eem.335. Fix snafu in unpairedMethodList maintennance during code compaction. Must only examine CMMethods. ------------------------------------------------------------------------ r2777 | eliot | 2013-08-22 14:35:57 -0700 (Thu, 22 Aug 2013) | 5 lines CogVM source as per VMMaker.oscog-eem.334. Fix snafu in CogMethodZone>>removeFromUnpairedMethodList: which can create an infinite loop in code compaction. ------------------------------------------------------------------------ r2776 | eliot | 2013-08-22 09:54:42 -0700 (Thu, 22 Aug 2013) | 18 lines CogVM source as per VMMaker.oscog-eem.333 Speed-up Newspeak significantly (e.g. -28% in one compile-intensive benchmark) by maintaining unpaired methods (compilations of anonymous accessors) on a linked list instead of searching the entire method zone. Do this by adding a NewspeakCogMethod and surrogates that add a nextMethod field. Update surrogate accessor generation so that accessors can answer and receive surrogates and nils. Also add a nop before the dynSuperEntry so as to change its alignment now that (in the Newspeak VM) CogMethod has changed size in gaining a field. Eliminate CogStackPage, collapsing it onto InterpreterStackPage (it only has a class side). Use temporaryCountOfMethodHader: instead of tempCountOf: in SimpleStackBasedCogit>>compileFrameBuild (header is in hand). ------------------------------------------------------------------------ r2775 | eliot | 2013-08-20 18:28:22 -0700 (Tue, 20 Aug 2013) | 8 lines CogVM source as per VMMaker.oscog-eem.329 Set the inBlock variable in scanBlock and scanMethod. Change the argument to the needsFrameFunction to be the stack delta. Change genSpecialSelectorClass's needsFrameFunction to needsFrameIfStackGreaterThanOne: which better handles e.g. TextColor>>dominates: other ^self class == other class than needsFrameIfFollowsSend:. ------------------------------------------------------------------------ r2773 | eliot | 2013-08-17 14:49:08 -0700 (Sat, 17 Aug 2013) | 15 lines CogVM source as per VMMaker.oscog-eem.328. Fix StackToRegisterMappingCogit>>genPrimitiveClass for case where numArgs > 0 (must use other than ReceiverResultReg, e.g. objectClass:). Improve register usage in genSpecialSelectorClass. Save & restore methodOrBlockNumTemps in compileBlockBodies for symmetry with needsFrame & methodOrBlockNumArgs. Slang: fix formatting of WhileForeverBreakIf loops. Tweak startPCOrNilOfLiteral:in: to filter-out arrays from its check for closure literals. ------------------------------------------------------------------------ r2772 | eliot | 2013-08-15 11:55:10 -0700 (Thu, 15 Aug 2013) | 4 lines CogVM source as per VMMaker.oscog-eem.322 Tweak frameless inst var store to avoid a register copy from Arg0Reg. ------------------------------------------------------------------------ r2765 | eliot | 2013-08-14 17:03:27 -0700 (Wed, 14 Aug 2013) | 21 lines CogVM source as per VMMaker.oscog-eem.321 Make primitiveObjectAtPut fail if changing the header word and the new header has a different literal count. Avoids crashing the VM when inadvertently changing the header, as a Newspeak bootstrap did recently. Implement frameless inst var store from arguments, so e.g. Point>>setX:Y: is frameless. Add Cogit support for clean blocks by scanning literals looking for BlockClosures on the current method. Add a prevBCDescriptor to the StackToRegisterMappingCogit scanners. This enables needsFrameIfFollowsSend:. Avoid spilling in frameless methods (now that pushTempVar can be frameless and hence inst var setters such at setX:Y: are now frameless) by adding needsFrameIfFollowsSend: used for special selectors #class & #==. ------------------------------------------------------------------------ r2764 | eliot | 2013-08-12 10:08:01 -0700 (Mon, 12 Aug 2013) | 3 lines Merge 2763. -memory and SQUEAK_MEMORY handle more than 31 bits of extra memory on 64-bit architectures. ------------------------------------------------------------------------ r2761 | eliot | 2013-08-01 14:59:19 -0700 (Thu, 01 Aug 2013) | 24 lines CogVM source as per VMMaker.oscog-eem.317 Correct several uses of literalCountOf:, using LiteralStart instead of 1, and BytesPerOop instead of BytesPerWord. Copy 314 transferTo:from: fix to CoInterpreterMT. Fix become for cog methods that are not paired with their bytecoded methods (e.g. Newspeak accessors). Eliminate dead code around contextInstructionPointer:context:. Eliminate duplicate methodClass asserts in ce*(Send: and simplify some in code compaction & code freeing. Don't inline freeStackPage: Revise the inlining change. Global vars passed as parameters must not be read after any non-trivial call. Use CCodeGenerator>>isAssertSelector: to check for all assert: calls (these are not inlined). hence fix assert:l: uses. ------------------------------------------------------------------------ r2760 | eliot | 2013-07-29 15:32:45 -0700 (Mon, 29 Jul 2013) | 16 lines CogVM source as per VMMaker.oscog-eem.314 Fix bug in transferTo:(from:) when doing a code compaction when ensuring there is a machine code method when switching to a process whose context has a machine code pc. Add an assert to commenceCogCompiledCodeCompaction to catch the actual bug (pushing the instructionPointer twice). Improve inlining via inlineSend:directReturn:exitVar:in: by refactoring argAssignmentsFor:args:in:'s innards. Now global variables are inlined if they are only read within the code being inlined. Implement warningat in term of warning so one only has to remember to set a breakpoint in warning, not both. ------------------------------------------------------------------------ r2759 | eliot | 2013-07-25 16:57:06 -0700 (Thu, 25 Jul 2013) | 4 lines CogVM source as per VMMaker.oscog-eem.312 Add tracing of GCs and code compactions to primTraceLog. ------------------------------------------------------------------------ r2758 | eliot | 2013-07-25 11:13:19 -0700 (Thu, 25 Jul 2013) | 4 lines CogVM source as per VMMaker.oscog-eem.311 primitiveTerminateTo needs one more assertValidStackedInstructionPointers: ------------------------------------------------------------------------ r2757 | eliot | 2013-07-25 10:10:22 -0700 (Thu, 25 Jul 2013) | 4 lines CogVM source as per VMMaker.oscog-eem.310 Fix some assert:s that should be assert:l:s ------------------------------------------------------------------------ r2756 | eliot | 2013-07-24 12:46:12 -0700 (Wed, 24 Jul 2013) | 13 lines CogVM source as per VMMaker.oscog-eem.309. Use assertValidStackedInstructionPointers: in primitiveTerminateTo. Fix the assert to use framePointer when on current page and instructionPointer ~= 0. Fix assertValidStackedInstructionPointersIn:line: usage in commenceCogCompiledCodeCompaction. Simplify relocateCallBeforeReturnPC:by: and elide bogus use of signedIntToLong there-in. Add a guard to findClassOfMethod:forReceiver:. ------------------------------------------------------------------------ r2754 | eliot | 2013-07-23 17:31:56 -0700 (Tue, 23 Jul 2013) | 14 lines CogVM source as per VMMaker.oscog-eem.308 Add an assert that checks all the instructionPointers in all stack pages. Use the assert in code compaction. (tracking down a rare crash at Cadence). Beef up the assertValidExecutionPointe:r:s:imbar:line: assert for interpreted frames (i.e. check savedIP if pc is ceRetrnToInterpreter) Freshen the translation of some of the VM plugins (for loop limit issue). Add new run & single-step prims to the processor sumlator plugins so access to memory past freeStart can be checked if needed. ------------------------------------------------------------------------ r2753 | eliot | 2013-07-18 12:45:39 -0700 (Thu, 18 Jul 2013) | 4 lines CogVM source as per VMMaker.oscog-eem.306. Add an assertValidExecutionPointers to the front side of process switch. ------------------------------------------------------------------------ r2752 | eliot | 2013-07-17 14:17:03 -0700 (Wed, 17 Jul 2013) | 10 lines CogVM source as per VMMaker.oscog-eem.305. Limit the ammount of space the Cogit will stack allocate when compiling. This limits the maximum number of bytecodes in a method that the Cogit will compile. Currently set at 1.5Mb of stack space from empirical tests of alloca on Mac OS X 10.6, linux 2.6 & Windows XP. Merge initializeCompilationWithConstantsOptions: into initializeMiscConstantsWith:. ------------------------------------------------------------------------ r2751 | eliot | 2013-07-17 13:57:47 -0700 (Wed, 17 Jul 2013) | 5 lines CogVM source as per VMMaker.oscog-eem.304. Make deferStackLimitSmashAround:[with:] answer true so it can be invoked in an assert and hence be optimized out in a non-assert VM, hence optimizing away assertValidExecutionPointe:r:s:imbar:line:. ------------------------------------------------------------------------ r2750 | eliot | 2013-07-16 15:54:52 -0700 (Tue, 16 Jul 2013) | 13 lines CogVM source as per VMMaker.oscog-eem.303 Add assert:l: and asserta:l: which take line numbers. Refactor assertValidExecutionPointe:r:s:imbar: to take a line number and supply it to assert:l: et al, for more informative assert failures. Use sqLowLevelMFence in deferStackLimitSmashAround:with: et al. Refactor preambleCCode emission so that a comment indicating its source is generated. Eliminate some compiler warnings is pathTo:using:followWeak:. ------------------------------------------------------------------------ r2749 | eliot | 2013-07-15 15:18:31 -0700 (Mon, 15 Jul 2013) | 2 lines Update the BitBltPlugin to include the fast Arm ASM option. ------------------------------------------------------------------------ r2747 | eliot | 2013-07-12 16:30:49 -0700 (Fri, 12 Jul 2013) | 10 lines CogVM source as per VMMaker.oscog-eem.302. Fix type errors in the Cogit that prevent the Cogit working when compiled with clang. Specifically void * pointers are not comparable. Make sure that fetchPointer:ofObject: & isIntegerValue: are declared in cointerp.h. Fix bug when assigning to some context inst vars from generated methods. Add accessors to document the context inst var access scheme. Fix a compiler warning comparing an error code in cog:selector: ------------------------------------------------------------------------ r2743 | eliot | 2013-06-14 16:51:36 -0700 (Fri, 14 Jun 2013) | 5 lines Cog VM source as per VMMaker.oscog-eem.278.mcz. Fix bad performance regression that on certain platforms (linux) results in all send misses causing a discarded PIC creation followed by a slow hash lookup. ------------------------------------------------------------------------ r2741 | eliot | 2013-06-12 12:40:48 -0700 (Wed, 12 Jun 2013) | 3 lines Update the Newspeak version of the VMProfileLinuxSupportPlugin. Improve robustness of the nscogbuild/unixbuild mvm scripts. ------------------------------------------------------------------------ r2740 | eliot | 2013-06-11 13:12:31 -0700 (Tue, 11 Jun 2013) | 3 lines Add the linux policy change dance to sqUnixVMProfile.c (cf sqUnixHeartbeat.c). Fix a bail_out typo. ------------------------------------------------------------------------ r2739 | eliot | 2013-06-10 18:16:01 -0700 (Mon, 10 Jun 2013) | 5 lines Cog VM source as per VMMaker.oscog-eem.298. Change the VMProfileLinuxSupportPlugin to follow symlinks, answering pairs of module name, dereferenced symlink or nil. ------------------------------------------------------------------------ r2738 | eliot | 2013-06-10 13:59:49 -0700 (Mon, 10 Jun 2013) | 4 lines Cog VM source as per VMMaker.oscog-eem.297. Fix 3 (!!) bugs in primitiveDLSymInLibrary. ------------------------------------------------------------------------ r2732 | eliot | 2013-06-06 15:17:23 -0700 (Thu, 06 Jun 2013) | 3 lines Make the Production/Debug/Assert distinction static so one can find it with strings - vm. Add an ident for the ITIMER_HEARTBEAT linux VMs. ------------------------------------------------------------------------ r2731 | eliot | 2013-06-06 14:50:39 -0700 (Thu, 06 Jun 2013) | 3 lines Add linux multiple thread priority builds to newspeak. Neaten the squeak linux mvm files. ------------------------------------------------------------------------ r2730 | eliot | 2013-06-06 14:40:56 -0700 (Thu, 06 Jun 2013) | 33 lines CogVM source as per VMMaker.oscog-eem.296. Fix bug in eden filling/object overwrite checking. must use unsigned vars in the fill loop. Add a plugin to support the VMProfiler on linux (now Steve Rees has told us how to get proper thread priorities on newer linuxes). Clean up some global struct code; - remove need to build separate sources to accomodate use of global register ptr to struct - clean up recording/testing for use of global struct in methods - define USE_GLOBAL_STRUCT_REG to use the global struct reg; right now machine factors require a different define for each machine/OS. Use asmLabel: false pragma to stop asm labels being put into floatValueOf and safeObejctAfter. Fix mistaken use of MFrameSlots in StackInterpreter>>interpreterAllocationReserveBytes. Use addressCouldBeObj: in oopHasAcceptableClass:. Replace broken primitiveUtcWithOffset with a version that works. Cast primitiveUtcWithOffset in terms of a new ioLocalSecondsOffset. Add stricter checking code to OSProcessPlugins. Add SqueakSSL plugin to nsvm plugins. Change -version output to print if a Production, Debug or Assert VM. Add builds for the multiple thread priorities linux regime. Fix the Unix heartbeat initialization code for this regime. ------------------------------------------------------------------------ r2723 | eliot | 2013-04-18 13:21:32 -0700 (Thu, 18 Apr 2013) | 3 lines Add some error checking to the UnixOSProcessPlugin's forkAndExecInDirectory prim. Eliminate some compiler warnings in the plugin. ------------------------------------------------------------------------ r2720 | eliot | 2013-04-12 15:16:14 -0700 (Fri, 12 Apr 2013) | 4 lines CogVM source as per VMMaker.oscog-eem.285. Eliminate some excessive use of push/popRemappableOop[:] in the SocketPlugin. ------------------------------------------------------------------------ r2719 | eliot | 2013-04-12 12:00:52 -0700 (Fri, 12 Apr 2013) | 6 lines Fix numberic option parsing in sqSocketSetOptions... (quite possibly the longest C function name I've ever seen). The old code only supported 1-digit length values, so setsockopt(SO_SNDBUF, 4096 didn't do what was expected at all (attempted to set the buffer size to 909717556, which is little-endian ascii for '4096', '4096' asByteArray unsignedLongAt: 1 => 909717556). ------------------------------------------------------------------------ r2718 | eliot | 2013-04-11 16:37:17 -0700 (Thu, 11 Apr 2013) | 6 lines Occasionally bizarre interactions cause the heartbeat's interval timer to disable. e.g. on CentOS linux when using PAM to authenticate, a failing authen- tication sequence disables the interval timer, for reasons unknown (setting a breakpoint in setitimer doesn't show an actual call). So a work around is to check the timer as a side-effect of ioRelinquishProcessorForMicroseconds. ------------------------------------------------------------------------ r2717 | eliot | 2013-04-10 17:17:11 -0700 (Wed, 10 Apr 2013) | 8 lines CogVM source as per VMMaker.oscog-eem.284. Add Callback LIFO ordering support to the new-style Callback return primitives to the IA32ABI Aline plugins. Fix some compiler warnings there-in. Improve the debug message printing in sqUnixExternalPrims.c so it prints line numbers. ------------------------------------------------------------------------ r2714 | eliot | 2013-04-04 11:39:55 -0700 (Thu, 04 Apr 2013) | 2 lines Oops! Remember to update the SCCS version. ------------------------------------------------------------------------ r2705 | eliot | 2013-03-19 09:37:43 -0700 (Tue, 19 Mar 2013) | 5 lines CogVM source as per VMMaker.oscog-eem.275. Remember to flush PushImplicit/SendAbsentImplicit caches on global cache flush and flush cache by method. Fix comment for flush-cache-by-method workhorse. ------------------------------------------------------------------------ r2704 | eliot | 2013-03-19 08:55:25 -0700 (Tue, 19 Mar 2013) | 9 lines CogVM source as per VMMaker.oscog-eem.274. Fix PC-mapping for NewspeakV4. Absent receiver sends must not be maped twice, once for IsNSSend and once for IsSend. So introduce class vars that state whether instructioon set uses PushImplicitReceiver (NSSendIsPCAnnotated is true) or SendAbsentImplicit (NSSendIsPCAnnotated is false). More info on optimizations to defeat for gcc 4.x compilation. ------------------------------------------------------------------------ r2701 | eliot | 2013-03-08 15:43:09 -0800 (Fri, 08 Mar 2013) | 11 lines CogVM source as per VMMaker.oscog-eem.272. Fix unknownBytecode processing to leave pc at unknown bytecode. Fix case of process switch to an interior frame. Fix some assert function signatures in the stack vm. Use symbols for types instead of strings in stack page funcs. Integrate VMMaker-oscog-EstebanLorenzano.235. - it is possible to build stackvm again ------------------------------------------------------------------------ r2697 | eliot | 2013-03-01 17:22:06 -0800 (Fri, 01 Mar 2013) | 19 lines iCogVM source as per VMMaker.oscog-eem.270 Fix the become issue where methods that are identical are failing the code test because their penultimate literals are different objects. Add a flag "cmUsesPenultimateLit" to jitted methods, stealing bits from stackCheckOffset (which was way larger than needed). Shrink stackCheckOffset to 12 bits (still an order of magnitude larger than needed) and add an error check on assigning it. Also add a check for max method size (2^16-1 bytes) and refuse to jit a method that generates too much code. When comparing code, use the cmUsesPenultimateLit flag to decide if comparison includes penultimate lit or not. This is mildly insane, but the VM really doesn't know about the penultimate literal and it shouldn't depend on knowing it can be ignored. Note that the CoInterpreter knows about the last literal; it uses this in supersends. With this hack, Pharo's condenseSources works. ------------------------------------------------------------------------ r2696 | eliot | 2013-02-28 15:46:24 -0800 (Thu, 28 Feb 2013) | 16 lines CogVM sources as per VMMaker.oscog-eem.269. Fix bug in primitiveClone/cloneContext: that causes the copy to be a word short. Use isPointerNonInt: and isContextNonInt: in a few places. Implement unknownBytecode. Send unknownBytecode to the activeContext on unknown bytecode if the selector is in the specialObjectsArray. Fix page size bug in platforms/Cross/vm/sqHeapMap.c. Add a trap command to scripts/versionInfoPlist and the mac mvm's to allow ^C. More description for unix builds on 64-bit linux. Have the upload script mark the upload directory and contents as read-only. ------------------------------------------------------------------------ r2692 | eliot | 2013-02-20 15:59:35 -0800 (Wed, 20 Feb 2013) | 15 lines CogVM source as per VMMaker.oscog-eem.266. Support one-way become on cogged methods that have the same code, for e.g. Pharo's setSourcePosition:inFile:. Add error checks for two-way becomming cogged methods, becomming married contexts, and for freeing any of these during become. Refactor freeObject: and restoreHeaderOf: to allow subclasses to add their error checks efficiently (i.e. avoiding fetching baseHeader more than once). Make assert in rawHeaderOf:put: accept forwarding. Tiny speed-up in using byteLengthOf: instead of byteSizeOf: in cogit. Add asLong to CCodeGenerator and there-by eliminate printf warnings in reportMinimumUnusedHeadroom. Eliminate warning in instVar:ofContext:put:. ------------------------------------------------------------------------ r2691 | eliot | 2013-02-20 09:56:53 -0800 (Wed, 20 Feb 2013) | 15 lines CogVM sources as per VMMaker.oscog-eem.265. Fix bug in assigning pc which can cause stackPage to not be most recently used. Fix short frame printing (eliminate an extra newline and use hex for receiver). Provide a -rh shorthand for -reportheadroom. Make sqUnixMemory.c compile on BSD (no HAVE_MMAP but still need those includes). Change the signatures of tenuringIncrementalGC fullGC incrementalGC & forceInterruptCheck to void return (for Plan 9). Include the AioPlugin in Squeak Cog VM generation. Add the -fno-caller-saves info to the Unix HowToBuilds. ------------------------------------------------------------------------ r2678 | eliot | 2013-02-05 18:55:12 -0800 (Tue, 05 Feb 2013) | 14 lines CogVM source as per VMMaker.oscog-eem.264. Fix snapshot primitive failure in the StackVM and Cogit. The primitive should fail, not merely return the receiver. Also if in Cogit, need to back-up instruction pointer on failure. Make reportMinimumUnusedHeadroom more informative (also print available headroom). Back out of named SerialPlugin primitives (comprehensive platform support is lacking). Fix reportStackHeadroom switch testing. Not applicable to the StackVM. ------------------------------------------------------------------------ r2677 | eliot | 2013-01-31 10:00:18 -0800 (Thu, 31 Jan 2013) | 3 lines Back out of the addition of the named serial port read & write primitives to the SerialPlugin. They're lacking adequate platform support right now. ------------------------------------------------------------------------ r2676 | eliot | 2013-01-30 17:42:03 -0800 (Wed, 30 Jan 2013) | 24 lines CogVM source as per VMMaker.oscog-eem.261. Move determination of the ammount of headroom to the platform in osCogStackPageHeadroom (in the various sqFooMain.c files). Provide a routine to monitor the ammount of unused headroom, which requires the stack memory be zeroed before use. Assume the platform will provide a -reportheadroom flag for enabling the report. Provide primitiveMinimumUnusedHeadroom for in-image access. Add some asserts to check that a page's frame pointer is always in range (setHeadFP:andSP:inPage: already did this). Add the GdbARMPlugin. Correct cygwin HowToBuilds. Nuke the sparseimage in the Newspeak mac installer. Add the named serial port read & write primitives to the SerialPlugin. Fix change history upload in uploadvms script. ------------------------------------------------------------------------ r2673 | eliot | 2013-01-18 11:25:43 -0800 (Fri, 18 Jan 2013) | 54 lines CogVM source as per VMMaker.oscog-eem.258 Fix becomeForward: when the rootTbale overflows. There were two bugs here. One is that initializeMemoryFirstFree: used to clear the needGCFlag so if the rootTable overflowed noteAsRoot:headerLoc:'s setting of the needGCFlag would be undone after the sweep. The other is that rooitTable overflow was indicated by rootTableCount >= RootTableSize which could be undone by becomeForward: freeing roots which need to be removed from the rootTable. At some point in becomeForward the rootTable would fill but at a later point a root would be freed, causing the table to become not full. The fix is two fold. 1. Add an explicit rootTableOverflowed flag instead of relying on rootTableCount >= RootTableSize. 2. move the clearing of the needGCFlag to the GC routines. Remove unnecessary senders of needGCFlag: false, and remove the accessor. As a side effect rewrite primitiveRootTable in terms of a new ObjectMemory>>rootTableObject. Remove the rootTable: accessor. Implement checkAllAccessibleObjectsOkay & checkOkayInterpreterObjects: (used to debug the above). Fix NewObjectMemory initialization to set freeStart at the same time as setting endOfMemory. This allows load-time scans and assert code to use freeStart instead of endOfMemory. Simplify markAndTraceStackPage: ; since the two implementations are distinct they don't need to contain the isCog if-then-else. Implement NewObjectMemory>>shorten:toIndexableSize: so that the last object is correctly shortened (cut back freeStart). Refactor the allocation check filling code into maybeFillWithAllocationCheckFillerFrom:to:. Make longPrintOop: print the class oop. Fix bug in printCallStackOf:currentFP: for widowed contexts. Use fputs for print: instead of printf. Rewrite the stackLimit computation after a moment of clarity. Allow the system to reduce the space for frames by up to an 1/8th. Make sure there's at least as much headroom as asked for. This changes the stack page size from 4096 to 2048 and much reduces the interpreterAllocationReserveBytes. Don't round up interpreterAllocationReserveBytes to a power of two. Integrate the named serial primitives plus Luc Fabresse's latest fix. Improve cygwin HoiwToBuilds with info on latest versions (thanks Ron). Map SO_REUSEPOR to kIP_REUSEPORT instead of kIP_REUSEADDR in sqMacNetwork.c. This doesn't fix the Mac Socket test failures because the Mac build uses the unix code. Sigh. ------------------------------------------------------------------------ r2672 | eliot | 2013-01-12 19:48:28 -0800 (Sat, 12 Jan 2013) | 22 lines CogVM source as per VMMaker.oscog-eem.255. [New[Co]]ObjectMemory: Fix becomeForward: so that objects whose references are deleted are freed and can no longer be resurrected via allObjects or allInstances. Remove freed young roots from the rootsTable. Filter freed objects pointed to from the extraRootsTable (because these locations can change it is wrong to remove entries from the extraRootsTable). Make primitiveIdentityHash pop all arguments, for Newspeak VMMirrors. StackToRegisterMappingCogit: Fix marshalling of absent receiver sends. The items beneath the arguments (and to-be-pushed receiver) must be spilled before the receiver is pushed. Improve code quality for numArgs > numRegArgs sends when receiver is not a spill and there are no uses of ReceiverResultReg amongst args. e.g. now avoids loading ReceiverResultReg from stack in code such as 1 with: 2 with: 3 . ------------------------------------------------------------------------ r2669 | eliot | 2013-01-10 15:34:44 -0800 (Thu, 10 Jan 2013) | 6 lines CogVM source as per /VMMaker.oscog-eem.253. Implement absent receiver dynamic super send in the Cogit. Change the Teleplace licenses to 3D ICC. ------------------------------------------------------------------------ r2664 | eliot | 2013-01-08 18:14:39 -0800 (Tue, 08 Jan 2013) | 4 lines CogVm source as per VMMaker.oscog-eem.252. Issue 117. Fix primitiveRemLargeIntegers. The result should be negated iff receiver negative. ------------------------------------------------------------------------ r2662 | eliot | 2013-01-08 13:55:32 -0800 (Tue, 08 Jan 2013) | 3 lines Cog VM source as per VMMsker.oscog-eem.251. Give primitiveRemLargeIntegers primitive # 20. ------------------------------------------------------------------------ r2661 | eliot | 2013-01-08 11:57:41 -0800 (Tue, 08 Jan 2013) | 4 lines Add yet another libc line to the linux launch script(s), and try and make the script suggest users extend it themselves. you can lead a horse to water... Rationalize the includes in sqUnixUUID.c. ------------------------------------------------------------------------ r2660 | eliot | 2013-01-07 13:54:37 -0800 (Mon, 07 Jan 2013) | 12 lines CogVM source as per VMMaker.oscog-eem.250. Fix (old) bug in ssAllocateRequiredRegMask:upThrough: that would flush entire stack if allocating any register. Implement absent receiver sends in the Cogit. Refactor pushImplicitReceiver into genGetImplicitReceiverFor: and clients and use genGetImplicitReceiverFor: for absent receiver sends. Use Arg1Reg in place of Arg0Reg in ceImplicitReceiverTrampoline. Fix CurrentImageCoInterpreterFacade for Newspeak methods. ------------------------------------------------------------------------ r2658 | eliot | 2013-01-04 12:44:30 -0800 (Fri, 04 Jan 2013) | 4 lines Turn off inlining when compiling the Cogit. The Cogit's runtime is negligible and we prefer to save space. With the recent changes (better shift code??) the VM appears faster anyway. ------------------------------------------------------------------------ r2655 | eliot | 2013-01-03 14:00:52 -0800 (Thu, 03 Jan 2013) | 11 lines CogVM source as per VMMaker.oscog-eem.248. Integrate directed shift changes from cog issue 111 that affect the CoInterpreter and Cogit. Make the translated primitive plugins include info from their primitive supplying classes. Add a script that reverts and touches file to correct date (why svn/hg/git revert omit this I can't fathom; points to support for manual edit only?). ------------------------------------------------------------------------ r2651 | eliot | 2013-01-02 18:31:11 -0800 (Wed, 02 Jan 2013) | 6 lines CogVM source as per VMMaker.oscog-eem.246 Integrate changes from VMMaker-dtl.293 which use >> & << shifts in place of slower bitShift: code in plugins. Add width failure cases to BMPReadWriterPlugin read & write 24Bmp prims. Use ClassByteString var in preference to ClassString var. ------------------------------------------------------------------------ r2649 | eliot | 2013-01-02 12:19:55 -0800 (Wed, 02 Jan 2013) | 5 lines CogVM source as per VMMaker.oscog-eem.244. Restore Cogit wanting COGMTVM to be determined on command line. Probably broke in VMMaker.oscog-eem.218. ------------------------------------------------------------------------ r2648 | eliot | 2013-01-02 12:05:38 -0800 (Wed, 02 Jan 2013) | 5 lines CogVM source as per VMMaker.oscog-eem.244. Restore Cogit wanting COGMTVM to be determined on command line. Probably broke in VMMaker.oscog-eem.218. ------------------------------------------------------------------------ r2647 | eliot | 2013-01-02 11:49:06 -0800 (Wed, 02 Jan 2013) | 6 lines CogVM source as per VMMaker.oscog-eem.243. Integrate issue 112. Add ULL suffix to > 32 bit integer literals. May help fix large integer arithmetic on 64-bit values with dumb C compilers. Integrate issue 115. Fix FFIPlugin/ThreadedFFIPlugin unsignedShortAt:. ------------------------------------------------------------------------ r2641 | eliot | 2012-12-20 16:45:13 -0800 (Thu, 20 Dec 2012) | 4 lines Correct the const declarations in the Cogit. Comment the MULTIPLE_BYTECODE_SETS vm parameter #65. ------------------------------------------------------------------------ r2640 | eliot | 2012-12-20 12:39:20 -0800 (Thu, 20 Dec 2012) | 42 lines CogVM source as per VMMaker.oscog-eem.240. Back out of the wrong-headed attempt to give compact class indices to long header objects in changeClassOf:to:, and comment why (markAndTrace: reuses header type bits and depends on compact class and size fields to reconstruct type bits after traverse). Consequently fix isClassOfNonImm:equalTo:compactClassIndex: so it will still accept long-header objects that are insances of compact classes but don't have a compact class index. Clean-up accesses to the compactClassesArray so that they go through the compactClassAt: where appropriate. Use the short-hand class determinators such as isInstanceOfClassFloat: in place of the long-winded is:instanceOf:compactClassIndex:. Remove obsolete use of cCode: 'magnitude >> 32' in the integer conversion routines signed64BitIntegerFor: et al now that Slang generates the correct cases for right-shift. Eliminate the compactClassTable accessor. CompactClasses and splOb: are both in scope in CogObjectRepresentationForSqueakV3. Override sweepPhase in NewObjectMemory and hence eliminate initializeFreeBlocksPreSweep. Fix off-by-one error in okayOop:. Make longPrintOop: print header type info. Make allAccessibleObjectsOk answer a result. Don't inline loadInitialContext for gdb breakpointing convenience. Declare some constant variables as const in the Cogit. Don't use SA_ONSTACK if NEED_SIGALTSTACK is 0. (default is 1, so this isn't a change, except for experimenting). Fix nscogbuild/unixbuild/HowToBuild (thanks Bob). ------------------------------------------------------------------------ r2639 | eliot | 2012-12-18 10:39:16 -0800 (Tue, 18 Dec 2012) | 5 lines Third time lucky. Fix bug in changeClass:from: so that if receiver has long header and class is compact, receiver still gets compact class field set, not cleared. No matter what header an instance has, if its class is compact it should have the compact class index set. ------------------------------------------------------------------------ r2637 | eliot | 2012-12-17 11:51:15 -0800 (Mon, 17 Dec 2012) | 10 lines CogVM source as per VMMaker.oscog-eem.238 Restore ThreadedFFIPlugin wanting COGMTVM to be determined on command line. Probably broke in VMMaker.oscog-eem.218 Fix bug in changeClass:from: so that if receiver has long header and class is compact, receiver still gets compact class field set, not cleared. No matter what header an instance has, if its class is compact it should have the compact class index set. ------------------------------------------------------------------------ r2636 | eliot | 2012-12-14 16:44:59 -0800 (Fri, 14 Dec 2012) | 2 lines Check for needing sigaltstack properly in setSignalNumber:handler:. ------------------------------------------------------------------------ r2635 | eliot | 2012-12-14 14:07:30 -0800 (Fri, 14 Dec 2012) | 3 lines Fix plugins. Code from previous check-in had "cosmetic" weaknesses, doubled include files and a semicolon trailing a #endif. ------------------------------------------------------------------------ r2634 | eliot | 2012-12-13 16:58:29 -0800 (Thu, 13 Dec 2012) | 2 lines Fix visibility of GetAttributeString on unix. ------------------------------------------------------------------------ r2633 | eliot | 2012-12-13 16:32:58 -0800 (Thu, 13 Dec 2012) | 11 lines Document the fact that the previous checking applied the -z now link flag to the linux builds. This causes the dynamic linker to resolve unresolved symbols on load instead of lazily. This affects reliability in signal handlers, because if the dynamic linker can run at any time it can tehrefore run in a signal handler and cause a deep call chain which could corrupt a stack page in the JIT. So the previous checkin applied three fixes to this issue: a) correct the stack headroom determination b) use sigaltstack for signal handlers in the UnixOSProcessPlugin c) link using -z now on linux. Fix a warning due to expandDereferenceInterpreterProxyFunctionTable mis-translation. ------------------------------------------------------------------------ r2632 | eliot | 2012-12-12 13:45:24 -0800 (Wed, 12 Dec 2012) | 16 lines CogVM source as per VMMaker-eem.233. Rename misnamed internameIsMutable: and internalIsImmutable: to isOopMutable: and isOopImmutable:. Affects sqVirtualMachine.c, but only part of api used in Newspeak VMs. Merge LargeInteger primitive fixes from VMMaker-dtl.286 and tests from VMMaker-dtl.289. UnixOSProcessPlugin: Merge with VMConstruction-Plugins-OSProcessPlugin-dtl.35. In particular restore missing code to forwardSignal:toSemaphoreAt: Get plugin to use SA_ONSTACK/sigaltstack for signal handlers if loaded in the JIT. ------------------------------------------------------------------------ r2631 | eliot | 2012-12-11 18:04:46 -0800 (Tue, 11 Dec 2012) | 38 lines Fix stackPage headroom calculation in CoInterpreter. Was getting things backward. This increases the stack page headroom by 62% from 1564 bytes to 2532 bytes. Shootout benchmarks unchanged, so reduction in frames per page is not an issue for typical code. This should result in fewer crashes on linux where the dynamic linker, if it kicked in during a signal handler, could cause a deep call chain at interrupt time and trample the start of the adjoining stack page. Merge LargeInteger primitive fixes from VMMaker-dtl.286. Change generation of plugin code so that internal plugins call VM routines directly and external plugins call through their own local copies of the function pointers in InterpreterProxy. External plugins copy the InterpreterProxy functions to their local copies in setInterpreter:. Change implementations of stObject:at:put: to return their value, to match the declaration in InterpreterProxy. Streamline ObjectMemory>>instantiateClass:indexableSize: (hdrSize and header3 change together). Optimize the debug VM by making startOfMemory a macro that answers heapBase instead of a method. Improve stack page printing, and make stack trace printing more robust (findClass/SelectorOfMethod:forReceiver:). Make temporary:in:put: et al answer their values. For stObject:at:put:. Make jumpTable size err message more explanatory. Rename misnamed internameIsMutable: and internalIsImmutable: to isOopMutable: and isOopImmutable:. Affects sqVirtualMachine.c, but only part of api used in Newspeak VMs. ------------------------------------------------------------------------ r2628 | eliot | 2012-11-30 16:53:30 -0800 (Fri, 30 Nov 2012) | 2 lines and another... ------------------------------------------------------------------------ r2627 | eliot | 2012-11-30 16:44:34 -0800 (Fri, 30 Nov 2012) | 2 lines Fix typo in unix/X11 display_setSavedWindowSize ------------------------------------------------------------------------ r2626 | eliot | 2012-11-30 16:01:39 -0800 (Fri, 30 Nov 2012) | 2 lines Not so fast... Its a pointer type, not a struct type. ------------------------------------------------------------------------ r2625 | eliot | 2012-11-30 15:56:37 -0800 (Fri, 30 Nov 2012) | 2 lines Fix a type typo in the Cogit. ------------------------------------------------------------------------ r2624 | eliot | 2012-11-30 15:16:14 -0800 (Fri, 30 Nov 2012) | 36 lines CogVM source as per VMMaker.oscog-eem.225. Fixes for cog issue 109, base frames and CallPrimitive, and merge with VMMaker.oscog-lw.224. Cogit: StackToRegisterMappingCogit, cog issue 109. Fix pc mapping for popped folded constants as in, e.g. 1-1. Need to check for annotateUse on popping a stack descriptor. CoInterpreter: Fix makeBaseFrame: for methods with CallPrimitive that get restarted. e.g. on:do:. We could make the CallPrimitive bytecode check for being at the start of a method, but I have decided, for strictness, to make executing CallPrimitive an error for the moment. This means that thater we could use it to embed primitive calls in the middle of methods. Streamline once again activation sequence to make setting method (actually bytecodeSetSelector) faster and on primitive failure to increment pc past CallPrimitive before checking for err code store. Make ensureMethodIsCogged: answer the cogged method, again for efficiency. Add tracing of stack overflows. Fix bug in printing of bytecode addresses in long/printOop: on CompiledMethods. Fix bug in printStringOf: so that it prints ... when truncating. Add missing case to isNullExternalPrimitiveCall:. Streamline long/printReferencesTo:. Slang: Improve formatting of code for cppIf:ifTrue:. ------------------------------------------------------------------------ r2620 | eliot | 2012-11-26 17:13:23 -0800 (Mon, 26 Nov 2012) | 21 lines VM: Complete multiple bytecode set support plus NewsqueakV4 bytecode set. Affects only the Newspeak VMs. Make instantiation primitives pop arguments, not assume arg count, for Newspeak. Make them answer error codes, and streamline, avoiding using self success. Integrate primitiveUtcWithOffset. Rename traceLinkedSends to more general traceFlags. Add better help for these. Plugins: Regenerate most plugins, to eliminate some warnings and to use isIntegerObjectrather than explicit bit test. ThreadedFFIPlugin: Fix bug with not attempting to run GC enough times for COGMTVM to freeze arguments. Fix bug in ffiCall:ArgArrayOrNil:NumArgs: not checking for an error case. ------------------------------------------------------------------------ r2586 | eliot | 2012-08-14 19:22:30 -0700 (Tue, 14 Aug 2012) | 4 lines CogVM source as per VMMaker.oscog-eem.203. Cosmetic changes, NewspeakVM and MULTIPLEBYTECODESETS expanded at translation time, and lost comments recivered. ------------------------------------------------------------------------ r2585 | eliot | 2012-08-14 09:06:45 -0700 (Tue, 14 Aug 2012) | 9 lines Cog VM source as per VMMaker.oscog-eem.201. Make sure youngReferrersList has room for every method since become/cache implicit receiver can cause any method to gain a young reference. Do so by counting methods in the zone. Make overflowing the youngReferrers list a hard error (appears to happen quite often in Newspeak code). Fix assert in interpretMethodFromMachineCode. ------------------------------------------------------------------------ r2584 | eliot | 2012-08-10 16:59:57 -0700 (Fri, 10 Aug 2012) | 2 lines CogVM source as per VMMaker.oscog-eem.200. Fix ^self slip in MT interpreter. ------------------------------------------------------------------------ r2582 | eliot | 2012-08-10 14:27:56 -0700 (Fri, 10 Aug 2012) | 8 lines CogVM source as per VMMaker.oscog-eem.199. Make overflowing the youngReferrers list a hard error (appears to happen quite often in Newspeak code). Fix bug in changeClassFrom:to: if receiver is a compact class instance with a large header. Several refactorings from Lars' work & multiple bytecode sets work mean generated code is somewhat changed. ------------------------------------------------------------------------ r2562 | eliot | 2012-07-17 17:35:02 -0700 (Tue, 17 Jul 2012) | 6 lines Make the sqGnu.h machinery support the multiple bytecode sets scheme. Add a trace facility to dispdbg.h for multiple bytecode sets. Update the HowToBuilds with more accurate info on building the Bochs plugin. Add an ioDisableHeartbeat to the itimer heartbeats for debugging. Make the unix build scripts nuke everything by default. ------------------------------------------------------------------------ r2559 | eliot | 2012-06-21 14:26:01 -0700 (Thu, 21 Jun 2012) | 6 lines CogVM source as per VMMaker.oscog-eem.163. Make wakeHighestPriority filter-out zombie processes; fixes Newspeak/Glue crash. Add -blockonerror flag to Unix & Mac VMs to allow attaching gdb on error/segv. Make the sigsegv handler catch SIGILL and SIGBUS on Unix and Mac. Move ioExit[WithErrorCode] from sqWin32Window.c to sqWin32Intel.c. ------------------------------------------------------------------------ r2558 | eliot | 2012-06-13 14:36:38 -0700 (Wed, 13 Jun 2012) | 3 lines Add 64-bit file support to linux builds. Fix sqUnixX11.c ClipChildren to ClipByChildren ------------------------------------------------------------------------ r2556 | eliot | 2012-06-07 12:29:52 -0700 (Thu, 07 Jun 2012) | 4 lines CogVM source as per VMMaker.oscog-eem.161. Integrate ipv6 socket primitives. Add UnixOSProcessPlugin primitiveDup, and make primitiveChdir return error and success results the right way round. ------------------------------------------------------------------------ r2552 | eliot | 2012-05-02 16:13:02 -0700 (Wed, 02 May 2012) | 19 lines CogVM source as per VMMakerr.oscog-eem.159 Plugins: Fix ThreadedFFIPlugin's preambleCCode for Pharo's mingw config. Merge fix for JPEGReadWriter2Plugin (http://bugs.squeak.org/view.php?id=7691) Merge with VMMaker version s of plugins JPEGReaderPlugin, KlattSynthesizerPlugin Matrix2x3Plugin Mpeg3Plugin (and hence lose some support files) Fix limitation in platforms/unix/plugins/SocketPlugin/sqUnixSocket.c which could cause NetNameResolver localHostAddress to answer 0 (if host has a set hostname not being honoured by local DNS servers). Fix falls back to localhost. Fix shift-enclose on Mac by translating to shifted unicode via UCKeyTranslate. Allow unix & mac plats to write crash.log to current directory if compiled with CRASH_DUMP_IN_CWD. (still need to fix Win). ------------------------------------------------------------------------ r2550 | eliot | 2012-04-17 23:14:23 -0700 (Tue, 17 Apr 2012) | 4 lines CogVM source as per VMMaker.oscog-eem.157. Implement proper bounds checking for byte access to compiled methods. Raise errors for accesses outside initialPC to size. ------------------------------------------------------------------------ r2549 | eliot | 2012-04-13 11:28:27 -0700 (Fri, 13 Apr 2012) | 20 lines As per r2548, but fixing the VMMaker package name. CogVM source as per VMMaker.oscog-eem.156 CoInterpreter: Provide a thorough flush primitive for CompiledMethods that discards all machine code and makes sure that any contexts using the method have bytecode pcs. Primitive #215 (same as 116 in the Stack VM). This is much slower than 116 (flushCache) since it has to enumerate over all heap contexts. Provide an xray primitive for CompiledMethod that answers if a method has machine code, and if so if it's machine code is frameless, and/or refers to a young object. No primitive number. Used to test the above. Make printOopShort: print Association keys. Useful for longPrintOop:, and hence printReferencesTo: etc. Mac OS: add fflush to debug printing in sqMacUIEventsUniversal.c so output appears promptly. ------------------------------------------------------------------------ r2548 | eliot | 2012-04-13 10:44:17 -0700 (Fri, 13 Apr 2012) | 20 lines CogVM source as per VMMaker.oscog-eem.156 CoInterpreter: Provide a thorough flush primitive for CompiledMethods that discards all machine code and makes sure that any contexts using the method have bytecode pcs. Primitive #215 (same as 116 in the Stack VM). This is much slower than 116 (flushCache) since it has to enumerate over all heap contexts. Provide an xray primitive for CompiledMethod that answers if a method has machine code, and if so if it's machine code is frameless, and/or refers to a young object. No primitive number. Used to test the above. Make printOopShort: print Association keys. Useful for longPrintOop:, and hence printReferencesTo: etc. Mac OS: add fflush to debug printing in sqMacUIEventsUniversal.c so output appears promptly. Build: a few more svn:ignore properties. ------------------------------------------------------------------------ r2547 | eliot | 2012-04-08 15:43:27 -0700 (Sun, 08 Apr 2012) | 4 lines Use the do-it-yourself asprintf in sqSCCSVersion.h since Mac OS's segfaults. Fix the annoying bogus error messages from the mprotect calls by getting the length arg to mprotect right. ------------------------------------------------------------------------ r2546 | eliot | 2012-04-05 12:21:49 -0700 (Thu, 05 Apr 2012) | 2 lines Add version infor for the Cross/plugins tree. Add a -version switch to win32. ------------------------------------------------------------------------ r2540 | eliot | 2012-04-03 14:25:41 -0700 (Tue, 03 Apr 2012) | 14 lines Cog VM source as per VMMaker.oscog-eem.154. Fix bad conceptual bug with become on methods. Unlike full and incremental GC, the reference from a Cog method to its method object must not be remapped since they're two halves of the same object. Fix FileStreamTest>testPositionPastEndIsAtEnd on unix & Mac OS. Merge Merge VMConstruction-Plugins-OSProcessPlugin-dtl.33's changes. Regenerate the apparently truncated nscogsrc ZipPlugin.c. Handle more libc variations for LD_LIBRARY_PATH in the unix launch scripts. ------------------------------------------------------------------------ r2539 | eliot | 2012-04-03 14:03:16 -0700 (Tue, 03 Apr 2012) | 10 lines Fix bad conceptual bug with become on methods. Unlike full and incremental GC, the reference from a Cog method to its method object must not be remapped since they're two halves of the same object. Merge Merge VMConstruction-Plugins-OSProcessPlugin-dtl.33's changes. Regenerate the apparently truncated nscogsrc ZipPlugin.c. Handle more libc variations for LD_LIBRARY_PATH in the unix launch scripts. ------------------------------------------------------------------------ r2538 | eliot | 2012-03-03 13:13:51 -0800 (Sat, 03 Mar 2012) | 12 lines Cog VM source as per VMMaker.oscog-eem.152. Fix tricky context state bug that can cause crashes in the GC. Contextpart>runUntilErrorOrReturnFrom: may pop the last argument. Hence if a frame is married in this state its spouse context won't have its last argument slot initialized. If later the frame is divorced and the arguments are not updated the last argument slot can be left with this uninitialized slot and ... bang. The sloution is to update arguments as well as stack contents when divorcing. This is good also because it removes the VM's assumption that method arguments are read-only, and that's only enforced by the Smalltalk bytecode compiler, not by the bytecode. ------------------------------------------------------------------------ r2537 | eliot | 2012-02-28 17:15:43 -0800 (Tue, 28 Feb 2012) | 5 lines CogVM source as per VMMaker.oscog-eem.150. Fix assert failures in mapVMRegisters due to new multiple bytecode set support. Disable filling of the weakRoots table during fullGC. Report remappable oop and weak root table overflows as errors. ------------------------------------------------------------------------ r2534 | eliot | 2012-02-20 19:08:12 -0800 (Mon, 20 Feb 2012) | 11 lines Support for multiple bytecode sets. The sign bit of a method's header can select an alternative bytecode set. This is implemented by adding 256 to currentBytecode when dispatching. The overhead is avoioded for slow machines using macrology. But in tests on a fast MacBook Pro adding the offset can actually be faster because other effects dominate dispatch performance on modern machines (e.g. code placement). Enough of a working stack build for performance measurment. Fix the SoundGenerationPlugin. ------------------------------------------------------------------------ r2532 | eliot | 2012-02-18 14:48:19 -0800 (Sat, 18 Feb 2012) | 13 lines CogVm source as per VMMaker.oscog-eem.144. Make primitiveObjectAtPut fail if used to store other than a SmallInteger into the method header. Better error message for inability to thread. Load function pointer early in ThreadedFFIPlugin's invocation checking sequence. This must come early for compatibility with the old FFIPlugin. Image-level code may assume the function pointer is loaded eagerly. Implement AndCwR & OrCwR in CogIA32Compiler. Nuke some junk in macbuild. Add untested stackbuild/{cygwinbuild,macbuild}. (time to move to mercurial?) Regenerate plugins with BytesPerWord defined. ------------------------------------------------------------------------ r2530 | eliot | 2012-02-03 15:02:38 -0800 (Fri, 03 Feb 2012) | 4 lines Add 1007,1008 & 1009 attribute info to version info on linux, & 1009 on Windows. Add -version option to Mac VM (with similar info to linux). Fix compilation warning in sqWin32PluginSupport.c ------------------------------------------------------------------------ r2529 | eliot | 2012-02-02 14:45:39 -0800 (Thu, 02 Feb 2012) | 2 lines Enable building vm-display-fbdev on linux. Exclude fbdev in the newspeak build. ------------------------------------------------------------------------ r2528 | eliot | 2012-02-01 18:03:33 -0800 (Wed, 01 Feb 2012) | 7 lines Load function pointer early in threaded FFI checking sequence, for compatibility with old FFIPlugin. Make Qwaq ticker support optional, requiring VM_TICKER to enable. This to simplify ticker for older linuxes. Include Michael Zeder's fixes to revive vm-display-fbdev build on linux. Avoid assuming readlink supports -f flag on linux builds. ------------------------------------------------------------------------ r2522 | eliot | 2011-12-12 11:24:27 -0800 (Mon, 12 Dec 2011) | 9 lines CogVM source as per VMMaker.oscog-eem.140. Avoid localizing backward jump count variables to interpret so that optimized and unoptimized VMs behave the same. On unix and Mac OS print the error message at the end of the stack dumps as well as before, so one can see error messages more readily. Fix regression with new command line parsing on Windows. If no image supplied and a GUI application open the image file open dialog. If a console app, print usage and quit. ------------------------------------------------------------------------ r2519 | eliot | 2011-11-30 14:30:39 -0800 (Wed, 30 Nov 2011) | 4 lines Change the VM argument access back to be consistent with linux: 0 => executable name -1 .. -n => VM arguments *including* image (if explicitly supplied). Provide standard i/o console access on Windows. ------------------------------------------------------------------------ r2518 | eliot | 2011-11-28 15:53:52 -0800 (Mon, 28 Nov 2011) | 4 lines Cope with old linuxes use of /lib/tls hack for an optional thread-local-storage version of libc/libpthread. The launch scripts add /lib/tls:/usr/lib/tls: to LD_LIBRARY_PATH instead of /lib:/usr/lib: if the VM is linked to /lib/tls/libc. ------------------------------------------------------------------------ r2517 | eliot | 2011-11-28 11:07:44 -0800 (Mon, 28 Nov 2011) | 6 lines Add access to VM arguments to Mac. Make Windows, Mac and Unix consistent: Smalltalk getSystemAttribute: -1 => executable name -2 .. -n => VM arguments *including* image (if explicitly supplied). Replace win32 command line parsing with unixesque code using CommandLineToArgvW. ------------------------------------------------------------------------ r2515 | eliot | 2011-11-18 10:13:10 -0800 (Fri, 18 Nov 2011) | 7 lines CogVM source as per VMMaker.oscog-eem.139. Replace bogus fix for frameless foo: arg instVar := instVar code gen bug (apparent failure to pop spills on frameless return), with correct fix, which is not to flush the top of stack when pop/storing receiver and/or temp vars. i.e. ssFlushUpThroughReceiverVariable: & ssFlushUpThroughTemporaryVariable: skip the entry at simStackPtr. ------------------------------------------------------------------------ r2514 | eliot | 2011-11-17 17:18:02 -0800 (Thu, 17 Nov 2011) | 4 lines CogVM source as per VMMaker.oscog-eem.138. Fix frameless foo: arg instVar := instVar code gen bug (failure to pop spills on frameless return). Use more hex printing in frame/oop printing. ------------------------------------------------------------------------ r2508 | eliot | 2011-11-09 11:41:06 -0800 (Wed, 09 Nov 2011) | 10 lines CogVM source as per VMMaker.oscog-eem.137. Fix primitiveContextAt[Put] for non-contexts (ContextPart subclasses other than MethodContext including BlockContext). stObjectAt[Put] could fail so args should be popped only on success. Fixes failures in ClosureCompilerTest>testSourceRangeAccessForBlueBookInjectInto as of VMMaker.oscog-eem.118. Add convenient shortPrintFrame:AndNCallers: for debugging. ------------------------------------------------------------------------ r2507 | eliot | 2011-11-08 16:20:29 -0800 (Tue, 08 Nov 2011) | 4 lines Make the unix launch script include /lib & /usr/lib in LD_LIBRARY_PATH if LD_LIBRARY_PATH is unset. Modify the invocations of ex in the editing scripts to not read ~/.exrc, and hence not be confused by e.g. set ignorecase. ------------------------------------------------------------------------ r2506 | eliot | 2011-11-07 10:28:00 -0800 (Mon, 07 Nov 2011) | 3 lines Fix error codes for at: and at:put: primitive so that for non-indexable objects they fail with #'bad receiver', not #'bad index'. ------------------------------------------------------------------------ r2503 | eliot | 2011-10-25 11:52:29 -0700 (Tue, 25 Oct 2011) | 6 lines Filter-out attempts to create MNU pics with new selectors. Fixes Stephane Rollandin's crash of 21/10/2011: [((Compiler new evaluate: ('Beuh' ifNuk: [yo])) on: Error do: [:ex | ex description]) printString] fork ------------------------------------------------------------------------ r2502 | eliot | 2011-10-19 11:52:10 -0700 (Wed, 19 Oct 2011) | 2 lines Ensure the unix run scripts set SQUEAK_PLUGINS if unset. ------------------------------------------------------------------------ r2501 | eliot | 2011-10-19 11:07:48 -0700 (Wed, 19 Oct 2011) | 11 lines CogVM source as per VMMaker.oscog-eem.134. Fix remaining bug in context access fixes of VMMaker.oscog-eem.119. stObject:at: and stObject:at:put: need to use stackPointerForMaybeMarriedContext: not fetchStackPointerOf:, since the context's stack pointer may be stale. Fix send trace printing. Interpreter sends need also to be printed. (A better fix is probably to redo sendBreakpoint: but this will serve for now). N.B. this reassigns the sendtrace flag values. Add primitiveNotEquivalent with prim # 169. ------------------------------------------------------------------------ r2499 | eliot | 2011-10-09 10:16:26 -0700 (Sun, 09 Oct 2011) | 8 lines CogVM source as per VMMaker.oscog-eem.133. Tiny performance tweak to bytecodePrimMultiply. Added findStringBeginningWith: debugging facility. Fix yet another slip in Cogit>>lookup:for:methodAndErrorSelectorInto: for cannotInterpret: cases. Fixes Mariano's crash as of 2011/10/03. Add -numextsems command-line argument to set size of external semaphore table on start-up. Changes to allow compilation via clang 1.7 on Mac OS X. Assert & Debug VMs work. -O2 production VM crashes on start-up. ------------------------------------------------------------------------ r2498 | eliot | 2011-10-04 07:47:44 -0700 (Tue, 04 Oct 2011) | 4 lines CogVM source as per VMMaker.oscog-eem.132. Fix yet another slip in Cogit>>lookup:for:methodAndErrorSelectorInto: for cannotInterpret: cases. Fixes Mariano's crash as of 2011/10/03. ------------------------------------------------------------------------ r2497 | eliot | 2011-10-03 14:46:33 -0700 (Mon, 03 Oct 2011) | 5 lines CogVm source as per VMMaker.oscog-eem.131. Deal with some realities in the minValidCallAddress checking code. At least on Mac OS under gcc -O, gcc will reorder code so that primitiveFail comes before interpret. Also firm up the signatures of rewriteInlineCacheAt:tag:target: & rewriteCallAt:target:. ------------------------------------------------------------------------ r2496 | eliot | 2011-09-27 18:21:14 -0700 (Tue, 27 Sep 2011) | 6 lines CogVM source as per VMMaker.oscog-eem.128 Fix regression in object-as-method/cannot-interpret for single and polymorphic inline cache misses (lookup:for:methodAndErrorSelectorInto:). Fix formatting bugette in context printing. Suitable svn:ignore props for Newspeak mac installer dir. ------------------------------------------------------------------------ r2495 | eliot | 2011-09-23 13:51:32 -0700 (Fri, 23 Sep 2011) | 4 lines CogVM source as per VMMaker.oscog-eem.127. Fix MNU PIC creation not to answer an error code to the interpreter. This is the call 0x00000013 bug. Regenerate Win32OSProcessPlugin to get an official source stamp. ------------------------------------------------------------------------ r2494 | eliot | 2011-09-22 18:24:09 -0700 (Thu, 22 Sep 2011) | 4 lines CogVM source as per VMMaker.oscog-eem.126. Fix cPICEndSize mis-computation caused by using rounded-up closedPICSize. Compute cPICEndSize and /then/ round-up closedPICSize. ------------------------------------------------------------------------ r2493 | eliot | 2011-09-21 16:10:54 -0700 (Wed, 21 Sep 2011) | 4 lines CogVM source as per VMMaker.oscog-eem.125. Add callsite link/relocate checks to catch the call 0x00000013 MNU callsite relinking bug. Reduce the size of the simStack to something proportional to LargeContextSize. ------------------------------------------------------------------------ r2492 | eliot | 2011-09-09 15:36:04 -0700 (Fri, 09 Sep 2011) | 4 lines In the Newspeak VM, don't cd to the image's directory on win32. Fix off-by-one error in Win32OSProcessPlugin>primitiveGetCurrentWorkingDirectory so it doesn't include an erroneous trailing null. ------------------------------------------------------------------------ r2491 | eliot | 2011-09-06 16:44:23 -0700 (Tue, 06 Sep 2011) | 2 lines CogVM source as per VMMaker.oscog-eem.122. Fix the 1Gb allocation bug. ------------------------------------------------------------------------ r2489 | eliot | 2011-08-22 17:22:53 -0700 (Mon, 22 Aug 2011) | 3 lines CogVm source as per VMMaker.oscog-eem.121. Clean up compilation warnings. Add a hard check on Cogit overflowing the number of allocated abstract instructions. ------------------------------------------------------------------------ r2488 | eliot | 2011-08-19 14:33:12 -0700 (Fri, 19 Aug 2011) | 16 lines CogVM source as per VMMaker.oscog-eem.119. CoInterpreter/StackInterpreter: Fix object accessing prims (at:, at:put: & size 60, 61 & 612) for contexts, because primitives 60-62 are used for the mirror primitives in ContextPart (object:at: et al). Fix now obsolete, but still used primitiveContextAt et al (primitives 210, 211 & 212) to be varargs, since these might also be used from mirror primitives. Pull the temporary:in:[put:] code into a non-inlined wrapper to avoid bloating the common case. Cogit/CogObjectRepresentationForSqueakV3: Fix genInnerPrimitiveAt: & genInnerPrimitiveSize to fail for context receivers. Fix genInnerPrimitiveAt:, genInnerPrimitiveStringAt: & genInnerPrimitiveSize to call the interpereter primitive on failure, to get the error code - not yet avoiding the call if the method doesn't use the error code; one thing at a time. ------------------------------------------------------------------------ r2487 | eliot | 2011-08-16 15:28:12 -0700 (Tue, 16 Aug 2011) | 16 lines CogVM source as per VMMaker.oscog-eem.117. Fix bugs described in the "[Pharo-project] Troubles with #flushCache and #run:with:in:" thread http://lists.gforge.inria.fr/pipermail/pharo-project/ 2011-July/050858.html. The PIC machinery wrongly treated invoke-as-method sends as MNUs. Closely related, finally fully implement PIC MNU cacheing where, by calling a special abort, a PIC is able to record that a gven selector is an MNU for a particular class. Speeds up a simple MNU benchmark by 33% (with more performance the deeper the receiver's cass hierarchy is). On Mac fix mis-editing of Info.plist to insert revision info so that VM .app once again starts on 10.5.x. Update Pharo icon to the nice Cog one. ------------------------------------------------------------------------ r2486 | eliot | 2011-08-08 12:01:31 -0700 (Mon, 08 Aug 2011) | 3 lines Include the rule 41 code in the BitBltPlugin. Fix regression in linux mt build mvm script. ------------------------------------------------------------------------ r2485 | eliot | 2011-08-07 13:36:57 -0700 (Sun, 07 Aug 2011) | 11 lines CogVM source as per VMMaker.oscog-eem.114. CoInterpreter: fix bad bug with primitiveClone of a compiled method. The clone should be an uncogged method irrespective of the state of the receiver. Symptoms include rare crashes in become: during MethodDictionaryTest which copies a test method. Cogit: Fix potential bug in become: with cogged methods. Since become can cause an object to gain a new reference cogged methods that gain new references must be added to youngReferrers. ------------------------------------------------------------------------ r2484 | eliot | 2011-08-01 14:36:19 -0700 (Mon, 01 Aug 2011) | 5 lines Move dialect-independence macros to sq.h and use them on Mac OS. Format platforms/unix/vm/sqUnixExternalPrims.c so I can make sense of it and hence avoid calling tryLoading with a null plugin. Update unix HowToBuilds with info on avoiding gcc 3.4.x and -O2. ------------------------------------------------------------------------ r2483 | eliot | 2011-07-31 15:48:45 -0700 (Sun, 31 Jul 2011) | 2 lines Dialect neutrality for error and help messages in the Unix VM. ------------------------------------------------------------------------ r2481 | eliot | 2011-07-30 13:48:09 -0700 (Sat, 30 Jul 2011) | 2 lines And the VM path must be terminated with a /. ------------------------------------------------------------------------ r2480 | eliot | 2011-07-30 13:45:12 -0700 (Sat, 30 Jul 2011) | 5 lines Modify Newspeak MacOS vm to answer Resources directory for primVMPath so that the sources file can be included in the Resources directory (which makes for a neater install). Modify the MacOS dmg installer a) to put the sources in the Resources directory and b) to include the YY.WW.REV version in the dmg name. ------------------------------------------------------------------------ r2476 | eliot | 2011-07-29 12:59:34 -0700 (Fri, 29 Jul 2011) | 4 lines CogVm source as per VMMaker.oscog-eem.113. Refuse to JIT closure no-context- switch value until teh relevant offsets have been computed. Add the Newspeak Windows installer by Peter von der Ahe. Builds an msi. ------------------------------------------------------------------------ r2474 | eliot | 2011-07-26 15:55:21 -0700 (Tue, 26 Jul 2011) | 8 lines CogVM source as per VMMaker.oscog-eem.112.mcz. Newspeak: Add missing incremental GC code for implicit receiver cache. Fix markLiteralsAndUnlinkIfUnmarkedSendOrPushImplicit:pc:method: for empty cache. Fix Mac VM to use correct Newspeak document icons for source files et al. Nuke long forgotten VERSION, in favour of platforms/Cross/vm/sqSCCSVersion.h. ------------------------------------------------------------------------ r2473 | eliot | 2011-07-25 15:47:11 -0700 (Mon, 25 Jul 2011) | 2 lines Use the Newspeak icons for Newspeak documents in the Newspeak VM. ------------------------------------------------------------------------ r2471 | eliot | 2011-07-25 13:49:46 -0700 (Mon, 25 Jul 2011) | 5 lines Newspeak Cog VM source as per VMMaker.oscog-eem.111.mcz. Fix remapNSIfObjectRef: pc:hasYoung: so if implicit receiver cache tag or value are young method must remain in youngReferrers. [gcc3x-]cointerp.c regenerated without defining given constants (i.e. IMMUTABILITY & NewspeakVM). ------------------------------------------------------------------------ r2468 | eliot | 2011-07-20 14:37:01 -0700 (Wed, 20 Jul 2011) | 2 lines Fix internal UUIDPlugin build on linux. Remember to update sqSCCSVersion.h. ------------------------------------------------------------------------ r2461 | eliot | 2011-07-15 15:18:34 -0700 (Fri, 15 Jul 2011) | 7 lines Fix Newspeak main window opening on Win32. Add getSystemAttribute 1009 to answer the revision and repository URL of the current source tree. See platforms/Cross/vm/sqSCCSVersion.h. Provide a script svnci that causes sqSCCSVersion.h to be updated on check-in so its REV is up-to-date. Modify mkvmarchives script to add rev to end of version numbers in the Mac Info.plist files. ------------------------------------------------------------------------ ------------------------------- Feb 15 2016 CogVM binaries as per VMMaker.oscog-eem.1679/r3602 Include 64-bit Spur VMs for Mac OS X x64 and Linux x64. N.B. As yet these VMs lack FFI support. Move all Mac OS X VMs to the Cocoa libraries. Minimum supported version should be 10.6.x. The Mac OS X VMs are signed and so should install properly without having to disable the launch security checks. Bug Fixes and Improvements: General: Add vmParameter 20 to answer the utc microseconds at startup. CoInterpreter: Remove the atCache from the CoInterpreter. It's of little benefit given the Cogit. ceSend: et al need to add looked up methods to the method cache, otherwise methods only found through machine code sends will not be jitted. Fix slip in maybeSelectorOfMethod: which will improve back traces including methods containing pragmas (including primitives). Modify secret primtiive 161, primitiveSetIdentityHash so that with 0 args it answers whether an object has an identity hash. This is vacuously true for V3, but is meaningful in Spur. Cogit: Fix /horrible/ bug with primitive error codes and fixups. The adjustment of the initialPC to skip the primitive and error code, if any, was done after generating fixups for backward branches, and hence these branches were bogus. Object>>shallowCopy in Spur is subject to this, but amazingly enough it has not surfaced before now. Fix this by adjusting the initialPC before scanMethod scans for fixups. Fix bug in Spur machine-code at:put: on 32-bit bits objects; method failed to fail for negative values. Fill unused portions of methods with the stop instruction, not nop. Explicitly initialize the code zone with stops. Explicitly clear the reclaimed portion of the method zone after a compaction. Include the reclaimed portion of the method zone in the I-cache flush after a compaction: no point in leaving it in cache since it isn't a valid call/jump target. Spur: Maintain the survivor count on scavenge. Fix start up of images containing >= 16 segments. The old code assumed numSegments < 16 and failed to grow the segment records, resulting in objects in segments greater than 15 to not be swizzled, and a resulting crash. Spur Cogit: Support CompiledMethod indexing in genPrimitiveAt[Put]. Hence fix the regression in at:[put:] whereby in Spur one could access the literals part of a method as bytes. Add a machine-code primitive for objectAt: to provide fast literal and header access on Spur. Add 16-bit indexability to Spur. Generate slimmer code for positive32BitValueOf: on 64-bit Spur. Fix a bug with out-of-place two-way become, which got the hash copy the wrong way round. By default, the hash stays with the reference in two-way become. Fix what appears to be a compiler bug with in-place two-way-become by treating the headers to be swapped so that remembered flags are swapped and hash bits are swapped if required. This fixes a bug with in-place two-way become of objects that are the same size on the heap. One object's contents would not be updated correctly. Implement ephemeron queue primitive. Add an image flag that controls the finalization support (StackInterpreter instVar newFinalization). If unset, finalization is as currently expected; WeakArray finalizes all WeakArrays in its registries on each finalization (which does not scale!). If set, then both fired ephemerons and bereaved weak arrays are added to the finalization queue and the finalization semaphore is signalled. In this regime the image is expected to send mourn to each element of the queue, and weak arrays will send themselves finalize in mourn, side-stepping the finalizeValues steps and rendering WeakArray's FinalizationDependents and WeakRegistry obsolete. The bit is set via Smalltalk vmParameterAt: 48 put: ((Smalltalk vmParameterAt: 48) bitOr: 64). Slang: Fix bad regression in type inference from VMMaker.oscog-eem.1587. returnTypeForSend:in: can only default return types to sqInt for unknown selectors. The rewrite in VMMaker.oscog-eem.1587 inadvertently defaulted the return type of known methods whose return type was yet to be determined to sqInt. The fix is to only default to sqInt if there is no known method for the given selector. This fixes, for instance, the weird flipping of the type of 32-bit Spur's headerWhileForwardingOf:,which should always be #sqLong. Fix bad bug in type inferrence. Avoid computing variable and return types prematurely i.e. don't derive types from as-yet-untyped methods. Fix baaaad bug in node:typeCompatibleWith:inliningInto:in: which was looking up the type of the formal parameter in inlining in the target method, not the method being inlined! Newspeak: Fix bug in MNU for cogged dynamic super sends - should start looking for #doesNotUnderstand: in the superclass not the receiver class. Unify MNU lookup between absent and present receiver sends as a result. Further fix outer send MNU by not confusing lkupClass and lkupClassTag. Push setting lkupClassTag down to clarify it is for new cache entries. Plugins: Fix the FilePlugin's unnecessary fullGC on Spur. Include the file sync prim in the FilePrims plugin. ThreadedFFIPlugin: - ExternalAddress now are taken correctly (nor as ByteArray or Alien, because they are different beasts). - allow pushing of pointers to any type (into a ByteArray, an ExternalAddress or an Alien), to allow passing parameters style int*, float*, etc. - allow reading in memory to allow read chunks of ByteArray Added ThreadedFFIPlugin>>#primitiveLoadSymbolFromModule (copy and adapt from IA32ABIPlugin). Fix coercion problems on FFI plugin (IA32 & ARM) - character were not correctly mapped back - floats were not being well checked - external addressed needs to be treated as aliens for the purpose of coercing them as pointers (bad regression by Eliot) Alien Plugins: Fix missing primitive failure for Alien typeAt: 0 [put:]. Add word accessors to Alien.