[svn:parrot] r47859 - in branches/dynop_mapping: include/parrot src

plobsing at svn.parrot.org plobsing at svn.parrot.org
Sat Jun 26 08:46:20 UTC 2010


Author: plobsing
Date: Sat Jun 26 08:46:19 2010
New Revision: 47859
URL: https://trac.parrot.org/parrot/changeset/47859

Log:
decode ops for proper pbc_disassemble

Modified:
   branches/dynop_mapping/include/parrot/call.h
   branches/dynop_mapping/include/parrot/op.h
   branches/dynop_mapping/src/debug.c

Modified: branches/dynop_mapping/include/parrot/call.h
==============================================================================
--- branches/dynop_mapping/include/parrot/call.h	Sat Jun 26 07:22:54 2010	(r47858)
+++ branches/dynop_mapping/include/parrot/call.h	Sat Jun 26 08:46:19 2010	(r47859)
@@ -318,12 +318,11 @@
     PARROT_ASSERT((sig)->vtable->base_type == enum_class_FixedIntegerArray); \
 } while (0)
 
-/* XXX Remove interp from this */
 #define ADD_OP_VAR_PART(interp, seg, pc, n) do { \
-    if (*(pc) == PARROT_OP_set_args_pc       \
-    ||  *(pc) == PARROT_OP_get_results_pc    \
-    ||  *(pc) == PARROT_OP_get_params_pc     \
-    ||  *(pc) == PARROT_OP_set_returns_pc) { \
+    if (OPCODE_IS((interp), (seg), *(pc), PARROT_OP_set_args_pc)       \
+    ||  OPCODE_IS((interp), (seg), *(pc), PARROT_OP_get_results_pc)    \
+    ||  OPCODE_IS((interp), (seg), *(pc), PARROT_OP_get_params_pc)     \
+    ||  OPCODE_IS((interp), (seg), *(pc), PARROT_OP_set_returns_pc)) { \
         PMC * const sig = (seg)->const_table->constants[(pc)[1]]->u.key; \
         (n) += VTABLE_elements((interp), sig); \
     } \

Modified: branches/dynop_mapping/include/parrot/op.h
==============================================================================
--- branches/dynop_mapping/include/parrot/op.h	Sat Jun 26 07:22:54 2010	(r47858)
+++ branches/dynop_mapping/include/parrot/op.h	Sat Jun 26 08:46:19 2010	(r47859)
@@ -78,6 +78,8 @@
     struct op_lib_t *lib;
 } op_info_t;
 
+#define OPCODE_IS(interp, seg, opnum, global_opnum) \
+    ((seg)->op_func_table[(opnum)] == (interp)->op_func_table[(global_opnum)])
 
 #endif /* PARROT_OP_H_GUARD */
 

Modified: branches/dynop_mapping/src/debug.c
==============================================================================
--- branches/dynop_mapping/src/debug.c	Sat Jun 26 07:22:54 2010	(r47858)
+++ branches/dynop_mapping/src/debug.c	Sat Jun 26 08:46:19 2010	(r47859)
@@ -2452,13 +2452,15 @@
        one fixed parameter (the signature vector), plus a varying number of
        registers/constants.  For each arg/return, we show the register and its
        flags using PIR syntax. */
-    if (*(op) == PARROT_OP_set_args_pc || *(op) == PARROT_OP_set_returns_pc)
+    if (OPCODE_IS(interp, interp->code, *(op), PARROT_OP_set_args_pc)
+    ||  OPCODE_IS(interp, interp->code, *(op), PARROT_OP_set_returns_pc))
         specialop = 1;
 
     /* if it's a retrieving op, specialop = 2, so that later a :flat flag
      * can be changed into a :slurpy flag. See flag handling below.
      */
-    if (*(op) == PARROT_OP_get_results_pc || *(op) == PARROT_OP_get_params_pc)
+    if (OPCODE_IS(interp, interp->code, *(op), PARROT_OP_get_results_pc)
+    ||  OPCODE_IS(interp, interp->code, *(op), PARROT_OP_get_params_pc))
         specialop = 2;
 
     if (specialop > 0) {


More information about the parrot-commits mailing list