Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
Stub in REPR and RakudoObject PMCs. Also group name should be nqp.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Sep 18, 2010
1 parent f8a9b8b commit a87a3a3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/pmc/STable.pmc
Expand Up @@ -20,7 +20,7 @@ static INTVAL get_next_type_cache_id() {
return TypeCacheIDSource;
}

pmclass STable manual_attrs dynpmc group rakudoobject {
pmclass STable manual_attrs dynpmc group nqp {
/* Initializes the STable's type cache ID; and sets the HOW to
* the supplied object. Leaves the rest to be filled out. Also
* flags PMC as needing custom mark and destroy. */
Expand Down
33 changes: 33 additions & 0 deletions src/pmc/rakudoobject.pmc
@@ -0,0 +1,33 @@
/* A RakudoObject PMC is what actually represents an object so far as
* the actual end user is concerned. While STable and REPR exist as
* PMCs, they are not designed to ever really leak into user space.
* This, on the other hand, is. In fact, pretty much everything that
* the user ever touches will be an instance of this PMC.
*
* This PMC itself, however, doesn't actually contain much logic at
* all. Mostly, it maps the Parrot world view to the Perl 6 object
* model one. Actual object semantics are provided by the intersection
* of the REPR and the HOW, both of which are pointed at by the STable.
* The only thing that you can be sure of if you have a RakudoObject
* PMC is that:
* PMC_data(SELF)[0]
* Will give you the address of an STable PMC. Thus everything in here
* should work with little more than this assumption.
*
* Note that this PMC is also never created directly. Instead, only a
* REPR can create it, and in doing so it will set the data pointer to
* point to something that can store the attributes etc and that has its
* first element being a pointer to the STable. Thus even GC marking is
* delegated to the REPR, since only it knows how a given object is laid
* out (since that depends on the representation).
*/
pmclass RakudoObject manual_attrs dynpmc group nqp {
/* Initialization simply marks the PMC as needing custom
* mark and destroy. */
VTABLE void init() {
PObj_custom_mark_SET(SELF);
PObj_custom_destroy_SET(SELF);
}

/* XXX Needs custom mark and destroy implementing. */
}

0 comments on commit a87a3a3

Please sign in to comment.