develooper Front page | perl.perl5.changes | Postings from October 2020

[Perl/perl5] bc89df: Revert "Force windows into C++ mode"

From:
Karl Williamson via perl5-changes
Date:
October 7, 2020 22:26
Subject:
[Perl/perl5] bc89df: Revert "Force windows into C++ mode"
Message ID:
Perl/perl5/push/refs/heads/smoke-me/khw-c99/efb3e7-fae24b@github.com
  Branch: refs/heads/smoke-me/khw-c99
  Home:   https://github.com/Perl/perl5
  Commit: bc89dfab5815234ec7161011883a0ccdce02ef50
      https://github.com/Perl/perl5/commit/bc89dfab5815234ec7161011883a0ccdce02ef50
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-10-07 (Wed, 07 Oct 2020)

  Changed paths:
    M win32/Makefile

  Log Message:
  -----------
  Revert "Force windows into C++ mode"

This reverts commit efb3e7c11633ab7dbb5e0f91d03dcf4674043a35.


  Commit: 075992732c33def0f659b3e1107adbd204ee9e29
      https://github.com/Perl/perl5/commit/075992732c33def0f659b3e1107adbd204ee9e29
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-10-07 (Wed, 07 Oct 2020)

  Changed paths:
    M win32/makefile.mk

  Log Message:
  -----------
  another way to build c++


  Commit: 252675795c8e06a2104493b9284e3080ec0d477f
      https://github.com/Perl/perl5/commit/252675795c8e06a2104493b9284e3080ec0d477f
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-10-07 (Wed, 07 Oct 2020)

  Changed paths:
    M regen/regcomp.pl
    M regnodes.h

  Log Message:
  -----------
  regen/regcomp.pl: Generate #defines for UTF8ness

This causes #defines to be generated for regexec.c to use in switch
statements, so that for each opcode there that is a case: there are
actually 4 cases, for the the target being UTF-8 or not, combined with
the pattern being UTF-8 or not.

This will be used in future commits to simplify things.


  Commit: a6d35777c4301fa20eb1e31fd576e0beac245cb9
      https://github.com/Perl/perl5/commit/a6d35777c4301fa20eb1e31fd576e0beac245cb9
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-10-07 (Wed, 07 Oct 2020)

  Changed paths:
    M regexec.c

  Log Message:
  -----------
  regexec.c: S_find_byclass(): utf8ness in switch()

This uses the #defines created in the previous commit to make the switch
statement in this function incorporate the UTF8ness of both the pattern
and the target string.

The reason for this is that the first statement in nearly every case of
the switch is to test if the target string being matched is UTF-8 or
not.  By putting that information into the the case number, those
conditionals can be eliminated, leading to cleaner, more modular code.
I had hoped that this would also improve performance since there are
fewer conditionals, but Sergey Aleynikov did performance testing of this
change for me, and found no real noticeable gain nor loss.

Further, the cases involving matching EXACTish nodes have to also test
if the pattern is UTF-8 or not before doing anything else.  I added that
information as well to the case number, so that those conditionals can
be eliminated.  For the non-EXACTish nodes, it simply means that that
two case statements execute the same code.

This is an intermediate commit, which only does the expansion of the
current cases into four for each.  The refactoring that takes advantage
of this is in the following commit.


  Commit: 131894220e565fefd3a50db2471c1da3e4af00bd
      https://github.com/Perl/perl5/commit/131894220e565fefd3a50db2471c1da3e4af00bd
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-10-07 (Wed, 07 Oct 2020)

  Changed paths:
    M regexec.c

  Log Message:
  -----------
  regexec.c: find_byclass(): Restructure

This is a follow-on to the previous commit.  The case number of the main
switch statement now includes three things: the regnode op, the UTF8ness
of the target, and the UTF8ness of the pattern.

This allows the conditionals within the previous cases (which only
encoded the op), to be removed, and things to be moved around so that
there is more fall throughs and fewer gotos, and the macros that are
called no longer have to test for UTF8ness; so I teased the UTF8 ones
apart from the non_UTF8 ones.


  Commit: f3da286b9849a21106b26a81784c3c3bcd1115d4
      https://github.com/Perl/perl5/commit/f3da286b9849a21106b26a81784c3c3bcd1115d4
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-10-07 (Wed, 07 Oct 2020)

  Changed paths:
    M regexec.c

  Log Message:
  -----------
  regexec.c: Rename a static variable

This is to distinguish it from a similar variable being added in a
future commit


  Commit: 3f46d560c9c1a1877d0e6fcfeddf7113de4451b2
      https://github.com/Perl/perl5/commit/3f46d560c9c1a1877d0e6fcfeddf7113de4451b2
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-10-07 (Wed, 07 Oct 2020)

  Changed paths:
    M regexec.c

  Log Message:
  -----------
  regexec.c: Macroize a common paradigm


  Commit: a4293ff9aedd76fdf73129c0f938bc070fcba846
      https://github.com/Perl/perl5/commit/a4293ff9aedd76fdf73129c0f938bc070fcba846
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-10-07 (Wed, 07 Oct 2020)

  Changed paths:
    M regexec.c

  Log Message:
  -----------
  regexec.c: Macroize another common paradigm


  Commit: fae24b066595f1c3b7c8c989857d17d4c193e977
      https://github.com/Perl/perl5/commit/fae24b066595f1c3b7c8c989857d17d4c193e977
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-10-07 (Wed, 07 Oct 2020)

  Changed paths:
    M regen/regcomp.pl
    M regexec.c
    M regnodes.h

  Log Message:
  -----------
  more case statements


Compare: https://github.com/Perl/perl5/compare/efb3e7c11633...fae24b066595



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About