Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 89d6fa6c7f697a2a64a3ec2c06f9ad3a9bb1846e
      
https://github.com/Perl/perl5/commit/89d6fa6c7f697a2a64a3ec2c06f9ad3a9bb1846e
  Author: Nicholas Clark <[email protected]>
  Date:   2021-07-26 (Mon, 26 Jul 2021)

  Changed paths:
    M ext/XS-APItest/APItest.pm

  Log Message:
  -----------
  Remove some cruft from XS::APItest.

We no longer need the 5.9.x era work around for UNITCHECK.

The use 5.011001 can go too.  As XS::APItest is only in the core tree and
never installed, the only perl it will ever run with is the version that it
shipped with.

This line was added in Sep 2010 by commit 83f8bb564961ee8f:

    merge XS-APItest-KeywordRPN into XS-APItest

    XS-APItest-KeywordRPN has turned out to be less useful as an independent
    module than expected, and less strictly about RPN than it originally was.

It was previously in the source for XS::APItest::KeywordRPN, and it's unclear
why it was needed there.


  Commit: 2517717a8902648de577d07f548caba6e3f2ecea
      
https://github.com/Perl/perl5/commit/2517717a8902648de577d07f548caba6e3f2ecea
  Author: Nicholas Clark <[email protected]>
  Date:   2021-07-26 (Mon, 26 Jul 2021)

  Changed paths:
    M pp_hot.c

  Log Message:
  -----------
  The cases for SVt_PVAV and SVt_PVHV in pp_defined are unreachable.

Remove them, and hit to the C compiler that it's unlikely that someone used
`defined` on a subroutine.

These have been unreachable since `defined @array` and `defined %hash`
became syntax errors. Whilst the same PP code is used for // and //=,
expressions such as`@a // @b` put the left array (or hash) in scalar
context, meaning that it always returns a define value.
(Should we warn on these?)


  Commit: 745e94a0ed91f09322e8188e2b5b0df8cd9aeca8
      
https://github.com/Perl/perl5/commit/745e94a0ed91f09322e8188e2b5b0df8cd9aeca8
  Author: Nicholas Clark <[email protected]>
  Date:   2021-07-26 (Mon, 26 Jul 2021)

  Changed paths:
    M t/op/tie.t

  Log Message:
  -----------
  Tests for tied hashes in list context (keys, values and both).

These weren't explicitly tested before.


  Commit: bd4f91e548cd03e60692e013e23c0fff31ead346
      
https://github.com/Perl/perl5/commit/bd4f91e548cd03e60692e013e23c0fff31ead346
  Author: Nicholas Clark <[email protected]>
  Date:   2021-07-26 (Mon, 26 Jul 2021)

  Changed paths:
    M sv.c

  Log Message:
  -----------
  Simplify some logic in S_find_hash_subscript().

The code is looping to look for the hash key whose value is the SV at the
address given in val. Previously the code in the loop would ignore hash
entries which were &PL_sv_undef or &PL_sv_placeholder. Given that this check
was *after* the equality check for val, but the the only way for the
function to return success ("found") was to continue beyond this check.
Hence, as-written it meant that the function would always return NULL
("not found") if val had either of these values, but would loop through the
entire hash *first* before doing so.

Hence move the check before the loop, to generate the same result, but with
less work.

Also, HeKEY(entry) can never be NULL, so this check was dead code and can be
removed. (The C compiler probably already spotted this)

Also, the code had special-case handling for HEf_SVKEY. What it used to do
was actually identical to what sv_2mortal(newSVhek(...)) does, so just use
that for everything. (Hashes themselves should never contain keys with this
special flag length - it's only used in MAGIC structures, and for HE
structures created while iterating tied hashes.)


  Commit: 0cdaae3e56c7eb2fab73f258cf564fe0d6d1b083
      
