Skip to content
This repository
Browse code

Merge remote branch 'origin/kill_current_object'

  • Loading branch information...
commit 5c81f3ea1cf2b5509c82f6cddd61ed04dc4da2a4 2 parents 6e92ffe + de3545f
Moritz Lenz moritz authored
23 include/parrot/context.h
@@ -148,12 +148,6 @@ FLOATVAL * Parrot_pcc_get_num_constants_func(PARROT_INTERP,
148 148 PARROT_EXPORT
149 149 PARROT_PURE_FUNCTION
150 150 PARROT_CAN_RETURN_NULL
151   -PMC* Parrot_pcc_get_object_func(PARROT_INTERP, ARGIN(const PMC *ctx))
152   - __attribute__nonnull__(2);
153   -
154   -PARROT_EXPORT
155   -PARROT_PURE_FUNCTION
156   -PARROT_CAN_RETURN_NULL
157 151 PMC* Parrot_pcc_get_outer_ctx_func(PARROT_INTERP, ARGIN(const PMC *ctx))
158 152 __attribute__nonnull__(2);
159 153
@@ -260,13 +254,6 @@ void Parrot_pcc_set_namespace_func(PARROT_INTERP,
260 254 __attribute__nonnull__(2);
261 255
262 256 PARROT_EXPORT
263   -void Parrot_pcc_set_object_func(PARROT_INTERP,
264   - ARGIN(PMC *ctx),
265   - ARGIN_NULLOK(PMC *object))
266   - __attribute__nonnull__(1)
267   - __attribute__nonnull__(2);
268   -
269   -PARROT_EXPORT
270 257 void Parrot_pcc_set_outer_ctx_func(PARROT_INTERP,
271 258 ARGIN(PMC *ctx),
272 259 ARGIN(PMC *outer_ctx))
@@ -363,8 +350,6 @@ UINTVAL Parrot_pcc_warnings_test_func(PARROT_INTERP,
363 350 #define ASSERT_ARGS_Parrot_pcc_get_num_constants_func \
364 351 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
365 352 PARROT_ASSERT_ARG(ctx))
366   -#define ASSERT_ARGS_Parrot_pcc_get_object_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
367   - PARROT_ASSERT_ARG(ctx))
368 353 #define ASSERT_ARGS_Parrot_pcc_get_outer_ctx_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
369 354 PARROT_ASSERT_ARG(ctx))
370 355 #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,
414 399 #define ASSERT_ARGS_Parrot_pcc_set_namespace_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
415 400 PARROT_ASSERT_ARG(interp) \
416 401 , PARROT_ASSERT_ARG(ctx))
417   -#define ASSERT_ARGS_Parrot_pcc_set_object_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
418   - PARROT_ASSERT_ARG(interp) \
419   - , PARROT_ASSERT_ARG(ctx))
420 402 #define ASSERT_ARGS_Parrot_pcc_set_outer_ctx_func __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
421 403 PARROT_ASSERT_ARG(interp) \
422 404 , PARROT_ASSERT_ARG(ctx) \
@@ -464,7 +446,6 @@ UINTVAL Parrot_pcc_warnings_test_func(PARROT_INTERP,
464 446 # define Parrot_pcc_get_continuation(i, c) (CONTEXT_STRUCT(c)->current_cont)
465 447 # define Parrot_pcc_get_caller_ctx(i, c) (CONTEXT_STRUCT(c)->caller_ctx)
466 448 # define Parrot_pcc_get_namespace(i, c) (CONTEXT_STRUCT(c)->current_namespace)
467   -# define Parrot_pcc_get_object(i, c) (CONTEXT_STRUCT(c)->current_object)
468 449 # define Parrot_pcc_get_lex_pad(i, c) (CONTEXT_STRUCT(c)->lex_pad)
469 450 # define Parrot_pcc_get_handlers(i, c) (CONTEXT_STRUCT(c)->handlers)
470 451
@@ -567,10 +548,6 @@ UINTVAL Parrot_pcc_warnings_test_func(PARROT_INTERP,
567 548 CONTEXT_STRUCT(c)->current_namespace = (value); \
568 549 PARROT_GC_WRITE_BARRIER((i), (c)); \
569 550 } while (0)
570   -# define Parrot_pcc_set_object(i, c, value) do { \
571   - CONTEXT_STRUCT(c)->current_object = (value); \
572   - PARROT_GC_WRITE_BARRIER((i), (c)); \
573   - } while (0)
574 551 # define Parrot_pcc_set_lex_pad(i, c, value) do { \
575 552 CONTEXT_STRUCT(c)->lex_pad = (value); \
576 553 PARROT_GC_WRITE_BARRIER((i), (c)); \
1  include/parrot/gc_api.h
@@ -99,7 +99,6 @@ typedef enum {
99 99 CURRENT_CTX,
100 100 CURRENT_SUB,
101 101 CURRENT_CONT,
102   - CURRENT_OBJECT,
103 102 CURRENT_LEXPAD,
104 103 CURRENT_TASK,
105 104
1  runtime/parrot/library/Stream/Writer.pir
@@ -68,7 +68,6 @@ END:
68 68
69 69 # mark it as closed
70 70 .local pmc status
71   - interpinfo self, .INTERPINFO_CURRENT_OBJECT
72 71 getattribute status, self, 'status'
73 72 status = 0
74 73 .end
3  src/call/args.c
@@ -407,8 +407,6 @@ Parrot_pcc_build_sig_object_from_op(PARROT_INTERP, ARGIN_NULLOK(PMC *signature),
407 407 }
408 408 else {
409 409 VTABLE_push_pmc(interp, call_object, pmc_value);
410   - if (arg_flags & PARROT_ARG_INVOCANT)
411   - Parrot_pcc_set_object(interp, call_object, pmc_value);
412 410 }
413 411
414 412 break;
@@ -611,7 +609,6 @@ set_call_from_varargs(PARROT_INTERP,
611 609 else {
612 610 VTABLE_push_pmc(interp, signature, pmc_arg);
613 611 ++i; /* skip 'i' */
614   - Parrot_pcc_set_object(interp, signature, pmc_arg);
615 612 }
616 613 }
617 614 else
1  src/call/context.c
@@ -244,7 +244,6 @@ init_context(ARGMOD(PMC *pmcctx), ARGIN_NULLOK(PMC *pmcold))
244 244 ctx->lex_pad = PMCNULL;
245 245 ctx->outer_ctx = NULL;
246 246 ctx->current_cont = NULL;
247   - ctx->current_object = NULL;
248 247 ctx->handlers = PMCNULL;
249 248 ctx->caller_ctx = NULL;
250 249 ctx->current_sig = PMCNULL;
32 src/call/context_accessors.c
@@ -461,38 +461,6 @@ Parrot_pcc_set_signature_func(PARROT_INTERP, ARGIN(PMC *ctx), ARGIN_NULLOK(PMC *
461 461 CONTEXT_STRUCT(ctx)->current_sig = sig_object;
462 462 }
463 463
464   -/*
465   -
466   -=item C<PMC* Parrot_pcc_get_object_func(PARROT_INTERP, const PMC *ctx)>
467   -
468   -=item C<void Parrot_pcc_set_object_func(PARROT_INTERP, PMC *ctx, PMC *object)>
469   -
470   -Get object of Context (in method call).
471   -
472   -=cut
473   -
474   -*/
475   -
476   -PARROT_EXPORT
477   -PARROT_PURE_FUNCTION
478   -PARROT_CAN_RETURN_NULL
479   -PMC*
480   -Parrot_pcc_get_object_func(SHIM_INTERP, ARGIN(const PMC *ctx))
481   -{
482   - ASSERT_ARGS(Parrot_pcc_get_object_func)
483   - PARROT_ASSERT(ctx->vtable->base_type == enum_class_CallContext);
484   - return CONTEXT_STRUCT(ctx)->current_object;
485   -}
486   -
487   -PARROT_EXPORT
488   -void
489   -Parrot_pcc_set_object_func(PARROT_INTERP, ARGIN(PMC *ctx), ARGIN_NULLOK(PMC *object))
490   -{
491   - ASSERT_ARGS(Parrot_pcc_set_object_func)
492   - PARROT_ASSERT(ctx->vtable->base_type == enum_class_CallContext);
493   - PARROT_GC_WRITE_BARRIER(interp, ctx);
494   - CONTEXT_STRUCT(ctx)->current_object = object;
495   -}
496 464
497 465 /*
498 466
4 src/interp/api.c
@@ -298,7 +298,6 @@ Parrot_interp_initialize_interpreter(PARROT_INTERP, ARGIN(Parrot_GC_Init_Args *a
298 298 /* clear context introspection vars */
299 299 Parrot_pcc_set_sub(interp, CURRENT_CONTEXT(interp), NULL);
300 300 Parrot_pcc_set_continuation(interp, CURRENT_CONTEXT(interp), NULL); /* TODO Use PMCNULL */
301   - Parrot_pcc_set_object(interp, CURRENT_CONTEXT(interp), NULL);
302 301
303 302 /* initialize built-in runcores */
304 303 Parrot_runcore_init(interp);
@@ -860,9 +859,6 @@ Parrot_interp_info_p(PARROT_INTERP, INTVAL what)
860 859 case CURRENT_CONT:
861 860 result = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp));
862 861 break;
863   - case CURRENT_OBJECT:
864   - result = Parrot_pcc_get_object(interp, CURRENT_CONTEXT(interp));
865   - break;
866 862 case CURRENT_LEXPAD:
867 863 result = Parrot_pcc_get_lex_pad(interp, CURRENT_CONTEXT(interp));
868 864 break;
4 src/ops/core.ops
@@ -379,8 +379,6 @@ inline op invokecc(invar PMC) :flow {
379 379
380 380 Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), dest);
381 381
382   - if (!PMC_IS_NULL(signature))
383   - Parrot_pcc_set_object(interp, signature, NULL);
384 382 Parrot_pcc_reuse_continuation(interp, CURRENT_CONTEXT(interp), dest);
385 383 dest = VTABLE_invoke(interp, p, dest);
386 384
@@ -395,8 +393,6 @@ inline op invoke(invar PMC, invar PMC) :flow {
395 393
396 394 Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), dest);
397 395
398   - if (!PMC_IS_NULL(signature))
399   - Parrot_pcc_set_object(interp, signature, NULL);
400 396 interp->current_cont = $2;
401 397
402 398 dest = VTABLE_invoke(interp, p, dest);
37 src/ops/core_ops.c
@@ -13693,9 +13693,6 @@ Parrot_invokecc_p(opcode_t *cur_opcode, PARROT_INTERP) {
13693 13693 PMC * const signature = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
13694 13694
13695 13695 Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), dest);
13696   - if ((!PMC_IS_NULL(signature))) {
13697   - Parrot_pcc_set_object(interp, signature, NULL);
13698   - }
13699 13696
13700 13697 Parrot_pcc_reuse_continuation(interp, CURRENT_CONTEXT(interp), dest);
13701 13698 dest = VTABLE_invoke(interp, p, dest);
@@ -13709,9 +13706,6 @@ Parrot_invoke_p_p(opcode_t *cur_opcode, PARROT_INTERP) {
13709 13706 PMC * const signature = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
13710 13707
13711 13708 Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), dest);
13712   - if ((!PMC_IS_NULL(signature))) {
13713   - Parrot_pcc_set_object(interp, signature, NULL);
13714   - }
13715 13709
13716 13710 interp->current_cont = PREG(2);
13717 13711 dest = VTABLE_invoke(interp, p, dest);
@@ -18082,9 +18076,6 @@ Parrot_callmethodcc_p_s(opcode_t *cur_opcode, PARROT_INTERP) {
18082 18076 if ((!PMC_IS_NULL(method_pmc))) {
18083 18077 PMC * const signature = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
18084 18078
18085   - if ((!PMC_IS_NULL(signature))) {
18086   - Parrot_pcc_set_object(interp, signature, object);
18087   - }
18088 18079
18089 18080 Parrot_pcc_reuse_continuation(interp, CURRENT_CONTEXT(interp), next);
18090 18081 dest = VTABLE_invoke(interp, method_pmc, next);
@@ -18116,10 +18107,6 @@ Parrot_callmethodcc_p_sc(opcode_t *cur_opcode, PARROT_INTERP) {
18116 18107 if ((!PMC_IS_NULL(method_pmc))) {
18117 18108 PMC * const signature = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
18118 18109
18119   - if ((!PMC_IS_NULL(signature))) {
18120   - Parrot_pcc_set_object(interp, signature, object);
18121   - }
18122   -
18123 18110 Parrot_pcc_reuse_continuation(interp, CURRENT_CONTEXT(interp), next);
18124 18111 dest = VTABLE_invoke(interp, method_pmc, next);
18125 18112 }
@@ -18145,9 +18132,6 @@ Parrot_callmethodcc_p_p(opcode_t *cur_opcode, PARROT_INTERP) {
18145 18132 PMC * signature = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
18146 18133
18147 18134 Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), next);
18148   - if ((!PMC_IS_NULL(signature))) {
18149   - Parrot_pcc_set_object(interp, signature, PREG(1));
18150   - }
18151 18135
18152 18136 Parrot_pcc_reuse_continuation(interp, CURRENT_CONTEXT(interp), next);
18153 18137 dest = VTABLE_invoke(interp, PREG(2), next);
@@ -18168,9 +18152,6 @@ Parrot_callmethod_p_s_p(opcode_t *cur_opcode, PARROT_INTERP) {
18168 18152 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)));
18169 18153 }
18170 18154 else {
18171   - if ((!PMC_IS_NULL(signature))) {
18172   - Parrot_pcc_set_object(interp, signature, object);
18173   - }
18174 18155
18175 18156 interp->current_cont = PREG(3);
18176 18157 dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next);
@@ -18193,9 +18174,6 @@ Parrot_callmethod_p_sc_p(opcode_t *cur_opcode, PARROT_INTERP) {
18193 18174 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)));
18194 18175 }
18195 18176 else {
18196   - if ((!PMC_IS_NULL(signature))) {
18197   - Parrot_pcc_set_object(interp, signature, object);
18198   - }
18199 18177
18200 18178 interp->current_cont = PREG(3);
18201 18179 dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next);
@@ -18213,9 +18191,6 @@ Parrot_callmethod_p_p_p(opcode_t *cur_opcode, PARROT_INTERP) {
18213 18191 PMC * signature = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
18214 18192
18215 18193 Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), next);
18216   - if ((!PMC_IS_NULL(signature))) {
18217   - Parrot_pcc_set_object(interp, signature, object);
18218   - }
18219 18194
18220 18195 interp->current_cont = PREG(3);
18221 18196 dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next);
@@ -18237,9 +18212,6 @@ Parrot_tailcallmethod_p_s(opcode_t *cur_opcode, PARROT_INTERP) {
18237 18212 else {
18238 18213 interp->current_cont = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp));
18239 18214 (PObj_get_FLAGS(interp->current_cont) |= SUB_FLAG_TAILCALL);
18240   - if ((!PMC_IS_NULL(signature))) {
18241   - Parrot_pcc_set_object(interp, signature, object);
18242   - }
18243 18215
18244 18216 dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next);
18245 18217 }
@@ -18262,9 +18234,6 @@ Parrot_tailcallmethod_p_sc(opcode_t *cur_opcode, PARROT_INTERP) {
18262 18234 else {
18263 18235 interp->current_cont = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp));
18264 18236 (PObj_get_FLAGS(interp->current_cont) |= SUB_FLAG_TAILCALL);
18265   - if ((!PMC_IS_NULL(signature))) {
18266   - Parrot_pcc_set_object(interp, signature, object);
18267   - }
18268 18237
18269 18238 dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next);
18270 18239 }
@@ -18282,9 +18251,6 @@ Parrot_tailcallmethod_p_p(opcode_t *cur_opcode, PARROT_INTERP) {
18282 18251
18283 18252 interp->current_cont = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp));
18284 18253 (PObj_get_FLAGS(interp->current_cont) |= SUB_FLAG_TAILCALL);
18285   - if ((!PMC_IS_NULL(signature))) {
18286   - Parrot_pcc_set_object(interp, signature, object);
18287   - }
18288 18254
18289 18255 dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next);
18290 18256 return (opcode_t *)dest;
@@ -24046,9 +24012,6 @@ Parrot_invokecc_p_p(opcode_t *cur_opcode, PARROT_INTERP) {
24046 24012 PMC * const signature = PREG(2);
24047 24013
24048 24014 Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), dest);
24049   - if ((!PMC_IS_NULL(signature))) {
24050   - Parrot_pcc_set_object(interp, signature, NULL);
24051   - }
24052 24015
24053 24016 Parrot_pcc_reuse_continuation(interp, CURRENT_CONTEXT(interp), dest);
24054 24017 dest = VTABLE_invoke(interp, p, dest);
2  src/ops/experimental.ops
@@ -296,8 +296,6 @@ inline op invokecc(invar PMC, invar PMC) :flow {
296 296
297 297 Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), dest);
298 298
299   - if (!PMC_IS_NULL(signature))
300   - Parrot_pcc_set_object(interp, signature, NULL);
301 299 Parrot_pcc_reuse_continuation(interp, CURRENT_CONTEXT(interp), dest);
302 300 dest = VTABLE_invoke(interp, p, dest);
303 301
13 src/ops/object.ops
@@ -60,9 +60,6 @@ op callmethodcc(invar PMC, in STR) :object_base :flow {
60 60 if (!PMC_IS_NULL(method_pmc)) {
61 61 PMC * const signature = Parrot_pcc_get_signature(interp,
62 62 CURRENT_CONTEXT(interp));
63   - if (!PMC_IS_NULL(signature))
64   - Parrot_pcc_set_object(interp, signature, object);
65   -
66 63 Parrot_pcc_reuse_continuation(interp, CURRENT_CONTEXT(interp), next);
67 64 dest = VTABLE_invoke(interp, method_pmc, next);
68 65 }
@@ -92,8 +89,6 @@ op callmethodcc(invar PMC, invar PMC) :object_base :flow {
92 89
93 90 Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), next);
94 91
95   - if (!PMC_IS_NULL(signature))
96   - Parrot_pcc_set_object(interp, signature, $1);
97 92 Parrot_pcc_reuse_continuation(interp, CURRENT_CONTEXT(interp), next);
98 93 dest = VTABLE_invoke(interp, $2, next);
99 94
@@ -118,8 +113,6 @@ op callmethod(invar PMC, in STR, invar PMC) :object_base :flow {
118 113 VTABLE_get_string(interp, VTABLE_get_class(interp, object)));
119 114 }
120 115 else {
121   - if (!PMC_IS_NULL(signature))
122   - Parrot_pcc_set_object(interp, signature, object);
123 116 interp->current_cont = $3;
124 117 dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next);
125 118 }
@@ -137,8 +130,6 @@ op callmethod(invar PMC, invar PMC, invar PMC) :object_base :flow {
137 130
138 131 Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), next);
139 132
140   - if (!PMC_IS_NULL(signature))
141   - Parrot_pcc_set_object(interp, signature, object);
142 133 interp->current_cont = $3;
143 134 dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next);
144 135 goto ADDRESS(dest);
@@ -162,8 +153,6 @@ op tailcallmethod(invar PMC, in STR) :object_base :flow {
162 153 else {
163 154 interp->current_cont = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp));
164 155 PObj_get_FLAGS(interp->current_cont) |= SUB_FLAG_TAILCALL;
165   - if (!PMC_IS_NULL(signature))
166   - Parrot_pcc_set_object(interp, signature, object);
167 156 dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next);
168 157 }
169 158 goto ADDRESS(dest);
@@ -181,8 +170,6 @@ op tailcallmethod(invar PMC, invar PMC) :object_base :flow {
181 170 interp->current_cont = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp));
182 171 PObj_get_FLAGS(interp->current_cont) |= SUB_FLAG_TAILCALL;
183 172
184   - if (!PMC_IS_NULL(signature))
185   - Parrot_pcc_set_object(interp, signature, object);
186 173 dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next);
187 174 goto ADDRESS(dest);
188 175 }
10 src/pmc/callcontext.pmc
@@ -519,7 +519,6 @@ pmclass CallContext provides array provides hash auto_attrs {
519 519 /* for now use a return continuation PMC */
520 520 ATTR PMC *handlers; /* local handlers for the context */
521 521 ATTR PMC *current_cont; /* the return continuation PMC */
522   - ATTR PMC *current_object; /* current object if a method call */
523 522 ATTR PMC *current_namespace; /* The namespace we're currently in */
524 523 ATTR opcode_t *current_pc; /* program counter of Sub invocation */
525 524 ATTR PMC *current_sig; /* temporary CallContext PMC for active call */
@@ -622,9 +621,6 @@ Mark any referenced strings and PMCs.
622 621 GET_ATTR_current_cont(INTERP, SELF, tmp);
623 622 Parrot_gc_mark_PMC_alive(INTERP, tmp);
624 623
625   - GET_ATTR_current_object(INTERP, SELF, tmp);
626   - Parrot_gc_mark_PMC_alive(INTERP, tmp);
627   -
628 624 GET_ATTR_current_namespace(INTERP, SELF, tmp);
629 625 Parrot_gc_mark_PMC_alive(INTERP, tmp);
630 626
@@ -950,10 +946,6 @@ return list of ExceptioHandlers
950 946
951 947 return current Continuation
952 948
953   -=item current_object
954   -
955   -return current Object (if in method call)
956   -
957 949 =item current_namespace
958 950
959 951 return current Namespace
@@ -984,8 +976,6 @@ return current Namespace
984 976 GET_ATTR_current_sub(INTERP, SELF, value);
985 977 else if (STRING_equal(INTERP, key, CONST_STRING(INTERP, "current_cont")))
986 978 GET_ATTR_current_cont(INTERP, SELF, value);
987   - else if (STRING_equal(INTERP, key, CONST_STRING(INTERP, "current_object")))
988   - GET_ATTR_current_object(INTERP, SELF, value);
989 979 else if (STRING_equal(INTERP, key, CONST_STRING(INTERP, "current_namespace")))
990 980 GET_ATTR_current_namespace(INTERP, SELF, value);
991 981 else if (STRING_equal(INTERP, key, CONST_STRING(INTERP, "handlers")))
1  src/pmc/coroutine.pmc
@@ -198,7 +198,6 @@ Swaps the "context".
198 198
199 199 Parrot_pcc_set_sub(INTERP, ctx, SELF);
200 200 Parrot_pcc_set_continuation(INTERP, ctx, ccont);
201   - Parrot_pcc_set_object(INTERP, ctx, PMCNULL);
202 201
203 202 INTERP->current_cont = PMCNULL;
204 203
4 src/pmc/sub.pmc
@@ -376,7 +376,6 @@ Invokes the subroutine.
376 376 VTABLE opcode_t *invoke(void *next) {
377 377 PMC * const caller_ctx = CURRENT_CONTEXT(INTERP);
378 378 PMC *ccont = INTERP->current_cont;
379   - PMC *object;
380 379
381 380 /* plain subroutine call
382 381 * create new context, place it in interpreter */
@@ -427,10 +426,7 @@ Invokes the subroutine.
427 426 Parrot_pcc_free_registers(INTERP, context);
428 427
429 428 Parrot_pcc_allocate_registers(INTERP, context, sub->n_regs_used);
430   - /* Preserve object */
431   - object = Parrot_pcc_get_object(INTERP, context);
432 429 Parrot_pcc_init_context(INTERP, context, caller_ctx);
433   - Parrot_pcc_set_object(INTERP, context, object);
434 430
435 431 Parrot_pcc_set_sub(INTERP, context, SELF);
436 432 Parrot_pcc_set_continuation(INTERP, context, ccont);
57 t/oo/objects.t
@@ -1592,55 +1592,54 @@ end:
1592 1592 # Foo54 and Bar54 have attribute accessor methods
1593 1593 new $P5, ['String'] # set attribute values
1594 1594 set $P5, "i" # attribute slots have reference semantics
1595   - set_args "0,0", $P5, "i"
  1595 + set_args "0,0,0", $P13, $P5, "i"
1596 1596 callmethodcc $P13, "Foo54__set"
1597 1597 get_results ""
1598 1598
1599 1599 new $P5, ['String']
1600 1600 set $P5, "j"
1601   - set_args "0,0", $P5, "j"
  1601 + set_args "0,0,0", $P13, $P5, "j"
1602 1602 callmethodcc $P13,"Foo54__set"
1603 1603 get_results ""
1604 1604
1605 1605 new $P5, ['String']
1606 1606 set $P5, "k"
1607   - set_args "0,0", $P5, "k"
  1607 + set_args "0,0,0", $P13, $P5, "k"
1608 1608 callmethodcc $P13,"Bar54__set"
1609 1609 get_results ""
1610 1610
1611 1611 new $P5, ['String']
1612 1612 set $P5, "l"
1613   - set_args "0,0", $P5, "l"
  1613 + set_args "0,0,0", $P13, $P5, "l"
1614 1614 callmethodcc $P13,"Bar54__set"
1615 1615 get_results ""
1616 1616
1617 1617 # now retrieve attributes
1618   - set_args "0", "i"
  1618 + set_args "0,0", $P13, "i"
1619 1619 callmethodcc $P13,"Foo54__get"
1620 1620 get_results "0", $P5
1621 1621 is( $P5, "i", 'got attrib i from Bar54->Foo54__get' )
1622 1622
1623   - set_args "0", "j"
  1623 + set_args "0,0", $P13, "j"
1624 1624 callmethodcc $P13,"Foo54__get"
1625 1625 get_results "0", $P5
1626 1626 is( $P5, "j", 'got attrib j from Bar54->Foo54__get' )
1627 1627
1628   - set_args "0", "k"
  1628 + set_args "0,0", $P13, "k"
1629 1629 callmethodcc $P13,"Bar54__get"
1630 1630 get_results "0", $P5
1631 1631 is( $P5, "k", 'got attrib k from Bar54->Bar54__get' )
1632 1632
1633   - set_args "0", "l"
1634   - callmethodcc $P13,"Bar54__get"
  1633 + set_args "0,0", $P13, "l"
  1634 + callmethodcc $P13, "Bar54__get"
1635 1635 get_results "0", $P5
1636 1636 is( $P5, "l", 'got attrib l from Bar54->Bar54__get' )
1637 1637 .end
1638 1638
1639 1639 # set(obj: Pvalue, Iattr_idx)
1640 1640 .sub Foo54__set
1641   - get_params "0,0", $P5, $S4
  1641 + get_params "0,0,0", $P2, $P5, $S4
1642 1642 ok( 1, "in Foo54__set" )
1643   - interpinfo $P2, .INTERPINFO_CURRENT_OBJECT
1644 1643 setattribute $P2, $S4, $P5
1645 1644 set_returns ""
1646 1645 returncc
@@ -1648,17 +1647,15 @@ end:
1648 1647
1649 1648 # Pattr = get(obj: Iattr_idx)
1650 1649 .sub Foo54__get
1651   - get_params "0", $S4
  1650 + get_params "0,0", $P2, $S4
1652 1651 ok( 1, "in Foo54__get" )
1653   - interpinfo $P2, .INTERPINFO_CURRENT_OBJECT
1654 1652 getattribute $P5, $P2, $S4
1655 1653 set_returns "0", $P5
1656 1654 returncc
1657 1655 .end
1658 1656
1659 1657 .sub Bar54__set
1660   - get_params "0,0", $P5, $S4
1661   - interpinfo $P2, .INTERPINFO_CURRENT_OBJECT
  1658 + get_params "0,0,0", $P2, $P5, $S4
1662 1659 ok( 1, "in Bar54__set" )
1663 1660 setattribute $P2, $S4, $P5
1664 1661 set_returns ""
@@ -1666,9 +1663,8 @@ end:
1666 1663 .end
1667 1664
1668 1665 .sub Bar54__get
1669   - get_params "0", $S4
  1666 + get_params "0,0", $P2, $S4
1670 1667 ok( 1, "in Bar54__get" )
1671   - interpinfo $P2, .INTERPINFO_CURRENT_OBJECT
1672 1668 getattribute $P5, $P2, $S4
1673 1669 set_returns "0", $P5
1674 1670 returncc
@@ -1702,51 +1698,51 @@ end:
1702 1698 # Foo56 and Bar56 have attribute accessor methods
1703 1699 new $P5, ['String'] # set attribute values
1704 1700 set $P5, "i" # attribute slots have reference semantics
1705   - set_args "0,0,0", $P5, "Foo56", "i"
  1701 + set_args "0,0,0,0", $P2, $P5, "Foo56", "i"
1706 1702 callmethodcc $P2, "set"
1707 1703
1708 1704 new $P5, ['String']
1709 1705 set $P5, "j"
1710   - set_args "0,0,0", $P5, "Foo56", "j"
  1706 + set_args "0,0,0,0", $P2, $P5, "Foo56", "j"
1711 1707 callmethodcc $P2, "set"
1712 1708
1713 1709 new $P5, ['String']
1714 1710 set $P5, "k"
1715   - set_args "0,0,0", $P5, "Bar56", "k"
  1711 + set_args "0,0,0,0", $P2, $P5, "Bar56", "k"
1716 1712 callmethodcc $P2, "set"
1717 1713
1718 1714 new $P5, ['String']
1719 1715 set $P5, "l"
1720   - set_args "0,0,0", $P5, "Bar56", "l"
  1716 + set_args "0,0,0,0", $P2, $P5, "Bar56", "l"
1721 1717 callmethodcc $P2, "set"
1722 1718
1723 1719 new $P5, ['String']
1724 1720 set $P5, "m"
1725   - set_args "0,0,0", $P5, "Bar56", "m"
  1721 + set_args "0,0,0,0", $P2, $P5, "Bar56", "m"
1726 1722 callmethodcc $P2, "set"
1727 1723
1728 1724 # now retrieve attributes
1729   - set_args "0,0", "Foo56", "i"
  1725 + set_args "0,0,0", $P2, "Foo56", "i"
1730 1726 callmethodcc $P2, "get"
1731 1727 get_results "0", $P5
1732 1728 is( $P5, 'i', 'got attrib i from subclass through parent method' )
1733 1729
1734   - set_args "0,0", "Foo56", "j"
  1730 + set_args "0,0,0", $P2, "Foo56", "j"
1735 1731 callmethodcc $P2, "get"
1736 1732 get_results "0", $P5
1737 1733 is( $P5, "j", 'got attrib i from subclass through parent method' )
1738 1734
1739   - set_args "0,0", "Bar56", "k"
  1735 + set_args "0,0,0", $P2, "Bar56", "k"
1740 1736 callmethodcc $P2, "get"
1741 1737 get_results "0", $P5
1742 1738 is( $P5, "k", 'got attrib i from subclass through parent method' )
1743 1739
1744   - set_args "0,0", "Bar56", "l"
  1740 + set_args "0,0,0", $P2, "Bar56", "l"
1745 1741 callmethodcc $P2, "get"
1746 1742 get_results "0", $P5
1747 1743 is( $P5, "l", 'got attrib i from subclass through parent method' )
1748 1744
1749   - set_args "0,0", "Bar56", "m"
  1745 + set_args "0,0,0", $P2, "Bar56", "m"
1750 1746 callmethodcc $P2, "get"
1751 1747 get_results "0", $P5
1752 1748 is( $P5, "m", 'got attrib i from subclass through parent method' )
@@ -1757,8 +1753,7 @@ end:
1757 1753
1758 1754 # set(obj: Pvalue, SClass, Sattr)
1759 1755 .sub set
1760   - get_params "0,0,0", $P5, $S4, $S5
1761   - interpinfo $P2, .INTERPINFO_CURRENT_OBJECT
  1756 + get_params "0,0,0,0", $P2, $P5, $S4, $S5
1762 1757 setattribute $P2, $S5, $P5
1763 1758 set_returns ""
1764 1759 returncc
@@ -1766,14 +1761,12 @@ end:
1766 1761
1767 1762 # Pattr = get(obj: SClass, Sattr)
1768 1763 .sub get
1769   - get_params "0,0", $S4, $S5
1770   - interpinfo $P2, .INTERPINFO_CURRENT_OBJECT
  1764 + get_params "0,0,0", $P2, $S4, $S5
1771 1765 getattribute $P5, $P2, $S5
1772 1766 set_returns "0", $P5
1773 1767 returncc
1774 1768 .end
1775 1769
1776   -
1777 1770 # Local Variables:
1778 1771 # mode: pir
1779 1772 # fill-column: 100
6 t/pmc/context.t
@@ -22,7 +22,7 @@ TODO: Implement real tests when CallContext PMC will be migrated to use ATTRibut
22 22 .sub main :main
23 23 .include 'test_more.pir'
24 24
25   - plan(20)
  25 + plan(19)
26 26
27 27 test_new()
28 28
@@ -87,10 +87,6 @@ TODO: Implement real tests when CallContext PMC will be migrated to use ATTRibut
87 87 $I0 = isa $P0, 'Continuation'
88 88 ok($I0, 'Got CallContext.current_cont')
89 89
90   - $P0 = getattribute ctx, 'current_object'
91   - $I0 = isa $P0, 'Foo'
92   - ok($I0, 'Got CallContext.current_object')
93   -
94 90 $P0 = getattribute ctx, 'current_namespace'
95 91 ok($P0, 'Got CallContext.current_namespace')
96 92 $P1 = $P0['test_inspect']
26 t/pmc/object-meths.t
@@ -5,7 +5,7 @@ use strict;
5 5 use warnings;
6 6 use lib qw( . lib ../lib ../../lib );
7 7 use Test::More;
8   -use Parrot::Test tests => 39;
  8 +use Parrot::Test tests => 38;
9 9
10 10 =head1 NAME
11 11
@@ -648,30 +648,6 @@ CODE
648 648 ok
649 649 OUTPUT
650 650
651   -pir_output_is( <<'CODE', <<'OUTPUT', "self - CURRENT_OBJECT" );
652   -
653   -.sub _main :main
654   - .local pmc A
655   -
656   - newclass A, "A"
657   - new A, ['A']
658   - A."foo"()
659   - end
660   -.end
661   -
662   -.namespace ["A"]
663   -
664   -.sub foo :method
665   - .include "interpinfo.pasm"
666   - $P0 = interpinfo .INTERPINFO_CURRENT_OBJECT
667   - eq_addr self, $P0, ok
668   - print "not "
669   -ok: print "ok\n"
670   -.end
671   -CODE
672   -ok
673   -OUTPUT
674   -
675 651 pir_output_is( <<'CODE', <<'OUTPUT', "Bug in method calling with nonconst keys" );
676 652
677 653 .sub _main :main

0 comments on commit 5c81f3e

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