context_unify3 branch is (almost) ready to merge back to trunk.

0 views
Skip to first unread message

Vasily Chekalkin

unread,
Dec 18, 2009, 4:33:37 AM12/18/09
to parro...@lists.parrot.org
Hello.

context_unify3 branch is almost ready to merge back into trunk. Two
major changes in branch:

* Merging CallSignature and Context into single CallContext PMC.
* Refactor whole VTABLE_invoke/invokecc/invoke_from_sigobject
interaction to push new CallContext on caller side, not callee side.

There is 1 (one) failing test at the moment which fails on my box
("standard" Debian Linux/i386). I will be very appreciated to have more
comprehensive testing on other platforms.

Last, but not least, thanks to chromatic++ and whiteknight++ for fixing
outstanding issues with branch.

--
Bacek.
_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Moritz Lenz

unread,
Dec 18, 2009, 8:52:56 AM12/18/09
to Vasily Chekalkin, parro...@lists.parrot.org
Hi,

I wanted to test that branch with rakudo, but it failed to build:

make[1]: Entering directory `/home/moritz/tmp/context_unify3/compilers/nqp'
../../parrot
/home/moritz/tmp/context_unify3/runtime/parrot/library/PGE/Perl6Grammar.pir
\
--output=src/Grammar_gen.pir src/Grammar.pg
src/gc/api.c:260: failed assertion 'PObj_is_PMC_TEST(obj)'
Backtrace - Obtained 32 stack frames (max trace depth is 32).
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0 [0x2af709ba73f3]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0(Parrot_confess+0x87)
[0x2af709ba7527]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0(Parrot_gc_mark_PMC_alive_fun+0x7f)
[0x2af709bb6c5f]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0 [0x2af709d5ddcd]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0(Parrot_gc_mark_PMC_alive_fun+0x12e)
[0x2af709bb6d0e]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0 [0x2af709d5e044]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0(Parrot_gc_mark_PMC_alive_fun+0x12e)
[0x2af709bb6d0e]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0 [0x2af709bbafff]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0 [0x2af709bb92a2]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0 [0x2af709bb9550]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0 [0x2af709bb69dd]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0 [0x2af709bb9153]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0 [0x2af709bb8fab]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0 [0x2af709bb6a48]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0 [0x2af709bb73d4]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0(Parrot_str_new_COW+0x85)
[0x2af709b05175]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0 [0x2af709bcfe31]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0 [0x2af709d0c56c]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0 [0x2af709bbeba4]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0 [0x2af709d52f72]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0 [0x2af709d64c5c]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0 [0x2af709d90386]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0 [0x2af709b1e538]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0 [0x2af709c21319]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0 [0x2af709c1f7ac]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0 [0x2af709bcbed4]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0(Parrot_pcc_invoke_from_sig_object+0x14c)
[0x2af709bc19ac]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0(Parrot_pcc_invoke_sub_from_c_args+0x182)
[0x2af709bc1b42]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0(Parrot_runcode+0x146)
[0x2af709ba4316]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0 [0x2af709dce421]
/home/moritz/tmp/context_unify3/blib/lib/libparrot.so.1.8.0(imcc_run+0x381)
[0x2af709dcf091]
../../parrot [0x400bb4]
make[1]: *** [nqp.pbc] Aborted
make[1]: Leaving directory `/home/moritz/tmp/context_unify3/compilers/nqp'
make: *** [compilers.dummy] Error 2

Cheers,
Moritz
_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Patrick R. Michaud

unread,
Dec 18, 2009, 11:09:45 AM12/18/09
to Vasily Chekalkin, parro...@lists.parrot.org
I'm able to get context_unify3 to build and install, but "parrot-nqp" fails:

