Skip to content
Browse files

Initialize $!reified/$!todo to a type object

Which means spesh turns it into something simpler; together with a JIT
improvement in MoarVM, we save over 300 bytes off the machine code that
is produced for ASSIGN-POS.
  • Loading branch information...
jnthn committed Apr 9, 2019
1 parent 286aa29 commit a21cf6ae0b36ca69fad2db591e6d7107b4a6ba04
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/Perl6/Metamodel/BOOTSTRAP.nqp
@@ -1775,7 +1775,8 @@ BEGIN {

# Helper for creating an attribute that vivifies to a clone of some VM
# storage type; used for the storage slots of arrays and hashes.
# storage type (or, if it's a type object, is just initialized with that
# type object); used for the storage slots of arrays and hashes.
sub storage_attr($name, $type, $package, $clonee, :$associative_delegate) {
return :$name, :$type, :$package, :auto_viv_primitive($clonee),
:$associative_delegate );
@@ -3269,8 +3270,8 @@ BEGIN {
# has Mu $!reified;
# has Mu $!todo;
List.HOW.add_parent(List, Cool);
List.HOW.add_attribute(List, scalar_attr('$!reified', Mu, List));
List.HOW.add_attribute(List, scalar_attr('$!todo', Mu, List));
List.HOW.add_attribute(List, storage_attr('$!reified', Mu, List, Mu));
List.HOW.add_attribute(List, storage_attr('$!todo', Mu, List, Mu));

# class Slip is List {

0 comments on commit a21cf6a

Please sign in to comment.
You can’t perform that action at this time.