hpi-swa / RSqueak

A Squeak/Smalltalk VM written in RPython.
BSD 3-Clause "New" or "Revised" License
83 stars 15 forks source link

primitiveFileWrite cannot handle Floats #74

Closed matthias-springer closed 9 years ago

matthias-springer commented 9 years ago

The primitiveFileWrite VMMaker code can handle bytes objects and words objects:

    (interpreterProxy isWordsOrBytes: array)
        ifFalse: [^ interpreterProxy primitiveFail].

Everything that is not a pointers object or a bytes object is a words object (is there something wrong with our object model?):

InterpreterProxy>>isWords: oop
    ^oop class isPointers not and:[oop class isBytes not]

However, in rsqueak, isinstance(interp.space.wrap_float(0.0), model.W_WordsObject) is False (and in Squeak: Float isWords returns true.

RSqueak object model:

    W_Object
        W_SmallInteger
        W_AbstractObjectWithIdentityHash
            W_Float
            W_AbstractObjectWithClassReference
                W_PointersObject
                W_BytesObject
                W_WordsObject
            W_CompiledMethod 

(SmallInteger isWords also returns true in Squeak)

krono commented 9 years ago

I think RSqueak's model is fine as is for now.

In V3, Floats actually are word object, in Spur, I think tagged.

The VMMaker code for that prim apparently makes heavy assumptions on the object representation. Maybe we can generalize?

j4yk commented 9 years ago

Floats are only tagged/immediate in 64 Bit Spur. Am 27.05.2015 21:00 schrieb "Tobias Pape" notifications@github.com:

I think RSqueak's model is fine as is for now.

In V3, Floats actually are word object, in Spur, I think tagged.

The VMMaker code for that prim apparently makes heavy assumptions on the object representation. Maybe we can generalize?

— Reply to this email directly or view it on GitHub https://github.com/HPI-SWA-Lab/RSqueak/issues/74#issuecomment-106036768.

timfel commented 9 years ago

Closed with #75?