[Vm-dev] Class checks in the vm

stephane ducasse stephane.ducasse at gmail.com
Sat Apr 21 19:50:27 UTC 2012

> I'm playing to bootstrap a Pharo image, trying to get a new environment running into my 'host' image, and after that, dump those new objects into a new image file.
> Now, to do that, I'm creating new classes for String, Character...  Which are well known by the vm specialObjectsArray.  And trying to initialize my new image classes, which creates new character objects, and new string objects which is causing me some troubles :P.
> Now, my question is about this check in vmmaker (and some others that look similar):
> Interpreter>>#asciiOfCharacter: characterObj  "Returns an integer object"
>     <inline: false>
>     self assertClassOf: characterObj is: (self splObj: ClassCharacter).
>     successFlag
>         ifTrue: [^ self fetchPointer: CharacterValueIndex ofObject: characterObj]
>         ifFalse: [^ ConstZero]  "in case some code needs an int"

Guillermo when you change the specialObjectsArray it does not solve your problem?
I imagine that check a class pointer is way faster than looking in the method dict.
Now why when you change the specialObjectArray it does not solve your problem?
Do you need two?

More information about the Vm-dev mailing list