Welcome to the main channel on the development of MoarVM, a virtual machine for NQP and Rakudo (moarvm.org). This channel is being logged for historical purposes.
Set by lizmat on 24 May 2021.
guifa Altai-man: I golfed it! 16:50
Altai-man guifa, great work! Now ticket time. :) 16:51
guifa m: class A { has int32 $.b is rw }; sub foo(int32 $c is rw) { $c += 1 }; my $a = A.new: :0b; foo $a;
camelia Bytecode validation error at offset 50, instruction 9:
operand type 32 does not match register type 24 for op decont_i in frame foo
in block <unit> at <tmp> line 1
MasterDuke m: class A { has int32 $.b is rw }; sub foo(int32 $c is rw) { $c += 1 }; my $a = A.new: :0b; foo $a.b; 16:59
camelia Bytecode validation error at offset 50, instruction 9:
operand type 32 does not match register type 24 for op decont_i in frame foo
in block <unit> at <tmp> line 1
MasterDuke m: class A { has int $.b is rw }; sub foo(int $c is rw) { $c += 1 }; my $a = A.new: :0b; foo $a.b;
camelia ( no output )
MasterDuke maybe nine++'s work on unsigned natives will also end up fixing that 17:00
dogbert17 looks like the optimizer might be involved in some fashion, try running with --optimize=0 17:38
timo turning the optimizer off completely requires --optimize=off ftr 17:51
guifa MasterDuke: ah noted. Unfortunately for this code I can't just use int, but I can definitely write in a work around for this particular function and comment it accordingly 17:53
nine chance is good, yes 18:25
guifa alright report filed. thanks for feedback, knowing the source I'll adjust my code for the time being 18:46
Geth MoarVM: 48f584c4fb | (Daniel Green)++ | src/core/coerce.c
Use faster itoa implementation

On my system this version consistently was faster than the existing one when running the benchmark from github.com/miloyip/itoa-benchmark
This was also still the case in a trivial benchmark of NQP and Raku code. For example,
  `MVM_SPESH_BLOCKING=1 ./nqp-m -e 'my str $s; my int $i := 0; my $n := nqp::time; while $i++ < 10_000_000 { $s := $i }; say(nqp::div_n(nqp::time - $n, 1000000000e0)); say($s)'`
reports ~0.56 before and ~0.43 after. Using callgrind (though just up to 1_000_000) I see ~958,400,000 instructions before and ~873,700,000 instructions after.
19:27
MoarVM: 06170c9733 | MasterDuke17++ (committed using GitHub Web editor) | src/core/coerce.c
Merge pull request #1618 from MasterDuke17/use_faster_itoa_implementation
MasterDuke nine: i suspect a nativecall problem here gist.github.com/melezhik/812837c04...b049059316 originally it was sensitive to MVM_SPESH_DISABLE=1, but now it's been golfed further and still aborts even with spesh disabled 19:52
nine yes, speshed code looks bogus 20:31
loc_10_obj doesnt make sense as return register ofbthat sp_runnativecall_o op 20:35
MasterDuke added valgrind output (all with spesh disabled) 20:49