[svn:parrot] r44212 - trunk/src/pmc
NotFound at svn.parrot.org
NotFound at svn.parrot.org
Sat Feb 20 00:13:11 UTC 2010
Author: NotFound
Date: Sat Feb 20 00:13:09 2010
New Revision: 44212
URL: https://trac.parrot.org/parrot/changeset/44212
Log:
replace op_count method in opcode pmc with vtable elements and add get_integer_keyed_int to get argument types
Modified:
trunk/src/pmc/opcode.pmc
Modified: trunk/src/pmc/opcode.pmc
==============================================================================
--- trunk/src/pmc/opcode.pmc Fri Feb 19 23:20:28 2010 (r44211)
+++ trunk/src/pmc/opcode.pmc Sat Feb 20 00:13:09 2010 (r44212)
@@ -81,10 +81,19 @@
return attrs->full_name_cache;
}
- METHOD op_count() {
+ VTABLE INTVAL elements() {
Parrot_Opcode_attributes * const attrs = PARROT_OPCODE(SELF);
- INTVAL count = attrs->info->op_count;
- RETURN(INTVAL count);
+ if (!attrs->info)
+ return -1;
+ return attrs->info->op_count - 1;
+ }
+
+ VTABLE INTVAL get_integer_keyed_int(INTVAL i) {
+ Parrot_Opcode_attributes * const attrs = PARROT_OPCODE(SELF);
+ INTVAL type = i < attrs->info->op_count - 1 ?
+ attrs->info->types[i] :
+ -1;
+ return type;
}
}
More information about the parrot-commits
mailing list