[squeak-dev] The Trunk: Kernel-eem.501.mcz

Levente Uzonyi leves at elte.hu
Sun Sep 26 03:27:49 UTC 2010


On Sun, 26 Sep 2010, commits at source.squeak.org wrote:

> 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.

#objectSize: seems to be missing.


Levente

>
> =============== 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!
>
>
>



More information about the Squeak-dev mailing list