Commit cb22a47c authored by Robert Lemmen's avatar Robert Lemmen

New upstream version 2018.06

parent 34003b86
......@@ -123,6 +123,7 @@ docs/announce/2018.03.md
docs/announce/2018.04.1.md
docs/announce/2018.04.md
docs/announce/2018.05.md
docs/announce/2018.06.md
docs/architecture.html
docs/architecture.svg
docs/archive/2017-IO-Grant--Action-Plan.md
......@@ -439,6 +440,8 @@ src/Perl6/Metamodel/TypePretense.nqp
src/Perl6/Metamodel/Versioning.nqp
src/Perl6/ModuleLoader.nqp
src/Perl6/Optimizer.nqp
src/Perl6/PodActions.nqp
src/Perl6/PodGrammar.nqp
src/Perl6/Pod.nqp
src/Perl6/World.nqp
src/RESTRICTED.setting
......@@ -459,6 +462,7 @@ src/vm/moar/ops/container.c
src/vm/moar/ops/container.h
src/vm/moar/ops/perl6_ops.c
src/vm/moar/Perl6/Ops.nqp
src/vm/moar/spesh-plugins.nqp
t/01-sanity/01-literals.t
t/01-sanity/02-op-math.t
t/01-sanity/03-op-logic.t
......@@ -482,6 +486,7 @@ t/01-sanity/20-defined.t
t/01-sanity/21-try.t
t/01-sanity/53-transpose.t
t/01-sanity/55-use-trace.t
t/01-sanity/56-use-isms.t
t/01-sanity/98-test-deprecated.t
t/01-sanity/99-test-basic.t
t/02-rakudo/01-is_approx.t
......
New in 2018.06:
+ Fixes:
+ Fixed numeric values in Signal enum [aa622a95][852c1bd3][f2b50378]
[774ec5a0][189c5a8a][b19cc4bd][c661c03c][5603771f][bfcfa5da]
[7e5a862e][cd8d0445]
+ Fixed long class names being cut off in X::TypeCheck message [a79de429]
+ Many improvements to POD parsing [75430ac9][cb66dfcc][6f1b1cb6]
[e1e7e4c6][cc28ce37][e776ded7][54aa17c6]
+ Fixed code execution in elided duplicate argument pair values
[fc57f9f0][73297600]
+ Fixed `use isms <Perl5>` for `rand` [d1d31fd5]
+ Fixed miscompilation of chain ops [c10b1eec]
+ Fixed home path when setting up repositories [91b211ac][d06e70c3]
+ [JVM] Implemented canStore in RakudoContainerSpec [704b893c]
+ Additions:
+ Made `is DEPRECATED` work on attributes with auto-generated
accessors [7e3aa2f2]
+ Added `:api<something>` in preparation for full zef / ecosystem
support [affc218f]
+ Added .perl method to Distributions [18f9de61]
+ Removals:
+ Removed backwards compatibility with installers using the
old Distribution class [2acbe7fc]
+ Moved pack/unpack support to lib/experimental.pm6 [9472fdfd][edc6ac6b]
+ Renamed `use p5isms` to more general `use isms <Perl5>` [4109ce36]
[c80ea2f2][56dbd735][148d7c56][95aa77c9]
+ Efficiency:
+ Streamlined creation of HyperWorkBatchIterator [20bf96f9]
+ Made .minpairs/.maxpairs about 25% faster [788cda94]
+ Privatized a lot of methods for (now) better performance
[c940a0ed][ec5e51c8][7284a30f][c49bbc93][0ac5c4ff][09a9bbc0]
[caafcb38][0c265d49][48864774][0e835805][5621b262]
+ Added spesh plugin support [192083f6]
+ Made private method calls 6.6x faster (spesh plugin) [51ff83c7]
+ Made qualified method calls 12x faster (spesh plugin) [f6f43d58]
+ Internal:
+ Moved &DEPRECATED to Rakudo::Deprecations.DEPRECATED [472f6e48]
[89a4cf0d][afbbf8f8][2fa08d5e][874ead51]
+ Turned Hash.BIND-KEY into multis [1c1acbc2]
+ Various NQP ↔ Perl 6 fixes [e4ecf5e5][23af3491][7bc6e46f][cbb5ee5f]
New in 2018.05:
+ SPECIAL NOTES:
+ Corresponding MoarVM release introduces hash randomization to
......
# Announce: Rakudo Perl 6 compiler, Release #124 (2018.06)
On behalf of the Rakudo development team, I’m very happy to announce the
June 2018 release of Rakudo Perl 6 #124. Rakudo is an implementation of
Perl 6 on the Moar Virtual Machine[^1].
This release implements the 6.c version of the Perl 6 specifications.
It includes bugfixes and optimizations on top of
the 2015.12 release of Rakudo.
Upcoming releases in 2018 will include new functionality that is not
part of the 6.c specification, available with a lexically scoped
pragma. Our goal is to ensure that anything that is tested as part of the
6.c specification will continue to work unchanged. There may be incremental
spec releases this year as well.
The tarball for this release is available from <https://rakudo.org/files/rakudo>.
Please note: This announcement is not for the Rakudo Star
distribution[^2] — it’s announcing a new release of the compiler
only. For the latest Rakudo Star release, see
<https://rakudo.org/files/star>.
The changes in this release are outlined below:
New in 2018.06:
+ Fixes:
+ Fixed numeric values in Signal enum [aa622a95][852c1bd3][f2b50378]
[774ec5a0][189c5a8a][b19cc4bd][c661c03c][5603771f][bfcfa5da]
[7e5a862e][cd8d0445]
+ Fixed long class names being cut off in X::TypeCheck message [a79de429]
+ Many improvements to POD parsing [75430ac9][cb66dfcc][6f1b1cb6]
[e1e7e4c6][cc28ce37][e776ded7][54aa17c6]
+ Fixed code execution in elided duplicate argument pair values
[fc57f9f0][73297600]
+ Fixed `use isms <Perl5>` for `rand` [d1d31fd5]
+ Fixed miscompilation of chain ops [c10b1eec]
+ Fixed home path when setting up repositories [91b211ac][d06e70c3]
+ [JVM] Implemented canStore in RakudoContainerSpec [704b893c]
+ Additions:
+ Made `is DEPRECATED` work on attributes with auto-generated
accessors [7e3aa2f2]
+ Added `:api<something>` in preparation for full zef / ecosystem
support [affc218f]
+ Added .perl method to Distributions [18f9de61]
+ Removals:
+ Removed backwards compatibility with installers using the
old Distribution class [2acbe7fc]
+ Moved pack/unpack support to lib/experimental.pm6 [9472fdfd][edc6ac6b]
+ Renamed `use p5isms` to more general `use isms <Perl5>` [4109ce36]
[c80ea2f2][56dbd735][148d7c56][95aa77c9]
+ Efficiency:
+ Streamlined creation of HyperWorkBatchIterator [20bf96f9]
+ Made .minpairs/.maxpairs about 25% faster [788cda94]
+ Privatized a lot of methods for (now) better performance
[c940a0ed][ec5e51c8][7284a30f][c49bbc93][0ac5c4ff][09a9bbc0]
[caafcb38][0c265d49][48864774][0e835805][5621b262]
+ Added spesh plugin support [192083f6]
+ Made private method calls 6.6x faster (spesh plugin) [51ff83c7]
+ Made qualified method calls 12x faster (spesh plugin) [f6f43d58]
+ Internal:
+ Moved &DEPRECATED to Rakudo::Deprecations.DEPRECATED [472f6e48]
[89a4cf0d][afbbf8f8][2fa08d5e][874ead51]
+ Turned Hash.BIND-KEY into multis [1c1acbc2]
+ Various NQP ↔ Perl 6 fixes [e4ecf5e5][23af3491][7bc6e46f][cbb5ee5f]
The following people contributed to this release:
Elizabeth Mattijsen, Will "Coke" Coleda, Jonathan Worthington,
Aleks-Daniel Jakimenko-Aleksejev, Zoffix Znet, Jeremy Studer,
Rafael Schipiura, 陈梓立, Tom Browder, Samantha McVey, Christian Bartolomäus,
Juan Julián Merelo Guervós, Stefan Seifert, Christian Sánchez, Daniel Green,
Ben Davies, Nick Logan, Luca Ferrari, Claudio Ramirez, Paweł Murias,
Bruce Gray, Tison, Ronald Schmidt, Timo Paulssen, Rob Hoelz, Luis F. Uceta,
dmaestro, Jonas Kramer, Moritz Lenz, Jan-Olof Hendig, KlappeZuAffeTot,
Jack Kuan, Brad Gilbert, İsmail Arılık
If you would like to contribute or find out more information, visit
<https://perl6.org>, <https://rakudo.org/how-to-help>, ask on the
<perl6-compiler@perl.org> mailing list, or ask on IRC #perl6 on freenode.
Additionally, we invite you to make a donation to The Perl Foundation
to sponsor Perl 6 development: <https://donate.perlfoundation.org/>
(put “Perl 6 Core Development Fund” in the ‘Purpose’ text field)
The next release of Rakudo (#125), is tentatively scheduled for 2018-07-21.
A list of the other planned release dates is available in the
“docs/release_guide.pod” file.
The development team appreciates feedback! If you’re using Rakudo, do
get back to us. Questions, comments, suggestions for improvements, cool
discoveries, incredible hacks, or any other feedback – get in touch with
us through (the above-mentioned) mailing list or IRC channel. Enjoy!
Please note that recent releases have known issues running on the JVM.
We are working to get the JVM backend working again but do not yet have
an estimated delivery date.
[^1]: See <http://moarvm.org/>
[^2]: What’s the difference between the Rakudo compiler and the Rakudo
Star distribution?
The Rakudo compiler is a compiler for the Perl 6 language.
Not much more.
The Rakudo Star distribution is the Rakudo compiler plus a selection
of useful Perl 6 modules, a module installer, Perl 6 introductory
documentation, and other software that can be used with the Rakudo
compiler to enhance its utility.
......@@ -18,8 +18,7 @@ Note that we are trying very hard to ensure there are no backward
compatibility issues post Christmas. As such, we may end up delaying
some releases to ensure any compatibility issues are resolved.
2018-06-16 Rakudo #124 (AlexDaniel + Releasable)
2018-07-21 Rakudo #125
2018-07-21 Rakudo #125 (AlexDaniel + Releasable)
2018-08-18 Rakudo #126
2018-09-15 Rakudo #127
2018-10-20 Rakudo #128
......@@ -469,6 +468,7 @@ Previous releases were bundled as part of monthly Parrot releases.
2018-04-25 Rakudo #122 "2018.04" (AlexDaniel + Releasable)
2018-04-30 2018.04.1 (AlexDaniel + Releasable)
2018-05-24 Rakudo #123 "2018.05" (AlexDaniel + Releasable)
2018-06-22 Rakudo #124 "2018.06" (AlexDaniel + Releasable)
=head1 COPYRIGHT
......
......@@ -276,7 +276,7 @@ sub bail-out ($desc?) is export {
}
multi sub is_approx(Mu $got, Mu $expected, $desc = '') is export {
DEPRECATED('is-approx'); # Remove for 6.d release
Rakudo::Deprecations.DEPRECATED('is-approx'); # Remove for 6.d release
$time_after = nqp::time_n;
my $tol = $expected.abs < 1e-6 ?? 1e-5 !! $expected.abs * 1e-6;
......
......@@ -35,8 +35,167 @@ package EXPORT::smallnatives {
}
package EXPORT::pack {
OUR::<EXPERIMENTAL-PACK> := True;
proto sub pack($, |) {*}
multi sub pack(Str $template, *@items) {
pack($template.comb(/<[a..zA..Z]>[\d+|'*']?/), @items)
}
multi sub pack(@template, *@items) {
my @bytes;
for @template -> $unit {
my $directive = substr($unit,0,1);
my $amount = substr($unit,1);
given $directive {
when 'A' {
my $ascii = shift @items // '';
my $data = $ascii.ords.cache;
if $amount eq '*' {
$amount = $data.elems;
}
if $amount eq '' {
$amount = 1;
}
for (@$data, 0x20 xx *).flat[^$amount] -> $byte {
X::Buf::Pack::NonASCII.new(:char($byte.chr)).throw if $byte > 0x7f;
@bytes.push: $byte;
}
}
when 'a' {
my $data = shift @items // Buf.new;
$data.=encode if nqp::istype($data,Str);
if $amount eq '*' {
$amount = $data.elems;
}
if $amount eq '' {
$amount = 1;
}
for (@$data, 0 xx *).flat[^$amount] -> $byte {
@bytes.push: $byte;
}
}
when 'H' {
my $hexstring = shift @items // '';
if $hexstring.chars % 2 {
$hexstring ~= '0';
}
@bytes.append: map { :16($_) }, $hexstring.comb(/../);
}
when 'x' {
if $amount eq '*' {
$amount = 0;
}
elsif $amount eq '' {
$amount = 1;
}
@bytes.append: 0x00 xx $amount;
}
when 'C' {
my $number = shift(@items);
@bytes.push: $number % 0x100;
}
when 'S' | 'v' {
my $number = shift(@items);
@bytes.append: ($number, $number +> 0x08) >>%>> 0x100;
}
when 'L' | 'V' {
my $number = shift(@items);
@bytes.append: ($number, $number +> 0x08,
$number +> 0x10, $number +> 0x18) >>%>> 0x100;
}
when 'n' {
my $number = shift(@items);
@bytes.append: ($number +> 0x08, $number) >>%>> 0x100;
}
when 'N' {
my $number = shift(@items);
@bytes.append: ($number +> 0x18, $number +> 0x10,
$number +> 0x08, $number) >>%>> 0x100;
}
X::Buf::Pack.new(:$directive).throw;
}
}
return Buf.new(@bytes);
}
proto sub unpack(|) {*}
multi sub unpack(Blob:D \blob, Str:D $template) {
unpack(blob, $template.comb(/<[a..zA..Z]>[\d+|'*']?/))
}
multi sub unpack(Blob:D \blob, @template) {
my @bytes = blob.list;
my @fields;
for @template -> $unit {
my $directive = substr($unit,0,1);
my $amount = substr($unit,1);
my $pa = $amount eq '' ?? 1 !!
$amount eq '*' ?? @bytes.elems !! +$amount;
given $directive {
when 'a' | 'A' | 'Z' {
@fields.push: @bytes.splice(0, $pa).map(&chr).join;
}
when 'H' {
my str $hexstring = '';
for ^$pa {
my $byte = shift @bytes;
$hexstring ~= ($byte +> 4).fmt('%x')
~ ($byte % 16).fmt('%x');
}
@fields.push($hexstring);
}
when 'x' {
splice @bytes, 0, $pa;
}
when 'C' {
@fields.append: @bytes.splice(0, $pa);
}
when 'S' | 'v' {
for ^$pa {
last if @bytes.elems < 2;
@fields.append: shift(@bytes)
+ (shift(@bytes) +< 0x08);
}
}
when 'L' | 'V' {
for ^$pa {
last if @bytes.elems < 4;
@fields.append: shift(@bytes)
+ (shift(@bytes) +< 0x08)
+ (shift(@bytes) +< 0x10)
+ (shift(@bytes) +< 0x18);
}
}
when 'n' {
for ^$pa {
last if @bytes.elems < 2;
@fields.append: (shift(@bytes) +< 0x08)
+ shift(@bytes);
}
}
when 'N' {
for ^$pa {
last if @bytes.elems < 4;
@fields.append: (shift(@bytes) +< 0x18)
+ (shift(@bytes) +< 0x10)
+ (shift(@bytes) +< 0x08)
+ shift(@bytes);
}
}
X::Buf::Pack.new(:$directive).throw;
}
}
return |@fields;
}
BEGIN OUR::<EXPERIMENTAL-PACK> := &unpack; # BEGIN is needed somehow
OUR::{'&pack'} := &pack;
}
package EXPORT::collation {
OUR::<EXPERIMENTAL-COLLATION> := True;
}
# vim: ft=perl6 expandtab sw=4
......@@ -6396,6 +6396,10 @@ class Perl6::Actions is HLL::Actions does STDActions {
}
else {
%named_counts{$name} := %named_counts{$name} - 1;
unless $_[2].has_compile_time_value {
$past.push(QAST::Stmts.new(
$_[2], QAST::Op.new(:op('list')), :flat(1)));
}
}
}
elsif nqp::istype($_, QAST::Op) && $_.name eq '&prefix:<|>' {
......
......@@ -481,6 +481,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
self.define_slang('Quote', Perl6::QGrammar, Perl6::QActions);
self.define_slang('Regex', Perl6::RegexGrammar, Perl6::RegexActions);
self.define_slang('P5Regex', Perl6::P5RegexGrammar, Perl6::P5RegexActions);
self.define_slang('Pod', Perl6::PodGrammar, Perl6::PodActions);
# Old language braid, going away eventually
# XXX TODO: if these are going out, be sure to make similar change
......@@ -1356,7 +1357,8 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
my $sp := $<EXPR><statement_prefix>;
if $sp && $sp<sym> eq 'do' {
my $s := $<statement_mod_loop><sym>;
$/.obs("do..." ~ $s, "repeat...while or repeat...until");
$/.obs("do..." ~ $s, "repeat...while or repeat...until")
unless $*LANG.pragma('p5isms');
}
}
]?
......@@ -3411,6 +3413,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
token term:sym<empty_set> { "∅" <!before <.[ \( \\ ' \- ]> || \h* '=>'> }
token term:sym<rand> {
<!{ $*LANG.pragma('p5isms') }>
<sym> »
[ <?before '('? \h* [\d|'$']> <.obs('rand(N)', 'N.rand for Num or (^N).pick for Int result')> ]?
[ <?before '()'> <.obs('rand()', 'rand')> ]?
......@@ -3532,7 +3535,9 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
elsif $trap == 2 { # probably misused P6ism
$<longname>."$orry"("Function \"$name\" may not be called without arguments (please use () or whitespace to denote arguments, or &$name to refer to the function as a noun, or use .$name if you meant to call it as a method on \$_)");
}
$<longname>.sorry("Argument to \"$name\" seems to be malformed") if $orry eq 'worry';
$<longname>.sorry("Argument to \"$name\" seems to be malformed")
if $orry eq 'worry'
&& !$*LANG.pragma('p5isms');
}
}
}
......@@ -4760,9 +4765,15 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
}
if %post_types || %unk_types || %unk_routines {
self.typed_sorry('X::Undeclared::Symbols',
:%post_types, :%unk_types, :%unk_routines,
:%routine_suggestion, :%type_suggestion);
if nqp::elems(%unk_routines) == 1 && %unk_routines<pack>
&& nqp::elems(%post_types) == 0 && nqp::elems(%unk_types) == 0 {
self.typed_sorry('X::Experimental', :feature<pack>)
}
else {
self.typed_sorry('X::Undeclared::Symbols',
:%post_types, :%unk_types, :%unk_routines,
:%routine_suggestion, :%type_suggestion);
}
}
self;
......
......@@ -9,6 +9,10 @@ role Perl6::Metamodel::AttributeContainer {
# Adds an attribute.
method add_attribute($obj, $meta_attr) {
my $name := $meta_attr.name;
if nqp::isnull(%!attribute_lookup) {
@!attributes := nqp::list();
%!attribute_lookup := nqp::hash();
}
if nqp::existskey(%!attribute_lookup, $name) {
nqp::die("Package '" ~ self.name($obj) ~
"' already has an attribute named '$name'");
......@@ -20,7 +24,7 @@ role Perl6::Metamodel::AttributeContainer {
# Composes all attributes.
method compose_attributes($obj, :$compiler_services) {
my %seen_with_accessor;
my %meths := self.method_table($obj);
my %meths := nqp::hllize(self.method_table($obj));
my %orig_meths;
for %meths {
%orig_meths{$_.key} := 1;
......
......@@ -2934,12 +2934,14 @@ BEGIN {
Map.HOW.add_parent(Map, Cool);
Map.HOW.add_attribute(Map, scalar_attr('$!storage', Mu, Map, :associative_delegate));
Map.HOW.compose_repr(Map);
nqp::settypehllrole(Map, 5);
# my class Hash is Map {
# has Mu $!descriptor;
Hash.HOW.add_parent(Hash, Map);
Hash.HOW.add_attribute(Hash, scalar_attr('$!descriptor', Mu, Hash, :!auto_viv_container));
Hash.HOW.compose_repr(Hash);
nqp::settypehllrole(Hash, 5);
# class Capture is Any {
# has @!list;
......
......@@ -17,6 +17,7 @@ role Perl6::Metamodel::BaseType {
# Our MRO is just that of base type.
method mro($obj) {
unless @!mro {
@!mro := nqp::list();
@!mro[0] := $obj;
for $!base_type.HOW.mro($!base_type) {
@!mro.push($_);
......
......@@ -40,13 +40,14 @@ class Perl6::Metamodel::ClassHOW
}
my $anon_id := 1;
method new_type(:$name, :$repr = 'P6opaque', :$ver, :$auth) {
method new_type(:$name, :$repr = 'P6opaque', :$ver, :$auth, :$api) {
my $metaclass := self.new();
my $obj := nqp::settypehll(nqp::newtype($metaclass, $repr), 'perl6');
$metaclass.set_name($obj, $name // "<anon|{$anon_id++}>");
self.add_stash($obj);
$metaclass.set_ver($obj, $ver) if $ver;
$metaclass.set_auth($obj, $auth) if $auth;
$metaclass.set_api($obj, $api) if $api;
$metaclass.setup_mixin_cache($obj);
nqp::setboolspec($obj, 5, nqp::null());
$obj
......@@ -122,9 +123,9 @@ class Perl6::Metamodel::ClassHOW
my @mro := self.mro($obj);
while $i < +@mro {
my $ptype := @mro[$i];
last if nqp::existskey($ptype.HOW.method_table($ptype), 'Bool');
last if nqp::existskey(nqp::hllize($ptype.HOW.method_table($ptype)), 'Bool');
last if nqp::can($ptype.HOW, 'submethod_table') &&
nqp::existskey($ptype.HOW.submethod_table($ptype), 'Bool');
nqp::existskey(nqp::hllize($ptype.HOW.submethod_table($ptype)), 'Bool');
$i := $i + 1;
}
if $i + 1 == +@mro {
......@@ -159,8 +160,8 @@ class Perl6::Metamodel::ClassHOW
if self.BUILDPLAN($obj) && nqp::isconcrete($compiler_services) {
# Class does not appear to have a BUILDALL yet
unless nqp::existskey($obj.HOW.submethod_table($obj),'BUILDALL')
|| nqp::existskey($obj.HOW.method_table($obj),'BUILDALL') {
unless nqp::existskey(nqp::hllize($obj.HOW.submethod_table($obj)),'BUILDALL')
|| nqp::existskey(nqp::hllize($obj.HOW.method_table($obj)),'BUILDALL') {
my $builder := nqp::findmethod(
$compiler_services,'generate_buildplan_executor');
my $method :=
......
......@@ -42,12 +42,13 @@ class Perl6::Metamodel::ConcreteRoleHOW
method multi() { $!multi }
}
method new_type(:@roles, :$name = '<anon>', :$ver, :$auth, :$repr) {
method new_type(:@roles, :$name = '<anon>', :$ver, :$auth, :$repr, :$api) {
my $metarole := self.new(:roles(@roles));
my $obj := nqp::settypehll(nqp::newtype($metarole, 'Uninstantiable'), 'perl6');
$metarole.set_name($obj, $name);
$metarole.set_ver($obj, $ver) if $ver;
$metarole.set_auth($obj, $auth) if $auth;
$metarole.set_api($obj, $api) if $api;
$obj;
}
......
......@@ -55,7 +55,7 @@ class Perl6::Metamodel::MethodDispatcher is Perl6::Metamodel::BaseDispatcher {
!! $obj.HOW.mro($obj);
my @methods;
for @mro {
my %mt := $_.HOW.method_table($_);
my %mt := nqp::hllize($_.HOW.method_table($_));
if nqp::existskey(%mt, $name) {
@methods.push(%mt{$name});
}
......
......@@ -7,14 +7,14 @@ role Perl6::Metamodel::MROBasedMethodDispatch {
#nqp::say( "looking for " ~ $name ~ " in " ~ $obj.HOW.name($obj) );
#
if nqp::can($obj.HOW, 'submethod_table') {
my %submethods := $obj.HOW.submethod_table($obj);
my %submethods := nqp::hllize($obj.HOW.submethod_table($obj));
if nqp::existskey(%submethods, $name) {
return %submethods{$name}
}
}
my %methods;
for self.mro($obj) {
%methods := $_.HOW.method_table($_);
%methods := nqp::hllize($_.HOW.method_table($_));
if nqp::existskey(%methods, $name) {
return %methods{$name}
}
......@@ -28,7 +28,7 @@ role Perl6::Metamodel::MROBasedMethodDispatch {
if $qtype.HOW.archetypes.parametric && nqp::can(self, 'concretization') {
# Resolve it via the concrete form of this parametric.
my $conc := self.concretization($obj, $qtype);
$conc.HOW.method_table($conc){$name}
nqp::hllize($conc.HOW.method_table($conc)){$name}
}
else {
# Non-parametric, so just locate it from the already concrete
......@@ -40,12 +40,12 @@ role Perl6::Metamodel::MROBasedMethodDispatch {
# Maybe this belongs on a role. Also, may be worth memoizing.
method can($obj, $name) {
my @meths;
my %smt := self.submethod_table($obj);
my %smt := nqp::hllize(self.submethod_table($obj));
if nqp::existskey(%smt, $name) {
@meths.push(%smt{$name});
}
for self.mro($obj) {
my %mt := $_.HOW.method_table($_);
my %mt := nqp::hllize($_.HOW.method_table($_));
if nqp::existskey(%mt, $name) {
@meths.push(%mt{$name})
}
......@@ -63,8 +63,8 @@ role Perl6::Metamodel::MROBasedMethodDispatch {
@mro_reversed.unshift($_);
}
for @mro_reversed {
for $_.HOW.method_table($_) {
%cache{$_.key} := $_.value;
for nqp::hllize($_.HOW.method_table($_)) {
%cache{$_.key} := nqp::decont($_.value);
}
if nqp::can($_.HOW, 'is_composed') && !$_.HOW.is_composed($_) {
$authable := 0;
......@@ -72,8 +72,8 @@ role Perl6::Metamodel::MROBasedMethodDispatch {
}
# Also add submethods.
for $obj.HOW.submethod_table($obj) {
%cache{$_.key} := $_.value;
for nqp::hllize($obj.HOW.submethod_table($obj)) {
%cache{$_.key} := nqp::decont($_.value);
}
nqp::setmethcache($obj, %cache);
......
......@@ -52,11 +52,11 @@ role Perl6::Metamodel::MethodContainer {
# If local flag was not passed, include those from parents.
unless $local {
for self.parents($obj, :all($all), :excl($excl)) {
for $_.HOW.method_table($_) {
@meths.push(nqp::hllizefor($_.value, 'perl6'));
for nqp::hllize($_.HOW.method_table($_)) {
@meths.push(nqp::hllizefor(nqp::decont($_.value), 'perl6'));
}
for $_.HOW.submethod_table($_) {
@meths.push(nqp::hllizefor($_.value, 'perl6'));
for nqp::hllize($_.HOW.submethod_table($_)) {
@meths.push(nqp::hllizefor(nqp::decont($_.value), 'perl6'));
}
}
}
......@@ -85,14 +85,14 @@ role Perl6::Metamodel::MethodContainer {
# Looks up a method with the provided name, for introspection purposes.
method lookup($obj, $name) {
for self.mro($obj) {
my %meth := $_.HOW.method_table($obj);
my %meth := nqp::hllize($_.HOW.method_table($obj));
if nqp::existskey(%meth, $name) {
return %meth{$name};
return nqp::decont(%meth{$name});
}
if nqp::can($_.HOW, 'submethod_table') {
my %submeth := $_.HOW.submethod_table($obj);
my %submeth := nqp::hllize($_.HOW.submethod_table($obj));
if nqp::existskey(%submeth, $name) {
return %submeth{$name};
return nqp::decont(%submeth{$name});
}
}
}
......
......@@ -90,9 +90,9 @@ role Perl6::Metamodel::Mixins {
$new_type.HOW.compose($new_type);
$new_type.HOW.set_shortname($new_type, $new_shortname);
$new_type.HOW.set_boolification_mode($new_type,
nqp::existskey($new_type.HOW.method_table($new_type), 'Bool')
nqp::existskey(nqp::hllize($new_type.HOW.method_table($new_type)), 'Bool')
|| nqp::can($new_type.HOW, 'submethod_table')
&& nqp::existskey($new_type.HOW.submethod_table($new_type), 'Bool')
&& nqp::existskey(nqp::hllize($new_type.HOW.submethod_table($new_type)), 'Bool')
?? 0
!! self.get_boolification_mode($obj));
$new_type.HOW.publish_boolification_spec($new_type);
......
......@@ -17,13 +17,14 @@ class Perl6::Metamodel::ModuleHOW
nqp::findmethod(NQPMu, 'BUILDALL')(nqp::create(self), |%named)
}
method new_type(:$name = '<anon>', :$repr, :$ver, :$auth) {
method new_type(:$name = '<anon>', :$repr, :$ver, :$auth, :$api) {
if $repr { nqp::die("'module' does not support custom representations") }
my $metaclass := self.new();
my $obj := nqp::settypehll(nqp::newtype($metaclass, 'Uninstantiable'), 'perl6');
$metaclass.set_name($obj, $name);
$metaclass.set_ver($obj, $ver) if $ver;
$metaclass.set_auth($obj, $auth) if $auth;
$metaclass.set_api($obj, $api) if $api;
self.add_stash($obj);
}
......
......@@ -47,7 +47,7 @@ role Perl6::Metamodel::MultiMethodContainer {
# Do we have anything in the methods table already in
# this class?
my %meths := self.method_table($obj);
my %meths := nqp::hllize(self.method_table($obj));
if nqp::existskey(%meths, $name) {
# Yes. Only or dispatcher, though? If only, error. If
# dispatcher, simply add new dispatchee.
......@@ -68,7 +68,7 @@ role Perl6::Metamodel::MultiMethodContainer {
my $found := 0;
while $j != +@mro && !$found {
my $parent := @mro[$j];
my %meths := $parent.HOW.method_table($parent);
my %meths := nqp::hllize($parent.HOW.method_table($parent));
if nqp::existskey(%meths, $name) {
# Found a possible - make sure it's a dispatcher, not
# an only.
......
......@@ -21,12 +21,13 @@ class Perl6::Metamodel::NativeHOW
nqp::findmethod(NQPMu, 'BUILDALL')(nqp::create(self), |%named)
}
method new_type(:$name = '<anon>', :$repr = 'P6opaque', :$ver, :$auth) {
method new_type(:$name = '<anon>', :$repr = 'P6opaque', :$ver, :$auth, :$api) {
my $metaclass := self.new();
my $obj := nqp::settypehll(nqp::newtype($metaclass, $repr), 'perl6');
$metaclass.set_name($obj, $name);
$metaclass.set_ver($obj, $ver) if $ver;