Skip to content

Commit 1f9da88

Browse files
committed
Add container spec slot of the s-table. Also a little movement to get vaguely related s-table elements in chunks to try and get better cache line hits.
1 parent 0cac59c commit 1f9da88

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/6model/sixmodelobject.h

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ typedef struct {
2121
INTVAL hint; /* Hint for use in static/gradual typing. */
2222
} AttributeIdentifier;
2323

24+
/* Language interop information that we hold if the type is declaring a
25+
* container of some sort. */
26+
typedef struct {
27+
AttributeIdentifier value_slot;
28+
PMC *fetch_method;
29+
} ContainerSpec;
30+
2431
/* S-Tables (short for Shared Table) contains the commonalities shared between
2532
* a (HOW, REPR) pairing (for example, (HOW for the class Dog, P6Opaque). */
2633
typedef struct {
@@ -35,9 +42,6 @@ typedef struct {
3542

3643
/* The type-object. */
3744
PMC *WHAT;
38-
39-
/* The underlying package stash. */
40-
PMC *WHO;
4145

4246
/* The method finder. */
4347
PMC * (*find_method) (PARROT_INTERP, PMC *obj, STRING *name, INTVAL hint);
@@ -67,6 +71,14 @@ typedef struct {
6771
* type directory based upon this ID. Otherwise you'll create memory
6872
* leaks for anonymous types, and other such screwups. */
6973
INTVAL type_cache_id;
74+
75+
/* If this is a container, then this contains information needed in
76+
* order to fetch the value in it. If not, it'll be null, which can
77+
* be taken as a "not a container" indication. */
78+
ContainerSpec *container_spec;
79+
80+
/* The underlying package stash. */
81+
PMC *WHO;
7082

7183
/* Parrot-specific set of v-table to method mappings, for overriding
7284
* of Parrot v-table functions. */

0 commit comments

Comments
 (0)