[parrot/parrot] 1b38fd: [pmc] start with resizablepmcarray unshift optimiz...

GitHub noreply at github.com
Wed Dec 3 09:06:31 UTC 2014


  Branch: refs/heads/smoke-me/rpa-offset-gh1152
  Home:   https://github.com/parrot/parrot
  Commit: 1b38fdea50c8cdad5ed49dc7217455881a5e7f01
      https://github.com/parrot/parrot/commit/1b38fdea50c8cdad5ed49dc7217455881a5e7f01
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-02 (Tue, 02 Dec 2014)

  Changed paths:
    M src/pmc/class.pmc
    M src/pmc/resizablepmcarray.pmc
    M src/runcore/trace.c

  Log Message:
  -----------
  [pmc] start with resizablepmcarray unshift optimizations

using a max offset 8, as in nqp/qrpa. See GH #1152
Here offset is still const 0.


  Commit: 267181aeafefdcee8031ad43c7d872257efc8321
      https://github.com/parrot/parrot/commit/267181aeafefdcee8031ad43c7d872257efc8321
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-02 (Tue, 02 Dec 2014)

  Changed paths:
    M src/events.c
    M src/pmc/resizablepmcarray.pmc

  Log Message:
  -----------
  [pmc] rpa trace: do_shift(INTERP, ...)

need interp for tracing, slow or fast


  Commit: 0beec7dcfb0dea296aa01f6a724458b3d1964a5e
      https://github.com/parrot/parrot/commit/0beec7dcfb0dea296aa01f6a724458b3d1964a5e
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-02 (Tue, 02 Dec 2014)

  Changed paths:
    M src/pmc/fixedpmcarray.pmc
    M src/pmc/resizablepmcarray.pmc

  Log Message:
  -----------
  [pmc] rpa enabled shift optimizations w/o splice

resizablepmcarray shift,unshift,resize,push,pop look now good.
just splice is missing. GH #1152


  Commit: ed456068f53f946fa30477675c19c4b21f852638
      https://github.com/parrot/parrot/commit/ed456068f53f946fa30477675c19c4b21f852638
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-02 (Tue, 02 Dec 2014)

  Changed paths:
    M src/pmc/resizablepmcarray.pmc

  Log Message:
  -----------
  [pmc] rpa: trying to fix splice WIP

Not offset optimized yet. And something still fails.
GH #1152


  Commit: f81fcce2b6bc33ebf95574f40479a2faf82464cc
      https://github.com/parrot/parrot/commit/f81fcce2b6bc33ebf95574f40479a2faf82464cc
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-02 (Tue, 02 Dec 2014)

  Changed paths:
    M src/pmc/resizablepmcarray.pmc

  Log Message:
  -----------
  [pmc] rpa: WIP some more fixes, but still failing


  Commit: 7b08f2d54ed96dc0f71fd3973947002b35101015
      https://github.com/parrot/parrot/commit/7b08f2d54ed96dc0f71fd3973947002b35101015
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-02 (Tue, 02 Dec 2014)

  Changed paths:
    M src/pmc/resizablepmcarray.pmc

  Log Message:
  -----------
  [pmc] rpa: remove old code without USE_OFFSET

Still one invalid access of freed data in push_pmc, and
invalid read in shift_pmc.
valgrind ./parrot_old -o runtime/parrot/library/HLL.pbc ext/nqp-rx/src/stage0/HLL-s0.pir


  Commit: e03374382334bda92efd4f1db6e2644ed7a0eadf
      https://github.com/parrot/parrot/commit/e03374382334bda92efd4f1db6e2644ed7a0eadf
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-03 (Wed, 03 Dec 2014)

  Changed paths:
    M src/pmc/resizablepmcarray.pmc

  Log Message:
  -----------
  [pmc] rpa: fix 2 cases: shift+push offset overflow

also:
* fix non-debugging TRACE_RPAd macro
* add some UNLIKELY hints


  Commit: 55364fcb7f450e1d98cf81c8c8c9e4e4af760218
      https://github.com/parrot/parrot/commit/55364fcb7f450e1d98cf81c8c8c9e4e4af760218
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-03 (Wed, 03 Dec 2014)

  Changed paths:
    M src/pmc/resizablepmcarray.pmc

  Log Message:
  -----------
  [pmc] rpa: fix defined, no throw. add get/set trace with -t1


  Commit: 4f761c6ecfc009b314bb156a10c412f9850e9b42
      https://github.com/parrot/parrot/commit/4f761c6ecfc009b314bb156a10c412f9850e9b42
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-03 (Wed, 03 Dec 2014)

  Changed paths:
    M src/pmc/fixedpmcarray.pmc
    M src/pmc/resizablepmcarray.pmc

  Log Message:
  -----------
  [pmc] rpa: specialize sort+reverse, need offset

