2008-08-29 Geoff Norton <gnorton@novell.com>
[mono.git] / mono / mini / TODO
index 90ca92d334e64c45dbfd671bf6f1224ff2efa2f2..d214318c81312e7cccf36ce5d306d5f10d83b508 100644 (file)
@@ -19,24 +19,59 @@ Other Ideas:
        - mono_metadata_row_col
        - mono_g_hash_table_lookup
        - mono_domain_get
-* load_class_names can be speeded up by caching the per-namespace hash tables
-  in a new hash table indexed by the index of the namespace in the blob heap.
-* the managed/unmanaged boundary is quite slow:
-       - it calls mono_get_lmf_addr, which calls TlsGetValue, which calls
-      pthread_getspecific (). This means that 3 function calls are needed for
-      each native function call.
-* mono_find_jit_opcode_emulation is called a lot of times during compilation,
-  and it involves a hash table lookup. 
-* mcs should create AssemblyBuilders with the Save flag instead of RunAndSave,
-  so the runtime could avoid fully constructing the types in the dynamic
-  assembly.
+
 * if a function which involves locking is called from another function which
   acquires the same lock, it might be useful to create a separate _inner 
   version of the function which does not re-acquire the lock. This is a perf
   win only if the function is called a lot of times, like mono_get_method.
 
-* the frame_state_for function in glibc 2.3.2 can't correctly decipher the 
-  unwind tables generated by gcc 3.3. It allways tells the runtime that not all
-  callee saved registers are saved, even when the icall is marked with
-  MONO_ARCH_SAVE_REGS. This forces the runtime to generate wrapper functions
-  for all icalls, slowing things down greatly.
\ No newline at end of file
+* we can avoid calls to class init trampolines if the are multiple calls to the
+  same trampoline in the same basic block. See:
+
+  http://bugzilla.ximian.com/show_bug.cgi?id=51096
+
+Usability
+---------
+
+* Remove the various optimization list of flags description, have an 
+  extra --help-optimizations flag.
+
+* Remove the various graph options, have a separate --help-graph for 
+  that list.
+
+Cleanup
+-------
+
+Clean up the usage of the various CEE_/OP_ constants inside the JIT. 
+
+Currently, there are the 5 variants for each opcode:
+- CEE_...
+- OP_...
+- OP_I...
+- OP_L...
+- OP_P...
+
+Some opcodes have some variants, while others don't.
+
+They are used as follows:
+- In method_to_ir, CEE_ means the IL opcode ie. without operand size information
+- In the rules inside the .brg files CEE_ means the same as OP_I..., since
+  long opcodes were transformed into OP_L.... by method_to_ir.
+- In the IR emitted by the rules inside the .brg files, CEE_ means the same as
+  OP_P..., since it is usually generated for pointer manipulation.
+- In mono_arch_emit_opcode, CEE_ means OP_P....
+
+As can be seen above, this is a mess. A proposed solution would be the 
+following:
+
+- In method_to_ir, transform CEE_ opcodes into the appropriate OP_I/OP_L
+  opcodes.
+- Get rid of the OP_P opcodes, and use the OP_... opcodes instead, since the
+  two usually means the same.
+- In the IR emitted by the burg rules, use the OP_... opcodes instead of the
+  CEE and OP_P opcodes.
+
+Using these rules would ensure that the same opcode means the same thing in
+all parts of the JIT.
+
+