Index: /export/ichebyki/workspace-e3.2.1/Harmony/working_vm/vm/port/src/lil/ipf/pim/m2n_ipf.cpp =================================================================== --- /export/ichebyki/workspace-e3.2.1/Harmony/working_vm/vm/port/src/lil/ipf/pim/m2n_ipf.cpp (revision 489039) +++ /export/ichebyki/workspace-e3.2.1/Harmony/working_vm/vm/port/src/lil/ipf/pim/m2n_ipf.cpp (working copy) @@ -244,12 +244,6 @@ emitter->ipf_movi(M2N_OBJECT_HANDLES, (int)imm_val); } -void m2n_pop_local_handles() { - assert(!hythread_is_suspend_enabled()); - M2nFrame *m2n = m2n_get_last_frame(); - free_local_object_handles3(m2n_get_local_handles(m2n)); -} - static void m2n_pop_local_handles() { assert(!hythread_is_suspend_enabled()); @@ -258,9 +252,11 @@ } M2nFrame * m2n = m2n_get_last_frame(); - free_local_object_handles2(m2n->local_object_handles); + // iche free_local_object_handles2(m2n->local_object_handles); + free_local_object_handles2(m2n_get_local_handles(m2n)); // iche + } - + static void m2n_free_local_handles() { assert(!hythread_is_suspend_enabled()); @@ -269,7 +265,8 @@ } M2nFrame * m2n = m2n_get_last_frame(); - free_local_object_handles3(m2n->local_object_handles); + // iche free_local_object_handles3(m2n->local_object_handles); + free_local_object_handles3(m2n_get_local_handles(m2n)); // iche } void m2n_gen_pop_m2n(Merced_Code_Emitter* emitter, bool handles, M2nPreserveRet preserve_ret, bool do_alloc, unsigned out_reg, int target) @@ -274,10 +271,12 @@ void m2n_gen_pop_m2n(Merced_Code_Emitter* emitter, bool handles, M2nPreserveRet preserve_ret, bool do_alloc, unsigned out_reg, int target) { + unsigned free_target; + if (handles) { assert(target != -1); // make sure a target has been provided // Do we need to call free? - unsigned free_target = (unsigned) target; + free_target = (unsigned) target; emitter->ipf_cmp(icmp_eq, cmp_none, SCRATCH_PRED_REG, SCRATCH_PRED_REG2, M2N_OBJECT_HANDLES, 0); emitter->ipf_br(br_cond, br_many, br_spnt, br_none, free_target, SCRATCH_PRED_REG); }