also add offset to append
add more notes to fixedpmcarray vtable docs


  Commit: 95ad4a71a136c39478355cabdf76701b126482e8
      https://github.com/parrot/parrot/commit/95ad4a71a136c39478355cabdf76701b126482e8
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-03 (Wed, 03 Dec 2014)

  Changed paths:
    M src/pmc/resizablepmcarray.pmc

  Log Message:
  -----------
  [pmc] rpa: optimize splice shrink fast on offset

if there is enough room at the left to fill in the elements
from from, adjust offset and jump to the fill routine

this optimization is not present in qrpa, and executed e.g.
in data_json.


  Commit: 8b339c29b68325cda6dd83250fb3c2073addc1d7
      https://github.com/parrot/parrot/commit/8b339c29b68325cda6dd83250fb3c2073addc1d7
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-03 (Wed, 03 Dec 2014)

  Changed paths:
    M src/pmc/resizablepmcarray.pmc

  Log Message:
  -----------
  [pmc] rpa: optimize splice resize a bit

add TRACE_SPLC


  Commit: 25952931895b64c528009da57ab02c8ac01ea47f
      https://github.com/parrot/parrot/commit/25952931895b64c528009da57ab02c8ac01ea47f
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-03 (Wed, 03 Dec 2014)

  Changed paths:
    M src/pmc/resizablepmcarray.pmc

  Log Message:
  -----------
  [pmc] rpa: fix resize move with offset

before 1,32,8 => only 32. after: 33


  Commit: 635c8052f03fc95e187d9fd2ab217c139566a175
      https://github.com/parrot/parrot/commit/635c8052f03fc95e187d9fd2ab217c139566a175
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-03 (Wed, 03 Dec 2014)

  Changed paths:
    M config/gen/makefiles/root.in
    M src/events.c
    M src/pmc/resizablepmcarray.pmc
    M t/pmc/resizablepmcarray.t

  Log Message:
  -----------
  [pmc] rpa: fix splice shrink fast, add tests

test rpa coverage and add all missing tests
shrink fast has a wrong offset, test splice_shrink_fast()
add tests for resize off empty and resize off move, the 2 fast
  variants with existing offset.
remove shift slow case, this is invalid, add assertion. this is caught
by size == 0 and we cannot have an offset bigger then the threshold.

remove unnedeed pmc/pmc_arrayiterator.h from src/events.c


  Commit: afe352c6f1bda71e83ca235088fcec8b8d47e82c
      https://github.com/parrot/parrot/commit/afe352c6f1bda71e83ca235088fcec8b8d47e82c
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-03 (Wed, 03 Dec 2014)

  Changed paths:
    M src/pmc/fixedpmcarray.pmc
    M src/pmc/resizablepmcarray.pmc

  Log Message:
  -----------
  [pmc] rpa: fix visit

we need an offset for visit, we cannot use the fixedpmcarray
method.


  Commit: ff1f22f6bb7b9d45328a3ae9704265cfa9ac0052
      https://github.com/parrot/parrot/commit/ff1f22f6bb7b9d45328a3ae9704265cfa9ac0052
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-03 (Wed, 03 Dec 2014)

  Changed paths:
    M src/pmc/resizablepmcarray.pmc
    M t/pmc/resizablepmcarray.t

  Log Message:
  -----------
  [pmc] rpa: fix resize with offset optimization

we moved the wrong items, and had wrong slack overwrites.
Add testcases.


  Commit: 458966b95334c1d688b4c9a104f9024dc702e81e
      https://github.com/parrot/parrot/commit/458966b95334c1d688b4c9a104f9024dc702e81e
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-03 (Wed, 03 Dec 2014)

  Changed paths:
    M src/pmc/fixedpmcarray.pmc
    M src/pmc/imageiofreeze.pmc
    M src/pmc/resizablepmcarray.pmc
    M t/pmc/freeze.t

  Log Message:
  -----------
  [pmc] rpa,fpa,imageiofreeze: various minor refactors

* Access attr struct more directly.
* Fix one syntax problem with UNLIKELY with non-std compilers.
* Optimize *1.5 by using integer math.
* Change rpa overallocation to use 1.5, not 2. This is better to handle
  free blocks.
* Always fill slack space, as we extend rpa via set. In a better version we
  should fill the slack space only when needed: only on set.
* Change push_{non-pmc} to use push_pmc and not set_keyed_int.
  push is offset optimized, set not.

Still WIP. object was probably modified after being freed


  Commit: 6003fdcf78fd61c501153019ef8b880a5ce0afb0
      https://github.com/parrot/parrot/commit/6003fdcf78fd61c501153019ef8b880a5ce0afb0
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-03 (Wed, 03 Dec 2014)

  Changed paths:
    M frontend/parrot/main.c
    M include/parrot/interpreter.h
    M src/pmc/resizablepmcarray.pmc
    M t/pmc/freeze.t

  Log Message:
  -----------
  [pmc] rpa: optimize slack filling with PMCNULL

