Dan,

Below are some questions about this ...

> -----Original Message-----
> From: Dan Sugalski [mailto:[EMAIL PROTECTED]]

[snip]

> Objects, as far as I see it, have the following properties:
>
> 1) They have runtime-assignable properties

Terminology question: what is the difference between a property and an
attribute? Perhaps the answer could go in the glossary.

[snip]

> #3 Since each class has a PMC type, we just need to associate the PMC
>   type with the data a class needs. Also pretty much no big deal, and
>   something we already have facilities for.

So, while there may be exceptions, generally all classes will be instances
of the Class PMC, true?

[snip]

> The call/jmpmeth opcodes either make a returnable or non-returnable
> method call. They fetch the function pointer from the object PMC and
> either dispatch to it or save the current state and jsr to it. Note
> that you can't jmpmeth into a C-implemented method, so no tail
> calling into those without some wrapper opcodes. The registers still
> need to be set up appropriately, just like with a regular sub call.

So the call opcode takes a method name or offset and calls a vtable method
to find the method and then invokes it?

> The find_method vtable entry should die, and be replaced with a plain
> method entry. This should return either the address of the start of
> the method's bytecode, or NULL. The NULL return is for those cases
> where the method actually executed via native code, and thus doesn't
> have to go anywhere. If an address is returned it's expected that the
> engine will immediately dispatch to that spot, obeying parrot's
> calling conventions.

Not sure what this means, does it mean that there is a method named
"find_method" accessed something like

  call Px, Py, "find_method"

which I can then call to find the method or am I off?

[snip]

> The structures:
>
> *) Attr PMCs have an array off their data pointer.
>
> *) Classes are variants of Attr PMCs. They have the following
>   guaranteed attributes in slots:
>
>     0) Hash with class name to attribute offset

I am not sure what this means, Don't we already have the class and it's
attributes if we are accessing these slots?

>     1) Hash with attribute name to attribute offset (relative to the
>        offset found from the hash in slot 0, generally known at
>        compile time, but introspection is nice)
>     2) Integer number of attributes this class has
>     3) Notification array

Do we store ptrs to parent classes in one of these slots? Also Can I access
slots like:

  set Px, Py[1]    # store the name to offset hash in Px

[snip]

So to sum up we need the following pmc's:

  pmclass Ref {
    data is a pointer to an object
  }

  pmclass Attr {
    data is an array of attributes
  }

  pmclass Class extends Attr {
  }

  pmclass Object {
    this was not explained, but I guess it at least
    has a reference to a Class and field data ???
  }

Does that cover it?
--
Jonathan Sillito

Reply via email to