slate pidgin woes

Timmy Douglas lists at timmy.tmbx.com
Tue Jun 26 19:34:59 PDT 2007



I'm trying to make some changes to the slate pidgin code to help make
porting the VM to my 64 bit machine easier. I probably did a few too
many search/replaces but basically I'm getting this error:


Generating function PSObject_isImmutable

Generating function PSObject_restrictsDelegation

Generating function PSObject_addSlotNamed_valued_at_

The following condition was signaled:
Error: A method translation wasn't found for copyBytes:into:.

The following restarts are available:
0)      Abort evaluation of expression
1)      Quit Slate

Enter 'help.' for instructions.
Debug [0..1]: up.
[tryHandlers]


the method translation searcher is:

g@(C SimpleGenerator traits) generateCFor: selector@(Symbol traits) on: arguments
[...]

g: ("SimpleGenerator" currentColumn: 0. currentLine: 0. level: 0. columnsPerLine: 1000.
    original: ("Stream" ...). inlining: True. asserting: False. verbose: False. useSymbolicConstants: True.
    useRightShiftForDivide: True. generateDeadCode: False. methodCalls: {"Bag" ...}.
    module: ("Module" ...). scope: {"Stack" ...})
selector: #copyBytes:into:
arguments: {obj cast + obj firstSlotOffset. offset - obj firstSlotOffset. newObj cast + newObj firstSlotOffset}
Debug [0..1]: (arguments at: 0) type
.
("Any" rules: ("Cloneable" ...))
Debug [0..1]: (arguments at: 1) type
.
("Any" rules: ("Cloneable" ...))

Debug [0..1]: (arguments at: 1) type is: Types C Type
.
False
Debug [0..1]: (arguments at: 1) type dispatcher.

The following condition was signaled from within the debugger:
The method #dispatcher was not found for the following arguments:
{("Any" ...)}
Debug [0..1]: #copyBytes:into: asInferenceRule
.
#__copyBytes:into:




I think the funcall is here:

  obj!(Byte pointer) cast + obj firstSlotOffset
    copyBytes: offset - obj firstSlotOffset
    into: newObj!(Byte pointer) cast + newObj firstSlotOffset.


The definition is here:

src@(Byte pointer) copyBytes: n into: dst
[| dst!(Byte pointer) |
  src < dst /\ (src + n > dst)
    ifTrue:
      [dst: dst + n.
        src: src + n.
        [dst: dst - 1.
          src: src - 1.
          dst store: src load.
          n: n - 1.
          n > 0] whileTrue]
    ifFalse:
      [[n > 0]
        whileTrue:
          [dst store: src load.
            dst: dst + 1.
            src: src + 1.
            n: n - 1]].
] export inline.


I can't really figure out what's going on here... it looks like the
first argument to #copyBytes:into: is casted to !(Byte Pointer) so it
should return a Byte Pointer after the addition statement. However the
repl shows "Any"? I don't even know if that's declared anywhere. When
I look at rules.slate and #union: it seems like most of the operations
will return a LongInt or something. But I don't know if that code is
used.


One thing that is changed that I can remember off the top of my head
is that firstSlotOffset's return type is changed to Word rather than
UnsignedLongInt. Word is aliased to the same thing so I don't think it
would matter. If anyone could give me some advice on how to debug
this, it would be great. thanks.


For those curious, I want to make two main changes to the slate pidgin
vm code: use a smaller group of types (and only use abstract ones like
Word/ObjectPointer/Byte rather than LongInt etc), and use
'sizeof(unsigned long int)' instead of inlining integers with
#[ObjectPointer byteSize] etc... I think this will make it easier to
port. This way instead of modifying bitSize fields for every type and
regenerating the vm everytime you switch platforms, you could just use
the same code everywhere and gcc would switch out sizeof depending on
the abi you were compiling against. ugh this is taking forever. maybe
by xmas i'll have the bootstrap working again. then it would be easier
to play with getting an inliner working.




More information about the Slate mailing list