{"push_id":975098080,"size":30,"distinct_size":14,"ref":"refs/heads/feature/gh14-native-types","head":"bc28e503a2fc28393480f4147c8b234c904f99d7","before":"3206bdf602a76ce27efd3a3a12f5e7b8a3f29ec9","commits":[{"sha":"9560b277005800138bf51301f1d65b8b78d6d524","author":{"email":"b3538261d0c0bffcce3d04dcc48be08a7393a14f@cpanel.net","name":"Reini Urban"},"message":"XSLoader: improve load_file errmsg\n\nprint the missing sofile","distinct":false,"url":"https://api.github.com/repos/perl11/cperl/commits/9560b277005800138bf51301f1d65b8b78d6d524"},{"sha":"fb2e9aeef4fada4c15e5ccfd15125de19a649de6","author":{"email":"b58d09249b3e367ae8383be7fc79efabb7794458@cpan.org","name":"Karl Williamson"},"message":"constant.pm lower memory use","distinct":false,"url":"https://api.github.com/repos/perl11/cperl/commits/fb2e9aeef4fada4c15e5ccfd15125de19a649de6"},{"sha":"f315c746a63756ec628cb288672d3354478c270d","author":{"email":"1001e8702733cced254345e193c88aaa47a4f5de@develop-help.com","name":"Tony Cook"},"message":"[perl #127334] S_incline: avoid overrunning the end of the parse buffer\n\nIf the rest of the allocation up to the end addressable memory was\nnon-spaces, this loop could cause a segmentation fault.\n\nAvoid that by ensuring we stop when we see a NUL.","distinct":false,"url":"https://api.github.com/repos/perl11/cperl/commits/f315c746a63756ec628cb288672d3354478c270d"},{"sha":"0c628ea13184a2c37e6154a114639d15999aac69","author":{"email":"b3538261d0c0bffcce3d04dcc48be08a7393a14f@cpanel.net","name":"Reini Urban"},"message":"HEK_STATIC: support static shared heks\n\nto be able to use them in the compiler\nas static IsCOW strings with LEN=0.\n\nSee GH #107 and the compiler branch pvcog (B-C-1.53_09)","distinct":false,"url":"https://api.github.com/repos/perl11/cperl/commits/0c628ea13184a2c37e6154a114639d15999aac69"},{"sha":"8377678bcf7a25526a05afaba74a092d14b8cc05","author":{"email":"b3538261d0c0bffcce3d04dcc48be08a7393a14f@cpanel.net","name":"Reini Urban"},"message":"HEK_STATIC: do not require a shared_he prepended\n\nwith HEK_STATIC we can unshare now a single HEK* without\nthe mandatory shared_he before in memory. no refcount needed","distinct":false,"url":"https://api.github.com/repos/perl11/cperl/commits/8377678bcf7a25526a05afaba74a092d14b8cc05"},{"sha":"c04d81bac70f84b1f101d0d19c4e99752ca895e5","author":{"email":"b3538261d0c0bffcce3d04dcc48be08a7393a14f@cpanel.net","name":"Reini Urban"},"message":"HEK_STATIC: make share_hek_hek a noop\n\nwith a static hek we do not have a prev. he with the refcount","distinct":false,"url":"https://api.github.com/repos/perl11/cperl/commits/c04d81bac70f84b1f101d0d19c4e99752ca895e5"},{"sha":"adb80535331ef2ae3dc1382a0320b3ba9a768a1d","author":{"email":"b3538261d0c0bffcce3d04dcc48be08a7393a14f@cpanel.net","name":"Reini Urban"},"message":"release_cperl.pod: add release guide\n\nnot yet finished, just a start","distinct":false,"url":"https://api.github.com/repos/perl11/cperl/commits/adb80535331ef2ae3dc1382a0320b3ba9a768a1d"},{"sha":"33c0675ffe98eb764dd2456eaffdc1320a6ff173","author":{"email":"b3538261d0c0bffcce3d04dcc48be08a7393a14f@cpanel.net","name":"Reini Urban"},"message":"Porting/makerel: typos in usage","distinct":false,"url":"https://api.github.com/repos/perl11/cperl/commits/33c0675ffe98eb764dd2456eaffdc1320a6ff173"},{"sha":"d5837b7e2737f8dbe73d79aa4a8b9463a5a90ee5","author":{"email":"b3538261d0c0bffcce3d04dcc48be08a7393a14f@cpanel.net","name":"Reini Urban"},"message":"Porting/makerel: use cperl prefix","distinct":false,"url":"https://api.github.com/repos/perl11/cperl/commits/d5837b7e2737f8dbe73d79aa4a8b9463a5a90ee5"},{"sha":"94b86e7fc092d27520f89355fdec40f7aa6e2483","author":{"email":"b3538261d0c0bffcce3d04dcc48be08a7393a14f@cpanel.net","name":"Reini Urban"},"message":"Configure: fixup startperl and perlpath for usecperl","distinct":false,"url":"https://api.github.com/repos/perl11/cperl/commits/94b86e7fc092d27520f89355fdec40f7aa6e2483"},{"sha":"158d1c6af2e8c1a7f82449e61b8a90df3b9b65e0","author":{"email":"b3538261d0c0bffcce3d04dcc48be08a7393a14f@cpanel.net","name":"Reini Urban"},"message":"release_cperl.pod: update\n\nnow done with deb","distinct":false,"url":"https://api.github.com/repos/perl11/cperl/commits/158d1c6af2e8c1a7f82449e61b8a90df3b9b65e0"},{"sha":"e8aa705a5936ba31f9e6312d3f1fe85555ed2cb4","author":{"email":"b3538261d0c0bffcce3d04dcc48be08a7393a14f@cpanel.net","name":"Reini Urban"},"message":"release_cperl.pod: more updates\n\nmostly for rpms","distinct":false,"url":"https://api.github.com/repos/perl11/cperl/commits/e8aa705a5936ba31f9e6312d3f1fe85555ed2cb4"},{"sha":"3945b47fb76bc46b00a0ac540d1839f93bf62c6c","author":{"email":"b3538261d0c0bffcce3d04dcc48be08a7393a14f@cpanel.net","name":"Reini Urban"},"message":"SHORT_DESC: added for packaging","distinct":false,"url":"https://api.github.com/repos/perl11/cperl/commits/3945b47fb76bc46b00a0ac540d1839f93bf62c6c"},{"sha":"e818e6b4aff7ca047b5e688fcde8b22b34ac687e","author":{"email":"b3538261d0c0bffcce3d04dcc48be08a7393a14f@cpanel.net","name":"Reini Urban"},"message":"make_patchnum: fix for shallow clone\n\ncreated with git clone --depth there may be no tags.","distinct":false,"url":"https://api.github.com/repos/perl11/cperl/commits/e818e6b4aff7ca047b5e688fcde8b22b34ac687e"},{"sha":"81b4d2f5b3a7ab0adafd06192764912285a1aa9d","author":{"email":"b3538261d0c0bffcce3d04dcc48be08a7393a14f@cpanel.net","name":"Reini Urban"},"message":"cperl dev. only: cp-rb cp-lb cp-rh cp-mt scripts\n\nskip them porting/manifest.t\ndescribe our branches in cp-rb\n\nautomate the ./cp-rb rebase --skip steps with an optional argument\n\nimport issues from private stash to github (stash is way better btw)\n\nadd a new branch-point from which the branches branch off\nto keep master clean.\n\nrenamed all the branches to the github issue id\n\ncp-*: updated after 1st release","distinct":false,"url":"https://api.github.com/repos/perl11/cperl/commits/81b4d2f5b3a7ab0adafd06192764912285a1aa9d"},{"sha":"d189da228a1cc66f1d10d4b8f82cd07a807fcec6","author":{"email":"b3538261d0c0bffcce3d04dcc48be08a7393a14f@cpanel.net","name":"Reini Urban"},"message":".git-rr-cache fixups [EOF master]","distinct":false,"url":"https://api.github.com/repos/perl11/cperl/commits/d189da228a1cc66f1d10d4b8f82cd07a807fcec6"},{"sha":"a623cc174e41c75e8185bc4f561e8b67b2e94d19","author":{"email":"b3538261d0c0bffcce3d04dcc48be08a7393a14f@cpanel.net","name":"Reini Urban"},"message":"Revert \"native opcodes: undef PERL_NATIVE_TYPES, disabled\"\n\nThis reverts commit 7becbb36b1109f29ecd168df490f3c1695ab99a5.","distinct":true,"url":"https://api.github.com/repos/perl11/cperl/commits/a623cc174e41c75e8185bc4f561e8b67b2e94d19"},{"sha":"ebee835ee4a89a94dda4a5d2ee304c25889be48c","author":{"email":"b3538261d0c0bffcce3d04dcc48be08a7393a14f@cpanel.net","name":"Reini Urban"},"message":"native: up- and downgrade native types in op chains\n\nthis optimizes, checks and partially infers types involving all unboxed\nnative types: :int, :uint, :str, :num.\n\nwe bite the bullet and create a const native already in the parser if\npossible, esp. :int. This saves creating a newSV upfront in the parser,\nesp.  when it's later used in native context.  If not it will be\ndowngraded to a boxed const.\n\ncheck every native chain in rpeep for followers if possible to upgrade\nto native.  and if only one either downgrade it, or add a box op to end\nthe chain.\n\nThrow bad_type_declared errors when upgrading to a type fails.\n  Type violation on scalar %s declared as :%s\nBut note that some of these types are implicit, such as numeric\nand string constants.\n\nadd op_pad2const helper.\na padsv cannot be replaced by a const in-place, as there is\nno room for the op_sv.\nthus we need the prev. sibling, which we best do in constant folding.\nwe also need to upgrade to native, because a const cannot carry the\ntype, other than implicit. native const is better later in the peep\nnative chain checker.\n\nneed now the SVf_NATIVE flag for pad data, which we took from SVf_PROTECT.\npad have multiple ops pointing to the curpad[].\nwe can only upgrade them to native as we see them.\n\nIdeas:\n* we could use a PadnameNATIVE flags instead.\n* when walk all padop's upgrade them on-the-fly.\n  problem: fold_constants sees a non-native pad op,\n  which points to a native pad.\n  we should not mark uninitialized lexical pads with SvNATIVE,\n  when the flags are still 0.\n\nProblems:\nwithin pushmark we omit all optimizations, as we do not carry the\nstack depth with us. i.e. -e'my int $a=1; print $b=$a+42+$a'\nall the arguments of print cannot be optimized yet.\nwith the stackdepth for print (which is 1 here) we could downgrade\nonly the result of $b=.\n\nThe optimizer can now up- and downgrade the native ops:\n\n./miniperl -Ilib -Dktv -e'my int $a=1; $b=$a+42+$a'\n\n(-e:1)\tmatch: padsv ():Scalar + :int <=> int_padsv ():int\n(-e:1)\tmatch: sassign (:Scalar,:Scalar):Scalar + :int <=> int_sassign (:int,:int):int\n(-e:1)\tnative: can upgrade sassign => int_sassign\n(-e:1)\tnative chain: int_const .. 2x .. nextstate\n(-e:1)\tmatch: padsv ():Scalar + :int <=> int_padsv ():int\n(-e:1)\tnative: upgrade padsv => int_padsv at [1]\n(-e:1)\tmatch: sassign (:Scalar,:Scalar):Scalar + :int <=> int_sassign (:int,:int):int\n(-e:1)\tnative: upgrade sassign => int_sassign\n(-e:1)\tnative: int_sassign -> nextstate needs no box\n(-e:1)\trpeep lastnative_op == o int_padsv continue\n(-e:1)\trpeep lastnative_op == o int_sassign continue\n(-e:1)\tmatch: padsv ():Scalar + :int <=> int_padsv ():int\n(-e:1)\tnative chain: int_padsv .. 4x .. gv\n(-e:1)\tmatch: padsv ():Scalar + :int <=> int_padsv ():int\n(-e:1)\tnative: upgrade padsv => int_padsv at [1]\n(-e:1)\trpeep lastnative_op == o int_const continue\n(-e:1)\trpeep lastnative_op == o int_add continue\n(-e:1)\trpeep lastnative_op == o int_padsv continue\n(-e:1)\trpeep lastnative_op == o int_add continue\n\nEXECUTING...\n\n(-e:0)\tenter\n(-e:0)\tnextstate\n(-e:1)\tint_const(1:int)\n(-e:1)\tint_padsv($a)\n(-e:1)\tint_sassign\n(-e:1)\tnextstate\n(-e:1)\tint_padsv($a)\n(-e:1)\tint_const(42:int)\n(-e:1)\ti_add\n(-e:1)\tint_add\n(-e:1)\tint_padsv($a)\n(-e:1)\tint_add (BOX)\n(-e:1)\tgvsv(main::b)\n(-e:1)\tsassign\n(-e:1)\tleave\n\non the end of statements we do not care boxing\n*SP, the last result. keep it native\ni.e. in\n\tint_sassign (BOX)\n\tnextstate\nBOX is not needed. nextstate resets the stack.\n\nsince a padsv with SvNATIVE IS_NATIVE_OP\nit needs special treatments to be upgraded.\npadav (native arrays) not yet.\n\nnative padsv needs to set the curpad[], as well as putting\nthe native val onto the stack.\n\ndeb_stack printing needs a looks_like_sv(), which checks the SV\narenas or the curpad pointers, if this is a SV or native value.\n\nmake sure we do not visit the native chain all over again\nfor every next element, by using a state lastnative_op.\nwe cannot use op_opt=1 as this is only for nullifying ops.\nrpeep is just a glorified nullifier framework, and hard to convince to\ndo normal optimizations.\n\nharmonize rpeep upgrader with ck_type rules: i_divide, i_modulo.\nTODO: we really should use one function for this, not two.\ncheck modulo for 2 const args where one is negative.\n  but if one is a typed int lexical, we'll use the libc (use integer)\n  fast i_modulo then.\n    my int $i = -3; $i % 2 => -1, not 1.\n  This is the same special case, which was removed with e7311069\n\n  See in http://www.nntp.perl.org/group/perl.perl5.porters/2001/10/msg45590.html\n  p5p arguing that it is using the mathematical \"correct\" semantics,\n  vs the C standards committee:\n  http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1124.pdf\n\n  \"When integers are divided, the result of the / operator is the\n  algebraic quotient with any fractional part discarded. If the\n  quotient a/b is representable, the expression\n  (a/b)*b + a%b shall equal a.\" Perl does not obey this, only with use integer.\n  'use integer; my ($a,$b)=(13,-4); print int(($a/$b)*$b) + $a % $b' => 13\n  'my ($a,$b)=(13,-4); print int(($a/$b)*$b) + $a % $b' => 10\n\nbox int_padsv when used before assign.\nA lhs padsv (i.e used as a container for the result) needs to\nput the SvNATIVE onto the stack, not just the value as in rhs.\nDetect it for now simply by checking op_next for sassign or aassign.\nSuch a padsv really should have a OPf_MOD lhs context flag. But we\ncannot handle native arrays (padav) yet.\n\nextend op_native_variant to check its args\nso far op_native_variant never checked the typed of it's args, as ck_type\ndid.\ndo now for UNOP and BINOP, but do not match int with Int or uint yet.\nThis fixes cases like 'my int $a=0; $b+$a+1' where gvsv *b prevents\nadd => int_add\nWe really should write a better matcher, as we only do simple single- and\ndouble-dispatch yet.  esp.  check not only both args, but pass the result\ntype to the next op, with possible casts.  For user-dispatch we need to come\nup with a better dispatcher which needs to be fast at run-time, i.e.  using\nmore memory.\n\ninitialize with newSV the IVX slot with 0.\nwe dont want to see uninitialized native values with -Ds\n\nadd op_insert_box, 2 ops needed for BINOP.\nwhen a chain ends with an BINOP, we need the 2 last ops being\nboxed. which is getting unfortunate.\nWith higher ops, we need to skip it alltogether.\n\nadd is_native_string\nto get more OP_STR_CONST, saving initial SVs.\nBut the parser does not give as that many.\nis_native_string checks if the pv can be stored as native ASCIIZ\nstring: no utf8, no embedded NULs, must have ending NUL.\n\nbail-out conditions are one typed op only,\nending BINOP,LOGOP with only one arg,\nor any LOOPOP,LISTOP.\nThe chain ends typically with a nextstate for good.\n\nnon downgradable ops need to be boxed.\nfor a *PADSV turn on BOXRET and return true.\nNote that in reality most native UN- and BINOPs\nneed not to be downgraded, only CONST and PADSV, as they start\na native chain.\n\non forbidden ops (pushmark..listop) downgrade the whole list.\ndo not break the loop, continue with next optim.\nadd more -Dkv on rpeep exit logic.\n\ndowngrade typed variants\ne.g. within pushmarks. also all binops and unops.\nS_op_downgrade_native got a bool with_box argument.","distinct":true,"url":"https://api.github.com/repos/perl11/cperl/commits/ebee835ee4a89a94dda4a5d2ee304c25889be48c"},{"sha":"eef666030f9648cfc090c739947dcd930840ad5b","author":{"email":"b3538261d0c0bffcce3d04dcc48be08a7393a14f@cpanel.net","name":"Reini Urban"},"message":"loop: fix loop optimizer, no o clobber\n\ndo not clobber o with the loop body. use o2 instead.","distinct":true,"url":"https://api.github.com/repos/perl11/cperl/commits/eef666030f9648cfc090c739947dcd930840ad5b"},{"sha":"2262c04e146a6e8ccd278e91d8e8fcdfcffc66b9","author":{"email":"b3538261d0c0bffcce3d04dcc48be08a7393a14f@cpanel.net","name":"Reini Urban"},"message":"native: fix the last make miniperl errors\n\nfixup missing targ in downgraded op, use S_const_iv.\nfix documentation of is_native_string and op_native_peek","distinct":true,"url":"https://api.github.com/repos/perl11/cperl/commits/2262c04e146a6e8ccd278e91d8e8fcdfcffc66b9"}]}