Levente Uzonyi uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ul.380.mcz
==================== Summary ====================
Name: System-ul.380
Author: ul
Time: 27 September 2010, 1:58:00.722 pm
UUID: d9fb6dad-55ca-a048-82bd-161222f88e4d
Ancestors: System-ul.379, System-topa.378
merged
=============== Diff against System-ul.379 ===============
Item was changed:
----- Method: SystemNavigation>>showMenuOf:withFirstItem:ifChosenDo:withCaption: (in category 'ui') -----
showMenuOf: selectorCollection withFirstItem: firstItem ifChosenDo: choiceBlock withCaption: aCaption
"Show a sorted menu of the given selectors, preceded by firstItem, and all abbreviated to 40 characters. Use aCaption as the menu title, if it is not nil. Evaluate choiceBlock if a message is chosen."
| index menuLabels sortedList |
sortedList := selectorCollection asSortedCollection.
+ menuLabels := Array streamContents:
+ [:strm | strm nextPut: (firstItem contractTo: 40).
+ sortedList do: [:sel | strm nextPut: (sel contractTo: 40)]].
+ index := UIManager default chooseFrom: menuLabels lines: #(1).
- menuLabels := String streamContents:
- [:strm | strm nextPutAll: (firstItem contractTo: 40).
- sortedList do: [:sel | strm cr; nextPutAll: (sel contractTo: 40)]].
- index := UIManager default chooseFrom: (menuLabels substrings) lines: #(1).
index = 1 ifTrue: [choiceBlock value: firstItem].
index > 1 ifTrue: [choiceBlock value: (sortedList at: index - 1)]!
Levente Uzonyi uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ul.380.mcz
==================== Summary ====================
Name: System-ul.380
Author: ul
Time: 27 September 2010, 1:58:00.722 pm
UUID: d9fb6dad-55ca-a048-82bd-161222f88e4d
Ancestors: System-ul.379, System-topa.378
merged
=============== Diff against System-ul.379 ===============
Item was changed:
----- Method: SystemNavigation>>showMenuOf:withFirstItem:ifChosenDo:withCaption: (in category 'ui') -----
showMenuOf: selectorCollection withFirstItem: firstItem ifChosenDo: choiceBlock withCaption: aCaption
"Show a sorted menu of the given selectors, preceded by firstItem, and all abbreviated to 40 characters. Use aCaption as the menu title, if it is not nil. Evaluate choiceBlock if a message is chosen."
| index menuLabels sortedList |
sortedList := selectorCollection asSortedCollection.
+ menuLabels := Array streamContents:
+ [:strm | strm nextPut: (firstItem contractTo: 40).
+ sortedList do: [:sel | strm nextPut: (sel contractTo: 40)]].
+ index := UIManager default chooseFrom: menuLabels lines: #(1).
- menuLabels := String streamContents:
- [:strm | strm nextPutAll: (firstItem contractTo: 40).
- sortedList do: [:sel | strm cr; nextPutAll: (sel contractTo: 40)]].
- index := UIManager default chooseFrom: (menuLabels substrings) lines: #(1).
index = 1 ifTrue: [choiceBlock value: firstItem].
index > 1 ifTrue: [choiceBlock value: (sortedList at: index - 1)]!
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.502.mcz
==================== Summary ====================
Name: Kernel-eem.502
Author: eem
Time: 25 September 2010, 8:31:12.094 pm
UUID: 2cf495fb-5958-4ba2-afdc-18caf380caef
Ancestors: Kernel-eem.501
include ContextPart>>objectSize: amongst the mirror primitives
=============== Diff against Kernel-eem.501 ===============
Item was added:
+ ----- Method: ContextPart>>objectSize: (in category 'mirror primitives') -----
+ objectSize: anObject
+ "Answer the number of indexable variables in the argument anObject without sending
+ it a message. This mimics the action of the VM when it fetches an object's variable size.
+ Used to simulate the execution machinery by, for example, the debugger.
+ Primitive. See Object documentation whatIsAPrimitive."
+
+ <primitive: 62>
+ "The number of indexable fields of fixed-length objects is 0"
+ ^0!
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.502.mcz
==================== Summary ====================
Name: Kernel-eem.502
Author: eem
Time: 25 September 2010, 8:31:12.094 pm
UUID: 2cf495fb-5958-4ba2-afdc-18caf380caef
Ancestors: Kernel-eem.501
include ContextPart>>objectSize: amongst the mirror primitives
=============== Diff against Kernel-eem.501 ===============
Item was added:
+ ----- Method: ContextPart>>objectSize: (in category 'mirror primitives') -----
+ objectSize: anObject
+ "Answer the number of indexable variables in the argument anObject without sending
+ it a message. This mimics the action of the VM when it fetches an object's variable size.
+ Used to simulate the execution machinery by, for example, the debugger.
+ Primitive. See Object documentation whatIsAPrimitive."
+
+ <primitive: 62>
+ "The number of indexable fields of fixed-length objects is 0"
+ ^0!
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.502.mcz
==================== Summary ====================
Name: Kernel-eem.502
Author: eem
Time: 25 September 2010, 8:31:12.094 pm
UUID: 2cf495fb-5958-4ba2-afdc-18caf380caef
Ancestors: Kernel-eem.501
include ContextPart>>objectSize: amongst the mirror primitives
=============== Diff against Kernel-eem.501 ===============
Item was added:
+ ----- Method: ContextPart>>objectSize: (in category 'mirror primitives') -----
+ objectSize: anObject
+ "Answer the number of indexable variables in the argument anObject without sending
+ it a message. This mimics the action of the VM when it fetches an object's variable size.
+ Used to simulate the execution machinery by, for example, the debugger.
+ Primitive. See Object documentation whatIsAPrimitive."
+
+ <primitive: 62>
+ "The number of indexable fields of fixed-length objects is 0"
+ ^0!
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.501.mcz
==================== Summary ====================
Name: Kernel-eem.501
Author: eem
Time: 25 September 2010, 7:55:34.708 pm
UUID: 5b55eae3-594b-4416-9d47-5a4ebaabb238
Ancestors: Kernel-ul.500
Add mirror primitives which can be used for accurate
execution simulation (a.k.a. debugging) of proxies.
=============== Diff against Kernel-ul.500 ===============
Item was added:
+ ----- Method: ContextPart>>object:basicAt: (in category 'mirror primitives') -----
+ object: anObject basicAt: index
+ "Answer the value of an indexable element in the argument anObject without sending
+ it a message. Fail if the argument index is not an Integer or is out of bounds, or if
+ anObject is not indexable. This mimics the action of the VM when it indexes an object.
+ Used to simulate the execution machinery by, for example, the debugger.
+ Primitive. See Object documentation whatIsAPrimitive."
+
+ <primitive: 60>
+ index isInteger ifTrue: [self errorSubscriptBounds: index].
+ index isNumber
+ ifTrue: [^self object: anObject basicAt: index asInteger]
+ ifFalse: [self errorNonIntegerIndex]!
Item was added:
+ ----- Method: ContextPart>>object:basicAt:put: (in category 'mirror primitives') -----
+ object: anObject basicAt: index put: value
+ "Store the last argument
+ value in the indexable element of the argument anObject indicated by index without sending
+ anObject a message. Fail if the argument index is not an Integer or is out of bounds, or if
+ anObject is not indexable, or if value is an inappropriate value for anObject's indexable slots.
+ This mimics the action of the VM when it indexes an object.
+ Used to simulate the execution machinery by, for example, the debugger.
+ Primitive. See Object documentation whatIsAPrimitive."
+
+ <primitive: 61>
+ index isInteger
+ ifTrue: [(index >= 1 and: [index <= (self objectSize: anObject)])
+ ifTrue: [self errorImproperStore]
+ ifFalse: [self errorSubscriptBounds: index]].
+ index isNumber
+ ifTrue: [^self object: anObject basicAt: index asInteger put: value]
+ ifFalse: [self errorNonIntegerIndex]!
Item was added:
+ ----- Method: ContextPart>>object:eqeq: (in category 'mirror primitives') -----
+ object: anObject eqeq: anOtherObject
+ "Answer whether the first and second arguments are the same object (have the
+ same object pointer) without sending a message to the first argument. This
+ mimics the action of the VM when it compares two object pointers. Used to
+ simulate the execution machinery by, for example, the debugger.
+ Primitive. See Object documentation whatIsAPrimitive."
+
+ <primitive: 110>
+ self primitiveFailed!
Item was added:
+ ----- Method: ContextPart>>object:instVarAt: (in category 'mirror primitives') -----
+ object: anObject instVarAt: anIndex
+ "Primitive. Answer a fixed variable in an object. The numbering of the
+ variables corresponds to the named instance variables. Fail if the index
+ is not an Integer or is not the index of a fixed variable. Essential for the
+ debugger. See Object documentation whatIsAPrimitive."
+
+ <primitive: 73>
+ "Access beyond fixed variables."
+ ^self object: anObject basicAt: anIndex - (self objectClass: anObject) instSize!
Item was added:
+ ----- Method: ContextPart>>object:instVarAt:put: (in category 'mirror primitives') -----
+ object: anObject instVarAt: anIndex put: aValue
+ "Primitive. Store a value into a fixed variable in the argument anObject.
+ The numbering of the variables corresponds to the named instance
+ variables. Fail if the index is not an Integer or is not the index of a
+ fixed variable. Answer the value stored as the result. Using this
+ message violates the principle that each object has sovereign control
+ over the storing of values into its instance variables. Essential for the
+ debugger. See Object documentation whatIsAPrimitive."
+
+ <primitive: 74>
+ "Access beyond fixed fields"
+ ^self object: anObject basicAt: anIndex - (self objectClass: anObject) instSize put: aValue!
Item was added:
+ ----- Method: ContextPart>>object:perform:withArguments:inClass: (in category 'mirror primitives') -----
+ object: anObject perform: selector withArguments: argArray inClass: lookupClass
+ "Send the selector, aSymbol, to anObject with arguments in argArray.
+ Fail if the number of arguments expected by the selector
+ does not match the size of argArray, or if lookupClass
+ cannot be found among the anObject's superclasses.
+ Primitive. Essential for the debugger."
+
+ <primitive: 100 error: error>
+ (selector isMemberOf: Symbol) ifFalse:
+ [^self error: 'selector argument must be a Symbol'].
+ (argArray isMemberOf: Array) ifFalse:
+ [^self error: 'argArray must be an Array'].
+ (selector numArgs = argArray size)
+ ifFalse: [^self error: 'incorrect number of arguments'].
+ ((self objectClass: anObject) == lookupClass
+ or: [(self objectClass: anObject) inheritsFrom: lookupClass]) ifFalse:
+ [^self error: 'lookupClass is not in anObject''s inheritance chain'].
+ self primitiveFailed!
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.501.mcz
==================== Summary ====================
Name: Kernel-eem.501
Author: eem
Time: 25 September 2010, 7:55:34.708 pm
UUID: 5b55eae3-594b-4416-9d47-5a4ebaabb238
Ancestors: Kernel-ul.500
Add mirror primitives which can be used for accurate
execution simulation (a.k.a. debugging) of proxies.
=============== Diff against Kernel-ul.500 ===============
Item was added:
+ ----- Method: ContextPart>>object:basicAt: (in category 'mirror primitives') -----
+ object: anObject basicAt: index
+ "Answer the value of an indexable element in the argument anObject without sending
+ it a message. Fail if the argument index is not an Integer or is out of bounds, or if
+ anObject is not indexable. This mimics the action of the VM when it indexes an object.
+ Used to simulate the execution machinery by, for example, the debugger.
+ Primitive. See Object documentation whatIsAPrimitive."
+
+ <primitive: 60>
+ index isInteger ifTrue: [self errorSubscriptBounds: index].
+ index isNumber
+ ifTrue: [^self object: anObject basicAt: index asInteger]
+ ifFalse: [self errorNonIntegerIndex]!
Item was added:
+ ----- Method: ContextPart>>object:basicAt:put: (in category 'mirror primitives') -----
+ object: anObject basicAt: index put: value
+ "Store the last argument
+ value in the indexable element of the argument anObject indicated by index without sending
+ anObject a message. Fail if the argument index is not an Integer or is out of bounds, or if
+ anObject is not indexable, or if value is an inappropriate value for anObject's indexable slots.
+ This mimics the action of the VM when it indexes an object.
+ Used to simulate the execution machinery by, for example, the debugger.
+ Primitive. See Object documentation whatIsAPrimitive."
+
+ <primitive: 61>
+ index isInteger
+ ifTrue: [(index >= 1 and: [index <= (self objectSize: anObject)])
+ ifTrue: [self errorImproperStore]
+ ifFalse: [self errorSubscriptBounds: index]].
+ index isNumber
+ ifTrue: [^self object: anObject basicAt: index asInteger put: value]
+ ifFalse: [self errorNonIntegerIndex]!
Item was added:
+ ----- Method: ContextPart>>object:eqeq: (in category 'mirror primitives') -----
+ object: anObject eqeq: anOtherObject
+ "Answer whether the first and second arguments are the same object (have the
+ same object pointer) without sending a message to the first argument. This
+ mimics the action of the VM when it compares two object pointers. Used to
+ simulate the execution machinery by, for example, the debugger.
+ Primitive. See Object documentation whatIsAPrimitive."
+
+ <primitive: 110>
+ self primitiveFailed!
Item was added:
+ ----- Method: ContextPart>>object:instVarAt: (in category 'mirror primitives') -----
+ object: anObject instVarAt: anIndex
+ "Primitive. Answer a fixed variable in an object. The numbering of the
+ variables corresponds to the named instance variables. Fail if the index
+ is not an Integer or is not the index of a fixed variable. Essential for the
+ debugger. See Object documentation whatIsAPrimitive."
+
+ <primitive: 73>
+ "Access beyond fixed variables."
+ ^self object: anObject basicAt: anIndex - (self objectClass: anObject) instSize!
Item was added:
+ ----- Method: ContextPart>>object:instVarAt:put: (in category 'mirror primitives') -----
+ object: anObject instVarAt: anIndex put: aValue
+ "Primitive. Store a value into a fixed variable in the argument anObject.
+ The numbering of the variables corresponds to the named instance
+ variables. Fail if the index is not an Integer or is not the index of a
+ fixed variable. Answer the value stored as the result. Using this
+ message violates the principle that each object has sovereign control
+ over the storing of values into its instance variables. Essential for the
+ debugger. See Object documentation whatIsAPrimitive."
+
+ <primitive: 74>
+ "Access beyond fixed fields"
+ ^self object: anObject basicAt: anIndex - (self objectClass: anObject) instSize put: aValue!
Item was added:
+ ----- Method: ContextPart>>object:perform:withArguments:inClass: (in category 'mirror primitives') -----
+ object: anObject perform: selector withArguments: argArray inClass: lookupClass
+ "Send the selector, aSymbol, to anObject with arguments in argArray.
+ Fail if the number of arguments expected by the selector
+ does not match the size of argArray, or if lookupClass
+ cannot be found among the anObject's superclasses.
+ Primitive. Essential for the debugger."
+
+ <primitive: 100 error: error>
+ (selector isMemberOf: Symbol) ifFalse:
+ [^self error: 'selector argument must be a Symbol'].
+ (argArray isMemberOf: Array) ifFalse:
+ [^self error: 'argArray must be an Array'].
+ (selector numArgs = argArray size)
+ ifFalse: [^self error: 'incorrect number of arguments'].
+ ((self objectClass: anObject) == lookupClass
+ or: [(self objectClass: anObject) inheritsFrom: lookupClass]) ifFalse:
+ [^self error: 'lookupClass is not in anObject''s inheritance chain'].
+ self primitiveFailed!