Rune - Code generator work (tests/format.d and tests/gfxslider.d compiles)
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 8 Feb 2021 02:10:01 +0000 (18:10 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 8 Feb 2021 03:11:44 +0000 (19:11 -0800)
commitddb1c1ff895d3bf1eb0fb1479fc61d0938ec721b
tree6ce53da032663e00c23178b4cca7a2d7d1b782c3
parentf205479c291e6cfcd004e7cf62317510bcdf01c4
Rune - Code generator work (tests/format.d and tests/gfxslider.d compiles)

* Do a ton of work on the code generator to implement all the
  changes made to the language.

* Use EX2F_LVALUE to flag an lvalue vs rvalue in the expression tree.
  Do NOT modify the Type structure with SF_LVALUE for this purpose,
  it creates massive confusion.

* Get the modifications to the 'this' argument for method calls
  operational in the code generator.

* Get some of the object lock side effects (gendata->mobj) operational
  again.

* Completely refactor the alignment and storage handling in the
  resolver.  Also rename many procedures for consistency.  Its probably
  generating too much (for now), but this revamp was needed.

* For now link libgen and librune to the code and not just libruntime.
  I'll have to fix it up later, or perhaps just keep it all in there
  to support run-time interpreted code and mixed mode execution in
  the future.

* Since we no longer have an RSInfo or fat reference structures,
  the reference pointer has to be tested against NULL.  If it is
  not-NULL we can extract in_DynVec and in_Type directly from a
  negative offset relative to the reference pointer.

  If it is NULL we use the resolved type from the expression,
  basically a LEA of a global symbol.

  The conditional uses a simple branch-past / fall-through
  sequence by tricking the LEA such that the negative offset in
  the branch-past code gives us the correct result.
30 files changed:
TODO
classes/sys/runtime.d
libgen/backend_llvm.c
libgen/backend_ras.c
libgen/context.h
libgen/defs.h
libgen/gen_emit.c
libgen/gen_exp.c
libgen/gen_info.c
libgen/gen_object.c
libgen/gen_stmt.c
libgen/run_exp.c
libgen/syscalls.c
librune/collapse.c
librune/decl.c
librune/decl.h
librune/exp.c
librune/exp.h
librune/resolve.c
librune/stmt.c
librune/stmt.h
librune/type.c
librune/type.h
librune/types.h
libruntime/event.c
libruntime/rt_refs.c
ras/insnx86.c
ras/main.c
rune/rune.c
tests/ptr2.d