Author: petdance
Date: Thu May 31 21:16:13 2007
New Revision: 18715
Modified:
trunk/src/headers.c
trunk/src/interpreter.c
trunk/src/utils.c
Log:
more exciting consting, and some localizing, and I even removed some unused
variables
Modified: trunk/src/headers.c
==============================================================================
--- trunk/src/headers.c (original)
+++ trunk/src/headers.c Thu May 31 21:16:13 2007
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2001-2003, The Perl Foundation.
+Copyright (C) 2001-2007, The Perl Foundation.
$Id$
=head1 NAME
@@ -48,7 +48,7 @@
static void *
get_free_buffer(Interp *interp, Small_Object_Pool *pool)
{
- PObj *buffer = (PObj *)pool->get_free_object(interp, pool);
+ PObj * const buffer = (PObj *)pool->get_free_object(interp, pool);
/* don't mess around with flags */
PObj_bufstart(buffer) = NULL;
@@ -78,8 +78,8 @@
Small_Object_Pool * new_pmc_pool(Interp *interp)
{
- int num_headers = PMC_HEADERS_PER_ALLOC;
- Small_Object_Pool *pmc_pool =
+ const int num_headers = PMC_HEADERS_PER_ALLOC;
+ Small_Object_Pool * const pmc_pool =
new_small_object_pool(interp, sizeof (PMC), num_headers);
pmc_pool->mem_pool = NULL;
@@ -103,10 +103,10 @@
new_bufferlike_pool(Interp *interp,
size_t actual_buffer_size)
{
- int num_headers = BUFFER_HEADERS_PER_ALLOC;
- size_t buffer_size =
+ const int num_headers = BUFFER_HEADERS_PER_ALLOC;
+ const size_t buffer_size =
(actual_buffer_size + sizeof (void *) - 1) & ~(sizeof (void *) -
1);
- Small_Object_Pool *pool =
+ Small_Object_Pool * const pool =
new_small_object_pool(interp, buffer_size, num_headers);
pool->mem_pool = interp->arena_base->memory_pool;
@@ -170,16 +170,15 @@
Small_Object_Pool *
make_bufferlike_pool(Interp *interp, size_t buffer_size)
{
- UINTVAL idx;
- UINTVAL num_old = interp->arena_base->num_sized;
+ const UINTVAL num_old = interp->arena_base->num_sized;
Small_Object_Pool **sized_pools =
interp->arena_base->sized_header_pools;
- idx = (buffer_size - sizeof (Buffer)) / sizeof (void *);
+ const UINTVAL idx = (buffer_size - sizeof (Buffer)) / sizeof (void *);
/* Expand the array of sized resource pools, if necessary */
if (num_old <= idx) {
- UINTVAL num_new = idx + 1;
+ const UINTVAL num_new = idx + 1;
sized_pools = (Small_Object_Pool **)mem_internal_realloc(sized_pools,
num_new * sizeof (void *));
memset(sized_pools + num_old, 0, sizeof (void *) * (num_new -
num_old));
@@ -209,7 +208,7 @@
Small_Object_Pool *
get_bufferlike_pool(Interp *interp, size_t buffer_size)
{
- Small_Object_Pool **sized_pools =
+ Small_Object_Pool ** const sized_pools =
interp->arena_base->sized_header_pools;
return sized_pools[ (buffer_size - sizeof (Buffer)) / sizeof (void *) ];
@@ -231,13 +230,12 @@
PMC *
new_pmc_header(Interp *interp, UINTVAL flags)
{
- Small_Object_Pool *pool;
- PMC *pmc;
+ Small_Object_Pool * const pool =
+ flags & PObj_constant_FLAG
+ ? interp->arena_base->constant_pmc_pool
+ : interp->arena_base->pmc_pool;
+ PMC * const pmc = (PMC *)pool->get_free_object(interp, pool);
- pool = flags & PObj_constant_FLAG ?
- interp->arena_base->constant_pmc_pool :
- interp->arena_base->pmc_pool;
- pmc = (PMC *)pool->get_free_object(interp, pool);
/* clear flags, set is_PMC_FLAG */
if (flags & PObj_is_PMC_EXT_FLAG) {
flags |= PObj_is_special_PMC_FLAG;
@@ -270,7 +268,7 @@
static PMC_EXT *
new_pmc_ext(Interp *interp)
{
- Small_Object_Pool *pool = interp->arena_base->pmc_ext_pool;
+ Small_Object_Pool * const pool = interp->arena_base->pmc_ext_pool;
PMC_EXT *ptr;
/*
* can't use normal get_free_object--PMC_EXT doesn't have flags
@@ -347,9 +345,9 @@
STRING *
new_string_header(Interp *interp, UINTVAL flags)
{
- STRING *string = (STRING *)get_free_buffer(interp, (flags &
PObj_constant_FLAG)
- ? interp->arena_base->constant_string_header_pool :
- interp->arena_base->string_header_pool);
+ STRING * const string = (STRING *)get_free_buffer(interp, (flags &
PObj_constant_FLAG)
+ ? interp->arena_base->constant_string_header_pool
+ : interp->arena_base->string_header_pool);
PObj_get_FLAGS(string) |= flags | PObj_is_string_FLAG|PObj_is_COWable_FLAG;
SET_NULL(string->strstart);
return string;
@@ -388,9 +386,7 @@
void *
new_bufferlike_header(Interp *interp, size_t size)
{
- Small_Object_Pool *pool;
-
- pool = get_bufferlike_pool(interp, size);
+ Small_Object_Pool * const pool = get_bufferlike_pool(interp, size);
return get_free_buffer(interp, pool);
}
@@ -411,7 +407,7 @@
{
UINTVAL i;
size_t max = 0;
- Arenas *arena_base = interp->arena_base;
+ Arenas * const arena_base = interp->arena_base;
for (i = 0; i < arena_base->num_sized; i++) {
if (arena_base->sized_header_pools[i]) {
@@ -438,7 +434,7 @@
get_min_buffer_address(Interp *interp)
{
UINTVAL i;
- Arenas *arena_base = interp->arena_base;
+ Arenas * const arena_base = interp->arena_base;
size_t min = (size_t) -1;
for (i = 0; i < arena_base->num_sized; i++) {
@@ -545,9 +541,8 @@
void
Parrot_initialize_header_pools(Interp *interp)
{
- Arenas *arena_base;
+ Arenas * const arena_base = interp->arena_base;
- arena_base = interp->arena_base;
/* Init the constant string header pool */
arena_base->constant_string_header_pool = new_string_pool(interp, 1);
arena_base->constant_string_header_pool->name = "constant_string_header";
@@ -627,25 +622,22 @@
Parrot_forall_header_pools(Interp *interp, int flag, void *arg,
pool_iter_fn func)
{
- Small_Object_Pool *pool;
- Arenas *arena_base;
- int ret_val, i;
-
- arena_base = interp->arena_base;
+ Arenas * const arena_base = interp->arena_base;
+ int i;
if ((flag & (POOL_PMC | POOL_CONST)) == (POOL_PMC | POOL_CONST)) {
- ret_val = (func)(interp, arena_base->constant_pmc_pool,
+ const int ret_val = (func)(interp, arena_base->constant_pmc_pool,
POOL_PMC | POOL_CONST, arg);
if (ret_val)
return ret_val;
}
if (flag & POOL_PMC) {
- ret_val = (func)(interp, arena_base->pmc_pool, POOL_PMC, arg);
+ const int ret_val = (func)(interp, arena_base->pmc_pool, POOL_PMC,
arg);
if (ret_val)
return ret_val;
}
if ((flag & (POOL_BUFFER | POOL_CONST)) == (POOL_BUFFER | POOL_CONST)) {
- ret_val = (func)(interp, arena_base->constant_string_header_pool,
+ const int ret_val = (func)(interp,
arena_base->constant_string_header_pool,
POOL_BUFFER | POOL_CONST, arg);
if (ret_val)
return ret_val;
@@ -653,12 +645,12 @@
if (!(flag & POOL_BUFFER))
return 0;
for (i = 0; i < (INTVAL)interp->arena_base->num_sized; i++) {
- pool = arena_base->sized_header_pools[i];
- if (!pool)
- continue;
- ret_val = (func)(interp, pool, POOL_BUFFER, arg);
- if (ret_val)
- return ret_val;
+ Small_Object_Pool * const pool = arena_base->sized_header_pools[i];
+ if (pool) {
+ const int ret_val = (func)(interp, pool, POOL_BUFFER, arg);
+ if (ret_val)
+ return ret_val;
+ }
}
return 0;
}
@@ -677,9 +669,10 @@
static void
free_pool(Interp *interp, Small_Object_Pool *pool)
{
- Small_Object_Arena *cur_arena, *next;
+ Small_Object_Arena *cur_arena;
+
for (cur_arena = pool->last_Arena; cur_arena;) {
- next = cur_arena->prev;
+ Small_Object_Arena * const next = cur_arena->prev;
mem_internal_free(cur_arena->start_objects);
mem_internal_free(cur_arena);
cur_arena = next;
@@ -691,9 +684,9 @@
sweep_cb_buf(Interp *interp, Small_Object_Pool *pool, int flag,
void *arg)
{
- int pass = (int)(INTVAL)arg;
-
#ifdef GC_IS_MALLOC
+ const int pass = (int)(INTVAL)arg;
+
if (pass == 0)
clear_cow(interp, pool, 1);
else if (pass == 1)
@@ -759,19 +752,18 @@
static void fix_pmc_syncs(Interp *dest_interp, Small_Object_Pool *pool) {
/* XXX largely copied from dod_sweep */
Small_Object_Arena *cur_arena;
- UINTVAL object_size = pool->object_size;
- size_t i;
- size_t nm;
- for (cur_arena = pool->last_Arena;
- NULL != cur_arena; cur_arena = cur_arena->prev) {
+ const UINTVAL object_size = pool->object_size;
+
+ for (cur_arena = pool->last_Arena; cur_arena; cur_arena = cur_arena->prev)
{
Buffer *b = (Buffer *)cur_arena->start_objects;
+ size_t i;
- for (i = nm = 0; i < cur_arena->used; i++) {
+ for (i = 0; i < cur_arena->used; i++) {
if (PObj_on_free_list_TEST(b))
; /* if it's on free list, do nothing */
else {
if (PObj_is_PMC_TEST(b)) {
- PMC *p = (PMC *)b;
+ PMC * const p = (PMC *)b;
if (PObj_is_PMC_shared_TEST(p)) {
PMC_sync(p)->owner = dest_interp;
}
@@ -791,12 +783,10 @@
void
Parrot_merge_header_pools(Interp *dest_interp, Interp *source_interp) {
- Arenas *dest_arena;
- Arenas *source_arena;
UINTVAL i;
- dest_arena = dest_interp->arena_base;
- source_arena = source_interp->arena_base;
+ Arenas * const dest_arena = dest_interp->arena_base;
+ Arenas * const source_arena = source_interp->arena_base;
/* heavily borrowed from forall_header_pools */
Modified: trunk/src/interpreter.c
==============================================================================
--- trunk/src/interpreter.c (original)
+++ trunk/src/interpreter.c Thu May 31 21:16:13 2007
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2001-2006, The Perl Foundation.
+Copyright (C) 2001-2007, The Perl Foundation.
$Id$
=head1 NAME
@@ -70,22 +70,23 @@
prederef_args(void **pc_prederef, Interp *interp,
opcode_t *pc, op_info_t *opinfo)
{
- PackFile_ConstTable * const_table = interp->code->const_table;
- int i, n, m, regs_n, regs_i, regs_p, regs_s;
- PMC *sig = NULL;
-
- regs_n = CONTEXT(interp->ctx)->n_regs_used[REGNO_NUM];
- regs_i = CONTEXT(interp->ctx)->n_regs_used[REGNO_INT];
- regs_p = CONTEXT(interp->ctx)->n_regs_used[REGNO_PMC];
- regs_s = CONTEXT(interp->ctx)->n_regs_used[REGNO_STR];
+ const PackFile_ConstTable * const const_table = interp->code->const_table;
+
+ const int regs_n = CONTEXT(interp->ctx)->n_regs_used[REGNO_NUM];
+ const int regs_i = CONTEXT(interp->ctx)->n_regs_used[REGNO_INT];
+ const int regs_p = CONTEXT(interp->ctx)->n_regs_used[REGNO_PMC];
+ const int regs_s = CONTEXT(interp->ctx)->n_regs_used[REGNO_STR];
/* prederef var part too */
- n = m = opinfo->op_count;
+ const int m = opinfo->op_count;
+ int n = opinfo->op_count;
+ int i;
+
ADD_OP_VAR_PART(interp, interp->code, pc, n);
for (i = 1; i < n; i++) {
opcode_t arg = pc[i];
int type;
if (i >= m) {
- sig = (PMC*) pc_prederef[1];
+ PMC * const sig = (PMC*) pc_prederef[1];
type = SIG_ITEM(sig, i - m);
type &= (PARROT_ARG_TYPE_MASK | PARROT_ARG_CONSTANT);
}
@@ -168,9 +169,9 @@
void
do_prederef(void **pc_prederef, Parrot_Interp interp, int type)
{
- size_t offset = pc_prederef - interp->code->prederef.code;
- opcode_t *pc = ((opcode_t *)interp->code->base.data) + offset;
- op_func_t *prederef_op_func = interp->op_lib->op_func_table;
+ const size_t offset = pc_prederef - interp->code->prederef.code;
+ opcode_t * const pc = ((opcode_t *)interp->code->base.data) + offset;
+ op_func_t * const prederef_op_func = interp->op_lib->op_func_table;
op_info_t *opinfo;
size_t n;
@@ -198,7 +199,7 @@
opinfo->types[n - 2] == PARROT_ARG_IC &&
pc[n - 1] < 0) || /* relative backward branch */
(opinfo->jump & PARROT_JUMP_ADDRESS)) {
- Prederef *pi = &interp->code->prederef;
+ Prederef * const pi = &interp->code->prederef;
/*
* first time prederef.branches == NULL:
* estimate size to 1/16th of opcodes
@@ -243,13 +244,13 @@
static void
turn_ev_check(Parrot_Interp interp, int on)
{
- Prederef *pi = &interp->code->prederef;
- size_t i, offs;
+ const Prederef * const pi = &interp->code->prederef;
+ size_t i;
if (!pi->branches)
return;
for (i = 0; i < pi->n_branches; ++i) {
- offs = pi->branches[i].offs;
+ const size_t offs = pi->branches[i].offs;
if (on) {
interp->code->prederef.code[offs] =
((void **)interp->op_lib->op_func_table)
@@ -281,8 +282,8 @@
static oplib_init_f
get_op_lib_init(int core_op, int which, PMC *lib)
{
- oplib_init_f init_func = (oplib_init_f)NULL;
if (core_op) {
+ oplib_init_f init_func;
switch (which) {
case PARROT_SWITCH_CORE:
case PARROT_SWITCH_JIT_CORE:
@@ -303,9 +304,10 @@
case PARROT_FAST_CORE: /* normal func core */
init_func = PARROT_CORE_OPLIB_INIT;
break;
+ default:
+ internal_exception(1, "Couldn't find init_func for core %d",
which);
+ break;
}
- if (!init_func)
- internal_exception(1, "Couldn't find init_func for core %d",
which);
return init_func;
}
return (oplib_init_f) D2FPTR(PMC_struct_val(lib));
@@ -325,7 +327,7 @@
static void
load_prederef(Interp *interp, int which)
{
- oplib_init_f init_func = get_op_lib_init(1, which, NULL);
+ const oplib_init_f init_func = get_op_lib_init(1, which, NULL);
int (*get_op)(const char * name, int full);
get_op = interp->op_lib->op_code;
@@ -354,11 +356,10 @@
{
load_prederef(interp, which);
if (!interp->code->prederef.code) {
- size_t N = interp->code->base.size;
+ const size_t N = interp->code->base.size;
opcode_t *pc = interp->code->base.data;
- size_t i, n, n_pics;
+ size_t i, n_pics;
void *pred_func;
- op_info_t *opinfo;
/* Parrot_memalign_if_possible in OpenBSD allocates 256 if you ask for 312
-- Need to verify this, it may have been a bug elsewhere. If it works now,
we can remove the mem_sys_allocate_zeroed line below. */
@@ -380,7 +381,9 @@
pred_func = ((void **)
interp->op_lib->op_func_table)[CORE_OPS_prederef__];
for (i = n_pics = 0; i < N;) {
- opinfo = &interp->op_info_table[*pc];
+ op_info_t * const opinfo = &interp->op_info_table[*pc];
+ size_t n;
+
temp[i] = pred_func;
n = opinfo->op_count;
ADD_OP_VAR_PART(interp, interp->code, pc, n);
@@ -447,9 +450,9 @@
load_prederef(interp, PARROT_CGP_CORE);
if (!interp->code->prederef.code) {
- size_t N = interp->code->base.size;
+ size_t N = interp->code->base.size; /* XXX Unused */
void **temp = (void **)prederef_arena;
- opcode_t *pc = interp->code->base.data;
+ opcode_t *pc = interp->code->base.data; /* XXX unused */
interp->code->prederef.code = temp;
/* TODO */
@@ -660,7 +663,7 @@
static opcode_t *
runops_switch(Interp *interp, opcode_t *pc)
{
- opcode_t *code_start = (opcode_t *)interp->code->base.data;
+ opcode_t * const code_start = (opcode_t *)interp->code->base.data;
void **pc_prederef;
init_prederef(interp, PARROT_SWITCH_CORE);
pc_prederef = interp->code->prederef.code + (pc - code_start);
@@ -803,9 +806,9 @@
void
Parrot_setup_event_func_ptrs(Parrot_Interp interp)
{
- size_t i, n = interp->op_count;
- oplib_init_f init_func = get_op_lib_init(1, interp->run_core, NULL);
- op_lib_t *lib = init_func(1);
+ const size_t n = interp->op_count;
+ const oplib_init_f init_func = get_op_lib_init(1, interp->run_core, NULL);
+ op_lib_t * const lib = init_func(1);
/*
* remember op_func_table
*/
@@ -814,6 +817,8 @@
return;
/* function or CG core - prepare func_table */
if (!interp->evc_func_table) {
+ size_t i;
+
interp->evc_func_table = (op_func_t *)mem_sys_allocate(
sizeof (op_func_t) * n);
for (i = 0; i < n; ++i)
@@ -976,7 +981,7 @@
{
op_lib_t *cg_lib, *new_lib;
op_func_t *ops_addr = NULL;
- size_t i, n_tot;
+ size_t n_tot;
#if 0
/* related to CG and CGP ops issue below */
STRING *op_variant;
@@ -992,6 +997,8 @@
n_tot * sizeof (op_func_t));
}
else {
+ size_t i;
+
ops_addr = (op_func_t *)mem_sys_allocate(n_tot * sizeof (op_func_t));
cg_lib->flags = OP_FUNC_IS_ALLOCATED;
for (i = 0; i < n_old; ++i)
@@ -1028,6 +1035,8 @@
* XXX running CG and CGP ops currently works only via the wrapper
*/
if (0 /*lib_variant */) {
+ size_t i;
+
new_init_func = get_op_lib_init(0, 0, lib_variant);
new_lib = new_init_func(1);
for (i = n_old; i < n_tot; ++i)
@@ -1037,6 +1046,7 @@
new_init_func((long) ops_addr);
}
else {
+ size_t i;
/* if not install wrappers */
/* fill new entries with the wrapper op */
for (i = n_old; i < n_tot; ++i)
@@ -1046,6 +1056,8 @@
* if we are running this core, update event check ops
*/
if ((int)interp->run_core == cg_lib->core_type) {
+ size_t i;
+
for (i = n_old; i < n_tot; ++i)
interp->evc_func_table[i] =
(op_func_t)ops_addr[CORE_OPS_check_events__];
@@ -1075,7 +1087,7 @@
dynop_register_switch(Parrot_Interp interp, PMC* lib_pmc,
size_t n_old, size_t n_new)
{
- op_lib_t *lib = PARROT_CORE_SWITCH_OPLIB_INIT(1);
+ op_lib_t * const lib = PARROT_CORE_SWITCH_OPLIB_INIT(1);
lib->op_count = n_old + n_new;
}
@@ -1091,10 +1103,11 @@
*/
static void
-notify_func_table(Parrot_Interp interp, op_func_t* table, int on)
+notify_func_table(Parrot_Interp interp, op_func_t* table /*NN*/, int on)
{
- oplib_init_f init_func = get_op_lib_init(1, interp->run_core, NULL);
- op_lib_t *lib = init_func(1);
+ const oplib_init_f init_func = get_op_lib_init(1, interp->run_core, NULL);
+ op_lib_t * const lib = init_func(1);
+
init_func((long) table);
switch (interp->run_core) {
case PARROT_SLOW_CORE: /* normal func core */
Modified: trunk/src/utils.c
==============================================================================
--- trunk/src/utils.c (original)
+++ trunk/src/utils.c Thu May 31 21:16:13 2007
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2001-2003, The Perl Foundation.
+Copyright (C) 2001-2007, The Perl Foundation.
$Id$
=head1 NAME
@@ -610,16 +610,14 @@
Parrot_byte_index(Interp *interp, const STRING *base,
const STRING *search, UINTVAL start_offset)
{
- char *base_start, *search_start;
+ const INTVAL searchlen = search->strlen;
+ const char * const search_start = search->strstart;
+ const INTVAL max_possible_offset = (base->strlen - search->strlen);
INTVAL current_offset;
- INTVAL max_possible_offset;
- INTVAL searchlen = search->strlen;
- search_start = search->strstart;
- max_possible_offset = (base->strlen - search->strlen);
for (current_offset = start_offset; current_offset <= max_possible_offset;
current_offset++) {
- base_start = (char *)base->strstart + current_offset;
+ const char * const base_start = (char *)base->strstart +
current_offset;
if (!memcmp(base_start, search_start, searchlen)) {
return current_offset;
}
@@ -632,18 +630,17 @@
Parrot_byte_rindex(Interp *interp, const STRING *base,
const STRING *search, UINTVAL start_offset)
{
- char *base_start, *search_start;
+ const INTVAL searchlen = search->strlen;
+ const char * const search_start = search->strstart;
+ UINTVAL max_possible_offset = (base->strlen - search->strlen);
INTVAL current_offset;
- UINTVAL max_possible_offset;
- INTVAL searchlen = search->strlen;
- search_start = search->strstart;
- max_possible_offset = (base->strlen - search->strlen);
+
if (start_offset && start_offset < max_possible_offset) {
max_possible_offset = start_offset;
}
for (current_offset = max_possible_offset; current_offset >= 0;
current_offset--) {
- base_start = (char *)base->strstart + current_offset;
+ const char * const base_start = (char *)base->strstart +
current_offset;
if (!memcmp(base_start, search_start, searchlen)) {
return current_offset;
}
@@ -678,17 +675,15 @@
*/
void
rec_climb_back_and_mark(int node_index, parrot_prm_context* c) {
- int pred, pred_index, src, node;
-
- node = c->dest_regs[node_index];
- pred = c->src_regs[node_index];
- pred_index = c->reg_to_index[pred];
+ const int node = c->dest_regs[node_index];
+ const int pred = c->src_regs[node_index];
+ const int pred_index = c->reg_to_index[pred];
if (pred_index < 0) { /* pred has no predecessor */
move_reg(pred, node, c);
}
else { /* pred has a predecessor, so may be processed */
- src = c->backup[pred_index];
+ const int src = c->backup[pred_index];
if (src < 0) { /* not visited */
move_reg(pred, node, c);
c->backup[pred_index] = node; /* marks pred*/
@@ -719,12 +714,11 @@
void
process_cycle_without_exit(int node_index, parrot_prm_context* c) {
- int pred, pred_index;
int alt = 0;
- pred = c->src_regs[node_index];
+ const int pred = c->src_regs[node_index];
/* pred_index has to be defined cause we are in a cycle so each node has a
pred*/
- pred_index = c->reg_to_index[pred];
+ const int pred_index = c->reg_to_index[pred];
/* let's try the alternate move function*/
if (NULL != c->mov_alt)
@@ -816,7 +810,7 @@
unsigned char temp_reg,
reg_move_func mov, reg_move_func mov_alt, void *info)
{
- int i,index;
+ int i;
int max_reg = 0;
int* nb_succ = NULL;
int* backup = NULL;
@@ -864,14 +858,14 @@
for (i = 0; i < max_reg; i++)
reg_to_index[i] = -1;
for (i = 0; i < n_regs; i++) {
- index = dest_regs[i];
+ const int index = dest_regs[i];
if (index != src_regs[i]) /* get rid of self-assignment */
reg_to_index[index] = i;
}
/* count the nb of successors for each reg index */
for (i = 0; i < n_regs; i++) {
- index = reg_to_index[ src_regs[i] ];
+ const int index = reg_to_index[ src_regs[i] ];
if (index >= 0) /* not interested in the wells that have no preds */
nb_succ[ index ]++;
}