Skip to content
Browse files

Add 'does invokable' to all PMCs with VTABLE_invoke (except Object). …

…Part of TT#1597

git-svn-id: https://svn.parrot.org/parrot/trunk@46700 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
1 parent 4e3b46c commit 336b07ce19a66b7da5c26fe1ddaa1b5ead42d334 @bacek bacek committed May 16, 2010
View
2 src/pmc/continuation.pmc
@@ -47,7 +47,7 @@ more information.
* Additionally ct->current_cont has the continuation of the caller.
*/
-pmclass Continuation auto_attrs {
+pmclass Continuation auto_attrs provides invokable {
/* continuation destination */
ATTR PackFile_ByteCode *seg; /* bytecode segment */
ATTR opcode_t *address; /* start of bytecode, addr to continue */
View
2 src/pmc/coroutine.pmc
@@ -73,7 +73,7 @@ print_sub_name(PARROT_INTERP, ARGIN(PMC *sub_pmc))
print_pbc_location(interp);
}
-pmclass Coroutine extends Sub auto_attrs {
+pmclass Coroutine extends Sub provides invokable auto_attrs {
ATTR INTVAL yield; /* yield in process */
ATTR opcode_t *address; /* next address to run - toggled each time */
ATTR PackFile_ByteCode *caller_seg; /* bytecode segment */
View
2 src/pmc/eval.pmc
@@ -163,7 +163,7 @@ mark_subs(PARROT_INTERP, ARGIN(PMC *self))
}
}
-pmclass Eval extends Sub auto_attrs {
+pmclass Eval extends Sub provides invokable auto_attrs {
VTABLE void init() {
Parrot_Sub_attributes *sub_data;
View
2 src/pmc/eventhandler.pmc
@@ -24,7 +24,7 @@ Event.
/* HEADERIZER END: static */
-pmclass EventHandler extends Sub auto_attrs {
+pmclass EventHandler extends Sub provides invokable auto_attrs {
ATTR STRING *type; /* the type of the event to handle */
ATTR PMC *code; /* the code object to execute */
View
2 src/pmc/exceptionhandler.pmc
@@ -26,7 +26,7 @@ exception object's C<_P5> attribute.
/* HEADERIZER BEGIN: static */
/* HEADERIZER END: static */
-pmclass ExceptionHandler extends Continuation auto_attrs {
+pmclass ExceptionHandler extends Continuation provides invokable auto_attrs {
ATTR PMC *handled_types;
ATTR PMC *handled_types_except;
View
2 src/pmc/multisub.pmc
@@ -25,7 +25,7 @@ Sub PMCs with the same short name, but different long names.
/* HEADERIZER BEGIN: static */
/* HEADERIZER END: static */
-pmclass MultiSub extends ResizablePMCArray auto_attrs provides array {
+pmclass MultiSub extends ResizablePMCArray auto_attrs provides array provides invokable {
VTABLE STRING * get_string() {
PMC * const sub0 = VTABLE_get_pmc_keyed_int(INTERP, SELF, 0);
View
2 src/pmc/nci.pmc
@@ -167,7 +167,7 @@ build_func(PARROT_INTERP, ARGMOD(Parrot_NCI_attributes *nci_info))
}
-pmclass NCI auto_attrs {
+pmclass NCI auto_attrs provides invokable {
/* NCI thunk handling attributes */
ATTR STRING *signature; /* The signature. */
ATTR void *func; /* Function pointer to call. */
View
2 src/pmc/parrotinterpreter.pmc
@@ -189,7 +189,7 @@ create_interp(ARGIN(PMC *self), ARGIN_NULLOK(Parrot_Interp parent))
new_interp->current_cont = NEED_CONTINUATION;
}
-pmclass ParrotInterpreter no_ro manual_attrs {
+pmclass ParrotInterpreter no_ro manual_attrs provides invokable {
ATTR struct parrot_interp_t *interp; /* this PMC's interpreter */
ATTR INTVAL tid; /* thread id */
ATTR PMC *args; /* args passed to this thread */
View
2 src/pmc/sub.pmc
@@ -48,7 +48,7 @@ print_sub_name(PARROT_INTERP, ARGIN_NULLOK(PMC *sub))
print_pbc_location(interp);
}
-pmclass Sub auto_attrs {
+pmclass Sub auto_attrs provides invokable {
ATTR PackFile_ByteCode *seg; /* bytecode segment */
ATTR size_t start_offs; /* sub entry in ops from seg->base.data */
ATTR size_t end_offs;
View
2 src/pmc/timer.pmc
@@ -61,7 +61,7 @@ initializer.
/* HEADERIZER BEGIN: static */
/* HEADERIZER END: static */
-pmclass Timer extends Task provides event auto_attrs {
+pmclass Timer extends Task provides event provides invokable auto_attrs {
ATTR FLOATVAL duration; /* The duration of the timer pause */
ATTR FLOATVAL interval; /* How often to repeat */
ATTR INTVAL repeat; /* Whether to repeat:
View
10 t/op/calling.t
@@ -1408,15 +1408,7 @@ CODE
ok
OUTPUT
-my @todo = (
- defined $ENV{TEST_PROG_ARGS}
- and
- $ENV{TEST_PROG_ARGS} =~ /--runcore=jit/
-)
- ? ( todo => 'broken with JIT (TT #983)' )
- : ();
-
-pir_output_is( <<'CODE', <<'OUTPUT', "clone_key_arg", @todo );
+pir_output_is( <<'CODE', <<'OUTPUT', "clone_key_arg" );
.sub main :main
foo()
print "ok\n"
View
2 t/pmc/coroutine.t
@@ -336,7 +336,7 @@ pir_output_is( << 'CODE', << 'OUTPUT', "check whether interface is done" );
.local pmc pmc1
pmc1 = new ['Coroutine']
.local int bool1
- does bool1, pmc1, "scalar" # XXX WTF
+ does bool1, pmc1, "invokable"
print bool1
print "\n"
does bool1, pmc1, "no_interface"
View
30 t/pmc/sub.t
@@ -9,7 +9,7 @@ use lib qw( . lib ../lib ../../lib );
use Test::More;
use Parrot::Test::Util 'create_tempfile';
-use Parrot::Test tests => 69;
+use Parrot::Test tests => 70;
use Parrot::Config;
=head1 NAME
@@ -837,15 +837,7 @@ the_sub
main
OUTPUT
-@todo = (
- defined $ENV{TEST_PROG_ARGS}
- and
- $ENV{TEST_PROG_ARGS} =~ /--runcore=jit/
-)
- ? ( todo => 'broken with JIT (TT #983)' )
- : ();
-
-pir_output_is( <<'CODE', <<'OUTPUT', "caller introspection via interp", @todo );
+pir_output_is( <<'CODE', <<'OUTPUT', "caller introspection via interp" );
.sub main :main
.include "interpinfo.pasm"
# this test will fail when run with -Oc
@@ -1735,6 +1727,24 @@ named_optional 5
named_slurpy 8
OUTPUT
+pir_output_is( <<'CODE', <<'OUT', 'interface' );
+.sub 'main' :main
+ .const 'Sub' $P0 = "main"
+
+ $I0 = does $P0, 'scalar'
+ say $I0 # Sub does not scalar
+ $I0 = does $P0, 'invokable'
+ say $I0 # Sub does invokable
+ $I0 = does $P0, 'no_interface'
+ say $I0 # Sub does not no_interface
+.end
+CODE
+0
+1
+0
+OUT
+
+
# Local Variables:
# mode: cperl
# cperl-indent-level: 4

0 comments on commit 336b07c

Please sign in to comment.
Something went wrong with that request. Please try again.