[dmd-internals] [D-Programming-Language/dmd] b9fa92: Refactoring in getVarExp()

GitHub via dmd-internals dmd-internals at puremagic.com
Thu Mar 19 20:31:36 PDT 2015


  Branch: refs/heads/master
  Home:   https://github.com/D-Programming-Language/dmd
  Commit: b9fa92de4b8c19dfd329e8be97bb5f876fdda589
      https://github.com/D-Programming-Language/dmd/commit/b9fa92de4b8c19dfd329e8be97bb5f876fdda589
  Author: k-hara <k.hara.pg at gmail.com>
  Date:   2015-03-20 (Fri, 20 Mar 2015)

  Changed paths:
    M src/interpret.c

  Log Message:
  -----------
  Refactoring in getVarExp()


  Commit: 9a6b349c3d9a1d991d429714c00fd103048ca792
      https://github.com/D-Programming-Language/dmd/commit/9a6b349c3d9a1d991d429714c00fd103048ca792
  Author: k-hara <k.hara.pg at gmail.com>
  Date:   2015-03-20 (Fri, 20 Mar 2015)

  Changed paths:
    M src/interpret.c
    M test/compilable/interpret3.d

  Log Message:
  -----------
  fix Issue 14304 - ICE with static immutable variable CTFE


  Commit: 6d8634bf1421be51413e5ba87154f5adf4bc7e30
      https://github.com/D-Programming-Language/dmd/commit/6d8634bf1421be51413e5ba87154f5adf4bc7e30
  Author: k-hara <k.hara.pg at gmail.com>
  Date:   2015-03-20 (Fri, 20 Mar 2015)

  Changed paths:
    M src/ctfeexpr.c
    M src/expression.c
    M src/expression.h
    M src/interpret.c
    A test/fail_compilation/fail14304.d

  Log Message:
  -----------
  Reduce memory space for CTFE

The prior fix for issue 14304 is simple, but it will also increase the amount of memory space for CTFE (and actually breaks Phobos unittest in Windows platform).

To fix performance issue without breaking CTFE behavior:
- Mark the cached value of non-mutable static variable specially, to represent "read-only constant".
- Prevent modifications of "read-only constant".
- Once a value is owned by CTFE (including cached ones), we can avoid redundant copies for that, because the expression object can be used directly during interpretation.


  Commit: 06537bcd9128b948a1feb35b4fd5e3cdd55c201c
      https://github.com/D-Programming-Language/dmd/commit/06537bcd9128b948a1feb35b4fd5e3cdd55c201c
  Author: Martin Nowak <code at dawg.eu>
  Date:   2015-03-20 (Fri, 20 Mar 2015)

  Changed paths:
    M src/ctfeexpr.c
    M src/expression.c
    M src/expression.h
    M src/interpret.c
    M test/compilable/interpret3.d
    A test/fail_compilation/fail14304.d

  Log Message:
  -----------
  Merge pull request #4503 from 9rnsr/fix14304

[REG2.067a] Issue 14304 - ICE with static immutable variable CTFE


Compare: https://github.com/D-Programming-Language/dmd/compare/83fe805eacc6...06537bcd9128


More information about the dmd-internals mailing list