From a972ac6e082ea550f7adbf16c6d069a85d7248c7 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Mon, 27 Mar 2006 14:15:53 +0000 Subject: [PATCH] *** empty log message *** --- ase/awk/run.c | 58 +++++---------------------------------------------- ase/awk/val.c | 5 +++-- 2 files changed, 8 insertions(+), 55 deletions(-) diff --git a/ase/awk/run.c b/ase/awk/run.c index c747f332..a634a8a5 100644 --- a/ase/awk/run.c +++ b/ase/awk/run.c @@ -1,5 +1,5 @@ /* - * $Id: run.c,v 1.22 2006-03-27 14:14:00 bacon Exp $ + * $Id: run.c,v 1.23 2006-03-27 14:15:53 bacon Exp $ */ #include @@ -605,24 +605,7 @@ static xp_awk_val_t* __eval_binary (xp_awk_t* awk, xp_awk_nde_exp_t* nde) xp_long_t r = ((xp_awk_val_int_t*)left)->val + ((xp_awk_val_int_t*)right)->val; - - // TODO: consider the code segement commented out below for optimization.... - /* - if (!xp_awk_isbuiltinval(left) && left->ref <= 1) - { - ((xp_awk_val_int_t*)left)->val = r; - res = left; - } - else if (!xp_awk_isbuiltinval(right) && right->ref <= 1) - { - ((xp_awk_val_int_t*)right)->val = r; - res = right; - } - else - { - */ - res = xp_awk_makeintval (awk, r); - //} + res = xp_awk_makeintval (awk, r); } } else if (nde->opcode == XP_AWK_BINOP_MINUS) @@ -633,43 +616,12 @@ static xp_awk_val_t* __eval_binary (xp_awk_t* awk, xp_awk_nde_exp_t* nde) xp_long_t r = ((xp_awk_val_int_t*)left)->val - ((xp_awk_val_int_t*)right)->val; - - /* - if (!xp_awk_isbuiltinval(left) && left->ref <= 1) - { - ((xp_awk_val_int_t*)left)->val = r; - res = left; - } - else if (!xp_awk_isbuiltinval(right) && right->ref <= 1) - { - ((xp_awk_val_int_t*)right)->val = r; - res = right; - } - else - { - */ - res = xp_awk_makeintval (awk, r); - //} + res = xp_awk_makeintval (awk, r); } } - /* - if (res == left) - { - xp_awk_refdownval_nofree (left); - xp_awk_refdownval (right); - } - else if (res == right) - { - xp_awk_refdownval (left); - xp_awk_refdownval_nofree (right); - } - else - { - */ - xp_awk_refdownval (awk, left); - xp_awk_refdownval (awk, right); - //} + xp_awk_refdownval (awk, left); + xp_awk_refdownval (awk, right); return res; } diff --git a/ase/awk/val.c b/ase/awk/val.c index 640a90c0..5cccc078 100644 --- a/ase/awk/val.c +++ b/ase/awk/val.c @@ -1,5 +1,5 @@ /* - * $Id: val.c,v 1.11 2006-03-27 11:43:17 bacon Exp $ + * $Id: val.c,v 1.12 2006-03-27 14:14:00 bacon Exp $ */ #include @@ -146,7 +146,8 @@ void xp_awk_refdownval (xp_awk_t* awk, xp_awk_val_t* val) if (xp_awk_isbuiltinval(val)) return; /* -xp_printf (XP_TEXT("ref down [count=>%d]\n"), val->ref); +xp_printf (XP_TEXT("%p, %p, %p\n"), xp_awk_val_nil, &__awk_nil, val); +xp_printf (XP_TEXT("ref down [count=>%d]\n"), (int)val->ref); xp_awk_printval (val); xp_printf (XP_TEXT("\n")); */