[Vm-dev] Class checks in the vm
guillermopolito at gmail.com
Tue Apr 17 15:33:33 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
Interpreter>>#asciiOfCharacter: characterObj "Returns an integer object"
*self assertClassOf: characterObj is: (self splObj: ClassCharacter).*
ifTrue: [^ self fetchPointer: CharacterValueIndex ofObject:
ifFalse: [^ ConstZero] "in case some code needs an int"
- Can't we put a more intelligent assersion like checking if the object
responds true to #isCharacter?
- And removing the static check from the vm and adding the dynamic and nice
#isCharacter check into the image?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Vm-dev