Only fill the rest with PMCNULL when necessary, i.e. when
we set an index > size, the intermediate indices between size and index-1.
This saves a lot of slack filling code cycles.

Error on delete oob.


  Commit: 6faeb4809168f9764c1e57d26a90feed1e2a32e0
      https://github.com/parrot/parrot/commit/6faeb4809168f9764c1e57d26a90feed1e2a32e0
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-03 (Wed, 03 Dec 2014)

  Changed paths:
    M src/pmc/resizablepmcarray.pmc

  Log Message:
  -----------
  [pmc] rpa: optimize delete_keyed_int

on index=0 just bump the offset as with shift,
else memmove en-block, not item by item in a loop.

This passes now most rpa related tests, just reverse has a conflict
with fpa. with reverse renamed to nreverse make test and benchmarking
is possible.


  Commit: d7dcb42eb46b4bf85e0c1cf5124a78c168979ce3
      https://github.com/parrot/parrot/commit/d7dcb42eb46b4bf85e0c1cf5124a78c168979ce3
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-03 (Wed, 03 Dec 2014)

  Changed paths:
    M ext/nqp-rx/src/stage0/nqp-setting.nqp
    M frontend/parrot/main.c
    M include/parrot/interpreter.h
    M src/hll.c

  Log Message:
  -----------
  [ext] fix the remaining rpa reverse problem

nqp ResizablePMCArray provided its own reverse method, which is now
not needed anymore. We use the better pir method instead.

Also found a syntax problem in parrot_old

Remaining todos:
t/op/lexicals.t                           (Wstat: 256 Tests: 54 Failed: 1)
  Failed test:  27
t/compilers/pge/p5regex/p5rx.t            (Wstat: 0 Tests: 960 Failed: 7)
  Failed tests:  172, 420-421, 442-443, 869-870
t/src/extend_vtable.t                     (Wstat: 512 Tests: 134 Failed: 2)
  Failed tests:  34, 37


  Commit: a307744aa6c85f458509b9d13b208d08e56c2591
      https://github.com/parrot/parrot/commit/a307744aa6c85f458509b9d13b208d08e56c2591
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-03 (Wed, 03 Dec 2014)

  Changed paths:
    M frontend/parrot/main.c
    M frontend/parrot2/main.c
    M include/parrot/interpreter.h
    M src/pmc/resizablepmcarray.pmc

  Log Message:
  -----------
  [core] apify -t20 as PARROT_TRACE_ARRAY_STATE_FLAG

Only available without --optimize, i.e. #ifndef NDEBUG


  Commit: e52dd5ca5b7375704b586426dcf497f114404d43
      https://github.com/parrot/parrot/commit/e52dd5ca5b7375704b586426dcf497f114404d43
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-03 (Wed, 03 Dec 2014)

  Changed paths:
    M src/pmc/resizablepmcarray.pmc

  Log Message:
  -----------
  [pmc] rpa: fix a resize edgecase with size=0

avoid negative offsets.
repro:
  valgrind ./parrot_old -t20 parrot-nqp.pbc --target=pir compilers/data_json/JSON.nqp


  Commit: 88a27d4dec5fcc3c46b43389dfa9c3fc028dc946
      https://github.com/parrot/parrot/commit/88a27d4dec5fcc3c46b43389dfa9c3fc028dc946
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-03 (Wed, 03 Dec 2014)

  Changed paths:
    M src/pmc/resizablepmcarray.pmc

  Log Message:
  -----------
  [pmc] rpa: fix invalid read in delete_keyed_int, off by one

with (1,9,10) and key=1 we read one too far.
repro:
  valgrind ./parrot_old -t20 t/compilers/pge/p5regex/p5rx.t


  Commit: 1905dc8ac4af92a663093b5da993dd2badf2052a
      https://github.com/parrot/parrot/commit/1905dc8ac4af92a663093b5da993dd2badf2052a
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-03 (Wed, 03 Dec 2014)

  Changed paths:
    M src/pmc/resizablepmcarray.pmc

  Log Message:
  -----------
  [pmc] rpa: shift optim, use data struct directly

do not use seperate SELF and temp values for the attrs.
2.40% faster on my mac, %ebp addressing for data.


  Commit: 2d88e5406321e7f09d31e87a24822465ab27aa4f
      https://github.com/parrot/parrot/commit/2d88e5406321e7f09d31e87a24822465ab27aa4f
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-03 (Wed, 03 Dec 2014)

  Changed paths:
    M src/pmc/resizablepmcarray.pmc

  Log Message:
  -----------
  [pmc] rpa: internal rename trace macros

add TRACE_RPAdata


Compare: https://github.com/parrot/parrot/compare/1b38fdea50c8^...2d88e5406321


More information about the parrot-commits mailing list