Commit b2eb8909 authored by Dominique Dumont's avatar Dominique Dumont

New upstream version 2017.02

parent 89ceca13
......@@ -300,6 +300,11 @@ E: francois.perrad@gadz.org
W: http://fperrad.googlepages.com/home
U: fperrad
N: M. Faiz Zakwan Zamzuri
E: skelic3@gmail.com
U: faraco
W: https://faracosite.wordpress.com
N: Gabor Szabo
E: szabgab@gmail.com
......@@ -827,6 +832,10 @@ N: Zach Morgan
E: zpmorgan@gmail.com
D: Rakudo patch
N: Zoffix Znet
E: cpan@zoffix.com
W: perl6.party
N: Zohar Kelrich
E: lumimies@gmail.com
......
#! perl
#!/usr/bin/env perl
# Copyright (C) 2009 The Perl Foundation
use 5.10.1;
......@@ -163,7 +163,7 @@ MAIN: {
}
}
for my $target (qw/common_bootstrap_sources moar_core_sources jvm_core_sources/) {
for my $target (qw/common_bootstrap_sources moar_core_sources moar_core_d_sources jvm_core_sources jvm_core_d_sources/) {
open my $FILELIST, '<', "tools/build/$target"
or die "Cannot read 'tools/build/$target': $!";
my @lines;
......@@ -257,6 +257,7 @@ MAIN: {
$config{'nqp_jars'} = $nqp_config{'jvm::runtime.jars'};
$config{'bld_nqp_jars'} = join( $config{'cpsep'}, map { $config{'sysroot'} . $_ } split( $config{'cpsep'}, $nqp_config{'jvm::runtime.jars'} ) );
$config{'nqp_classpath'} = $nqp_config{'jvm::runtime.classpath'};
$config{'nqp_libdir'} = $nqp_config{'nqp::libdir'};
$config{'j_runner'} = $win ? 'perl6-j.bat' : 'perl6-j';
......
......@@ -137,9 +137,6 @@
the "roast" repository <http://github.com/perl6/roast/> and run all
of these tests that are currently known to pass.
You can compare your own results to the results of the daily runs in
<https://github.com/coke/perl6-roast-data/>.
At present we do not have any plans to directly store the official test
suite as part of the Rakudo repository, but will continue to fetch it
from the roast repository. Releases of Rakudo get a snapshot of
......
The Artistic License 2.0
Copyright (c) 2000-2016, The Perl Foundation.
Copyright (c) 2000-2006, The Perl Foundation.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
......
......@@ -101,6 +101,8 @@ docs/announce/2016.09.md
docs/announce/2016.10.md
docs/announce/2016.11.md
docs/announce/2016.12.md
docs/announce/2017.01.md
docs/announce/2017.02.md
docs/architecture.html
docs/architecture.svg
docs/ChangeLog
......@@ -149,6 +151,8 @@ src/core/Associative.pm
src/core/AST.pm
src/core/asyncops.pm
src/core/Attribute.pm
src/core/Awaitable.pm
src/core/Awaiter.pm
src/core/Backtrace.pm
src/core/Baggy.pm
src/core/BagHash.pm
......@@ -162,6 +166,7 @@ src/core/Cancellation.pm
src/core/Capture.pm
src/core/Channel.pm
src/core/Code.pm
src/core/Collation.pm
src/core/Compiler.pm
src/core/Complex.pm
src/core/CompUnit/DependencySpecification.pm
......@@ -191,6 +196,8 @@ src/core/Cursor.pm
src/core/Dateish.pm
src/core/Date.pm
src/core/DateTime.pm
src/core.d/await.pm
src/core.d/core_prologue.pm
src/core/Deprecations.pm
src/core/Distribution.pm
src/core/Distro.pm
......@@ -274,6 +281,8 @@ src/core/QuantHash.pm
src/core/Rakudo/Internals/JSON.pm
src/core/Rakudo/Internals.pm
src/core/Rakudo/Internals/VMBackedDecoder.pm
src/core/Rakudo/Iterator.pm
src/core/Rakudo/Metaops.pm
src/core/Range.pm
src/core/Rational.pm
src/core/Rat.pm
......@@ -426,6 +435,8 @@ t/02-rakudo/01-is_approx.t
t/02-rakudo/02-new-is-approx.t
t/02-rakudo/03-cmp-ok.t
t/02-rakudo/04-diag.t
t/02-rakudo/05-range-in-range.t
t/02-rakudo/06-is.t
t/02-rakudo/dump.t
t/02-rakudo/repl.t
t/02-rakudo/test-packages/CustomOps.pm6
......@@ -473,6 +484,10 @@ t/04-nativecall/20-concurrent.c
t/04-nativecall/20-concurrent.t
t/04-nativecall/CompileTestLib.pm
t/05-messages/01-errors.t
t/06-tap-harness/01-desc-backslashes.t
t/06-tap-harness/02-skip-all.t
t/06-tap-harness/test-files/01-desc-backslashes--1.TAP-TEST
t/06-tap-harness/test-files/02-skip-all.TAP-TEST
t/fudgeandrun
t/harness5
t/harness6
......@@ -485,6 +500,7 @@ tools/build/create-moar-runner.pl
tools/build/gen-cat.nqp
tools/build/gen-version.pl
tools/build/install-core-dist.pl
tools/build/jvm_core_d_sources
tools/build/jvm_core_sources
tools/build-localtest.pl
tools/build/Makefile-common-macros.in
......@@ -496,6 +512,7 @@ tools/build/makeNATIVE_ARRAY.pl6
tools/build/makeNATIVE_SHAPED_ARRAY.pl6
tools/build/makeSLICE.pl6
tools/build/makeUNIPROP.pl6
tools/build/moar_core_d_sources
tools/build/moar_core_sources
tools/build/nqp-jvm-rr.pl
tools/build/NQP_REVISION
......
......@@ -2,11 +2,11 @@
This is Rakudo Perl, a Perl 6 compiler for the MoarVM and JVM.
Rakudo Perl is Copyright (C) 2008-2016, The Perl Foundation. Rakudo Perl
Rakudo Perl is Copyright (C) 2008-2017, The Perl Foundation. Rakudo Perl
is distributed under the terms of the Artistic License 2.0. For more
details, see the full text of the license in the file LICENSE.
This directory contains only the Rakudo Perl 6 compiler itself; it
This directory contains only the Rakudo Perl 6 compiler itself; it
does not contain any of the modules, documentation, or other items
that would normally come with a full Perl 6 distribution. If you're
after more than just the bare compiler, please download [the latest
......@@ -30,7 +30,8 @@ The general process for building is running `perl Configure.pl` with
the desired configuration options (common options listed below), and
then running `make` or `make install`. Optionally, you may run
`make spectest` to test your build on [Roast](http://github.com/perl6/roast),
the Official Perl 6 test suite.
the Official Perl 6 test suite. To update the test suite, run
`make spectest_update`.
Installation of Rakudo simply requires building and running `make install`.
Note that this step is necessary for running Rakudo from outside the build
......@@ -92,12 +93,14 @@ This is always a good starting point.
If you have a question about Perl 6 syntax or the right way to approach
a problem using Perl 6, you probably want the "perl6-users@perl.org"
mailing list or the "irc.freenode.net/#perl6" channel. The perl6-users
mailing list or the [irc.freenode.net/#perl6 IRC
channel](https://webchat.freenode.net/?channels=#perl6). The perl6-users
list is primarily for the people who want to use Perl 6 to write
programs, so newbie questions are welcomed there. Newbie questions
are also welcome on the #perl6 channel; the Rakudo and Perl 6
development teams tend to hang out there and are generally glad
to help. You can follow "@rakudoperl" on Twitter, and there's
to help. You can follow [@perl6org](https://twitter.com/perl6org)
and [@rakudoperl](https://twitter.com/rakudoperl) on Twitter, and there's
a Perl 6 news aggregator at [Planet Perl 6](http://pl6anet.org/).
Questions about NQP can also be posted to the #perl6 IRC channel.
......
......@@ -2,9 +2,9 @@
# For appveyor.yml syntax reference, please see
# https://www.appveyor.com/docs/appveyor-yml
#
# JVM is already preinstalled in build worker. Please see
# JVM is already preinstalled in build worker. Please see
# https://www.appveyor.com/docs/installed-software#java
#
#
# Platforms (e.g. x64, x86)
platform:
......@@ -46,7 +46,7 @@ matrix:
# Installation
install:
- '"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64'
- choco install strawberryperl
- appveyor-retry choco install strawberryperl --version 5.20.1.1 --allow-empty-checksums
- SET PATH=C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH%
- ECHO %RAKUDO_OPTIONS%
- CD %APPVEYOR_BUILD_FOLDER%
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -149,11 +149,12 @@ About Perl 6.d, expect an incremental update.
but just didn't have time: the missing regex backtracking controls, the
sub-byte int types, non-parameter cases of coercion types, things we
discover people miss especially in IO, etc.
* Goal is sometime in 2016; we'll judge it based upon what we see (like, if
* Goal is sometime in 2017; we'll judge it based upon what we see (like, if
there is a strong desire to get an incremental update out the door to cover
things people really block on not having, we can do so)
A lot of effort in 2016 will go on performance engineering and making things
more robust. Macros and slangs are the biggest post-6.c project language wise;
A lot of effort in 2016 was focused on performance engineering and making things
more robust. This work will continue until the eventual feature freeze and release.
Macros and slangs are the biggest post-6.c project language wise;
if they happen to be in great shape by 6.d then they can make it in, but if
not they'd be a reasonable target for 6.e.
......@@ -13,7 +13,6 @@
- [p6box_u](#p6box_u)
- [p6capturelex](#p6capturelex)
- [p6capturelexwhere](#p6capturelexwhere)
- [p6captureouters](#p6captureouters)
- [p6captureouters2](#p6captureouters2)
- [p6clearpre](#p6clearpre)
- [p6configposbindfailover](#p6configposbindfailover)
......@@ -107,8 +106,6 @@ Box a native uint into a Perl 6 UInt.
## p6capturelexwhere
* p6capturelexwhere(Mu $closure)
## p6captureouters
## p6captureouters2
* p6captureouters2(Mu $coderef)
......
......@@ -22,9 +22,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.
2016-12-17 Rakudo #106 (Zoffix)
2017-01-21 Rakudo #107
2017-02-18 Rakudo #108
2017-02-18 Rakudo #108 (Zoffix)
2017-03-18 Rakudo #109
2017-04-15 Rakudo #110
2017-05-20 Rakudo #111
......@@ -288,10 +286,13 @@ Sign the tarball with your PGP key:
=item 18.
Upload the tarball and the signature to L<http://rakudo.org/downloads/rakudo>:
Upload the tarball and the signature to L<http://rakudo.org/downloads/rakudo>
and L<https://rakudo.perl6.org/downloads/rakudo/>:
scp rakudo-YYYY.MM.tar.gz rakudo-YYYY.MM.tar.gz.asc \
rakudo@rakudo.org:public_html/downloads/rakudo/
scp rakudo-YYYY.MM.tar.gz rakudo-YYYY.MM.tar.gz.asc \
rakudo@www.p6c.org:public_html/downloads/rakudo/
If you do not have permissions for that, ask one of (pmichaud, jnthn, FROGGS,
masak, tadzik, moritz, PerlJam/perlpilot, [Coke], lizmat, timotimo, fsergot,
......@@ -424,10 +425,12 @@ Previous releases were bundled as part of monthly Parrot releases.
2016-09-17 Rakudo #103 "2016.09" (Zoffix + NeuralAnomaly)
2016-10-15 Rakudo #104 "2016.10" (Zoffix + NeuralAnomaly)
2016-11-19 Rakudo #105 "2016.11" (Zoffix + NeuralAnomaly)
2016-12-17 Rakudo #106 "2016.12" (Zoffix + NeuralAnomaly)
2017-01-20 Rakudo #107 "2017.01" (Zoffix + NeuralAnomaly)
=head1 COPYRIGHT
Copyright (C) 2009-2016, The Perl Foundation.
Copyright (C) 2009-2017, The Perl Foundation.
=cut
......
# Guide for Automated Release of Rakudo Compiler
This document describes the step to perform an automated release of the Rakudo
This document describes the steps to perform an automated release of the Rakudo
Compiler. While not required, it can be useful to be familiar with the
[manual release process](release_guide.pod), so you know what steps the build
robot is performing.
......@@ -53,7 +53,7 @@ Zoffix](https://twitter.com/zoffix) to enable the JVM backend logic.
If needed, you can look at the [source of the release
bot](https://github.com/zoffixznet/na); the brunt of the work done by
[Perl-6-enhanced bash
scripts]https://github.com/zoffixznet/na/tree/master/lib/NA/ReleaseScript].
scripts](https://github.com/zoffixznet/na/tree/master/lib/NA/ReleaseScript).
The [Perl6.Fail Web App source code](https://github.com/zoffixznet/r6)
is also available.
......@@ -104,15 +104,7 @@ the commit sha to mark the commit as reviewed.
### Reminders
About a week before the release, NeuralAnomaly will automatically
remind #perl6-dev users about the upcoming release. You can also trigger the
reminder manually with the `remind` command:
> &lt;Zoffix&gt; NeuralAnomaly: remind<br>
> &lt;NeuralAnomaly&gt; Reminder! Next release will be in 1 week and 0 days.
Since last release, there are 125 new still-open tickets (15 unreviewed and 0
blockers) and 4 unreviewed commits. See https://perl6.fail/release/stats for
details
A week before the release, remind users in `#perl6-dev` of the upcoming release.
Also, a few days before the release, remind users to double check
[the changelog](ChangeLog) to ensure the changes you've been adding during the
......@@ -127,44 +119,50 @@ list, if needed.
### Initiate Release
On the release date, wait until the MoarVM release has been completed, then
issue the `release` command to NeuralAnomaly. If MoarVM hasn't been released,
there are unreviewed tickets, or blocking tickets, the bot will not proceed
and will tell you about it.
If the prerequisites are good, the bot will ask for the "secret number" to
proceed. This is mostly to prevent accidental triggering of the command. Tell
the bot the current day of the month—that's the secret number:
----
> &lt;Zoffix&gt; NeuralAnomaly, release<br>
> &lt;NeuralAnomaly&gt; test mode is OFF. This is the real deal—we are
releasing! Guess the number I'm think of to proceed.<br>
> &lt;Zoffix&gt; NeuralAnomaly: 17<br>
> &lt;NeuralAnomaly&gt; Good guess! Starting release [...]
###### 👷👷👷 Work in Progress 👷👷👷
The bot will then proceed with testing and releasing NQP and Rakudo,
informing about completed steps occasionally. You can watch the progress
live, at the URL given by NeuralAnomaly. **You can abort the process at any
time, by issuing `abort` command to the bot**
Currently the bot requires [Release Constants](https://github.com/zoffixznet/na/blob/1b50cde78d60f632896fed3edcc830fc365c08da/lib/NA/ReleaseConstants.pm6#L16-L36) to be updated and switched to
"production mode" manually (and then restarting the bot).
> &lt;Zoffix&gt; NeuralAnomaly: abort
> &lt;NeuralAnomaly&gt; Zoffix, what? Why?! What happened‽‽ Release process aborted.
Also, the release process cannot be aborted via IRC; only by killing the bot.
The process will be automatically aborted if any test failures are encountered or
if any of the commands used during the release return a non-zero exit status.
----
An aborted process cannot be restarted, and you must start from the beginning.
### Final Confirmation
Once NeuralAnomaly successfully completes all of the testing and prepares the
tarballs, the bot will ask for the final confirmation. You confirm it by
issuing `go` command. This will cause the bot to upload the release tarballs to
[Rakudo.org](http://rakudo.org) and email the release announcement. Once that is
completed, NeuralAnomaly will announce on IRC that release has been completed.
> &lt;NeuralAnomaly&gt; all tests passed. Ready to finalized the release. Just say go<br>
> &lt;Zoffix&gt; NeuralAnomaly: go
On the release date, wait until the MoarVM release has been completed, then
issue the `cut the release` command to NeuralAnomaly.
The bot will proceed through all the release steps, aborting if any stage
fails to complete successfully.
> &lt;Zoffix&gt; NeuralAnomaly, cut the release<br>
&lt;NeuralAnomaly&gt; Zoffix, Will do! If you're feeling particularly naughty,<br>
you can watch me at http://perl6.fail/release/progress or go look at<br>
some cats http://icanhas.cheezburger.com/lolcats<br>
&lt;NeuralAnomaly&gt; Zoffix, ☠☠☠☠☠☠ R6 status is not clean. Cannot proceed<br>
&lt;NeuralAnomaly&gt; Zoffix, ☠☠☠☠☠☠☠☠☠☠ ABNORMAL EXIT!
If you wish to (re-)start the release process from a specific step or to run
just some particular steps, issue the `steps` command to view available steps
and then issue the `run` command, along with just the steps you wish to run:
> &lt;Zoffix&gt; NeuralAnomaly, steps<br>
&lt;NeuralAnomaly&gt; Zoffix, all pre nqp r post pre-r6 pre-blank-slate nqp-clone<br>
nqp-bump-vers nqp-build nqp-test nqp-tar nqp-tar-build nqp-tag nqp-tar-sign<br>
nqp-tar-copy r-clone r-prep-ann r-bump-vers r-build r-p5 r-stress r-stress-v6c<br>
r-tar r-tar-build r-tar-p5 r-tar-stress r-tag r-tar-sign r-tar-copy post-scp<br>
&lt;Zoffix&gt; NeuralAnomaly, run r-build r-p5 r-stress r-stress-v6c r-tar<br>
r-tar-build r-tar-p5 r-tar-stress r-tag r-tar-sign r-tar-copy post-scp
The build log will be displayed in the terminal running the bot, as well
as copied into the file indicated by `"release-log"` key in `config.json` file.
That file must match where `perl6.fail` website expects to find it (if you care
about the site displaying it at all).
### Send Email
Email the generated release announcement to `perl6-compiler@perl.org`
### Wikipedia
......
......@@ -13,7 +13,7 @@ our sub mangle_cpp_symbol(Routine $r, $symbol) {
my @params = $r.signature.params;
if $r ~~ Method {
@params.shift;
@params.pop if @params[*-1].name eq '%_';
@params.pop if @params.tail.name eq '%_';
}
my $params = join '', @params.map: {
......
......@@ -23,7 +23,7 @@ our sub mangle_cpp_symbol(Routine $r, $symbol) {
my @params = $r.signature.params;
if $r ~~ Method {
@params.shift;
@params.pop if @params[*-1].name eq '%_';
@params.pop if @params.tail.name eq '%_';
}
my $params = join '', @params.map: {
......
......@@ -89,7 +89,7 @@ sub declarator2text($pod) {
my $what = do given $pod.WHEREFORE {
when Method {
my @params=$_.signature.params[1..*];
@params.pop if @params[*-1].name eq '%_';
@params.pop if @params.tail.name eq '%_';
'method ' ~ $_.name ~ signature2text(@params)
}
when Sub {
......
......@@ -170,15 +170,21 @@ grammar Grammar {
^^ [ <plan> | <test> | <bailout> | <version> | <comment> || <unknown> ] \n
}
token plan {
'1..' <count=.num> <.sp>* [ '#' <.sp>* $<directive>=[:i 'SKIP'] <.alnum>* [ <.sp>+ $<explanation>=[\N*] ]? ]?
'1..' <count=.num> <.sp>* [
'#' <.sp>* $<directive>=[:i 'SKIP'] \S*
[ <.sp>+ $<explanation>=[\N*] ]?
]?
}
regex description {
[ <-[\n\#\\]> | \\<[\\#]> ]+ <!after <sp>+>
[ '\\\\' || '\#' || <-[\n#]> ]+ <!after <sp>+>
}
token test {
$<nok>=['not '?] 'ok' [ <.sp> <num> ]? ' -'?
[ <.sp>* <description> ]?
[ <.sp>* '#' <.sp>* $<directive>=[:i [ 'SKIP' | 'TODO'] ] <.alnum>* [ <.sp>+ $<explanation>=[\N*] ]? ]?
[
<.sp>* '#' <.sp>* $<directive>=[:i [ 'SKIP' \S* | 'TODO'] ]
[ <.sp>+ $<explanation>=[\N*] ]?
]?
<.sp>*
}
token bailout {
......@@ -219,7 +225,7 @@ grammar Grammar {
method plan($/) {
my %args = :raw(~$/), :tests(+$<count>);
if $<directive> {
%args<skip-all explanation> = True, $<explanation>;
%args<skip-all explanation> = True, ~$<explanation>;
}
make TAP::Plan.new(|%args);
}
......@@ -392,7 +398,7 @@ class Formatter::Text does Formatter {
my $output;
my $name = $session.header;
if ($result.skip-all) {
$output = self.format-return("$name skipped");
$output = self.format-return("$name skipped\n");
}
elsif ($result.has-problems($!ignore-exit)) {
$output = self.format-test-failure($name, $result);
......
use MONKEY-GUTS; # Allow NQP ops.
unit module Test;
# Copyright (C) 2007 - 2016 The Perl Foundation.
# Copyright (C) 2007 - 2017 The Perl Foundation.
# settable from outside
my int $perl6_test_times = ?%*ENV<PERL6_TEST_TIMES>;
......@@ -114,7 +114,13 @@ multi sub is(Mu $got, Mu:U $expected, $desc = '') is export {
~ " got: '$got'";
}
else {
my $test = $got === $expected;
# infix:<===> can't handle Mu's
my $test = nqp::eqaddr($expected.WHAT, Mu)
?? nqp::eqaddr($got.WHAT, Mu)
!! nqp::eqaddr($got.WHAT, Mu)
?? False
!! $got === $expected;
$ok = proclaim(?$test, $desc);
if !$test {
_diag "expected: ($expected.^name())\n"
......@@ -129,7 +135,12 @@ multi sub is(Mu $got, Mu:D $expected, $desc = '') is export {
$time_after = nqp::time_n;
my $ok;
if $got.defined { # also hack to deal with Failures
my $test = $got eq $expected;
# infix:<eq> can't handle Mu's
my $test = nqp::eqaddr($expected.WHAT, Mu)
?? nqp::eqaddr($got.WHAT, Mu)
!! nqp::eqaddr($got.WHAT, Mu)
?? False
!! $got eq $expected;
$ok = proclaim(?$test, $desc);
if !$test {
if try $got .Str.subst(/\s/, '', :g)
......@@ -228,7 +239,7 @@ sub bail-out ($desc?) is export {
}
multi sub is_approx(Mu $got, Mu $expected, $desc = '') is export {
DEPRECATED('is-approx'); # Remove at 20161217 release (6 months from today)
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;
......@@ -328,7 +339,8 @@ sub is-approx-calculate (
multi sub todo($reason, $count = 1) is export {
$time_after = nqp::time_n;
$todo_upto_test_num = $num_of_tests_run + $count;
$todo_reason = "# TODO $reason";
# Adding a space to not backslash the # TODO
$todo_reason = " # TODO $reason";
$time_before = nqp::time_n;
}
......@@ -339,7 +351,7 @@ multi sub skip() {
}
multi sub skip($reason, $count = 1) is export {
$time_after = nqp::time_n;
die "skip() was passed a non-numeric number of tests. Did you get the arguments backwards?" if $count !~~ Numeric;
die "skip() was passed a non-integer number of tests. Did you get the arguments backwards or use a non-integer number?" if $count !~~ Int;
my $i = 1;
while $i <= $count { proclaim(1, "# SKIP " ~ $reason); $i = $i + 1; }
$time_before = nqp::time_n;
......@@ -603,10 +615,11 @@ sub proclaim($cond, $desc is copy ) {
}
# TAP parsers do not like '#' in the description, they'd miss the '# TODO'
# So, adding a ' \' before it.
$desc = $desc
?? nqp::join('\\#',
?? nqp::join(' \\#',
nqp::split('#',
nqp::join('\\\\', nqp::split('\\', $desc.Str))
$desc.Str
)
)
!! '';
......
......@@ -37,3 +37,6 @@ package EXPORT::smallnatives {
package EXPORT::pack {
OUR::<EXPERIMENTAL-PACK> := True;
}
package EXPORT::collation {
OUR::<EXPERIMENTAL-COLLATION> := True;
}
This diff is collapsed.
......@@ -3,6 +3,8 @@ use QRegex;
use Perl6::Optimizer;
class Perl6::Compiler is HLL::Compiler {
has $!language_version;
method compilation-id() {
my class IDHolder { }
BEGIN { (IDHolder.WHO)<$ID> := $*W.handle }
......@@ -11,7 +13,20 @@ class Perl6::Compiler is HLL::Compiler {
method implementation() { self.config<implementation> }
method language_name() { 'Perl' }
method language_version() { self.config<language_version> }
method reset_language_version() {
$!language_version := NQPMu;
}
method set_language_version($version) {
$!language_version := $version;
}
method language_version() {
if nqp::defined($!language_version) {
$!language_version
}
else {
$!language_version := self.config<language_version>
}
}
method command_eval(*@args, *%options) {
if nqp::existskey(%options, 'doc') && !%options<doc> {
......
This diff is collapsed.
This diff is collapsed.
......@@ -13,11 +13,11 @@ class Perl6::Metamodel::BaseDispatcher {
$!idx := $!idx + 1;
if self.has_invocant {
my $inv := self.invocant;
nqp::setdispatcher(self);
nqp::setdispatcherfor(self, $call);
$call($inv, |@pos, |%named);
}
else {
nqp::setdispatcher(self);
nqp::setdispatcherfor(self, $call);
$call(|@pos, |%named);
}
}
......@@ -25,7 +25,7 @@ class Perl6::Metamodel::BaseDispatcher {
method call_with_capture($capture) {
my $call := @!candidates[$!idx];
$!idx := $!idx + 1;
nqp::setdispatcher(self);
nqp::setdispatcherfor(self, $call);
nqp::invokewithcapture(nqp::decont($call), $capture)
}
......@@ -123,7 +123,7 @@ class Perl6::Metamodel::WrapDispatcher is Perl6::Metamodel::BaseDispatcher {
method enter(*@pos, *%named) {
my $fresh := nqp::clone(self);
my $first := self.candidates[0];
nqp::setdispatcher($fresh);
nqp::setdispatcherfor($fresh, $first);
$first(|@pos, |%named)
}
}
......@@ -7,6 +7,9 @@ role Perl6::Metamodel::MethodContainer {
has @!method_order;
# Cache that expires when we add methods (primarily to support NFA stuff).
# The hash here is readonly; we copy/replace in on addition, for thread
# safety (additions are dominated by lookups, so a lock - even a rw-lock -
# is not ideal here).
has %!cache;
# Add a method.
......@@ -98,10 +101,10 @@ role Perl6::Metamodel::MethodContainer {
# Caches or updates a cached value.
method cache($obj, str $key, $value_generator) {
%!cache || (%!cache := {});
nqp::existskey(%!cache, $key) ??
%!cache{$key} !!
(%!cache{$key} := $value_generator())
my %orig_cache := %!cache;
nqp::ishash(%orig_cache) && nqp::existskey(%!cache, $key)
?? %!cache{$key}
!! self.cache_add($obj, $key, $value_generator())
}
method cache_get($obj, str $key) {
......@@ -110,7 +113,10 @@ role Perl6::Metamodel::MethodContainer {
}
method cache_add($obj, str $key, $value) {
%!cache := nqp::hash() unless nqp::ishash(%!cache);
%!cache{$key} := $value;
my %orig_cache := %!cache;
my %copy := nqp::ishash(%orig_cache) ?? nqp::clone(%orig_cache) !! {};
%copy{$key} := $value;
%!cache := %copy;
$value
}
}
......@@ -46,7 +46,7 @@ class Perl6::Metamodel::NativeRefHOW
$info<nativeref> := nqp::hash();
$info<nativeref><type> := nqp::decont($!type);
$info<nativeref><refkind> := $!refkind // 'unknown';
nqp::composetype($obj, $info);
nqp::composetype(nqp::decont($obj), $info);
$!repr_composed := 1;
}
}
......
......@@ -8,7 +8,7 @@ role Perl6::Metamodel::REPRComposeProtocol {
if self.attributes($obj) {
nqp::die("Cannot have attributes on an array representation");
}
nqp::composetype($obj, nqp::hash('array',
nqp::composetype(nqp::decont($obj), nqp::hash('array',
nqp::hash('type', nqp::decont(self.array_type($obj)))));
}
......@@ -57,7 +57,7 @@ role Perl6::Metamodel::REPRComposeProtocol {
}
# Compose the representation using it.
nqp::composetype($obj, nqp::hash('attribute', @repr_info));
nqp::composetype(nqp::decont($obj), nqp::hash('attribute', @repr_info));
}
$!composed_repr := 1;
......
......@@ -49,6 +49,11 @@ class Perl6::ModuleLoader does Perl6::ModuleLoaderVMConfig {
my $file := 'Perl6/BOOTSTRAP' ~ self.file-extension;
my $include := nqp::getcomp('perl6').cli-options<nqp-lib>;
$file := ($include ?? $include ~ '/' !! nqp::getcomp('perl6').config<prefix> ~ '/share/nqp/lib/') ~ $file;
if nqp::existskey(%modules_loaded, $file) {
return nqp::ctxlexpad(%modules_loaded{$file});
}
nqp::loadbytecode($file);
%modules_loaded{$file} := my $module_ctx := $*MAIN_CTX;
nqp::bindhllsym('perl6', 'GLOBAL', $preserve_global);
......@@ -89,6 +94,9 @@ class Perl6::ModuleLoader does Perl6::ModuleLoaderVMConfig {