Permalink
Browse files

Merge remote-tracking branch 'origin/kill_current_object' into bacek/…

…unmerge_context

Conflicts:
	include/parrot/context.h
	src/call/context_accessors.c
	src/ops/core_ops.c
	src/pmc/callsignature.pmc
	src/pmc/sub.pmc
  • Loading branch information...
2 parents ff07689 + de3545f commit 2ed595c23cb13eaa665f156cd17b6878dd27c251 @bacek bacek committed Apr 3, 2012
View
24 include/parrot/context.h
@@ -148,12 +148,6 @@ FLOATVAL * Parrot_pcc_get_num_constants_func(PARROT_INTERP,
PARROT_EXPORT
PARROT_PURE_FUNCTION
PARROT_CAN_RETURN_NULL
-PMC* Parrot_pcc_get_object_func(PARROT_INTERP, ARGIN(const PMC *ctx))
- __attribute__nonnull__(2);
-
-PARROT_EXPORT
-PARROT_PURE_FUNCTION
-PARROT_CAN_RETURN_NULL
PMC* Parrot_pcc_get_outer_ctx_func(PARROT_INTERP, ARGIN(const PMC *ctx))
__attribute__nonnull__(2);
@@ -260,13 +254,6 @@ void Parrot_pcc_set_namespace_func(PARROT_INTERP,
__attribute__nonnull__(2);
PARROT_EXPORT
-void Parrot_pcc_set_object_func(PARROT_INTERP,
- ARGIN(PMC *ctx),
- ARGIN_NULLOK(PMC *object))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2);
-
-PARROT_EXPORT
void Parrot_pcc_set_outer_ctx_func(PARROT_INTERP,
ARGIN(PMC *ctx),
ARGIN(PMC *outer_ctx))
@@ -363,8 +350,6 @@ UINTVAL Parrot_pcc_warnings_test_func(PARROT_INTERP,
#define ASSERT_ARGS_Parrot_pcc_get_num_constants_func \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(ctx))
-#define ASSERT_ARGS_Parrot_pcc_get_object_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(ctx))
#define ASSERT_ARGS_Parrot_pcc_get_outer_ctx_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(ctx))
#define ASSERT_ARGS_Parrot_pcc_get_pc_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
@@ -414,9 +399,6 @@ UINTVAL Parrot_pcc_warnings_test_func(PARROT_INTERP,
#define ASSERT_ARGS_Parrot_pcc_set_namespace_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(ctx))
-#define ASSERT_ARGS_Parrot_pcc_set_object_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(interp) \
- , PARROT_ASSERT_ARG(ctx))
#define ASSERT_ARGS_Parrot_pcc_set_outer_ctx_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(ctx) \
@@ -464,8 +446,6 @@ UINTVAL Parrot_pcc_warnings_test_func(PARROT_INTERP,
# define Parrot_pcc_get_continuation(i, c) (CONTEXT_STRUCT(c)->current_cont)
# define Parrot_pcc_get_caller_ctx(i, c) (CONTEXT_STRUCT(c)->caller_ctx)
# define Parrot_pcc_get_namespace(i, c) (CONTEXT_STRUCT(c)->current_namespace)
-//# define Parrot_pcc_get_object(i, c) (CONTEXT_STRUCT(c)->current_object)
-# define Parrot_pcc_get_object(i, c) (PMCNULL)
# define Parrot_pcc_get_lex_pad(i, c) (CONTEXT_STRUCT(c)->lex_pad)
# define Parrot_pcc_get_handlers(i, c) (CONTEXT_STRUCT(c)->handlers)
@@ -568,10 +548,6 @@ UINTVAL Parrot_pcc_warnings_test_func(PARROT_INTERP,
CONTEXT_STRUCT(c)->current_namespace = (value); \
PARROT_GC_WRITE_BARRIER((i), (c)); \
} while (0)
-# define Parrot_pcc_set_object(i, c, value) do { \
- //CONTEXT_STRUCT(c)->current_object = (value); \
- PARROT_GC_WRITE_BARRIER((i), (c)); \
- } while (0)
# define Parrot_pcc_set_lex_pad(i, c, value) do { \
CONTEXT_STRUCT(c)->lex_pad = (value); \
PARROT_GC_WRITE_BARRIER((i), (c)); \
View
1 include/parrot/gc_api.h
@@ -99,7 +99,6 @@ typedef enum {
CURRENT_CTX,
CURRENT_SUB,
CURRENT_CONT,
- CURRENT_OBJECT,
CURRENT_LEXPAD,
CURRENT_TASK,
View
1 runtime/parrot/library/Stream/Writer.pir
@@ -68,7 +68,6 @@ END:
# mark it as closed
.local pmc status
- interpinfo self, .INTERPINFO_CURRENT_OBJECT
getattribute status, self, 'status'
status = 0
.end
View
3 src/call/args.c
@@ -408,8 +408,6 @@ Parrot_pcc_build_sig_object_from_op(PARROT_INTERP, ARGIN_NULLOK(PMC *signature),
}
else {
VTABLE_push_pmc(interp, call_object, pmc_value);
- if (arg_flags & PARROT_ARG_INVOCANT)
- Parrot_pcc_set_object(interp, call_object, pmc_value);
}
break;
@@ -612,7 +610,6 @@ set_call_from_varargs(PARROT_INTERP,
else {
VTABLE_push_pmc(interp, signature, pmc_arg);
++i; /* skip 'i' */
- Parrot_pcc_set_object(interp, signature, pmc_arg);
}
}
else
View
1 src/call/context.c
@@ -244,7 +244,6 @@ init_context(ARGMOD(PMC *pmcctx), ARGIN_NULLOK(PMC *pmcold))
ctx->lex_pad = PMCNULL;
ctx->outer_ctx = NULL;
ctx->current_cont = NULL;
- ctx->current_object = NULL;
ctx->handlers = PMCNULL;
ctx->caller_ctx = NULL;
ctx->current_sig = PMCNULL;
View
33 src/call/context_accessors.c
@@ -461,39 +461,6 @@ Parrot_pcc_set_signature_func(PARROT_INTERP, ARGIN(PMC *ctx), ARGIN_NULLOK(PMC *
CONTEXT_STRUCT(ctx)->current_sig = sig_object;
}
-/*
-
-=item C<PMC* Parrot_pcc_get_object_func(PARROT_INTERP, const PMC *ctx)>
-
-=item C<void Parrot_pcc_set_object_func(PARROT_INTERP, PMC *ctx, PMC *object)>
-
-Get object of Context (in method call).
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_PURE_FUNCTION
-PARROT_CAN_RETURN_NULL
-PMC*
-Parrot_pcc_get_object_func(SHIM_INTERP, ARGIN(const PMC *ctx))
-{
- ASSERT_ARGS(Parrot_pcc_get_object_func)
- return PMCNULL;
-// PARROT_ASSERT(ctx->vtable->base_type == enum_class_Context);
-// return CONTEXT_STRUCT(ctx)->current_object;
-}
-
-PARROT_EXPORT
-void
-Parrot_pcc_set_object_func(PARROT_INTERP, ARGIN(PMC *ctx), ARGIN_NULLOK(PMC *object))
-{
- ASSERT_ARGS(Parrot_pcc_set_object_func)
-// PARROT_ASSERT(ctx->vtable->base_type == enum_class_Context);
-// PARROT_GC_WRITE_BARRIER(interp, ctx);
-// CONTEXT_STRUCT(ctx)->current_object = object;
-}
/*
View
4 src/interp/api.c
@@ -297,7 +297,6 @@ Parrot_interp_initialize_interpreter(PARROT_INTERP, ARGIN(Parrot_GC_Init_Args *a
/* clear context introspection vars */
Parrot_pcc_set_sub(interp, CURRENT_CONTEXT(interp), NULL);
Parrot_pcc_set_continuation(interp, CURRENT_CONTEXT(interp), NULL); /* TODO Use PMCNULL */
- Parrot_pcc_set_object(interp, CURRENT_CONTEXT(interp), NULL);
/* initialize built-in runcores */
Parrot_runcore_init(interp);
@@ -859,9 +858,6 @@ Parrot_interp_info_p(PARROT_INTERP, INTVAL what)
case CURRENT_CONT:
result = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp));
break;
- case CURRENT_OBJECT:
- result = Parrot_pcc_get_object(interp, CURRENT_CONTEXT(interp));
- break;
case CURRENT_LEXPAD:
result = Parrot_pcc_get_lex_pad(interp, CURRENT_CONTEXT(interp));
break;
View
4 src/ops/core.ops
@@ -379,8 +379,6 @@ inline op invokecc(invar PMC) :flow {
Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), dest);
- if (!PMC_IS_NULL(signature))
- Parrot_pcc_set_object(interp, signature, NULL);
Parrot_pcc_reuse_continuation(interp, CURRENT_CONTEXT(interp), dest);
dest = VTABLE_invoke(interp, p, dest);
@@ -395,8 +393,6 @@ inline op invoke(invar PMC, invar PMC) :flow {
Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), dest);
- if (!PMC_IS_NULL(signature))
- Parrot_pcc_set_object(interp, signature, NULL);
interp->current_cont = $2;
dest = VTABLE_invoke(interp, p, dest);
View
4 src/ops/core_ops.c
@@ -18182,8 +18182,6 @@ Parrot_callmethodcc_p_sc(opcode_t *cur_opcode, PARROT_INTERP) {
if ((!PMC_IS_NULL(method_pmc))) {
PMC * const signature = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
- Parrot_pcc_set_object(interp, CURRENT_CONTEXT(interp), object);
-
Parrot_pcc_reuse_continuation(interp, CURRENT_CONTEXT(interp), next);
dest = VTABLE_invoke(interp, method_pmc, next);
}
@@ -18209,7 +18207,6 @@ Parrot_callmethodcc_p_p(opcode_t *cur_opcode, PARROT_INTERP) {
PMC * signature = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), next);
- Parrot_pcc_set_object(interp, CURRENT_CONTEXT(interp), PREG(1));
Parrot_pcc_reuse_continuation(interp, CURRENT_CONTEXT(interp), next);
dest = VTABLE_invoke(interp, PREG(2), next);
@@ -18230,7 +18227,6 @@ Parrot_callmethod_p_s_p(opcode_t *cur_opcode, PARROT_INTERP) {
dest = Parrot_ex_throw_from_op_args(interp, next, EXCEPTION_METHOD_NOT_FOUND, "Method '%Ss' not found for invocant of class '%Ss'", meth, VTABLE_get_string(interp, VTABLE_get_class(interp, object)));
}
else {
- Parrot_pcc_set_object(interp, CURRENT_CONTEXT(interp), object);
interp->current_cont = PREG(3);
dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next);
View
2 src/ops/experimental.ops
@@ -296,8 +296,6 @@ inline op invokecc(invar PMC, invar PMC) :flow {
Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), dest);
- if (!PMC_IS_NULL(signature))
- Parrot_pcc_set_object(interp, signature, NULL);
Parrot_pcc_reuse_continuation(interp, CURRENT_CONTEXT(interp), dest);
dest = VTABLE_invoke(interp, p, dest);
View
13 src/ops/object.ops
@@ -60,9 +60,6 @@ op callmethodcc(invar PMC, in STR) :object_base :flow {
if (!PMC_IS_NULL(method_pmc)) {
PMC * const signature = Parrot_pcc_get_signature(interp,
CURRENT_CONTEXT(interp));
- if (!PMC_IS_NULL(signature))
- Parrot_pcc_set_object(interp, signature, object);
-
Parrot_pcc_reuse_continuation(interp, CURRENT_CONTEXT(interp), next);
dest = VTABLE_invoke(interp, method_pmc, next);
}
@@ -92,8 +89,6 @@ op callmethodcc(invar PMC, invar PMC) :object_base :flow {
Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), next);
- if (!PMC_IS_NULL(signature))
- Parrot_pcc_set_object(interp, signature, $1);
Parrot_pcc_reuse_continuation(interp, CURRENT_CONTEXT(interp), next);
dest = VTABLE_invoke(interp, $2, next);
@@ -118,8 +113,6 @@ op callmethod(invar PMC, in STR, invar PMC) :object_base :flow {
VTABLE_get_string(interp, VTABLE_get_class(interp, object)));
}
else {
- if (!PMC_IS_NULL(signature))
- Parrot_pcc_set_object(interp, signature, object);
interp->current_cont = $3;
dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next);
}
@@ -137,8 +130,6 @@ op callmethod(invar PMC, invar PMC, invar PMC) :object_base :flow {
Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), next);
- if (!PMC_IS_NULL(signature))
- Parrot_pcc_set_object(interp, signature, object);
interp->current_cont = $3;
dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next);
goto ADDRESS(dest);
@@ -162,8 +153,6 @@ op tailcallmethod(invar PMC, in STR) :object_base :flow {
else {
interp->current_cont = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp));
PObj_get_FLAGS(interp->current_cont) |= SUB_FLAG_TAILCALL;
- if (!PMC_IS_NULL(signature))
- Parrot_pcc_set_object(interp, signature, object);
dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next);
}
goto ADDRESS(dest);
@@ -181,8 +170,6 @@ op tailcallmethod(invar PMC, invar PMC) :object_base :flow {
interp->current_cont = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp));
PObj_get_FLAGS(interp->current_cont) |= SUB_FLAG_TAILCALL;
- if (!PMC_IS_NULL(signature))
- Parrot_pcc_set_object(interp, signature, object);
dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next);
goto ADDRESS(dest);
}
View
24 src/platform/generic/dl.c
@@ -37,18 +37,12 @@ PARROT_CAN_RETURN_NULL
static void * find_handle_entry(ARGIN(const void *handle))
__attribute__nonnull__(1);
-static void push_handle_entry(ARGIN(void *handle))
- __attribute__nonnull__(1);
-
-static void remove_handle_entry(ARGIN(void *handle))
- __attribute__nonnull__(1);
-
+static void push_handle_entry(ARGIN_NULLOK(void *handle));
+static void remove_handle_entry(ARGIN_NULLOK(void *handle));
#define ASSERT_ARGS_find_handle_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(handle))
-#define ASSERT_ARGS_push_handle_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(handle))
-#define ASSERT_ARGS_remove_handle_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(handle))
+#define ASSERT_ARGS_push_handle_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_remove_handle_entry __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: static */
@@ -65,8 +59,10 @@ struct handle_entry {
struct handle_entry *handle_list = NULL;
static void
-push_handle_entry(ARGIN(void *handle))
+push_handle_entry(ARGIN_NULLOK(void *handle))
{
+ ASSERT_ARGS(push_handle_entry)
+
struct handle_entry *e;
e = (struct handle_entry *) malloc(sizeof (struct handle_entry));
@@ -84,6 +80,8 @@ PARROT_CAN_RETURN_NULL
static void *
find_handle_entry(ARGIN(const void *handle))
{
+ ASSERT_ARGS(find_handle_entry)
+
const struct handle_entry *e;
for (e = handle_list; e; e = e->next) {
@@ -95,8 +93,10 @@ find_handle_entry(ARGIN(const void *handle))
}
static void
-remove_handle_entry(ARGIN(void *handle))
+remove_handle_entry(ARGIN_NULLOK(void *handle))
{
+ ASSERT_ARGS(remove_handle_entry)
+
if (handle_list) {
if (handle_list->handle == handle) {
struct handle_entry * const p = handle_list;
View
10 src/pmc/context.pmc
@@ -47,7 +47,6 @@ pmclass Context provides array provides hash auto_attrs {
/* for now use a return continuation PMC */
ATTR PMC *handlers; /* local handlers for the context */
ATTR PMC *current_cont; /* the return continuation PMC */
- ATTR PMC *current_object; /* current object if a method call */
ATTR PMC *current_namespace; /* The namespace we're currently in */
ATTR opcode_t *current_pc; /* program counter of Sub invocation */
ATTR PMC *current_sig; /* temporary CallContext PMC for active call */
@@ -115,9 +114,6 @@ Mark any referenced strings and PMCs.
GET_ATTR_current_cont(INTERP, SELF, tmp);
Parrot_gc_mark_PMC_alive(INTERP, tmp);
- GET_ATTR_current_object(INTERP, SELF, tmp);
- Parrot_gc_mark_PMC_alive(INTERP, tmp);
-
GET_ATTR_current_namespace(INTERP, SELF, tmp);
Parrot_gc_mark_PMC_alive(INTERP, tmp);
@@ -189,10 +185,6 @@ return list of ExceptioHandlers
return current Continuation
-=item current_object
-
-return current Object (if in method call)
-
=item current_namespace
return current Namespace
@@ -217,8 +209,6 @@ return current Namespace
GET_ATTR_current_sub(INTERP, SELF, value);
else if (STRING_equal(INTERP, key, CONST_STRING(INTERP, "current_cont")))
GET_ATTR_current_cont(INTERP, SELF, value);
- else if (STRING_equal(INTERP, key, CONST_STRING(INTERP, "current_object")))
- GET_ATTR_current_object(INTERP, SELF, value);
else if (STRING_equal(INTERP, key, CONST_STRING(INTERP, "current_namespace")))
GET_ATTR_current_namespace(INTERP, SELF, value);
else if (STRING_equal(INTERP, key, CONST_STRING(INTERP, "handlers")))
View
1 src/pmc/coroutine.pmc
@@ -191,7 +191,6 @@ Swaps the "context".
Parrot_pcc_set_sub(INTERP, ctx, SELF);
Parrot_pcc_set_continuation(INTERP, ctx, ccont);
- Parrot_pcc_set_object(INTERP, ctx, PMCNULL);
INTERP->current_cont = PMCNULL;
View
5 src/pmc/sub.pmc
@@ -376,7 +376,6 @@ Invokes the subroutine.
VTABLE opcode_t *invoke(void *next) {
PMC * const caller_ctx = CURRENT_CONTEXT(INTERP);
PMC *ccont = INTERP->current_cont;
- PMC *object;
/* plain subroutine call
* create new context, place it in interpreter */
@@ -419,10 +418,6 @@ Invokes the subroutine.
context = Parrot_set_new_context(INTERP, sub->n_regs_used);
- /* Preserve object */
- // FIXME object = Parrot_pcc_get_object(INTERP, signature);
- // Parrot_pcc_set_object(INTERP, context, object);
-
Parrot_pcc_set_sub(INTERP, context, SELF);
Parrot_pcc_set_continuation(INTERP, context, ccont);
Parrot_pcc_set_constants(INTERP, context, sub->seg->const_table);
View
57 t/oo/objects.t
@@ -1592,83 +1592,79 @@ end:
# Foo54 and Bar54 have attribute accessor methods
new $P5, ['String'] # set attribute values
set $P5, "i" # attribute slots have reference semantics
- set_args "0,0", $P5, "i"
+ set_args "0,0,0", $P13, $P5, "i"
callmethodcc $P13, "Foo54__set"
get_results ""
new $P5, ['String']
set $P5, "j"
- set_args "0,0", $P5, "j"
+ set_args "0,0,0", $P13, $P5, "j"
callmethodcc $P13,"Foo54__set"
get_results ""
new $P5, ['String']
set $P5, "k"
- set_args "0,0", $P5, "k"
+ set_args "0,0,0", $P13, $P5, "k"
callmethodcc $P13,"Bar54__set"
get_results ""
new $P5, ['String']
set $P5, "l"
- set_args "0,0", $P5, "l"
+ set_args "0,0,0", $P13, $P5, "l"
callmethodcc $P13,"Bar54__set"
get_results ""
# now retrieve attributes
- set_args "0", "i"
+ set_args "0,0", $P13, "i"
callmethodcc $P13,"Foo54__get"
get_results "0", $P5
is( $P5, "i", 'got attrib i from Bar54->Foo54__get' )
- set_args "0", "j"
+ set_args "0,0", $P13, "j"
callmethodcc $P13,"Foo54__get"
get_results "0", $P5
is( $P5, "j", 'got attrib j from Bar54->Foo54__get' )
- set_args "0", "k"
+ set_args "0,0", $P13, "k"
callmethodcc $P13,"Bar54__get"
get_results "0", $P5
is( $P5, "k", 'got attrib k from Bar54->Bar54__get' )
- set_args "0", "l"
- callmethodcc $P13,"Bar54__get"
+ set_args "0,0", $P13, "l"
+ callmethodcc $P13, "Bar54__get"
get_results "0", $P5
is( $P5, "l", 'got attrib l from Bar54->Bar54__get' )
.end
# set(obj: Pvalue, Iattr_idx)
.sub Foo54__set
- get_params "0,0", $P5, $S4
+ get_params "0,0,0", $P2, $P5, $S4
ok( 1, "in Foo54__set" )
- interpinfo $P2, .INTERPINFO_CURRENT_OBJECT
setattribute $P2, $S4, $P5
set_returns ""
returncc
.end
# Pattr = get(obj: Iattr_idx)
.sub Foo54__get
- get_params "0", $S4
+ get_params "0,0", $P2, $S4
ok( 1, "in Foo54__get" )
- interpinfo $P2, .INTERPINFO_CURRENT_OBJECT
getattribute $P5, $P2, $S4
set_returns "0", $P5
returncc
.end
.sub Bar54__set
- get_params "0,0", $P5, $S4
- interpinfo $P2, .INTERPINFO_CURRENT_OBJECT
+ get_params "0,0,0", $P2, $P5, $S4
ok( 1, "in Bar54__set" )
setattribute $P2, $S4, $P5
set_returns ""
returncc
.end
.sub Bar54__get
- get_params "0", $S4
+ get_params "0,0", $P2, $S4
ok( 1, "in Bar54__get" )
- interpinfo $P2, .INTERPINFO_CURRENT_OBJECT
getattribute $P5, $P2, $S4
set_returns "0", $P5
returncc
@@ -1702,51 +1698,51 @@ end:
# Foo56 and Bar56 have attribute accessor methods
new $P5, ['String'] # set attribute values
set $P5, "i" # attribute slots have reference semantics
- set_args "0,0,0", $P5, "Foo56", "i"
+ set_args "0,0,0,0", $P2, $P5, "Foo56", "i"
callmethodcc $P2, "set"
new $P5, ['String']
set $P5, "j"
- set_args "0,0,0", $P5, "Foo56", "j"
+ set_args "0,0,0,0", $P2, $P5, "Foo56", "j"
callmethodcc $P2, "set"
new $P5, ['String']
set $P5, "k"
- set_args "0,0,0", $P5, "Bar56", "k"
+ set_args "0,0,0,0", $P2, $P5, "Bar56", "k"
callmethodcc $P2, "set"
new $P5, ['String']
set $P5, "l"
- set_args "0,0,0", $P5, "Bar56", "l"
+ set_args "0,0,0,0", $P2, $P5, "Bar56", "l"
callmethodcc $P2, "set"
new $P5, ['String']
set $P5, "m"
- set_args "0,0,0", $P5, "Bar56", "m"
+ set_args "0,0,0,0", $P2, $P5, "Bar56", "m"
callmethodcc $P2, "set"
# now retrieve attributes
- set_args "0,0", "Foo56", "i"
+ set_args "0,0,0", $P2, "Foo56", "i"
callmethodcc $P2, "get"
get_results "0", $P5
is( $P5, 'i', 'got attrib i from subclass through parent method' )
- set_args "0,0", "Foo56", "j"
+ set_args "0,0,0", $P2, "Foo56", "j"
callmethodcc $P2, "get"
get_results "0", $P5
is( $P5, "j", 'got attrib i from subclass through parent method' )
- set_args "0,0", "Bar56", "k"
+ set_args "0,0,0", $P2, "Bar56", "k"
callmethodcc $P2, "get"
get_results "0", $P5
is( $P5, "k", 'got attrib i from subclass through parent method' )
- set_args "0,0", "Bar56", "l"
+ set_args "0,0,0", $P2, "Bar56", "l"
callmethodcc $P2, "get"
get_results "0", $P5
is( $P5, "l", 'got attrib i from subclass through parent method' )
- set_args "0,0", "Bar56", "m"
+ set_args "0,0,0", $P2, "Bar56", "m"
callmethodcc $P2, "get"
get_results "0", $P5
is( $P5, "m", 'got attrib i from subclass through parent method' )
@@ -1757,23 +1753,20 @@ end:
# set(obj: Pvalue, SClass, Sattr)
.sub set
- get_params "0,0,0", $P5, $S4, $S5
- interpinfo $P2, .INTERPINFO_CURRENT_OBJECT
+ get_params "0,0,0,0", $P2, $P5, $S4, $S5
setattribute $P2, $S5, $P5
set_returns ""
returncc
.end
# Pattr = get(obj: SClass, Sattr)
.sub get
- get_params "0,0", $S4, $S5
- interpinfo $P2, .INTERPINFO_CURRENT_OBJECT
+ get_params "0,0,0", $P2, $S4, $S5
getattribute $P5, $P2, $S5
set_returns "0", $P5
returncc
.end
-
# Local Variables:
# mode: pir
# fill-column: 100
View
6 t/pmc/context.t
@@ -22,7 +22,7 @@ TODO: Implement real tests when CallContext PMC will be migrated to use ATTRibut
.sub main :main
.include 'test_more.pir'
- plan(20)
+ plan(19)
test_new()
@@ -87,10 +87,6 @@ TODO: Implement real tests when CallContext PMC will be migrated to use ATTRibut
$I0 = isa $P0, 'Continuation'
ok($I0, 'Got CallContext.current_cont')
- $P0 = getattribute ctx, 'current_object'
- $I0 = isa $P0, 'Foo'
- ok($I0, 'Got CallContext.current_object')
-
$P0 = getattribute ctx, 'current_namespace'
ok($P0, 'Got CallContext.current_namespace')
$P1 = $P0['test_inspect']
View
26 t/pmc/object-meths.t
@@ -5,7 +5,7 @@ use strict;
use warnings;
use lib qw( . lib ../lib ../../lib );
use Test::More;
-use Parrot::Test tests => 39;
+use Parrot::Test tests => 38;
=head1 NAME
@@ -648,30 +648,6 @@ CODE
ok
OUTPUT
-pir_output_is( <<'CODE', <<'OUTPUT', "self - CURRENT_OBJECT" );
-
-.sub _main :main
- .local pmc A
-
- newclass A, "A"
- new A, ['A']
- A."foo"()
- end
-.end
-
-.namespace ["A"]
-
-.sub foo :method
- .include "interpinfo.pasm"
- $P0 = interpinfo .INTERPINFO_CURRENT_OBJECT
- eq_addr self, $P0, ok
- print "not "
-ok: print "ok\n"
-.end
-CODE
-ok
-OUTPUT
-
pir_output_is( <<'CODE', <<'OUTPUT', "Bug in method calling with nonconst keys" );
.sub _main :main

0 comments on commit 2ed595c

Please sign in to comment.