1.1 --- a/docs/structures.txt Sun Jul 27 02:00:31 2008 +0200
1.2 +++ b/docs/structures.txt Mon Jul 28 00:26:29 2008 +0200
1.3 @@ -107,11 +107,12 @@
1.4
1.5 A suitable structure layout might be something like this:
1.6
1.7 - Identifier Address Type Object ...
1.8 + Identifier Address Details Type Object ...
1.9
1.10 - 0 1 2 3 4
1.11 - classcode invocation __class__ attribute ...
1.12 - reference reference reference
1.13 + 0 1 2 3 4 5
1.14 + classcode invocation invocation __class__ attribute ...
1.15 + reference #args, reference reference
1.16 + #defaults
1.17
1.18 Here, the classcode refers to the attribute lookup table for the object. Since
1.19 classes and instances share the same classcode, they might resemble the
1.20 @@ -119,16 +120,17 @@
1.21
1.22 Class C:
1.23
1.24 - 0 1 2 3 4
1.25 - code for C __new__ class type attribute ...
1.26 - reference reference reference
1.27 + 0 1 2 3 4 5
1.28 + code for C __new__ __new__ class type attribute ...
1.29 + reference #args, reference reference
1.30 + #defaults
1.31
1.32 Instance of C:
1.33
1.34 - 0 1 2 3 4
1.35 - code for C C.__call__ class C attribute ...
1.36 - reference reference reference
1.37 - (if exists)
1.38 + 0 1 2 3 4 5
1.39 + code for C C.__call__ C.__call__ class C attribute ...
1.40 + reference #args, reference reference
1.41 + (if exists) #defaults
1.42
1.43 The __new__ reference would lead to code consisting of the following
1.44 instructions:
1.45 @@ -144,10 +146,10 @@
1.46
1.47 Function f:
1.48
1.49 - 0 1 2 3 4
1.50 - code for code class attribute ...
1.51 - function reference function reference
1.52 - reference
1.53 + 0 1 2 3 4 5
1.54 + code for code code class attribute ...
1.55 + function reference #args, function reference
1.56 + #defaults reference
1.57
1.58 Here, the code reference would lead to code for the function. Note that the
1.59 function locals are completely distinct from this structure and are not
1.60 @@ -158,10 +160,10 @@
1.61
1.62 Module m:
1.63
1.64 - 0 1 2 3 4
1.65 - code for m (unused) module type attribute ...
1.66 - reference (global)
1.67 - reference
1.68 + 0 1 2 3 4 5
1.69 + code for m (unused) (unused) module type attribute ...
1.70 + reference (global)
1.71 + reference
1.72
1.73 Both classes and modules have code in their definitions, but this would be
1.74 generated in order and not referenced externally.