[Vm-dev] VM Maker: VMMaker.oscog-eem.2996.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Jul 26 03:01:59 UTC 2021
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2996.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.2996
Author: eem
Time: 25 July 2021, 8:01:52.462478 pm
UUID: f9c242de-fd1b-45c9-a795-bc614ec9ff08
Ancestors: VMMaker.oscog-eem.2995
Oops; can't use an internal selector in MiscPrimitivePlugin.
=============== Diff against VMMaker.oscog-eem.2995 ===============
Item was changed:
----- Method: MiscPrimitivePlugin>>primitiveStringHash (in category 'primitives') -----
primitiveStringHash
"ByteArray (class) hashBytes: aByteArray startingWith: speciesHash"
<export: true flags: #FastCPrimitiveFlag>
| aByteArray hash byteArrayOop |
<var: 'aByteArray' type: #'unsigned char *'>
<var: 'hash' type: #'unsigned int'>
hash := interpreterProxy stackIntegerValue: 0.
interpreterProxy failed ifTrue:
[^interpreterProxy primitiveFailFor: PrimErrBadArgument].
byteArrayOop := interpreterProxy stackValue: 1.
((interpreterProxy isBytes: byteArrayOop)
+ and: [interpreterProxy isWordsOrBytes: byteArrayOop]) ifFalse: "filters out CompiledMethods"
- and: [interpreterProxy isWordsOrBytesNonImm: byteArrayOop]) ifFalse: "filters out CompiledMethods"
[^interpreterProxy primitiveFailFor: PrimErrBadArgument].
aByteArray := interpreterProxy firstIndexableField: byteArrayOop.
0 to: (interpreterProxy sizeOfSTArrayFromCPrimitive: aByteArray) - 1 do:
[ :pos |
hash := hash + (aByteArray at: pos) * 16r19660D ].
interpreterProxy methodReturnInteger: (hash bitAnd: 16r0FFFFFFF)!
More information about the Vm-dev
mailing list