Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package nqp for openSUSE:Factory checked in 
at 2022-10-03 13:44:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nqp (Old)
 and      /work/SRC/openSUSE:Factory/.nqp.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "nqp"

Mon Oct  3 13:44:53 2022 rev:42 rq:1007426 version:2022.07

Changes:
--------
--- /work/SRC/openSUSE:Factory/nqp/nqp.changes  2022-04-03 21:31:28.779497514 
+0200
+++ /work/SRC/openSUSE:Factory/.nqp.new.2275/nqp.changes        2022-10-03 
13:45:10.917404858 +0200
@@ -1,0 +2,8 @@
+Sat Oct  1 12:32:30 CEST 2022 - n...@detonation.org
+
+- update to version 2022.07
+  * Presize $!mbc and write at offsets instead of pushing
+  * Write each frame directly to the MAST bytecode file...
+  * Speed up "sorted_keys" sub
+
+-------------------------------------------------------------------

Old:
----
  nqp-2022.03.tar.gz

New:
----
  nqp-2022.07.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ nqp.spec ++++++
--- /var/tmp/diff_new_pack.i3717u/_old  2022-10-03 13:45:11.549406248 +0200
+++ /var/tmp/diff_new_pack.i3717u/_new  2022-10-03 13:45:11.553406257 +0200
@@ -17,15 +17,15 @@
 
 
 Name:           nqp
-Version:        2022.03
+Version:        2022.07
 Release:        1.1
 Summary:        Not Quite Perl
 License:        Artistic-2.0
 Group:          Development/Languages/Other
 URL:            https://github.com/Raku/nqp
 Source:         nqp-%{version}.tar.gz
-BuildRequires:  moarvm-devel >= 2022.03
-Requires:       moarvm >= 2022.03
+BuildRequires:  moarvm-devel >= 2022.07
+Requires:       moarvm >= 2022.07
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 %ifarch s390x
 BuildRequires:  libffi-devel

++++++ nqp-2022.03.tar.gz -> nqp-2022.07.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nqp-2022.03/README.pod new/nqp-2022.07/README.pod
--- old/nqp-2022.03/README.pod  2022-03-20 19:06:20.000000000 +0100
+++ new/nqp-2022.07/README.pod  2022-07-31 20:16:01.000000000 +0200
@@ -102,10 +102,10 @@
 change without notice. It's a tool for writing Raku compilers, not a
 low-level module for Raku programmers.
 
-The L<examples directory|https://github.com/perl6/nqp/tree/master/examples> is 
a good place to start, with the
-L<loops|https://github.com/perl6/nqp/blob/master/examples/loops.nqp> and other 
files. Opcodes are listed in
-L<the docs 
directory|https://github.com/perl6/nqp/blob/master/docs/ops.markdown>. NQP also 
has built-in routines
-listed in L<the docs 
directory|https://github.com/perl6/nqp/blob/master/docs/built-ins.md>. You can 
use NQP from this
+The L<examples directory|https://github.com/raku/nqp/tree/master/examples> is 
a good place to start, with the
+L<loops|https://github.com/raku/nqp/blob/master/examples/loops.nqp> and other 
files. Opcodes are listed in
+L<the docs 
directory|https://github.com/raku/nqp/blob/master/docs/ops.markdown>. NQP also 
has built-in routines
+listed in L<the docs 
directory|https://github.com/raku/nqp/blob/master/docs/built-ins.md>. You can 
use NQP from this
 release, it will be already installed if you have built Raku from
 scratch.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nqp-2022.03/VERSION new/nqp-2022.07/VERSION
--- old/nqp-2022.03/VERSION     2022-03-20 19:06:23.000000000 +0100
+++ new/nqp-2022.07/VERSION     2022-07-31 20:16:04.000000000 +0200
@@ -1 +1 @@
-2022.03
+2022.07
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nqp-2022.03/docs/qast.markdown 
new/nqp-2022.07/docs/qast.markdown
--- old/nqp-2022.03/docs/qast.markdown  2022-03-20 19:06:20.000000000 +0100
+++ new/nqp-2022.07/docs/qast.markdown  2022-07-31 20:16:01.000000000 +0200
@@ -18,7 +18,7 @@
 unit of code that is being compiled. This includes:
 
 * **hll** - the name of the high level language that this QAST tree was
-  produced from, for example, "perl6", "tcl", "bf".
+  produced from, for example, "raku", "tcl", "bf".
 
 * **load** - code to evaluate at the point that the compilation unit is
   loaded as a module (but not if it is invoked as a mainline program).
