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