pmichaud@orange:~/parrot/context_unify3$ cat x
say('hello');
pmichaud@orange:~/parrot/context_unify3$ ./parrot-nqp x
Null PMC access in get_string()
current instr.: 'parrot;Regex;Cursor;!PREFIX__!subrule' pc 2410 (src/stage0/Regex-s0.pir:1321)
called from Sub 'parrot;NQP;Grammar;!PREFIX__term:sym<colonpair>' pc 17734 (src/stage0/NQP-s0.pir:4747)
called from Sub 'parrot;Regex;Cursor;!protoregex_tokrx' pc 1971 (src/stage0/Regex-s0.pir:1077)
called from Sub 'parrot;Regex;Cursor;!protoregex' pc 1752 (src/stage0/Regex-s0.pir:971)
...

Since parrot-nqp fails, I can't build the rakudo-ng branch at all.
Also cannot build nqp-rx for similar reasons.

Attempting to build Rakudo 'master' branch gives me:

cc -c -o perl6_group.o -Isrc/pmc -I/home/pmichaud/parrot/context_unify3/install/include/1.8.0-devel -I/home/pmichaud/parrot/context_unify3/install/include/1.8.0-devel/pmc -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHASATTRIBUTE_CONST -DHASATTRIBUTE_DEPRECATED -DHASATTRIBUTE_MALLOC -DHASATTRIBUTE_NONNULL -DHASATTRIBUTE_NORETURN -DHASATTRIBUTE_PURE -DHASATTRIBUTE_UNUSED -DHASATTRIBUTE_WARN_UNUSED_RESULT -falign-functions=16 -fvisibility=hidden -funit-at-a-time -maccumulate-outgoing-args -W -Wall -Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wdisabled-optimization -Wendif-labels -Wextra -Wformat -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimplicit -Wimport -Winit-self -Winline -Winvalid-pch -Wlogical-op -Wmissing-braces -Wmissing-field-initializers -Wno-missing-format-attribute -Wmissing-include-dirs -Wpacked -Wparentheses -Wpointer-arith -Wreturn-
type -Wsequence-point -Wno-shadow -Wsign-compare -Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default -Wtrigraphs -Wundef -Wunknown-pragmas -Wno-unused -Wvariadic-macros -Wwrite-strings -Wbad-function-cast -Wc++-compat -Wdeclaration-after-statement -Werror=declaration-after-statement -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wnonnull -DDISABLE_GC_DEBUG=1 -DNDEBUG -O2 -g -DHAS_GETTEXT -fPIC -DHAVE_COMPUTED_GOTO perl6_group.c
In file included from /home/pmichaud/parrot/context_unify3/install/include/1.8.0-devel/parrot/interpreter.h:132,
from /home/pmichaud/parrot/context_unify3/install/include/1.8.0-devel/parrot/platform_interface.h:12,
from /home/pmichaud/parrot/context_unify3/install/include/1.8.0-devel/parrot/parrot.h:257,
from perl6_group.c:17:
/home/pmichaud/parrot/context_unify3/install/include/1.8.0-devel/parrot/context.h:27:33: error: pmc/pmc_callcontext.h: No such file or directory
make: *** [src/pmc/perl6_group.so] Error 1

Pm
_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Andrew Whitworth

unread,
Dec 18, 2009, 3:28:08 PM12/18/09
to Patrick R. Michaud, parro...@lists.parrot.org
I tracked this problem down. NQP-RX uses these lines in the offending function:

$P0 = context['current_sub']
context = context['caller_ctx']

With the new CallContext PMC, string keys are used to lookup named
arguments, not look up attributes. To get attributes, we need the
getattribute opcode:

$P0 = getattribute context, 'current_sub'
context = getattribute context, 'caller_ctx'

I don't know if the getattribute syntax will work in current trunk.

Technically the Context PMC wasn't introduced in Parrot until the 1.6
release, so it hasn't appeared in a supported release and is
experimental. We should make sure we coordinate a fix with pmichaud,
so that when the branch does land there won't be any issues in our
HLLs.

--Andrew Whitworth

