Project

General

Profile

Actions

Backport #8014

closed

Add missing node types to ObjectSpace.count_nodes

Added by tmm1 (Aman Karmani) about 11 years ago. Updated about 11 years ago.

Status:
Closed
[ruby-core:53130]

Description

diff --git a/ext/objspace/objspace.c b/ext/objspace/objspace.c
index b8f524c..5857327 100644
--- a/ext/objspace/objspace.c
+++ b/ext/objspace/objspace.c
@@ -469,6 +469,7 @@ count_nodes(int argc, VALUE *argv, VALUE os)
COUNT_NODE(NODE_OP_ASGN2);
COUNT_NODE(NODE_OP_ASGN_AND);
COUNT_NODE(NODE_OP_ASGN_OR);

  •   COUNT_NODE(NODE_OP_CDECL);
      COUNT_NODE(NODE_CALL);
      COUNT_NODE(NODE_FCALL);
      COUNT_NODE(NODE_VCALL);
    

@@ -502,6 +503,7 @@ count_nodes(int argc, VALUE *argv, VALUE os)
COUNT_NODE(NODE_ARGS);
COUNT_NODE(NODE_ARGS_AUX);
COUNT_NODE(NODE_OPT_ARG);

  •   COUNT_NODE(NODE_KW_ARG);
      COUNT_NODE(NODE_POSTARG);
      COUNT_NODE(NODE_ARGSCAT);
      COUNT_NODE(NODE_ARGSPUSH);
    

@@ -519,6 +521,7 @@ count_nodes(int argc, VALUE *argv, VALUE os)
COUNT_NODE(NODE_SCLASS);
COUNT_NODE(NODE_COLON2);
COUNT_NODE(NODE_COLON3);

  •   COUNT_NODE(NODE_CREF);
      COUNT_NODE(NODE_DOT2);
      COUNT_NODE(NODE_DOT3);
      COUNT_NODE(NODE_FLIP2);
    

@@ -539,7 +542,7 @@ count_nodes(int argc, VALUE *argv, VALUE os)
COUNT_NODE(NODE_PRELUDE);
COUNT_NODE(NODE_LAMBDA);
#undef COUNT_NODE

  •     default: node = INT2FIX(nodes[i]);
    
  •     default: node = INT2FIX(i);
      }
      rb_hash_aset(hash, node, SIZET2NUM(nodes[i]));
    
    }
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0