@@ -32,7 +32,7 @@
 
     QAST::CompUnit.new(
         # Set the HLL.
-        :hll('perl6'),
+        :hll('raku'),
         
         # This variable contains the outermost QAST::Block of the
         # program.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nqp-2022.03/examples/CallFromJava.java 
new/nqp-2022.07/examples/CallFromJava.java
--- old/nqp-2022.03/examples/CallFromJava.java  2022-03-20 19:06:20.000000000 
+0100
+++ new/nqp-2022.07/examples/CallFromJava.java  2022-07-31 20:16:01.000000000 
+0200
@@ -1,7 +1,7 @@
 // nqp$ javac -cp bin/ examples/CallFromJava.java
 // nqp$ java -cp 
nqp-runtime.jar:3rdparty/asm/asm-4.1.jar:3rdparty/asm/asm-tree-4.1.jar:. 
examples.CallFromJava nqp.jar nqp 'say(2+2)'
 // 4
-// rakudo$ java -cp 
../nqp-jvm:../nqp-jvm/3rdparty/asm/asm-4.1.jar:../nqp-jvm/3rdparty/asm/asm-tree-4.1.jar:../nqp-jvm/nqp-runtime.jar:rakudo-runtime.jar:.
 examples.CallFromJava perl6.jar perl6 'say 2 + 2'
+// rakudo$ java -cp 
../nqp-jvm:../nqp-jvm/3rdparty/asm/asm-4.1.jar:../nqp-jvm/3rdparty/asm/asm-tree-4.1.jar:../nqp-jvm/nqp-runtime.jar:rakudo-runtime.jar:.
 examples.CallFromJava raku.jar raku 'say 2 + 2'
 // 4
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nqp-2022.03/examples/use-classes.nqp 
new/nqp-2022.07/examples/use-classes.nqp
--- old/nqp-2022.03/examples/use-classes.nqp    2022-03-20 19:06:20.000000000 
+0100
+++ new/nqp-2022.07/examples/use-classes.nqp    2022-07-31 20:16:01.000000000 
+0200
@@ -2,7 +2,7 @@
 
 # based on blog post by Andrew Shitov:
 #
-#   https://perl6.online/2018/01/09/what-does-nqpgetattr-do/
+#   https://andrewshitov.com/2018/01/09/what-does-nqpgetattr-do/
 #
 #   class C {
 #       has $.attr is rw;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nqp-2022.03/src/core/Hash.nqp 
new/nqp-2022.07/src/core/Hash.nqp
--- old/nqp-2022.03/src/core/Hash.nqp   2022-03-20 19:06:20.000000000 +0100
+++ new/nqp-2022.07/src/core/Hash.nqp   2022-07-31 20:16:01.000000000 +0200
@@ -6,12 +6,14 @@
 # so a bubble sort would be fine. However, the
 # number can get much larger (e.g., when profiling
 # a build of the Rakudo settings), so use a heapsort
-# instead.
+# instead.  Note that this sorts in **reverse** order.
 sub sorted_keys($hash) {
     my @keys := nqp::list_s();
-    for $hash {
-        nqp::push_s(@keys, $_.key);
-    }
+    my $iter := nqp::iterator($hash);
+    nqp::while(
+      $iter,
+      nqp::push_s(@keys,nqp::iterkey_s(nqp::shift($iter)))
+    );
 
     sub sift_down(@a, int $start, int $end) {
         my int $root := $start;
@@ -40,26 +42,24 @@
     }
 
     my int $count := +@keys;
-    if $count < 3 {
-        if $count == 2 && nqp::atpos_s(@keys, 0) gt nqp::atpos_s(@keys, 1) {
-            nqp::push_s(@keys, nqp::shift_s(@keys));
+    if $count > 2 {
+        my int $start := $count / 2;
+        my int $end := $count - 1;
+        while --$start >= 0 {
+            sift_down(@keys, $start, $end);
         }
-        return @keys;
-    }
-    my int $start := $count / 2 - 1;
-    my int $end := $count - 1;
-    while $start >= 0 {
-        sift_down(@keys, $start, $end);
-        $start := $start - 1;
-    }
 
-    while $end > 0 {
-        my str $swap := nqp::atpos_s(@keys, $end);
-        nqp::bindpos_s(@keys, $end, nqp::atpos_s(@keys, 0));
-        nqp::bindpos_s(@keys, 0, $swap);
-        $end := $end - 1;
-        sift_down(@keys, 0, $end);
+        while $end > 0 {
+            my str $swap := nqp::atpos_s(@keys, $end);
+            nqp::bindpos_s(@keys, $end, nqp::atpos_s(@keys, 0));
+            nqp::bindpos_s(@keys, 0, $swap);
+            $end := $end - 1;
+            sift_down(@keys, 0, $end);
+        }
+    }
+    elsif $count == 2 && nqp::atpos_s(@keys, 0) lt nqp::atpos_s(@keys, 1) {
+        nqp::push_s(@keys, nqp::shift_s(@keys));
     }
 
-    return @keys;
+    @keys
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nqp-2022.03/src/vm/moar/QAST/QASTCompilerMAST.nqp 
new/nqp-2022.07/src/vm/moar/QAST/QASTCompilerMAST.nqp
--- old/nqp-2022.03/src/vm/moar/QAST/QASTCompilerMAST.nqp       2022-03-20 
19:06:20.000000000 +0100
+++ new/nqp-2022.07/src/vm/moar/QAST/QASTCompilerMAST.nqp       2022-07-31 
20:16:01.000000000 +0200
@@ -2615,65 +2615,93 @@
         my @handlers := $f.handlers;
         my @debug_map_idxs := $f.debug_map_idxs;
         my int $debug_map_idxs_length := nqp::elems(@debug_map_idxs);
-        $!mbc.write_uint32($f.bytecode-offset); # Bytecode segment offset
-        $!mbc.write_uint32($f.bytecode-length); # Bytecode length in bytes
-        $!mbc.write_uint32(my uint $num_local_types := 
nqp::elems(@local_types)); # Number of locals/registers
-        $!mbc.write_uint32(my uint $num_lexical_types := 
nqp::elems(@lexical_types)); # Number of lexicals
-        $!mbc.write_uint32($f.cuuid-idx); # Compilation unit unique ID (string 
heap index)
-        $!mbc.write_uint32($f.name-idx); # Name (string heap index)
+
+        my uint32 $mbc_pos := nqp::elems($!mbc);
+        sub add_uint32($data) {
+            $!mbc.write_uint32_at($data, $mbc_pos);
+            $mbc_pos := $mbc_pos + 4;
+        }
+        sub add_uint16($data) {
+            $!mbc.write_uint16_at($data, $mbc_pos);
+            $mbc_pos := $mbc_pos + 2;
+        }
+        # Pre-size $!mbc to estimated total size. If any of the @handlers have 
a category mask of MVM_EX_CATEGORY_LABELED
+        # then we write some extra data, so this is just a lower bound on the 
size.
+        nqp::setelems($!mbc, $mbc_pos +
+                             12 * 4 +                            # constant 
number of 32-bit writes
+                             3 * 2 +                             # constant 
number of 16-bit writes
+                             2 * nqp::elems(@local_types) +      # one 16-bit 
write per
+                             6 * nqp::elems(@lexical_types) +    # one 16-bit 
write + one 32-bit write per
+                             20 * nqp::elems(@handlers) +        # two 16-bit 
writes + four 32-bit writes per
+                             12 * $num_static_lex_values +       # two 16-bit 
writes + two 32-bit writes per
+                             6 * ($debug_map_idxs_length / 2));  # one 16-bit 
write + one 32-bit write per
+
+        add_uint32($f.bytecode-offset); # Bytecode segment offset
+        add_uint32($f.bytecode-length); # Bytecode length in bytes
+        add_uint32((my uint $num_local_types := nqp::elems(@local_types))); # 
Number of locals/registers
+        add_uint32((my $num_lexical_types := nqp::elems(@lexical_types))); # 
Number of lexicals
+        add_uint32($f.cuuid-idx); # Compilation unit unique ID (string heap 
index)
+        add_uint32($f.name-idx); # Name (string heap index)
+
         my $outer := $f.outer;
         if nqp::defined($outer) {
-            $!mbc.write_uint16(my uint $frame_index := 
self.get_frame_index($outer)); # Outer
+            add_uint16((my uint $frame_index := 
self.get_frame_index($outer))); # Outer
         }
         else {
-            $!mbc.write_uint16($idx); # Outer
+            add_uint16($idx); # Outer
         }
-        $!mbc.write_uint32($f.annotations-offset); # Annotation segment offset
-        $!mbc.write_uint32($f.num-annotations); # Number of annotations
-        $!mbc.write_uint32(my uint $num_handlers := nqp::elems(@handlers)); # 
Number of handlers
-        $!mbc.write_uint16(my uint $flags := $f.flags); # Frame flag bits
-        $!mbc.write_uint16($num_static_lex_values); # Number of entries in 
static lexical values table
+        add_uint32($f.annotations-offset); # Annotation segment offset
+        add_uint32($f.num-annotations); # Number of annotations
+        add_uint32((my uint $num_handlers := nqp::elems(@handlers))); # Number 
of handlers
+        add_uint16((my uint $flags := $f.flags)); # Frame flag bits
+        add_uint16($num_static_lex_values); # Number of entries in static 
lexical values table
         if $f.flags +& 4 { # FRAME_FLAG_HAS_CODE_OBJ
-            $!mbc.write_uint32(my uint $idx := 
nqp::add_i($f.code_obj_sc_dep_idx, 1)); # Code object SC dependency index + 1
-            $!mbc.write_uint32($f.code_obj_sc_idx); # SC object index
+            add_uint32((my uint $idx := nqp::add_i($f.code_obj_sc_dep_idx, 
1))); # Code object SC dependency index + 1
+            add_uint32($f.code_obj_sc_idx); # SC object index
         }
         else {
             my uint $zero := 0;
-            $!mbc.write_uint32($zero); # No code object SC dependency index
-            $!mbc.write_uint32($zero); # No SC object index
+            add_uint32($zero); # No code object SC dependency index
+            add_uint32($zero); # No SC object index
         }
-        $!mbc.write_uint32(my uint $num_debug_map := nqp::elems($f.debug_map));
+        add_uint32((my uint $num_debug_map := nqp::elems($f.debug_map)));
+
         for @local_types {
-            $!mbc.write_uint16(my uint16 $type := type_to_local_type($_));
+            add_uint16((my uint16 $type := type_to_local_type($_)));
         }
+
         my int $i := 0;
         for @lexical_types {
-            $!mbc.write_uint16(my uint16 $type := type_to_local_type($_));
-            $!mbc.write_uint32(my uint32 $name := nqp::atpos_i(@lexical_names, 
$i++));
+            add_uint16((my uint16 $type := type_to_local_type($_)));
+            add_uint32((my uint32 $name := nqp::atpos_i(@lexical_names, 
$i++)));
         }
+
         for @handlers {
-            $!mbc.write_uint32($_.start_offset);
-            $!mbc.write_uint32($_.end_offset);
-            $!mbc.write_uint32($_.category_mask);
-            $!mbc.write_uint16($_.action);
-            $!mbc.write_uint16($_.local);
-            $!mbc.write_uint32($f.resolve-label($_.label));
+            add_uint32($_.start_offset);
+            add_uint32($_.end_offset);
+            add_uint32($_.category_mask);
+            add_uint16($_.action);
+            add_uint16($_.local);
+            add_uint32($f.resolve-label($_.label));
             if $_.category_mask +& 4096 { # MVM_EX_CATEGORY_LABELED
-                $!mbc.write_uint16($_.label_reg);
+                nqp::setelems($!mbc, nqp::elems($!mbc) + 2);
+                add_uint16($_.label_reg);
             }
         }
+
         $i := 0;
         while ($i < $num_static_lex_values) {
-            $!mbc.write_uint16(my uint $index  := 
nqp::atpos_i(@static_lex_values, 4 * $i));
-            $!mbc.write_uint16(my uint $flags  := 
nqp::atpos_i(@static_lex_values, 4 * $i + 1));
-            $!mbc.write_uint32(my uint $sc_idx := 
nqp::atpos_i(@static_lex_values, 4 * $i + 2));
-            $!mbc.write_uint32(my uint $idx    := 
nqp::atpos_i(@static_lex_values, 4 * $i + 3));
+            add_uint16((my uint $index  := nqp::atpos_i(@static_lex_values, 4 
* $i)));
+            add_uint16((my uint $flags  := nqp::atpos_i(@static_lex_values, 4 
* $i + 1)));
+            add_uint32((my uint $sc_idx := nqp::atpos_i(@static_lex_values, 4 
* $i + 2)));
+            add_uint32((my uint $idx    := nqp::atpos_i(@static_lex_values, 4 
* $i + 3)));
             $i++;
         }
+
         $i := 0;
         while $i < $debug_map_idxs_length {
-            $!mbc.write_uint16(my uint $idx  := nqp::atpos_i(@debug_map_idxs, 
$i++));
-            $!mbc.write_uint32(my uint $name := nqp::atpos_i(@debug_map_idxs, 
$i++));
+            add_uint16((my uint $idx  := nqp::atpos_i(@debug_map_idxs, $i++)));
+            add_uint32((my uint $name := nqp::atpos_i(@debug_map_idxs, $i++)));
         }
     }
     method collect_bytecode() {
@@ -2795,13 +2823,17 @@
         self.write_extops;
         self.align_and_write($file);
         my uint $idx := 0;
+        my uint $size_frames := 0;
         for @!frames {
             # need to set the bycode offset here since we don't call 
self.collect_bytecode()
             $_.set-bytecode-offset($!bytecode_size);
             self.write_frame($_, $idx++);
             $!bytecode_size := $!bytecode_size + nqp::elems($_.bytecode);
+            nqp::writefh($file, $!mbc);
+            $size_frames := $size_frames + nqp::elems($!mbc);
+            nqp::setelems($!mbc, my uint $zero := 0);
         }
-        self.align_and_write($file);
+        self.align_file($size_frames, $file);
         self.write_callsites;
         self.align_and_write($file);
         self.write_string_heap;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nqp-2022.03/t/nqp/018-associative.t 
new/nqp-2022.07/t/nqp/018-associative.t
--- old/nqp-2022.03/t/nqp/018-associative.t     2022-03-20 19:06:20.000000000 
+0100
+++ new/nqp-2022.07/t/nqp/018-associative.t     2022-07-31 20:16:01.000000000 
+0200
@@ -1,6 +1,6 @@
 # check hash access methods
 
-plan(19);
+plan(23);
 
 my %h;
 
@@ -48,3 +48,22 @@
 }
 
 ok(nqp::eqaddr(as_return_value(), NQPMu), 'getting a NQPMu for a missing hash 
member when used a s return value');
+
+my @keys := <a b c d e f g h i j>;
+my @values := 1,2,3,4,5,6,7,8,9,10;
+
+my %sh;
+for @values {
+    %sh{@keys[$_-1]} := $_;
+}
+
+is(nqp::join("",sorted_keys(%sh)), nqp::flip(nqp::join("",@keys)), 'did we get 
sorted keys');
+
+my %eh;
+is(nqp::join("",sorted_keys(%eh)), "", 'did we get no keys');
+
+%eh<a> := 1;
+is(nqp::join("",sorted_keys(%eh)), "a", 'did we get one key');
+
+%eh<b> := 1;
+is(nqp::join("",sorted_keys(%eh)), "ba", 'did we get two keys');
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nqp-2022.03/t/nqp/060-bigint.t 
new/nqp-2022.07/t/nqp/060-bigint.t
--- old/nqp-2022.03/t/nqp/060-bigint.t  2022-03-20 19:06:20.000000000 +0100
+++ new/nqp-2022.07/t/nqp/060-bigint.t  2022-07-31 20:16:01.000000000 +0200
@@ -101,7 +101,7 @@
     'Bit ops (RT 109740)');
 
 # Now we'll create a type that boxes a P6bigint.
-my $bi_boxer := NQPClassHOW.new_type(:name('TestPerl6Int'), :repr('P6opaque'));
+my $bi_boxer := NQPClassHOW.new_type(:name('TestRakuInt'), :repr('P6opaque'));
 $bi_boxer.HOW.add_attribute($bi_boxer, NQPAttribute.new(
     :name('$!value'), :type($bi_type), :box_target(1)
 ));
@@ -305,6 +305,6 @@
     skip("skipping test that uses a 64bit int on a 32bit backend");
 }
 else {
-    # https://github.com/perl6/nqp/issues/363
+    # https://github.com/raku/nqp/issues/363
     ok(100000000000000009 != 100000000000000016, 'int literals that are the 
same float value are unequal');
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nqp-2022.03/tools/find-undocumented-ops.raku 
new/nqp-2022.07/tools/find-undocumented-ops.raku
--- old/nqp-2022.03/tools/find-undocumented-ops.raku    2022-03-20 
19:06:20.000000000 +0100
+++ new/nqp-2022.07/tools/find-undocumented-ops.raku    2022-07-31 
20:16:01.000000000 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl6
+#!/usr/bin/env raku
 sub MAIN (Str:D $nqp-folder, Str:D $moar-folder, Bool :$moar-names, Bool 
:$moar-and-nqp-names) {
     my $nqp-doc-file = make-io($nqp-folder, "docs/ops.markdown");
     my $moar-oplist  = make-io($moar-folder, "src/core/oplist");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nqp-2022.03/tools/templates/MOAR_REVISION 
new/nqp-2022.07/tools/templates/MOAR_REVISION
--- old/nqp-2022.03/tools/templates/MOAR_REVISION       2022-03-20 
19:06:23.000000000 +0100
+++ new/nqp-2022.07/tools/templates/MOAR_REVISION       2022-07-31 
20:16:04.000000000 +0200
@@ -1 +1 @@
-2022.03
+2022.07

Reply via email to