Rune Serialize - Stabilization, Generation, major overhaul
[rune.git] / TODO
1
2 * Recheck gfxinput2 memory bleeding.
3
4 * TODO: Give each global variable its own RefStor for locking
5   purposes if needed.
6
7 * Assignments of the same variable to itself are a big problem.  The
8   underlying storge is dropped and then copied, but atm the drop code
9   cleans out the storage (e.g. any pointers or references).
10
11 * &array[n] is causing extra hanging locks in the interpreter.
12
13 * &lvalue --- do not set SRS flags!!!  The address is not the local stack
14   address.
15
16 * ptr.method() calls (other than new()) just don't understand whether
17   the method object is locked or unlocked.  This isn't a problem for
18   ptr->method() calls through classes since the contents of a class is
19   always naturally unlocked (but still ref'd of course).
20
21 * XXX *pptr or *ptr-to-compound-type does not know whether the indirected
22   object resides in naturally locked or naturally unlocked storage.
23
24   --> intention - disallow &locked-storage-ptr or &locked-storage-comptype,
25       require the use of 'unlocked' on the storage to be able to take its
26       address.  Relax requirements if TF_HASLVPTR is false.
27
28 * Do not allow the address of any return argument be taken during a
29   call.  Messes up content-locked return data.
30
31 * Global compound types need to be fixed to not try to maintain locks.
32
33 * Lock global and (class) object storage in GenGetDeclarationData()
34
35 * on LValueStor, do not flow-through LVRSGet's.  Instead require that
36   LValueStor's passed as an argument or return value have their
37   underlying object locked (and other LValueStor's do not, even if on
38   the stack).
39
40   This makes .new() work as the lock will be borrowed if relaying an
41   lvs passed in, and if not relaying the caller must lock the underlying.
42
43   When an object is forwarded by constructing an LValueStor for it,
44   the lock must be borrowed if the object is already locked.  Access
45   semantics are such that this should always be the case.
46
47 * insnx86.c line 149 ish.. remove rea->regused ???
48
49 * gen_refstor.c ~720, make DOP_ARGS_STORAGE cacheable.  But to
50   work properly RAS needs to do a dummy load of each argument
51   from EA[non-cache] to EA.CACHE to ensure that the register
52   is properly initialized.  And for pointers, to sync back
53   on return (?)
54
55 * Cacheability of compound types in RAS ?
56
57 * see classes strlen() code. CMP/BRA opt causes RSPUT to be improperly
58   handled (fix by optimizing out the PRSGET/RSPUT sequence for the
59   comparison?  what if both args need it?)
60
61 * optimize const global access to immediate value XXX doesn't currently 
62   happen (strlen()'s test against NIL).
63
64 * optimized stack storage in llvm is not cleared
65
66 * return/result sequencing must be validated by the resolver.  break/continue
67   may not cross a result; point and result; cannot be conditionalized in one
68   path unless it is also present in the other.
69
70 * Add 'finalize' to class/subclass decl indicating that no further subclassing
71   is allowed.
72
73 * libgen initializers for global declarations w/ assignments or type defaults.
74
75 * resolver propagate CTF_RESOLVING flag in run-time context.
76
77 * resolver and runtime and generator - validate when casting pointers
78   that an integral number of objects of the target fits in the source.
79   Otherwise the cast is illegal.
80
81 * tests/refine.d - method call through non-replicated (i.e. not part of
82                    subclass) @ref currently executes the superclass method
83                    instead of looking up the actual method via the type.
84
85 * generally speaking must change how interfaces and classes work when making
86   field accesses.  Disallow in interfaces, allow otherwise but then restrict
87   how refine operates so field offsets remain consistent across all
88   sub-classes.  Disallow alias access via @ref?
89
90 * resolver - Disallow binding of incompatible subclasses to a superclass.
91              Do this by flagging the incompatibility.
92
93 * resolver - Enforce that non-interface classes cannot contain interfaces.
94
95 * resolver - Enforce that it is not allowed to take the sizeof() an interface
96              object.
97
98 * resolver - Enforce that one cannot instantiate/declare an interface type.
99
100 * resolver - Enforce that object accessors can only be to non-generic elements.
101
102 * resolver - Reorder generic elements in an interface to the end for offset
103              assignment purposes.
104
105 * resolver - Do not allow pointer arithmatic on references.
106
107 * libgen - chained temporary data returned along one side of an expressin
108   can get corrupted by the other side.  On the top-level temporary data is
109   'safe'.
110
111 * libgen - RunRelsRefStor in operators a mess.
112
113 * libgen - exp.c RunCastExpPtrToRef() is basically messing with the
114   type of the passed-in lvalue, which is really a bad idea.
115
116 * read, write, sizeof, arysize, and bcopy currently taking Int32 !!!'s. FIX!
117   Add size_t, ssize_t.
118
119 * When realizing persistent store we have to clean out any previously
120   existing pointers.
121
122 * map files containing structures with pointers can get corrupted.  Maybe
123   we should just disallow pointers entirely for any persistent store.
124
125 * Persistent store mmap() file path is currently hacked up.  Needs command
126   line arg to set the home directory for the program, and the default
127   should be "$HOME/.<program>/rune_%s.map".  libgen/heap.c
128
129 * infinintely recursive aliases are not currently detected.
130
131   alias a = b;
132   alias b = a + 1;
133
134 * get rid of need for 'auto' prefix in casts to distinguish between
135   variable names and types.
136
137 * share pens and also share font information
138
139 * Handle simple exposure aggregation and use clip to limit update area
140   (see tests/gfxslider.d)
141
142 * Wide char for SSTRING ?  i.e. 'x'
143
144 isg for resolveType's assigned expression
145
146 DONE<<constructors/destructors for global elements and statement blocks>> ?
147
148 reference type resolver and libi/exp.c TOK_STRIND and TOK_CALL.  METHOD CALLS
149 via ref types (don't screw around with the exp, dup it instead?)
150
151 refine: check validity of procedural refinements (different return types,
152 argument types, etc...)
153
154 is d_Search now obsolete?
155
156 Add support for 'super'.  Either 'structural->super' or 'super.<blah>'
157 (for method calls), to access a superclass element that has been overloaded
158 in the subclass.
159
160 We need to be able to copy a statement tree (procedure body) on the fly
161 in the resolver, when a subclass is passed to a procedure expecting its
162 superclass.  We have to keep track of compound types (proc args) in order
163 to cache the various versions of the procedure.  We already have d_Super
164 to locate the procedure in a TOK_CALL if the procedure body is NULL.
165 The modified procedure must be able to pass a different sg_Level.. i.e.
166 the one for the superclass, even though all of its types will be the actual
167 class (the subclass), in order to locate the proper declaration (a declaration
168 may be invisible to the subclass but visible to the superclass).
169
170 --
171
172
173 int ary[exp] ... the exp is shared across qualifications of the type,
174 which is bad.  Also, what about compound types sharing the same semgroup?
175 that should be ok.
176
177 double check 'isglobal' TF/SGF_NOINIT cache
178
179 cast procedures generally work but we really need to formalize
180 how ex_Type is set verses what the exp node really wants (e.g. for
181 procedures... look at ex_Type or look at the procdecl's return type?).
182
183 really fix cast... in libi/exp.c 
184
185 Check global scope when indirecting through a type or class rather 
186 then storage.  only allow global scope for storage in that case.
187
188 non-global procedure called through object -- automatic "this" reference.
189 procedures embedded in class accessing class elements?????  global vs
190 non-global
191
192 Implement STF_FORWARD checking (do not allow forward reference stack 
193 declarations to other decls at the same semantic level.)
194
195 Make procedural refinement work
196
197 Implement scope
198
199 Implement heap variables (implement as initialized pointers / use '@' ?)
200
201 Partial procedure args resolution
202
203 procedure pointers (point to the declaration)
204