[squeak-dev] The Trunk: System-eem.1236.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Jun 28 17:13:10 UTC 2021

Eliot Miranda uploaded a new version of System to project The Trunk:

==================== Summary ====================

Name: System-eem.1236
Author: eem
Time: 28 June 2021, 10:13:05.818847 am
UUID: eb4ecd02-13f0-7b48-ac7d-d77dbdfa49f5
Ancestors: System-dtl.1235

Add the new primitive error codes to the specialObjectsArray.

=============== Diff against System-dtl.1235 ===============

Item was changed:
  ----- Method: SmalltalkImage>>recreateSpecialObjectsArray (in category 'special objects') -----
  	"Smalltalk recreateSpecialObjectsArray"
  	"To external package developers:
  	If you are writing a plugin and need additional special object(s) for your own use, 
  	use addGCRoot() function and use own, separate special objects registry "
  	"The Special Objects Array is an array of objects used by the Squeak virtual machine.
  	 Its contents are critical and accesses to it by the VM are unchecked, so don't even
  	 think of playing here unless you know what you are doing."
  	| newArray |
  	newArray := Array new: 60.
  	"Nil false and true get used throughout the VM"
  	newArray at: 1 put: nil.
  	newArray at: 2 put: false.
  	newArray at: 3 put: true.
  	"This association holds the active process (a ProcessScheduler)"
  	newArray at: 4 put: (self specialObjectsArray at: 4) "(self bindingOf: #Processor) but it answers an Alias".
  	"Numerous classes below used for type checking and instantiation"
  	newArray at: 5 put: Bitmap.
  	newArray at: 6 put: SmallInteger.
  	newArray at: 7 put: ByteString.
  	newArray at: 8 put: Array.
  	newArray at: 9 put: Smalltalk.
  	newArray at: 10 put: BoxedFloat64.
  	newArray at: 11 put: (self globals at: #Context).
  	newArray at: 12 put: WideString. "Was BlockContext"
  	newArray at: 13 put: Point.
  	newArray at: 14 put: LargePositiveInteger.
  	newArray at: 15 put: Display.
  	newArray at: 16 put: Message.
  	newArray at: 17 put: CompiledMethod.
  	newArray at: 18 put: ((self specialObjectsArray at: 18) ifNil: [Semaphore new]). "low space Semaphore"
  	newArray at: 19 put: Semaphore.
  	newArray at: 20 put: Character.
  	newArray at: 21 put: #doesNotUnderstand:.
  	newArray at: 22 put: #cannotReturn:.
  	newArray at: 23 put: nil. "This is the process signalling low space."
  	"An array of the 32 selectors that are compiled as special bytecodes,
  	 paired alternately with the number of arguments each takes."
  	newArray at: 24 put: #(+ 1 - 1 < 1 > 1 <= 1 >= 1 = 1 ~= 1
  							* 1 / 1 \\ 1 @ 1 bitShift: 1 // 1 bitAnd: 1 bitOr: 1
  							at: 1 at:put: 2 size 0 next 0 nextPut: 1 atEnd 0 == 1 class 0
  							~~ 1 value 0 value: 1 do: 1 new 0 new: 1 x 0 y 0 ).
  	newArray at: 25 put: nil. "Was an array of the 255 Characters in ascii order. This is nil in Spur, which has immediate Characters."
  	newArray at: 26 put: #mustBeBoolean.
  	newArray at: 27 put: ByteArray.
  	newArray at: 28 put: Process.
  	"An array of up to 31 classes whose instances will have compact headers; an empty array in Spur"
  	newArray at: 29 put: self compactClassesArray.
  	newArray at: 30 put: ((self specialObjectsArray at: 30) ifNil: [Semaphore new]). "delay Semaphore"
  	newArray at: 31 put: ((self specialObjectsArray at: 31) ifNil: [Semaphore new]). "user interrupt Semaphore"
  	"Entries 32 - 34 unreferenced. Previously these contained prototype instances to be copied for fast initialization"
  	newArray at: 32 put: DoubleByteArray. "was the prototype Float"
  	newArray at: 33 put: WordArray. "was the prototype 4-byte LargePositiveInteger"
  	newArray at: 34 put: DoubleWordArray. "was the prototype Point"
  	newArray at: 35 put: #cannotInterpret:.
  	newArray at: 36 put: nil. "was the prototype MethodContext"
  	newArray at: 37 put: BlockClosure.
  	newArray at: 38 put: (self at: #FullBlockClosure ifAbsent: []). "was the prototype BlockContext"
  	"array of objects referred to by external code"
  	newArray at: 39 put: (self specialObjectsArray at: 39).	"external semaphores"
  	newArray at: 40 put: nil. "Reserved for Mutex in Cog VMs"
  	newArray at: 41 put: ((self specialObjectsArray at: 41) ifNil: [LinkedList new]). "Reserved for a LinkedList instance for overlapped calls in CogMT"
  	newArray at: 42 put: ((self specialObjectsArray at: 42) ifNil: [Semaphore new]). "finalization Semaphore"
  	newArray at: 43 put: LargeNegativeInteger.
  	"External objects for callout.
  	 Note: Written so that one can actually completely remove the FFI."
  	newArray at: 44 put: (self at: #ExternalAddress ifAbsent: []).
  	newArray at: 45 put: (self at: #ExternalStructure ifAbsent: []).
  	newArray at: 46 put: (self at: #ExternalData ifAbsent: []).
  	newArray at: 47 put: (self at: #ExternalFunction ifAbsent: []).
  	newArray at: 48 put: (self at: #ExternalLibrary ifAbsent: []).
  	newArray at: 49 put: #aboutToReturn:through:.
  	newArray at: 50 put: #run:with:in:.
  	"51 reserved for immutability message"
  	newArray at: 51 put: #attemptToAssign:withIndex:.
  	newArray at: 52 put: #(nil "nil => generic error" #'bad receiver'
  							#'bad argument' #'bad index'
  							#'bad number of arguments'
  							#'inappropriate operation'  #'unsupported operation'
  							#'no modification' #'insufficient object memory'
  							#'insufficient C memory' #'not found' #'bad method'
  							#'internal error in named primitive machinery'
  							#'object may move' #'resource limit exceeded'
  							#'object is pinned' #'primitive write beyond end of object'
  							#'object moved' #'object not pinned' #'callback error'),
+ 						  {	PrimitiveError new errorName: #'operating system error'; yourself.
+ 							 ExceptionInFFICallError new errorName: #'exception in FFI call'; yourself},
+ 						  #(	#'heap compaction needed' #'operation failed'
+ 							#'internal error' #'uninitialized').
- 							{PrimitiveError new errorName: #'operating system error'; yourself.
- 							 ExceptionInFFICallError new errorName: #'exception in FFI call'; yourself}.
  	"53 to 55 are for Alien"
  	newArray at: 53 put: (self at: #Alien ifAbsent: []).
  	newArray at: 54 put: #invokeCallbackContext:. "use invokeCallback:stack:registers:jmpbuf: for old Alien callbacks."
  	newArray at: 55 put: (self at: #UnsafeAlien ifAbsent: []).
  	"Used to be WeakFinalizationList for WeakFinalizationList hasNewFinalization, obsoleted by ephemeron support."
  	newArray at: 56 put: nil.
  	"reserved for foreign callback process"
  	newArray at: 57 put: (self specialObjectsArray at: 57 ifAbsent: []).
  	newArray at: 58 put: #unusedBytecode.
  	"59 reserved for Sista counter tripped message"
  	newArray at: 59 put: #conditionalBranchCounterTrippedOn:.
  	"60 reserved for Sista class trap message"
  	newArray at: 60 put: #classTrapFor:.
  	"Now replace the virtual machine's reference in one atomic operation"
  	self specialObjectsArray becomeForward: newArray!

Item was changed:
+ (PackageInfo named: 'System') postscript: '"Add the new primitive error codes to the specialObjectsArray if they are not there yet."
+ Smalltalk primitiveErrorTable size < 26 ifTrue:
+ 	[Smalltalk recreateSpecialObjectsArray]'!
- (PackageInfo named: 'System') postscript: 'SystemNavigation initializeAuthors.
- Preferences removePreference: #duplicateControlAndAltKeys.
- Preferences removePreference: #duplicateAllControlAndAltKeys.
- Preferences removePreference: #swapControlAndAltKeys.'!

More information about the Squeak-dev mailing list