Object.st
branchjv
changeset 18630 a74d669db937
parent 18442 bd42fa983e3f
parent 18620 b4e9f25d6ce6
child 18688 43370946620c
equal deleted inserted replaced
18617:fbfd2d411738 18630:a74d669db937
  3457 	    self dependents:(WeakArray with:anObject)
  3457 	    self dependents:(WeakArray with:anObject)
  3458 	] ifFalse:[
  3458 	] ifFalse:[
  3459 	    deps class == WeakArray ifTrue:[
  3459 	    deps class == WeakArray ifTrue:[
  3460 		dep := deps at:1.
  3460 		dep := deps at:1.
  3461 		dep ~~ anObject ifTrue:[
  3461 		dep ~~ anObject ifTrue:[
  3462 		    (dep isNil or:[dep == 0]) ifTrue:[
  3462 		    (dep isNil or:[dep class == SmallInteger]) ifTrue:[
  3463 			deps at:1 put:anObject
  3463 			deps at:1 put:anObject
  3464 		    ] ifFalse:[
  3464 		    ] ifFalse:[
  3465 			self dependents:(WeakIdentitySet with:dep with:anObject)
  3465 			self dependents:(WeakIdentitySet with:dep with:anObject)
  3466 		    ]
  3466 		    ]
  3467 		]
  3467 		]
  3560     |deps nwDeps|
  3560     |deps nwDeps|
  3561 
  3561 
  3562     deps := self dependents.
  3562     deps := self dependents.
  3563     deps size ~~ 0 ifTrue:[
  3563     deps size ~~ 0 ifTrue:[
  3564 	deps do:[:d |
  3564 	deps do:[:d |
  3565 		    (d notNil and:[d ~~ 0]) ifTrue:[
  3565 		    (d notNil and:[d class ~~ SmallInteger]) ifTrue:[
  3566 			aBlock value:d
  3566 			aBlock value:d
  3567 		    ]
  3567 		    ]
  3568 		]
  3568 		]
  3569     ].
  3569     ].
  3570     nwDeps := self nonWeakDependents.
  3570     nwDeps := self nonWeakDependents.
  3613 	    "/ added. Here we have to do the inverse ...
  3613 	    "/ added. Here we have to do the inverse ...
  3614 
  3614 
  3615 	    ((deps class == WeakArray) or:[deps class == Array]) ifTrue:[
  3615 	    ((deps class == WeakArray) or:[deps class == Array]) ifTrue:[
  3616 		((d := deps at:1) == anObject
  3616 		((d := deps at:1) == anObject
  3617 		or:[d isNil
  3617 		or:[d isNil
  3618 		or:[d == 0]]) ifTrue:[
  3618 		or:[d class == SmallInteger]]) ifTrue:[
  3619 		    self dependents:nil
  3619 		    self dependents:nil
  3620 		]
  3620 		]
  3621 	    ] ifFalse:[
  3621 	    ] ifFalse:[
  3622 		deps remove:anObject ifAbsent:[].
  3622 		deps remove:anObject ifAbsent:[].
  3623 		(n := deps size) == 0 ifTrue:[
  3623 		(n := deps size) == 0 ifTrue:[
  5270 "/        GenericException handle:[:ex |
  5270 "/        GenericException handle:[:ex |
  5271 "/            "/ ignore any error during termination
  5271 "/            "/ ignore any error during termination
  5272 "/        ] do:[
  5272 "/        ] do:[
  5273 "/           Processor activeProcess terminate.
  5273 "/           Processor activeProcess terminate.
  5274 "/        ].
  5274 "/        ].
       
  5275 	MiniDebugger enter.
  5275 	Processor activeProcess terminateNoSignal.
  5276 	Processor activeProcess terminateNoSignal.
  5276     ].
  5277     ].
  5277 
  5278 
  5278     "if there has been an ST-signal installed, use it ..."
  5279     "if there has been an ST-signal installed, use it ..."
  5279     sig := OperatingSystem operatingSystemSignal:signalNumber.
  5280     sig := OperatingSystem operatingSystemSignal:signalNumber.
  6564 perform:aSelector withOptionalArgument:arg
  6565 perform:aSelector withOptionalArgument:arg
  6565     "send aSelector-message to the receiver.
  6566     "send aSelector-message to the receiver.
  6566      If the message expects an argument, pass arg."
  6567      If the message expects an argument, pass arg."
  6567 
  6568 
  6568     aSelector argumentCount == 1 ifTrue:[
  6569     aSelector argumentCount == 1 ifTrue:[
  6569         ^ self perform:aSelector with:arg
  6570 	^ self perform:aSelector with:arg
  6570     ].
  6571     ].
  6571     ^ self perform:aSelector
  6572     ^ self perform:aSelector
  6572 
  6573 
  6573     "
  6574     "
  6574      |rec sel|
  6575      |rec sel|
  6589 
  6590 
  6590     |numArgs|
  6591     |numArgs|
  6591 
  6592 
  6592     numArgs := aSelector argumentCount.
  6593     numArgs := aSelector argumentCount.
  6593     numArgs == 0 ifTrue:[
  6594     numArgs == 0 ifTrue:[
  6594         ^ self perform:aSelector
  6595 	^ self perform:aSelector
  6595     ].
  6596     ].
  6596     numArgs == 1 ifTrue:[
  6597     numArgs == 1 ifTrue:[
  6597         ^ self perform:aSelector with:optionalArg1
  6598 	^ self perform:aSelector with:optionalArg1
  6598     ].
  6599     ].
  6599     ^ self perform:aSelector with:optionalArg1 with:optionalArg2.
  6600     ^ self perform:aSelector with:optionalArg1 with:optionalArg2.
  6600 
  6601 
  6601     "
  6602     "
  6602      |rec sel|
  6603      |rec sel|
  6617 
  6618 
  6618     |numArgs|
  6619     |numArgs|
  6619 
  6620 
  6620     numArgs := aSelector argumentCount.
  6621     numArgs := aSelector argumentCount.
  6621     numArgs == 0 ifTrue:[
  6622     numArgs == 0 ifTrue:[
  6622         ^ self perform:aSelector
  6623 	^ self perform:aSelector
  6623     ].
  6624     ].
  6624     numArgs == 1 ifTrue:[
  6625     numArgs == 1 ifTrue:[
  6625         ^ self perform:aSelector with:optionalArg1
  6626 	^ self perform:aSelector with:optionalArg1
  6626     ].
  6627     ].
  6627     numArgs == 2 ifTrue:[
  6628     numArgs == 2 ifTrue:[
  6628         ^ self perform:aSelector with:optionalArg1 with:optionalArg2
  6629 	^ self perform:aSelector with:optionalArg1 with:optionalArg2
  6629     ].
  6630     ].
  6630     ^ self perform:aSelector with:optionalArg1 with:optionalArg2 with:optionalArg3.
  6631     ^ self perform:aSelector with:optionalArg1 with:optionalArg2 with:optionalArg3.
  6631 
  6632 
  6632     "
  6633     "
  6633      |rec sel|
  6634      |rec sel|
  6648 
  6649 
  6649     |numArgs|
  6650     |numArgs|
  6650 
  6651 
  6651     numArgs := aSelector argumentCount.
  6652     numArgs := aSelector argumentCount.
  6652     numArgs == 0 ifTrue:[
  6653     numArgs == 0 ifTrue:[
  6653         ^ self perform:aSelector
  6654 	^ self perform:aSelector
  6654     ].
  6655     ].
  6655     numArgs == 1 ifTrue:[
  6656     numArgs == 1 ifTrue:[
  6656         ^ self perform:aSelector with:optionalArg1
  6657 	^ self perform:aSelector with:optionalArg1
  6657     ].
  6658     ].
  6658     numArgs == 2 ifTrue:[
  6659     numArgs == 2 ifTrue:[
  6659         ^ self perform:aSelector with:optionalArg1 with:optionalArg2
  6660 	^ self perform:aSelector with:optionalArg1 with:optionalArg2
  6660     ].
  6661     ].
  6661     numArgs == 3 ifTrue:[
  6662     numArgs == 3 ifTrue:[
  6662         ^ self perform:aSelector with:optionalArg1 with:optionalArg2 with:optionalArg3
  6663 	^ self perform:aSelector with:optionalArg1 with:optionalArg2 with:optionalArg3
  6663     ].
  6664     ].
  6664     ^ self perform:aSelector with:optionalArg1 with:optionalArg2 with:optionalArg3 with:optionalArg4.
  6665     ^ self perform:aSelector with:optionalArg1 with:optionalArg2 with:optionalArg3 with:optionalArg4.
  6665 
  6666 
  6666     "
  6667     "
  6667      |rec sel|
  6668      |rec sel|
  9042 
  9043 
  9043 ifNil:nilBlockOrValue ifNotNil:notNilBlockOrValue
  9044 ifNil:nilBlockOrValue ifNotNil:notNilBlockOrValue
  9044     "return the value of the first arg, if I am nil,
  9045     "return the value of the first arg, if I am nil,
  9045      the result from evaluating the 2nd argument, if I am not nil.
  9046      the result from evaluating the 2nd argument, if I am not nil.
  9046      Notice:
  9047      Notice:
  9047         This method is open coded (inlined) by the compiler(s)
  9048 	This method is open coded (inlined) by the compiler(s)
  9048         - redefining it may not work as expected."
  9049 	- redefining it may not work as expected."
  9049 
  9050 
  9050     (notNilBlockOrValue isBlock and:[notNilBlockOrValue argumentCount == 1]) ifTrue:[
  9051     (notNilBlockOrValue isBlock and:[notNilBlockOrValue argumentCount == 1]) ifTrue:[
  9051         ^ notNilBlockOrValue value:self.
  9052 	^ notNilBlockOrValue value:self.
  9052     ].
  9053     ].
  9053     ^ notNilBlockOrValue value
  9054     ^ notNilBlockOrValue value
  9054 !
  9055 !
  9055 
  9056 
  9056 ifNotNil:aBlockOrValue
  9057 ifNotNil:aBlockOrValue
  9057     "return myself if nil, or the result from evaluating the argument,
  9058     "return myself if nil, or the result from evaluating the argument,
  9058      if I am not nil.
  9059      if I am not nil.
  9059      Notice:
  9060      Notice:
  9060         This method is open coded (inlined) by the compiler(s)
  9061 	This method is open coded (inlined) by the compiler(s)
  9061         - redefining it may not work as expected."
  9062 	- redefining it may not work as expected."
  9062 
  9063 
  9063     (aBlockOrValue isBlock and:[aBlockOrValue argumentCount == 1]) ifTrue:[
  9064     (aBlockOrValue isBlock and:[aBlockOrValue argumentCount == 1]) ifTrue:[
  9064         ^ aBlockOrValue value:self.
  9065 	^ aBlockOrValue value:self.
  9065     ].
  9066     ].
  9066     ^ aBlockOrValue value
  9067     ^ aBlockOrValue value
  9067 !
  9068 !
  9068 
  9069 
  9069 ifNotNil:notNilBlockOrValue ifNil:nilBlockOrValue
  9070 ifNotNil:notNilBlockOrValue ifNil:nilBlockOrValue
  9070     "return the value of the 2nd arg, if I am nil,
  9071     "return the value of the 2nd arg, if I am nil,
  9071      the result from evaluating the 1st argument, if I am not nil.
  9072      the result from evaluating the 1st argument, if I am not nil.
  9072      Notice:
  9073      Notice:
  9073         This method is open coded (inlined) by the compiler(s)
  9074 	This method is open coded (inlined) by the compiler(s)
  9074         - redefining it may not work as expected."
  9075 	- redefining it may not work as expected."
  9075 
  9076 
  9076     (notNilBlockOrValue isBlock and:[notNilBlockOrValue argumentCount == 1]) ifTrue:[
  9077     (notNilBlockOrValue isBlock and:[notNilBlockOrValue argumentCount == 1]) ifTrue:[
  9077         ^ notNilBlockOrValue value:self.
  9078 	^ notNilBlockOrValue value:self.
  9078     ].
  9079     ].
  9079     ^ notNilBlockOrValue value
  9080     ^ notNilBlockOrValue value
  9080 !
  9081 !
  9081 
  9082 
  9082 ifNotNilDo:aBlock
  9083 ifNotNilDo:aBlock
 10299 
 10300 
 10300 
 10301 
 10301 !Object class methodsFor:'documentation'!
 10302 !Object class methodsFor:'documentation'!
 10302 
 10303 
 10303 version
 10304 version
 10304     ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.809 2015-06-05 16:11:10 stefan Exp $'
 10305     ^ '$Header$'
 10305 !
 10306 !
 10306 
 10307 
 10307 version_CVS
 10308 version_CVS
 10308     ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.809 2015-06-05 16:11:10 stefan Exp $'
 10309     ^ '$Header$'
 10309 !
 10310 !
 10310 
 10311 
 10311 version_HG
 10312 version_HG
 10312 
 10313 
 10313     ^ '$Changeset: <not expanded> $'
 10314     ^ '$Changeset: <not expanded> $'