[Vm-dev] VM Maker: VMMaker-dtl.371.mcz
commits at source.squeak.org
commits at source.squeak.org
Sat Sep 26 19:05:31 UTC 2015
David T. Lewis uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker-dtl.371.mcz
==================== Summary ====================
Name: VMMaker-dtl.371
Author: dtl
Time: 26 September 2015, 3:04:46.647 pm
UUID: b97b3504-c995-4458-8af2-d1748f246f0b
Ancestors: VMMaker-dtl.370
Collect a few scattered method comments into InterpreterProxy to provide better reference for plugin writers.
=============== Diff against VMMaker-dtl.370 ===============
Item was changed:
----- Method: InterpreterProxy>>arrayValueOf: (in category 'object access') -----
arrayValueOf: oop
+ "Return the address of first indexable field of resulting array object, or fail if the instance variable does not contain an indexable bytes or words object."
+ "Note: May be called by translated primitive code."
<returnTypeC: 'void *'>
self success: (self isWordsOrBytes: oop).
^CArrayAccessor on: oop.!
Item was changed:
----- Method: InterpreterProxy>>fetchLong32:ofObject: (in category 'object access') -----
fetchLong32: fieldIndex ofObject: oop
+ " index by 32-bit units, and return a 32-bit value. Intended to replace fetchWord:ofObject:"
+ "fetchWord:ofObject: is rescinded as of VMMaker 3.8 64bit VM. This is the same code as
+ used therein and may need revision for 64 bit cleanliness"
- "fetchWord:ofObject: is rescinded as of VMMaker 3.8 64bit VM. This is the same code as used therein and may need revision for 64 bit cleanliness"
^oop instVarAt: fieldIndex+1!
Item was changed:
----- Method: InterpreterProxy>>fetchPointer:ofObject: (in category 'object access') -----
fetchPointer: index ofObject: oop
+ "index by word size, and return a pointer as long as the word size"
^oop instVarAt: index+1!
Item was changed:
----- Method: InterpreterProxy>>instanceSizeOf: (in category 'object access') -----
instanceSizeOf: classObj
+ "Answer the number of slots in a class. For example the instanceSizeOf:
+ ClassPoint is 2, for the x & y slots. The instance size of non-pointer classes is 0."
^classObj instSize!
Item was changed:
----- Method: InterpreterProxy>>sizeOfSTArrayFromCPrimitive: (in category 'object access') -----
sizeOfSTArrayFromCPrimitive: cPtr
+ "Return the number of indexable fields of the given object. This method is to be called from an automatically generated C primitive. The argument is assumed to be a pointer to the first indexable field of a words or bytes object; the object header starts 4 bytes before that."
"Note: Only called by translated primitive code."
<var: #cPtr type: 'void *'>
^self shouldNotImplement!
Item was changed:
----- Method: InterpreterProxy>>stObject:at: (in category 'object access') -----
stObject: array at: index
+ "Return what ST would return for <obj> at: index."
^array at: index!
Item was changed:
----- Method: InterpreterProxy>>stObject:at:put: (in category 'object access') -----
stObject: array at: index put: value
+ "Do what ST would return for <obj> at: index put: value."
^array at: index put: value!
Item was changed:
----- Method: InterpreterProxy>>stSizeOf: (in category 'object access') -----
stSizeOf: oop
+ "Return the number of indexable fields in the given object. (i.e., what Smalltalk would return for <obj> size)."
+ "Note: Assume oop is not a SmallInteger!!"
- "Return the number of indexable fields in the receiver"
^oop basicSize!
Item was changed:
----- Method: InterpreterProxy>>storeInteger:ofObject:withValue: (in category 'object access') -----
storeInteger: index ofObject: oop withValue: integer
+ "Note: May be called by translated primitive code."
(self isIntegerValue: integer)
ifTrue:[^self storePointer: index ofObject: oop withValue: integer]
ifFalse:[^self primitiveFail]!
More information about the Vm-dev
mailing list