[Vm-dev] Class checks in the vm

Guillermo Polito guillermopolito at gmail.com
Sun Apr 22 15:15:39 UTC 2012


On Sat, Apr 21, 2012 at 9:50 PM, stephane ducasse <
stephane.ducasse at gmail.com> wrote:

>
> >
> > 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?
>
> yes, or more :). (or none in the ideal case :( )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20120422/49411413/attachment.htm


More information about the Vm-dev mailing list