https://github.com/Perl/perl5/commit/0cdaae3e56c7eb2fab73f258cf564fe0d6d1b083
  Author: Nicholas Clark <[email protected]>
  Date:   2021-07-26 (Mon, 26 Jul 2021)

  Changed paths:
    M gv.c

  Log Message:
  -----------
  In Perl_gv_check() set and clear HvAUXf_SCAN_STASH just once.

Previously the flag bit was set and cleared for each iteration of the outer
loop. The compiler *might* have made this optimisation that this commit makes
for us, but might not.


  Commit: bffed14d6aeedc70a2f799ef7c8fe1f5d608eb52
      
https://github.com/Perl/perl5/commit/bffed14d6aeedc70a2f799ef7c8fe1f5d608eb52
  Author: Nicholas Clark <[email protected]>
  Date:   2021-07-26 (Mon, 26 Jul 2021)

  Changed paths:
    M mro_core.c
    M op.c
    M pp_ctl.c

  Log Message:
  -----------
  Where the key is an SV, replace some hv_* calls with hv_*_ent equivalents.

This avoids the SvUTF8(tmpstr) ? -(I32)SvCUR(tmpstr) : (I32)SvCUR(tmpstr)
code dance.


  Commit: 5ebe3ee8a2e8df14624495256026a546dbf8c1dc
      
https://github.com/Perl/perl5/commit/5ebe3ee8a2e8df14624495256026a546dbf8c1dc
  Author: Nicholas Clark <[email protected]>
  Date:   2021-07-26 (Mon, 26 Jul 2021)

  Changed paths:
    M hv.h
    M mro_core.c

  Log Message:
  -----------
  Convert code in mro_core.c to use hv_*hek() APIs where possible.

Add a macro hv_existshek() to implement exists.

The HEK-based macros are more efficient wrappers of hv_common() than the
string/length/flags macros because they also pass in the pre-computed hash
value (from the HEK). This avoids hv_common() needing to recalculate it.


  Commit: f1c1602aa05e6e31a961fec177e6d315ca1db236
      
https://github.com/Perl/perl5/commit/f1c1602aa05e6e31a961fec177e6d315ca1db236
  Author: Nicholas Clark <[email protected]>
  Date:   2021-07-26 (Mon, 26 Jul 2021)

  Changed paths:
    M mro_core.c

  Log Message:
  -----------
  S_mro_gather_and_rename() can use HvTOTALKEYS(), as placeholders don't matter.

Stashes *shouldn't* have placeholders, but even if they did, the loop skips
if !isGV(val) is true, which will hold for placeholders.

Also move the call to hv_fetchhek() after the check for main::main::main::...
The C compiler can't optimise that call away because it doesn't know whether
it has has side effects. We know that it doesn't, so we can move it.


  Commit: c23e25b4e677ccabda2bc164083171818f764db0
      
https://github.com/Perl/perl5/commit/c23e25b4e677ccabda2bc164083171818f764db0
  Author: Nicholas Clark <[email protected]>
  Date:   2021-07-26 (Mon, 26 Jul 2021)

  Changed paths:
    M MANIFEST
    M hv.c
    A t/op/hash-clear-placeholders.t

  Log Message:
  -----------
  S_clear_placeholders() should call HvHASKFLAGS_off() if no keys remain.

This isn't essential - HvHASKFLAGS() set when there are no keys with flags
merely disables some potential optimisations. (The other way round - not
being set when keys have flags would be a bug).

This is a regression I introduced in Feb 2004 with commit d36773897a6f30fc:
    hv_clear_placeholders now manipulates the linked lists directly, rather
    than using the iterator interface and calling hv_delete
    This will allow hv_delete to be simplified to remove most of the
    special casing related to placeholders.

However several people have looked at the code since then and no-one has
realised that with the logic as-was, this call had to be unreachable.

Also avoid calling  HvPLACEHOLDERS_get() twice - each caller has already
done this, so pass the value in.


Compare: https://github.com/Perl/perl5/compare/66d6cad32aa5...c23e25b4e677

Reply via email to