_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Vasily Chekalkin

unread,
Dec 18, 2009, 4:50:54 PM12/18/09
to Andrew Whitworth, parro...@lists.parrot.org
Andrew Whitworth wrote:
> I tracked this problem down. NQP-RX uses these lines in the offending function:
>
> $P0 = context['current_sub']
> context = context['caller_ctx']
>
> With the new CallContext PMC, string keys are used to lookup named
> arguments, not look up attributes. To get attributes, we need the
> getattribute opcode:
>
> $P0 = getattribute context, 'current_sub'
> context = getattribute context, 'caller_ctx'
>
> I don't know if the getattribute syntax will work in current trunk.

It doesn't. But I can add it now for "transition period" to support both
forms.

--
Bacek
_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

James E Keenan

unread,
Dec 18, 2009, 9:32:24 PM12/18/09
to parro...@lists.parrot.org
I ran 'make fulltest' on this branch. While the tests covered by 'make
test' all passed, there were errors in the other targets.

Here is a paste which will point you to the errors.

http://nopaste.snit.ch/19144

I took care of the trailing_space error. I think we should try to get
'make fulltest' passing before the merge; otherwise we will have
headaches going into the 2.0 release next month.

Thank you very much.
kid51

_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Michael Hind

unread,
Dec 19, 2009, 5:25:03 AM12/19/09
to ba...@bacek.com, jk...@verizon.net, parro...@lists.parrot.org
fixed the other codetest failure at r43150

built and ran tests with Ubuntu 9.10 amd64 (g++ with --optimize)

one failure in make test (t/library/streams.t - Failed test:  12)

with fulltest:

one failure in testg, same failure as make test in library_tests, benchmark_tests - Failed tests:  18-20 and 3 tests fail in examples_tests, one of the failures is in t/examples/streams.t, which might be related to the library_tests failure.

I pasted the summary at http://nopaste.snit.ch/19146

Cheers, Michael (mikehh)



2009/12/19 James E Keenan <jk...@verizon.net>



--
Michael H. Hind

Tel:  +44 (0) 1224 443 570
Cell: +44 (0) 7877 224 745

Vasily Chekalkin

unread,
Dec 19, 2009, 6:31:22 AM12/19/09
to Michael Hind, jk...@verizon.net, parro...@lists.parrot.org
Michael Hind wrote:
> fixed the other codetest failure at r43150
>
> built and ran tests with Ubuntu 9.10 amd64 (g++ with --optimize)
>
> one failure in make test (t/library/streams.t - Failed test: 12)
>
> with fulltest:
>
> one failure in testg, same failure as make test in library_tests,
> benchmark_tests - Failed tests: 18-20 and 3 tests fail in
> examples_tests, one of the failures is in t/examples/streams.t, which
> might be related to the library_tests failure.
>
> I pasted the summary at http://nopaste.snit.ch/19146
>

ok, benchmark_tests fixed in r43155. streams and libraries is same
failure. I'm trying to fix it.

Vasily Chekalkin

unread,
Dec 19, 2009, 7:47:41 AM12/19/09
to parro...@lists.parrot.org
Hello.

(Just in case if someone will able to hack on this branch for next ~12
hours.)

To simplify life of HLL developers I'm going to do next things:

1. Implement new function Parrot_pcc_(get|set)_next_call_context (or
similar with better name) which will be accessor to
"interp->current_sig". It will be used in "build_sigobject",
"invoke_from_sigobject" and various "op invoke".
2. Switch Parrot_pcc_get_signature to return current context.

Main reason is - HLL devs depends on getting current "CallSignature"
from CURRENT_CONTEXT using Parrot_pcc_get_signature. PCC depends on
building CallContext on same functions. But PCC builds signature for
future use, HLL - for current use. So, it's better to use different
accessors.

--
Bacek,
falling asleep at face of future.
_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Reply all
Reply to author
Forward
0 new messages