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

GitHub noreply at github.com
Tue Dec 2 16:06:17 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: a1235417c2c08fbaaaaf403035db86a72339040e
      https://github.com/parrot/parrot/commit/a1235417c2c08fbaaaaf403035db86a72339040e
  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: fix 2 cases: shift+push offset overflow

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


  Commit: 94bed1b6b282fc21f1335066b2bbddbd66b9c547
      https://github.com/parrot/parrot/commit/94bed1b6b282fc21f1335066b2bbddbd66b9c547
  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: fix defined, no throw. add get/set trace with -t1


  Commit: 6cd70264ad5ae6ced121ef6efa122f4dbc4bacf2
      https://github.com/parrot/parrot/commit/6cd70264ad5ae6ced121ef6efa122f4dbc4bacf2
  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: specialize sort+reverse, need offset

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


  Commit: a866e718f5e2ecb9b5c26e72bb846eefdcb01fcf
      https://github.com/parrot/parrot/commit/a866e718f5e2ecb9b5c26e72bb846eefdcb01fcf
  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: 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: 42a71f1ce3f8cd5fe514939527a32b9d0227453e
      https://github.com/parrot/parrot/commit/42a71f1ce3f8cd5fe514939527a32b9d0227453e
  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: optimize splice resize a bit

add TRACE_SPLC


  Commit: 56b059781f2de2ffbd7351314d6fba71eae8ae0c
      https://github.com/parrot/parrot/commit/56b059781f2de2ffbd7351314d6fba71eae8ae0c
  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: fix resize move with offset

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


  Commit: f0c8a0441a3368344897735e94cd73e68c70ccee
      https://github.com/parrot/parrot/commit/f0c8a0441a3368344897735e94cd73e68c70ccee
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-02 (Tue, 02 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: 002295f4e3e2383bec8e0d0b02b79b105d796d86
      https://github.com/parrot/parrot/commit/002295f4e3e2383bec8e0d0b02b79b105d796d86
  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: fix visit

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


  Commit: b4679ed2ff70fa6a58f9fb544682eba440a568a2
      https://github.com/parrot/parrot/commit/b4679ed2ff70fa6a58f9fb544682eba440a568a2
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-02 (Tue, 02 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: 719170f2503abcc9919c19e79ff41d54682167c8
      https://github.com/parrot/parrot/commit/719170f2503abcc9919c19e79ff41d54682167c8
  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/imageiofreeze.pmc
    M src/pmc/resizablepmcarray.pmc
    M t/pmc/freeze.t

  Log Message:
  -----------
  [pmc]: 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: 8ca6ee78d2b984111179185e64836814d1fea2a0
      https://github.com/parrot/parrot/commit/8ca6ee78d2b984111179185e64836814d1fea2a0
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-02 (Tue, 02 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: a89f98c681d0455b241b468e2b5b4c23a6fee667
      https://github.com/parrot/parrot/commit/a89f98c681d0455b241b468e2b5b4c23a6fee667
  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: 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: e58c12b94a6542f324618a363f7df64efe930547
      https://github.com/parrot/parrot/commit/e58c12b94a6542f324618a363f7df64efe930547
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-02 (Tue, 02 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: 3e1e5df0c9c76e85fb6a1d22ce61d0174b3cabfc
      https://github.com/parrot/parrot/commit/3e1e5df0c9c76e85fb6a1d22ce61d0174b3cabfc
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-12-02 (Tue, 02 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


Compare: https://github.com/parrot/parrot/compare/8005345686fa...3e1e5df0c9c7


More information about the parrot-commits mailing list