harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r649391 [4/4] - in /harmony/enhanced/drlvm/trunk: ./ make/ make/extra/ make/vm/ vm/em/src/ vm/gc_gen/src/common/ vm/gc_gen/src/gen/ vm/gc_gen/src/mark_compact/ vm/gc_gen/src/semi_space/ vm/interpreter/src/ vm/port/include/ vm/port/include/t...
Date Fri, 18 Apr 2008 07:26:38 GMT
Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/em64t/lil_code_generator_em64t.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/em64t/lil_code_generator_em64t.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/em64t/lil_code_generator_em64t.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/em64t/lil_code_generator_em64t.cpp Fri Apr 18 00:26:23 2008
@@ -216,7 +216,7 @@
                     ++cur_tmp_reg;
                 }
             }
-            ASSERT(0,"LIL INTERNAL ERROR: Not enough temporary registers");
+            DIE(("LIL INTERNAL ERROR: Not enough temporary registers"));
         }
 
         virtual ~Tmp_GR_Opnd() {
@@ -240,8 +240,7 @@
             // registers in the following order:
             // xmm8, xmm9, ... xmm15
             ASSERT(get_num_used_reg() < LcgEM64TContext::MAX_FR_TEMPORARY + LcgEM64TContext:: MAX_FR_LOCALS,
-            //ASSERT(get_num_used_reg() < LcgEM64TContext::MAX_FR_TEMPORARY ,
-                "LIL INTERNAL ERROR: Not enough temporary registers");
+                ("LIL INTERNAL ERROR: Not enough temporary registers"));
             m_idx = LcgEM64TContext::get_xmm_reg_from_map(
                 LcgEM64TContext::FR_TEMPORARY_OFFSET + get_num_used_reg()).get_idx();
             ++get_num_used_reg();
@@ -273,7 +272,7 @@
     // returns the location of the n'th fp local
     const LcgEM64TLoc * get_fp_local(const unsigned n) const {
         // DO NOT SUPPORT FP LOCALS
-        ABORT("Not supported");
+        DIE(("Not supported"));
         return NULL;
         /*
         assert(n < context.get_num_fr_locals());
@@ -309,7 +308,7 @@
         case LT_F8:
             return 8;
         default:
-            ASSERT(0, "Unknown LIL type");
+            DIE(("Unknown LIL type"));
         }
         return 0;
     }
@@ -512,7 +511,7 @@
                 : new(mem) LcgEM64TLoc(LLK_Gr, LcgEM64TContext::GR_RETURNS_OFFSET);
         }
         default:
-            ASSERT(0, "Unknown variable kind");
+            DIE(("Unknown variable kind"));
         }
         return NULL;  // should never be reached
     }
@@ -766,7 +765,7 @@
             shift_op_rm_imm(dest, src, imm_val);
             break;
         default:
-            ASSERT(0, "Unexpected operation");
+            DIE(("Unexpected operation"));
         }
     }
 
@@ -814,7 +813,7 @@
             break;
         }
         default:
-            ASSERT(0, "Unexpected operation");  // control should never reach this point
+            DIE(("Unexpected operation"));  // control should never reach this point
         }
     }
 
@@ -857,7 +856,7 @@
             buf = mov(buf, dest_reg, get_rm_opnd(src), size_32);
             break;
         default:
-            ASSERT(0, "Unexpected operation");  // control should never reach this point
+            DIE(("Unexpected operation"));  // control should never reach this point
         }
 
         if (dest->kind != LLK_Gr) {
@@ -905,7 +904,7 @@
                     base_loc != NULL ? get_r_opnd(base_loc).reg_no() : n_reg,
                     tmp_reg.reg_no(), (uint32)offset, scale));
             }
-            ASSERT(0, "Should never reach this point");
+            DIE(("Should never reach this point"));
         }
 
         // need to perform manual calculation of the effective address
@@ -1193,7 +1192,7 @@
                     result = op1_imm << op2_imm;
                     break;
                 default:
-                    ASSERT(0, "Unexpected operation");   // control should never reach this point
+                    DIE(("Unexpected operation"));   // control should never reach this point
                 }
                 move_imm(dest_loc, result);
             } else if (lil_operand_is_immed(op1)) {
@@ -1213,7 +1212,7 @@
                     shift_op_imm_rm(dest_loc, op1_imm, op2_loc);
                     break;
                 default:
-                    ASSERT(0, "Unexpected operation");  // control should never reach this point
+                    DIE(("Unexpected operation"));  // control should never reach this point
                 }
             } else if (lil_operand_is_immed(op2)) {
                 const LcgEM64TLoc*  op1_loc = get_op_loc(op1, false);
@@ -1256,7 +1255,7 @@
                     result = (int32) (uint64) (uint32) imm;
                     break;
                 default:
-                    ASSERT(0, "Unexpected operation");  // control should never reach this point
+                    DIE(("Unexpected operation"));  // control should never reach this point
                 }
                 move_imm(dest_loc, result);
             } else { // non-immediate operand
@@ -1338,7 +1337,7 @@
             buf = mov(buf, *dest_reg, addr, size_64);
             goto move_to_destination;
         default:
-            ASSERT(0, "Unexpected LIL type");  // invalid value in type
+            DIE(("Unexpected LIL type"));  // invalid value in type
         }
 
         assert(size != n_size);
@@ -1484,7 +1483,7 @@
             cc = Condition_B;
             break;
         default:
-            ASSERT(0, "Unknown predicate");
+            DIE(("Unknown predicate"));
         }
 
         void * const mem_ptr = mem.alloc(sizeof(Tmp_GR_Opnd));
@@ -1654,7 +1653,7 @@
             break;
         }
         default:
-            ASSERT(0, "Unknown kind");
+            DIE(("Unknown kind"));
         }
     }
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/ia32/lil_code_generator_ia32.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/ia32/lil_code_generator_ia32.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/ia32/lil_code_generator_ia32.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/ia32/lil_code_generator_ia32.cpp Fri Apr 18 00:26:23 2008
@@ -181,7 +181,7 @@
         info->arg_order = LAO_R2l;
         info->callee_pop = true;
         break;
-    default: ASSERT(0, "Unknown calling convention");
+    default: DIE(("Unknown calling convention"));
     }
 }
 
@@ -198,7 +198,7 @@
     case LT_G8:
     case LT_F8:
         return true;
-    default: ASSERT(0, "Unexpected LIL type"); for(;;);
+    default: DIE(("Unexpected LIL type")); for(;;);
     }
 }
 
@@ -232,7 +232,7 @@
     case LT_G8:
     case LT_F8:
         return 8;
-    default: ASSERT(0, "Unexpected LIL type"); for(;;);
+    default: DIE(("Unexpected LIL type")); for(;;);
     }
 }
 
@@ -312,7 +312,7 @@
     case LOLT_Stack: return (loc->u.v<124 ? 4 : 7); // 124 is used to work correctly for two words on the stack
     case LOLT_Immed: return 5;
     case LOLT_Tofs: return 8;
-    default: ASSERT(0, "Unexpected type"); for(;;);
+    default: DIE(("Unexpected type")); for(;;);
     }
 }
 
@@ -332,7 +332,7 @@
     case 5:
         return &edx_opnd;
     default:
-        ASSERT(0, "Unexpected index");
+        DIE(("Unexpected index"));
         return NULL;
     }
 }
@@ -364,7 +364,7 @@
             num--;
     if (n_std_places==0 && n_locals+num<=3)
         return get_local_reg(3-num);
-    ASSERT(0, "All the possible cases are supposed to be already covered");
+    DIE(("All the possible cases are supposed to be already covered"));
     return NULL;
 }
 
@@ -382,7 +382,7 @@
         switch (lil_variable_get_index(v)) {
         case 0: loc->u.r.r1 = &edx_opnd; break;
         case 1: loc->u.r.r1 = &ecx_opnd; break;
-        default: ASSERT(0, "Unexpected index");
+        default: DIE(("Unexpected index"));
         }
         break;
     case LVK_Out:
@@ -413,7 +413,7 @@
             loc->u.r.r2 = &edx_opnd;
         }
         break;
-    default: ASSERT(0, "Unknown kind");
+    default: DIE(("Unknown kind"));
     }
 }
 
@@ -602,7 +602,7 @@
                 info->size += 2;
                 break;
             case LO_Not:
-                ASSERT(0, "Unexpected operation");
+                DIE(("Unexpected operation"));
             case LO_Sx1:
             case LO_Sx2:
             case LO_Zx1:
@@ -610,7 +610,7 @@
                 ii->u.asgn.mov_to_r = false;
                 info->size += 1+size_loc(&ii->loc2);
                 break;
-            default: ASSERT(0, "Unknown operation");
+            default: DIE(("Unknown operation"));
             }
         }
         if (ii->u.asgn.mov_to_r) info->size += size_loc(&ii->loc2)*num_regs;
@@ -707,7 +707,7 @@
                 ii->u.jc.stack = (ii->loc1.t==LOLT_Stack);
             } else if (ii->loc1.t==LOLT_Stack) {
                 if (ii->loc2.t==LOLT_Stack) {
-                    ASSERT(0, "Unexpected type");
+                    DIE(("Unexpected type"));
                 } else {
                     ii->u.jc.immed = false;
                     ii->u.jc.stack = true;
@@ -738,7 +738,7 @@
         case LP_Lt: ii->u.jc.cc=Condition_L; break;
         case LP_Ule: ii->u.jc.cc=Condition_BE; break;
         case LP_Ult: ii->u.jc.cc=Condition_B; break;
-        default: ASSERT(0, "Unknown predicate");
+        default: DIE(("Unknown predicate"));
         }
         if (invert) {
             switch (ii->u.jc.cc) {
@@ -788,7 +788,7 @@
             tailcalls++;
             info->size += size_loc(&ii->loc1);
             break;
-        default: ASSERT(0, "Unexpected call kind");
+        default: DIE(("Unexpected call kind"));
         }
     }
 
@@ -830,7 +830,7 @@
         case LT_PInt:
             ii->u.pop_m2n = 1;
             break;
-        default: ASSERT(0, "Unknown LIL type");
+        default: DIE(("Unknown LIL type"));
         }
         info->size += m2n_pop_m2n_size(lil_ic_get_m2n_state(ctxt.ctxt)==LMS_Handles, 4, num, ii->u.pop_m2n);
     }
@@ -911,7 +911,7 @@
         ++*temp_reg;
         *buf = mov(*buf, *tmp, Imm_Opnd(loc->u.v));
         return tmp;}
-    default: ASSERT(0, "Unknown type"); for(;;);
+    default: DIE(("Unknown type")); for(;;);
     }
 }
 
@@ -942,7 +942,7 @@
         *buf = pop(*buf, *reg1);
         if (t==LT_F8) *buf = pop(*buf, *reg2);
         break;}
-    default: ASSERT(0, "Unknown type");
+    default: DIE(("Unknown type"));
     }
 }
 
@@ -966,7 +966,7 @@
         *buf = fld(*buf, M_Base_Opnd(esp_reg, 0), (t==LT_F8));
         *buf = alu(*buf, add_opc, esp_opnd, Imm_Opnd(t==LT_F4 ? 4 : 8));
         break;}
-    default: ASSERT(0, "Unknown type");
+    default: DIE(("Unknown type"));
     }
 }
 
@@ -991,7 +991,7 @@
         return size_32;
         //break;// remark #111: statement is unreachable
     default:
-        ASSERT(0, "Unknown LIL type"); for(;;);
+        DIE(("Unknown LIL type")); for(;;);
     }
 }
 
@@ -1083,7 +1083,7 @@
                 case LOLT_Immed:{
                     *buf = imul(*buf, *(ii->r1), Imm_Opnd(ii->loc3.u.v));
                     break;}
-                default: ASSERT(0, "Unexpected type");
+                default: DIE(("Unexpected type"));
                 }            
                 break;
             case LO_Neg:
@@ -1093,17 +1093,17 @@
                 switch (ii->loc3.t) {
                 case LOLT_Reg:
                 case LOLT_Stack:
-                    ASSERT(0, "Unexpected type");
+                    DIE(("Unexpected type"));
                 case LOLT_Immed:{
                     *buf = shift(*buf, shl_opc, *(ii->r1), Imm_Opnd(ii->loc3.u.v));
                     break;}
-                default: ASSERT(0, "Unexpected type");
+                default: DIE(("Unexpected type"));
                 }
                 break;
             case LO_And:
                 opc = and_opc; goto alu;
             case LO_Not:
-                ASSERT(0, "Unexpected operation");
+                DIE(("Unexpected operation"));
             case LO_Sx1: sign=true; sz = size_8; goto widden;
             case LO_Sx2: sign=true; sz = size_16; goto widden;
             case LO_Zx1: sign=false; sz = size_8; goto widden;
@@ -1119,7 +1119,7 @@
                 case LOLT_Immed:{
                     *buf = alu(*buf, opc, *(ii->r1), Imm_Opnd(ii->loc3.u.v));
                     break;}
-                default: ASSERT(0, "Unexpected type");
+                default: DIE(("Unexpected type"));
                 }            
                 break;
             widden:
@@ -1140,10 +1140,10 @@
                         *buf = movzx(*buf, *(ii->r1), M_Base_Opnd(esp_reg, ii->loc2.u.v), sz);
                     }
                     break;}
-                default: ASSERT(0, "Unexpected type");
+                default: DIE(("Unexpected type"));
                 }
                 break;
-            default: ASSERT(0, "Unexpected operartion");
+            default: DIE(("Unexpected operartion"));
             }
             break;
         case LSO_Lea:{
@@ -1189,7 +1189,7 @@
             *buf = mov(*buf, *(ii->r1), *(ii->u.address.addr));
             break;
         case LT_G8:
-            ASSERT(0, "Unexpected type");
+            DIE(("Unexpected type"));
             //ASSERT(0 == 1, "Need proper implementation");
             //*buf = mov(*buf, *(ii->r1), *(ii->u.address.addr));
             // Bit of a hack to change this value, but it works
@@ -1197,7 +1197,7 @@
             //*buf = mov(*buf, *(ii->r2), *(ii->u.address.addr));
             break;
         default:
-            ASSERT(0, "Unexpected LIL type"); // other types not allowed
+            DIE(("Unexpected LIL type")); // other types not allowed
         }
         if (ii->mov_to_dst) move_register_to_location(buf, &ii->loc1, ii->r1, ii->r2, t);
     }
@@ -1278,7 +1278,7 @@
                 *buf = alu(*buf, or_opc, *reg, M_Base_Opnd(esp_reg, ii->loc1.u.v+4));
                 break;}
             default:
-                ASSERT(0, "Unexpected type");
+                DIE(("Unexpected type"));
             }
         }
         if (ctxt.info->short_jumps) {
@@ -1320,7 +1320,7 @@
                 *buf = push(*buf, m1);
                 extra += 8;
                 break;}
-            default: ASSERT(0, "Unexpected type size");
+            default: DIE(("Unexpected type size"));
             }
             if (l2r) i++;
         }
@@ -1338,7 +1338,7 @@
         case LOLT_Immed:
             *buf = ::call(*buf, (char*)l->u.v);
             break;
-        default: ASSERT(0, "Unexpected type");
+        default: DIE(("Unexpected type"));
         }
     }
 
@@ -1371,10 +1371,10 @@
             case LOLT_Immed:
                 *buf = jump(*buf, (char*)ii->loc1.u.v);
                 break;
-            default: ASSERT(0, "Unexpected type");
+            default: DIE(("Unexpected type"));
             }
             break;
-        default: ASSERT(0, "Unexpected call kind");
+        default: DIE(("Unexpected call kind"));
         }
     }
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/ia32/stack_iterator_ia32.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/ia32/stack_iterator_ia32.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/ia32/stack_iterator_ia32.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/ia32/stack_iterator_ia32.cpp Fri Apr 18 00:26:23 2008
@@ -14,11 +14,11 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-
 /** 
  * @author Intel, Pavel Afremov
- * @version $Revision$
  */  
+#define LOG_DOMAIN "exn"
+#include "clog.h"
 
 #include "environment.h"
 #include "jit_intf_cpp.h"
@@ -32,8 +32,6 @@
 #include "interpreter.h"
 #include "cci.h"
 
-#include "clog.h"
-
 #include "dump.h"
 #include "port_threadunsafe.h"
 #include "open/vm_method_access.h"
@@ -75,12 +73,12 @@
 
     si->m2nfl   = m2n_get_previous_frame(m2nfl);
 
-    TRACE2("si", ("si_unwind_from_m2n, ip = %p",(void*)m2nfl->eip));
+    CTRACE(("si_unwind_from_m2n, ip = %p",(void*)m2nfl->eip));
 
     // Is it a normal M2nFrame or one for suspended managed code?
     if ((uint32)m2nfl->p_lm2nf==1) {
         // Suspended managed code, eip is at instruction, esp & registers are in regs structure
-        TRACE2("si", ("si_unwind_from_m2n from suspended managed code, ip = %p", 
+        CTRACE(("si_unwind_from_m2n from suspended managed code, ip = %p", 
             (void*)m2nfl->regs->eip));
         si->c.esp = m2nfl->regs->esp;
         si->c.p_eip = &(m2nfl->regs->eip);
@@ -336,7 +334,7 @@
 {
     ASSERT_NO_INTERPRETER
     if (si->cci) {
-        TRACE2("si", ("si_goto_previous from ip = %p (%s%s)",
+        CTRACE(("si_goto_previous from ip = %p (%s%s)",
             (void*)si_get_ip(si),
             method_get_name(si->cci->get_method()),
             method_get_descriptor(si->cci->get_method())));
@@ -344,7 +342,7 @@
         si->cci->get_jit()->unwind_stack_frame(si->cci->get_method(), si_get_jit_context(si));
         si->c.is_ip_past = TRUE;
     } else {
-        TRACE2("si", ("si_goto_previous from ip = %p (M2N)",
+        CTRACE(("si_goto_previous from ip = %p (M2N)",
             (void*)si_get_ip(si)));
         if (!si->m2nfl) return;
         si_unwind_from_m2n(si, over_popped);
@@ -357,12 +355,12 @@
         si->cci = NULL;
 
     if (si->cci) {
-        TRACE2("si", ("si_goto_previous to ip = %p (%s%s)",
+        CTRACE(("si_goto_previous to ip = %p (%s%s)",
             (void*)si_get_ip(si),
             method_get_name(si->cci->get_method()),
             method_get_descriptor(si->cci->get_method())));
     } else {
-        TRACE2("si", ("si_goto_previous to ip = %p (M2N)",
+        CTRACE(("si_goto_previous to ip = %p (M2N)",
             (void*)si_get_ip(si)));
     }
 }
@@ -472,22 +470,21 @@
 
     void *lastFrame = p_TLS_vmthread->lastFrame;
 
-    TRACE2("exn",("  curr = 0x%p\n", lastFrame));
-    TRACE2("exn",(" handler=0x%p\n", handler));
+    CTRACE(("  curr = 0x%p\n", lastFrame));
+    CTRACE((" handler=0x%p\n", handler));
 
     if (!(handler < lastFrame)) {
-        TRACE2("exn",("all ok\n"));
+        CTRACE(("all ok\n"));
         return;
     }
 
-    // NO CXX LOGGER PLEASE! doesn't work with destructive unwinding!
-    INFO2("exn", ("ERROR: Destructive unwinding: C++ objects detected on stack!\n"));
+    WARN(("ERROR: Destructive unwinding: C++ objects detected on stack!\n"));
 
     while(handler < lastFrame) {
-        INFO2("exn", ("  droping 0x%p\n", handler));
+        WARN(("  droping 0x%p\n", handler));
         handler = *(int**)handler;
     }
-    INFO2("exn", (" setting curr 0x%p\n", handler));
+    WARN((" setting curr 0x%p\n", handler));
     __asm {
         mov eax, handler
         mov fs:[0], eax
@@ -527,10 +524,10 @@
     cpp_check_last_frame();
 #endif // _WIN32
 
-    TRACE2("exn", ("generating control transfer stub"));
+    CTRACE(("generating control transfer stub"));
     // 3. Call the stub
     transfer_control_stub_type tcs = gen_transfer_control_stub();
-    TRACE2("exn", ("tcs"));
+    CTRACE(("tcs"));
     tcs(&local_si);
 }
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/lil.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/lil.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/lil.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/lil.cpp Fri Apr 18 00:26:23 2008
@@ -350,14 +350,14 @@
         // ? 20030613: I really don't want this code here, but for now...
         Class_Handle UNUSED ch = type_info_get_class(tih);
         assert(ch);
-        ASSERT(0, "Unexpected data type");
+        DIE(("Unexpected data type"));
     }
     case VM_DATA_TYPE_MP:
     case VM_DATA_TYPE_UP:
         return LT_PInt;
     case VM_DATA_TYPE_STRING:
     case VM_DATA_TYPE_INVALID:
-    default: ASSERT(0, "Unknown data type"); for(;;);
+    default: DIE(("Unknown data type")); for(;;);
     }
 }
 
@@ -1186,7 +1186,7 @@
         return c->out_sig->arg_types[v->index];
     case LVK_Ret:
         return c->ret;
-    default: ASSERT(0, "Unknown variable kind"); for(;;);
+    default: DIE(("Unknown variable kind")); for(;;);
     }
 }
 
@@ -1226,7 +1226,7 @@
     case LVK_Ret:
         c->ret = t;
         break;
-    default: ASSERT(0, "Unknown variable kind");
+    default: DIE(("Unknown variable kind"));
     }
 }
 
@@ -1264,7 +1264,7 @@
     case LO_Zx4:
         return t;
     default:
-        ASSERT(0, "Unexpected operation");
+        DIE(("Unexpected operation"));
         return LT_Void;
     }
 }
@@ -1371,7 +1371,7 @@
     case LIT_Print:
         // nothing to do here
         break;
-    default: ASSERT(0, "Unknown instruction tag");
+    default: DIE(("Unknown instruction tag"));
     }
 }
 
@@ -1749,7 +1749,7 @@
     case LIT_Print:
         v->print(i->u.print.str, &i->u.print.arg);
         break;
-    default: ASSERT(0, "Unknown instruction tag");
+    default: DIE(("Unknown instruction tag"));
     }
 }
 
@@ -1795,7 +1795,7 @@
     case LP_Ult:
         return true;
     default:
-        ASSERT(0, "Unknown predicate");
+        DIE(("Unknown predicate"));
         return false; // not reached
     }
 }
@@ -1824,7 +1824,7 @@
     case LO_And:
         return true;
     default:
-        ASSERT(0, "Unknown operation");
+        DIE(("Unknown operation"));
         return false; // not reached
     }
 }
@@ -2083,7 +2083,7 @@
     case LCC_Rth: fprintf(out, "rth"); break;
     case LCC_Jni: fprintf(out, "jni"); break;
     case LCC_StdCall: fprintf(out, "stdcall"); break;
-    default: ASSERT(0, "Unknown calling convention");
+    default: DIE(("Unknown calling convention"));
     }
     fflush(out);
 }
@@ -2100,7 +2100,7 @@
     case LT_Ref: fprintf(out, "ref"); break;
     case LT_PInt: fprintf(out, "pint"); break;
     case LT_Void: fprintf(out, "void"); break;
-    default: ASSERT(0, "Unknown LIL type");
+    default: DIE(("Unknown LIL type"));
     }
     fflush(out);
 }
@@ -2143,7 +2143,7 @@
         assert(v->index==0);
         fprintf(out, "r");
         return;
-    default: ASSERT(0, "Unknown kind");
+    default: DIE(("Unknown kind"));
     }
     fprintf(out, "%d", v->index);
     fflush(out);
@@ -2193,7 +2193,7 @@
     case LAR_None:    break;
     case LAR_Acquire: fprintf(out, ",acquire"); break;
     case LAR_Release: fprintf(out, ",release"); break;
-    default: ASSERT(0, "Unexpected acqrel value");
+    default: DIE(("Unexpected acqrel value"));
     }
     fprintf(out, "]");
     fflush(out);
@@ -2281,7 +2281,7 @@
             fprintf(out, "zx4 ");
             lil_print_operand(out, &(i->u.asgn.o1));
             break;
-        default: ASSERT(0, "Unknown operation");
+        default: DIE(("Unknown operation"));
         }
         break;
     case LIT_Ts:
@@ -2363,7 +2363,7 @@
             fprintf(out, " <u ");
             lil_print_operand(out, &(i->u.jc.c.o2));
             break;
-        default: ASSERT(0, "Unknown predicate");
+        default: DIE(("Unknown predicate"));
         }
         fprintf(out, ",%s", i->u.jc.l);
         break;
@@ -2388,7 +2388,7 @@
         case LCK_TailCall:
             fprintf(out, "tailcall ");
             break;
-        default: ASSERT(0, "Unknown call kind");
+        default: DIE(("Unknown call kind"));
         }
         lil_print_operand(out, &(i->u.call.target));
         break;
@@ -2411,7 +2411,7 @@
         fprintf(out, "\n");
         break;
     default:
-        ASSERT(0, "Unknown instruction tag");
+        DIE(("Unknown instruction tag"));
     };
     fprintf(out, ";\n");
     fflush(out);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/lil_code_generator_utils.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/lil_code_generator_utils.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/lil_code_generator_utils.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/lil/lil_code_generator_utils.cpp Fri Apr 18 00:26:23 2008
@@ -132,7 +132,7 @@
         *(int32*)patch->addr = (int32)(POINTER_SIZE_INT)label_adress->addr;
         break;
     default:
-        ASSERT(0, "Unknown patch type");
+        DIE(("Unknown patch typ"));
     }
 }
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/object/object_handles.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/object/object_handles.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/object/object_handles.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/object/object_handles.cpp Fri Apr 18 00:26:23 2008
@@ -119,7 +119,7 @@
         for(i=0; i<c->mp_size; i++)
       // ? 20030710: GC V4 does not support this, and a static build fails on Linux
 #ifdef PLATFORM_POSIX
-      ABORT("Not supported on this platform");
+      DIE(("Not supported on this platform"));
 #else
             gc_add_root_set_entry_managed_pointer(c->elements[c->obj_size+i], FALSE);
 #endif

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/object/vm_arrays.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/object/vm_arrays.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/object/vm_arrays.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/object/vm_arrays.cpp Fri Apr 18 00:26:23 2008
@@ -619,7 +619,7 @@
         }
         break;
     default:
-        ABORT("Unexpected type specifier");
+        DIE(("Unexpected type specifier"));
     }
 
     return ACR_Okay;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/reflection/annotations.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/reflection/annotations.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/reflection/annotations.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/reflection/annotations.cpp Fri Apr 18 00:26:23 2008
@@ -117,7 +117,7 @@
 
         assert(exn_raised());
         jthrowable jfailure = exn_get();
-        ASSERT(jfailure, "FIXME lazy exceptions handling");
+        ASSERT(jfailure, ("FIXME lazy exceptions handling"));
         exn_clear();
         jthrowable jnewfailure = exn_create("java/lang/TypeNotPresentException",
             tih->get_type_name()->bytes, jfailure);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/reflection/reflection.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/reflection/reflection.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/reflection/reflection.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/reflection/reflection.cpp Fri Apr 18 00:26:23 2008
@@ -313,7 +313,7 @@
         }
         else //unwrap to primitive
         {
-            ASSERT(arg, "Cannot unwrap NULL");
+            ASSERT(arg, ("Cannot unwrap NULL"));
             Class* arg_clss = jobject_to_struct_Class(arg);
             char arg_sig = is_wrapper_class(arg_clss->get_name()->bytes);
             char param_sig = (char)type;
@@ -342,13 +342,13 @@
 
 jobject reflection_get_enum_value(JNIEnv *jenv, Class* enum_type, String* name) 
 {
-    ASSERT(enum_type->is_enum(), "Requested Class is not ENUM: "
-        << enum_type->get_name()->bytes);
+    ASSERT(enum_type->is_enum(), ("Requested Class is not ENUM: %s", 
+        enum_type->get_name()->bytes));
 
     for (unsigned i=0; i<enum_type->get_number_of_fields(); i++) {
         if (enum_type->get_field(i)->get_name() == name) {
 #ifndef NDEBUG
-            ASSERT(enum_type->get_field(i)->is_enum(), "Requested field is not ENUM: " << name->bytes);
+            ASSERT(enum_type->get_field(i)->is_enum(), ("Requested field is not ENUM: %d", name->bytes));
             const String* type = enum_type->get_name();
             const String* desc = enum_type->get_field(i)->get_descriptor();
             if (desc->len != (type->len + 2)

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/object_generic.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/object_generic.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/object_generic.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/object_generic.cpp Fri Apr 18 00:26:23 2008
@@ -85,7 +85,7 @@
     if ( *P_HASH_CONTENTION_BYTE(p_obj) & HASH_MASK)
         return *P_HASH_CONTENTION_BYTE(p_obj) & HASH_MASK;
 
-    ASSERT(0, "All the possible cases are supposed to be covered before");
+    DIE(("All the possible cases are supposed to be covered before"));
     return 0xff;
 }
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_dump.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_dump.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_dump.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_dump.cpp Fri Apr 18 00:26:23 2008
@@ -14,33 +14,11 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/**
- * @author Nikolay Kuznetsov
- * @version $Revision: 1.1.2.2.4.4 $
- */
+#define LOG_DOMAIN "thread.dump"
+#include "cxxlog.h"
 
 #include <set>
 #include "thread_dump.h"
-#include "m2n.h"
-#include "stack_iterator.h"
-#include "stack_trace.h"
-#include "mon_enter_exit.h"
-#include "jni_utils.h"
-#include "jit_intf_cpp.h"
-#include "dll_jit_intf.h"
-
-#include "object_generic.h"
-#include "Class.h"
-#include "vtable.h"
-#include "environment.h"
-#include "root_set_enum_internal.h"
-#include "lock_manager.h"
-#include "open/gc.h"
-#include "cci.h"
-
-#define LOG_DOMAIN "thread_dump"
-#include "cxxlog.h"
-
 
 static std::set < void *>unique_references;
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_java_basic.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_java_basic.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_java_basic.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_java_basic.cpp Fri Apr 18 00:26:23 2008
@@ -19,6 +19,8 @@
  * @file thread_java_basic.c
  * @brief Key threading operations like thread creation and pointer conversion.
  */
+#define LOG_DOMAIN "tm.java"
+#include "cxxlog.h"
 
 #include "open/hythread_ext.h"
 #include "open/vm_properties.h"
@@ -26,9 +28,6 @@
 #include "vm_threads.h"
 #include "jni.h"
 
-#define LOG_DOMAIN "tm.java"
-#include "cxxlog.h"
-
 static jmethodID jthread_get_run_method(JNIEnv * env, jthread java_thread);
 static jfieldID jthread_get_alive_field(JNIEnv * env, jthread java_thread);
 static IDATA jthread_associate_native_and_java_thread(JNIEnv *jni_env,
@@ -86,7 +85,7 @@
         // zero hythread_self() because we don't do it in hythread_detach_ex()
         hythread_set_self(NULL);
 
-        TRACE(("TM: native thread terminated due to shutdown: native: %p tm: %p",
+        CTRACE(("TM: native thread terminated due to shutdown: native: %p tm: %p",
             apr_os_thread_current(), native_thread));
 
         // FIXME - uncomment after TM state transition complete
@@ -127,7 +126,7 @@
     vm_thread->jni_env = jni_env;
     vm_thread->daemon = start_proc_data.daemon;
 
-    TRACE(("TM: Java thread started: id=%d OS_handle=%p",
+    CTRACE(("TM: Java thread started: id=%d OS_handle=%p",
            hythread_get_id(native_thread), apr_os_thread_current()));
 
     if (!vm_thread->daemon) {
@@ -179,7 +178,7 @@
     status = hythread_set_state(native_thread, TM_THREAD_STATE_TERMINATED);
     assert(status == TM_ERROR_NONE);
 
-    TRACE(("TM: Java thread finished: id=%d OS_handle=%p",
+    CTRACE(("TM: Java thread finished: id=%d OS_handle=%p",
         hythread_get_id(native_thread), apr_os_thread_current()));
 
     hythread_detach_ex(native_thread);
@@ -252,7 +251,7 @@
     status = hythread_create_ex(native_thread, NULL, attrs->stacksize,
                         attrs->priority, jthread_wrapper_start_proc, NULL, attrs);
 
-    TRACE(("TM: Created thread: id=%d", hythread_get_id(native_thread)));
+    CTRACE(("TM: Created thread: id=%d", hythread_get_id(native_thread)));
 
     return status;
 } // jthread_create_with_function
@@ -301,7 +300,7 @@
     }
     jthread_start_count();
 
-    TRACE(("TM: Current thread attached to jthread=%p", java_thread));
+    CTRACE(("TM: Current thread attached to jthread=%p", java_thread));
     return TM_ERROR_NONE;
 } // jthread_attach
 
@@ -390,7 +389,7 @@
     assert(vm_thread);
     assert(hythread_is_suspend_enabled());
 
-    TRACE(("TM: jthread_vm_detach(%p)", vm_thread));
+    CTRACE(("TM: jthread_vm_detach(%p)", vm_thread));
     if (!vm_thread->daemon) {
         hythread_t native_thread = (hythread_t)vm_thread;
         IDATA status = hythread_decrease_nondaemon_threads_count(native_thread, 1);
@@ -535,7 +534,7 @@
     status = hythread_sleep_interruptable(millis, nanos);
 #ifndef NDEBUG
     if (status == TM_ERROR_INTERRUPT) {
-        TRACE(("TM: sleep interrupted status received, thread: %p",
+        CTRACE(("TM: sleep interrupted status received, thread: %p",
                hythread_self()));
     }
 #endif
@@ -618,12 +617,12 @@
 jthread jthread_get_java_thread(hythread_t native_thread)
 {
     if (native_thread == NULL) {
-        TRACE(("TM: native thread is NULL"));
+        CTRACE(("TM: native thread is NULL"));
         return NULL;
     }
     vm_thread_t vm_thread = jthread_get_vm_thread(native_thread);
     if (vm_thread == NULL) {
-        TRACE(("TM: vm_thread_t thread is NULL"));
+        CTRACE(("TM: vm_thread_t thread is NULL"));
         return NULL;
     }
     return vm_thread->java_thread;
@@ -667,7 +666,7 @@
  */
 void throw_interrupted_exception(void)
 {
-    TRACE(("interrupted_exception thrown"));
+    CTRACE(("interrupted_exception thrown"));
     vm_thread_t vm_thread = p_TLS_vmthread;
     assert(vm_thread);
     JNIEnv *env = vm_thread->jni_env;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_java_monitors.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_java_monitors.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_java_monitors.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_java_monitors.cpp Fri Apr 18 00:26:23 2008
@@ -19,14 +19,14 @@
  * @file thread_java_monitors.c
  * @brief Java thread monitors related functions
  */
+#define LOG_DOMAIN "tm.monitor"
+#include "cxxlog.h"
+
 #include <open/hythread_ext.h>
 #include "jthread.h"
 #include "vm_threads.h"
 #include "jni.h"
 
-#define LOG_DOMAIN "tm.monitor"
-#include "cxxlog.h"
-
 static void jthread_add_owned_monitor(jobject monitor);
 static void jthread_remove_owned_monitor(jobject monitor);
 static void jthread_set_owned_monitor(jobject monitor);
@@ -323,7 +323,7 @@
     hythread_thin_monitor_t *lockword = vm_object_get_lockword_addr(monitor);
     if (!hythread_is_fat_lock(*lockword)) {
         if (!hythread_owns_thin_lock(native_thread, *lockword)) {
-            TRACE(("ILLEGAL_STATE wait %x\n", lockword));
+            CTRACE(("ILLEGAL_STATE wait %x\n", lockword));
             hythread_suspend_enable();
             return TM_ERROR_ILLEGAL_STATE;
         }
@@ -408,7 +408,7 @@
         // nothing to do
         return;
     }
-    TRACE(("TM: add owned monitor: %x", monitor));
+    CTRACE(("TM: add owned monitor: %x", monitor));
 
     int disable_status = hythread_reset_suspend_disable();
 
@@ -426,7 +426,7 @@
     if (jvmti_thread->owned_monitors_nmb >= jvmti_thread->owned_monitors_size) {
         int new_size = jvmti_thread->owned_monitors_size * 2;
 
-        TRACE(("Increasing owned_monitors_size to: %d", new_size));
+        CTRACE(("Increasing owned_monitors_size to: %d", new_size));
         jobject* new_monitors = (jobject*)apr_palloc(vm_thread->pool,
                 new_size * sizeof(jobject));
         assert(new_monitors);
@@ -453,7 +453,7 @@
         // nothing to do
         return;
     }
-    TRACE(("TM: remove owned monitor: %x", monitor));
+    CTRACE(("TM: remove owned monitor: %x", monitor));
 
     for (int i = jvmti_thread->owned_monitors_nmb - 1; i >= 0; i--) {
         if (vm_objects_are_equal(jvmti_thread->owned_monitors[i], monitor)) {
@@ -482,7 +482,7 @@
         // nothing to do
         return;
     }
-    TRACE(("TM: set contended monitor: %x", monitor));
+    CTRACE(("TM: set contended monitor: %x", monitor));
 
     int disable_count = hythread_reset_suspend_disable();
     jvmti_thread->contended_monitor = vm_thread->jni_env->NewGlobalRef(monitor);
@@ -499,7 +499,7 @@
         // nothing to do
         return;
     }
-    TRACE(("TM: set wait monitor: %x", monitor));
+    CTRACE(("TM: set wait monitor: %x", monitor));
 
     int disable_count = hythread_reset_suspend_disable();
     jvmti_thread->wait_monitor = vm_thread->jni_env->NewGlobalRef(monitor);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_java_suspend.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_java_suspend.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_java_suspend.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_java_suspend.cpp Fri Apr 18 00:26:23 2008
@@ -48,13 +48,13 @@
         // it is a fast path
         // thread is not alive or is not suspended, nothing to do
 
-        TRACE(("java resume exit, self: %p, thread: %p",
+        CTRACE(("java resume exit, self: %p, thread: %p",
             hythread_self(), vm_thread));
 
         return TM_ERROR_NONE;
     }
 
-    TRACE(("java resume enter, self: %p, thread: %p, "
+    CTRACE(("java resume enter, self: %p, thread: %p, "
         "suspend_flag: %d", hythread_self(), vm_thread,
         vm_thread->suspend_flag));
 
@@ -62,7 +62,7 @@
     Lock_Manager *suspend_lock = VM_Global_State::loader_env->p_suspend_lock;
     suspend_lock->_lock();
 
-    TRACE(("java resume lock enter, self: %p, thread: %p, "
+    CTRACE(("java resume lock enter, self: %p, thread: %p, "
         "suspend_flag: %d", hythread_self(), vm_thread,
         vm_thread->suspend_flag));
 
@@ -71,7 +71,7 @@
         // thread is not alive or is already suspended,
         // release the lock and exit
 
-        TRACE(("java resume exit, self: %p, thread: %p",
+        CTRACE(("java resume exit, self: %p, thread: %p",
             hythread_self(), vm_thread));
 
         suspend_lock->_unlock();
@@ -84,13 +84,13 @@
         vm_thread->suspend_flag = 0;
     }
 
-    TRACE(("java resume lock exit, self: %p, thread: %p, "
+    CTRACE(("java resume lock exit, self: %p, thread: %p, "
         "suspend_flag: %d", hythread_self(), vm_thread,
         vm_thread->suspend_flag));
 
     suspend_lock->_unlock();
 
-    TRACE(("java resume exit, self: %p, thread: %p, "
+    CTRACE(("java resume exit, self: %p, thread: %p, "
         "suspend_flag: %d", hythread_self(), vm_thread,
         vm_thread->suspend_flag));
 
@@ -117,7 +117,7 @@
         return TM_ERROR_NONE;
     }
 
-    TRACE(("java resume all"));
+    CTRACE(("java resume all"));
 
     Lock_Manager *suspend_lock = VM_Global_State::loader_env->p_suspend_lock;
     suspend_lock->_lock();
@@ -158,20 +158,20 @@
         // it is a fast path
         // thread is not alive or is already suspended, nothing to do
 
-        TRACE(("java suspend enter, self: %p, thread: %p",
+        CTRACE(("java suspend enter, self: %p, thread: %p",
             hythread_self(), vm_thread));
 
         return TM_ERROR_NONE;
     }
 
-    TRACE(("java suspend enter, self: %p, thread: %p, "
+    CTRACE(("java suspend enter, self: %p, thread: %p, "
            "suspend_flag: %d", hythread_self(), vm_thread,
            vm_thread->suspend_flag));
 
     Lock_Manager *suspend_lock = VM_Global_State::loader_env->p_suspend_lock;
     suspend_lock->_lock();
 
-    TRACE(("java suspend lock enter, self: %p, thread: %p, "
+    CTRACE(("java suspend lock enter, self: %p, thread: %p, "
            "suspend_flag: %d", hythread_self(), vm_thread,
            vm_thread->suspend_flag));
 
@@ -180,7 +180,7 @@
         // thread is not alive or is already suspended,
         // release the lock and exit
 
-        TRACE(("java suspend exit, self: %p, thread: %p, ",
+        CTRACE(("java suspend exit, self: %p, thread: %p, ",
             hythread_self(), vm_thread));
 
         suspend_lock->_unlock();
@@ -202,7 +202,7 @@
         status = hythread_thread_unlock(hy_thread);
         assert(status == TM_ERROR_NONE);
 
-        TRACE(("java suspend lock exit, self: %p, thread: %p, "
+        CTRACE(("java suspend lock exit, self: %p, thread: %p, "
             "suspend_flag: %d", hythread_self(), vm_thread,
             vm_thread->suspend_flag));
 
@@ -212,7 +212,7 @@
 
         suspend_lock->_lock();
 
-        TRACE(("java suspend lock enter, self: %p, thread: %p, "
+        CTRACE(("java suspend lock enter, self: %p, thread: %p, "
             "suspend_flag: %d", hythread_self(), vm_thread,
             vm_thread->suspend_flag));
     } else {
@@ -223,13 +223,13 @@
         vm_thread->suspend_flag = 1;
 
     }
-    TRACE(("java suspend lock exit, self: %p, thread: %p, "
+    CTRACE(("java suspend lock exit, self: %p, thread: %p, "
         "suspend_flag: %d", hythread_self(), vm_thread,
         vm_thread->suspend_flag));
 
     suspend_lock->_unlock();
 
-    TRACE(("java suspend exit, self: %p, thread: %p, "
+    CTRACE(("java suspend exit, self: %p, thread: %p, "
         "suspend_flag: %d", hythread_self(), vm_thread,
         vm_thread->suspend_flag));
 
@@ -268,7 +268,7 @@
         return TM_ERROR_NONE;
     }
 
-    TRACE(("java suspend all"));
+    CTRACE(("java suspend all"));
 
     Lock_Manager *suspend_lock = VM_Global_State::loader_env->p_suspend_lock;
     suspend_lock->_lock();

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_manager.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_manager.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_manager.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_manager.cpp Fri Apr 18 00:26:23 2008
@@ -14,19 +14,9 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/** 
- * @author Andrey Chernyshev
- * @version $Revision: 1.1.2.1.4.5 $
- */
-
-
+#define LOG_DOMAIN "vmcore.thread"
+#include "cxxlog.h"
 #include "platform_lowlevel.h"
-#include <assert.h>
-
-//MVM
-#include <iostream>
-
-using namespace std;
 
 #ifndef PLATFORM_POSIX
 #include "vm_process.h"
@@ -65,8 +55,6 @@
 #include "java_lang_thread_ia32.h"
 #endif
 
-#define LOG_DOMAIN "vmcore.thread"
-#include "cxxlog.h"
 
 
 jint jthread_allocate_vm_thread_pool(JavaVM *java_vm,

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/verify_stack_enumeration.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/verify_stack_enumeration.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/verify_stack_enumeration.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/verify_stack_enumeration.cpp Fri Apr 18 00:26:23 2008
@@ -109,7 +109,7 @@
     // we are guaranteed that noone will start
     // enumeration while we are holding gc lock
 
-    LOG("--- verify_stack_enumeration started [" << counter << "]---");
+    TRACE("--- verify_stack_enumeration started [" << counter << "]---");
 
     // cache heap boundaries
     if (NULL == heap_base) { heap_base = gc_heap_base_address(); }
@@ -151,7 +151,7 @@
     vm_enumerate_thread(p_TLS_vmthread);
 
     // scan the stack
-    LOG("  stack is from " << stack_top << " to " << stack_end);
+    TRACE("  stack is from " << stack_top << " to " << stack_end);
     void** word = stack_top;
     std::set<void**>::iterator i;
     while (word < stack_end) {
@@ -163,7 +163,7 @@
                 // drop the root
                 roots.erase(i);
             } else {
-                LOG2("verify.rse.bug", 
+                TRACE2("verify.rse.bug", 
                     "pointer " << *word << " at " << word << " was not enumerated");
             }
         }
@@ -174,7 +174,7 @@
     while (i != roots.end()) {
         if (*i) {
             void** root = *i;
-            LOG2("verify.rse.bug", "the root " << *root << " at " << root
+            TRACE2("verify.rse.bug", "the root " << *root << " at " << root
                 << " was not found during conservative stack scan");
         }
         ++i;
@@ -190,7 +190,7 @@
     roots.clear();
     size = 0;
 
-    LOG("--- completed verify_stack_enumeration [" << counter++ << "]---");
+    TRACE("--- completed verify_stack_enumeration [" << counter++ << "]---");
     vm_gc_unlock_enum();
 
     // XXX: workaround to avoid infinite recursion

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/compile_em64t.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/compile_em64t.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/compile_em64t.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/compile_em64t.cpp Fri Apr 18 00:26:23 2008
@@ -18,6 +18,8 @@
  * @author Intel, Evgueni Brevnov
  * @version $Revision$
  */  
+#define LOG_DOMAIN "vm.helpers"
+#include "cxxlog.h"
 
 #include "open/types.h"
 #include "open/vm_type_access.h"
@@ -36,9 +38,6 @@
 #include "exceptions.h"
 #include "exceptions_jit.h"
 
-#define LOG_DOMAIN "vm.helpers"
-#include "cxxlog.h"
-
 #include "dump.h"
 #include "vm_stats.h"
 
@@ -51,7 +50,7 @@
 }
 
 void patch_code_with_threads_suspended(Byte * UNREF code_block, Byte * UNREF new_code, size_t UNREF size) {
-    ABORT("Not supported on EM64T currently");
+    DIE(("Not supported on EM64T currently"));
 }
 
 void compile_protect_arguments(Method_Handle method, GcFrame * gc) {
@@ -146,7 +145,7 @@
         case VM_DATA_TYPE_VALUE:
             LDIE(30, "This functionality is not currently supported");
         default:
-            ASSERT(0, "Unexpected data type: " << type_info_get_type(tih));
+            DIE(("Unexpected data type: %d", type_info_get_type(tih)));
         }
     }
 }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/jit_runtime_support_em64t.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/jit_runtime_support_em64t.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/jit_runtime_support_em64t.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/jit_runtime_support_em64t.cpp Fri Apr 18 00:26:23 2008
@@ -18,8 +18,8 @@
  * @author Intel, Evgueni Brevnov
  * @version $Revision$
  */  
-
-#include <assert.h>
+#define LOG_DOMAIN "vm.helpers"
+#include "cxxlog.h"
 
 #include "open/types.h"
 #include "open/gc.h"
@@ -36,9 +36,6 @@
 #include "m2n.h"
 #include "../m2n_em64t_internal.h"
 
-#define LOG_DOMAIN "vm.helpers"
-#include "cxxlog.h"
-
 #include "vm_stats.h"
 #include "dump.h"
 #include "exceptions.h"
@@ -351,7 +348,7 @@
     case VM_RT_NEW_VECTOR_USING_VTABLE:
         return rth_get_lil_new_vector_using_vtable();
     default:
-        ASSERT(false, "Unexpected helper id" << f);
+        DIE(("Unexpected helper id %d", f));
         return NULL;
     }
 }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base_natives/java_lang_thread_em64t.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base_natives/java_lang_thread_em64t.h?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base_natives/java_lang_thread_em64t.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base_natives/java_lang_thread_em64t.h Fri Apr 18 00:26:23 2008
@@ -20,13 +20,13 @@
  */  
 
 
-#include "log_macro.h"
+#include "clog.h"
 
 #ifdef PLATFORM_POSIX
 
 
-#define OS_HW_REGS_TO_VM_THREAD_REGS()    ABORT("Not supported");
-#define OS_VM_THREAD_REGS_TO_HW_REGS()    ABORT("Not supported");
+#define OS_HW_REGS_TO_VM_THREAD_REGS()    DIE(("Not supported));
+#define OS_VM_THREAD_REGS_TO_HW_REGS()    DIE(("Not supported));
 
 #else
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/compile_IA32.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/compile_IA32.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/compile_IA32.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/compile_IA32.cpp Fri Apr 18 00:26:23 2008
@@ -144,13 +144,13 @@
                 break;
             }
         default:
-            ASSERT(0, "Unexpected data type: " << type_info_get_type(tih));
+            DIE(("Unexpected data type: %d", type_info_get_type(tih)));
         }
     }
 }
 
 void patch_code_with_threads_suspended(Byte * UNREF code_block, Byte * UNREF new_code, size_t UNREF size) {
-    ABORT("Not supported on IA32 currently");
+    DIE(("Not supported on IA32 currently"));
 }
 
 // Convert a reference on the stack, if null, from a managed null

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/ini_iA32.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/ini_iA32.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/ini_iA32.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/ini_iA32.cpp Fri Apr 18 00:26:23 2008
@@ -14,17 +14,8 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/** 
- * @author Intel, Evgueni Brevnov
- * @version $Revision: 1.1.2.1.4.3 $
- */  
-
-//MVM
-#include <iostream>
-
-using namespace std;
-
-#include <assert.h>
+#define LOG_DOMAIN "invoke"
+#include "cxxlog.h"
 
 #include "open/types.h"
 #include "open/vm_util.h"
@@ -46,9 +37,6 @@
 
 #include "port_malloc.h"
 
-#define LOG_DOMAIN "invoke"
-#include "cxxlog.h"
-
 #include "dump.h"
 
 typedef ManagedObject* (*RefFuncPtr)(uint32* args, int args_size, void* func);
@@ -287,7 +275,7 @@
                 argId -= 2;
                 break;
             default:
-                ABORT("Unexpected java type");
+                DIE(("Unexpected java type"));
         }
     }
     assert(argId >= 0);
@@ -343,7 +331,7 @@
             break;
 
         default:
-            ABORT("Unexpected java type");
+            DIE(("Unexpected java type"));
     }
 
     if (exn_raised()) {
@@ -363,6 +351,7 @@
     //printf("execute:  pop: prev = 0x%p, curr=0x%p\n", &lastFrame, lastFrame);
     p_TLS_vmthread->lastFrame = lastFrame;
 }
+
 
 
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/jit_runtime_support_ia32.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/jit_runtime_support_ia32.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/jit_runtime_support_ia32.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/jit_runtime_support_ia32.cpp Fri Apr 18 00:26:23 2008
@@ -18,14 +18,8 @@
  * @author Intel, Evgueni Brevnov, Ivan Volosyuk
  * @version $Revision: 1.1.2.2.4.5 $
  */  
-
-
-//MVM
-#include <iostream>
-
-using namespace std;
-
-#include <assert.h>
+#define LOG_DOMAIN "vm.helpers"
+#include "cxxlog.h"
 
 #include "open/types.h"
 #include "open/gc.h"
@@ -57,9 +51,6 @@
 #include "m2n.h"
 #include "../m2n_ia32_internal.h"
 
-#define LOG_DOMAIN "vm.helpers"
-#include "cxxlog.h"
-
 #include "dump.h"
 #include "vm_stats.h"
 
@@ -75,7 +66,7 @@
     ASSERT_THROW_AREA;
     assert(!hythread_is_suspend_enabled());
     exn_throw_by_name("java/lang/ClassCastException");
-    ABORT("The last called function should not return");
+    DIE(("The last called function should not return"));
 } //vm_throw_java_lang_ClassCastException
 
 #ifdef VM_STATS // exclude remark in release mode (defined but not used)
@@ -785,7 +776,7 @@
 {
     ASSERT_THROW_AREA;
     exn_throw_by_name("java/lang/IncompatibleClassChangeError");
-    ABORT("The last called function should not return");
+    DIE(("The last called function should not return"));
 } //vm_throw_java_lang_IncompatibleClassChangeError
 
 
@@ -859,7 +850,7 @@
     ASSERT_THROW_AREA;
     assert(!hythread_is_suspend_enabled());
     exn_throw_by_name("java/lang/ArithmeticException");
-    ABORT("The last called function should not return");
+    DIE(("The last called function should not return"));
 } //vm_throw_java_lang_ArithmeticException
 
 
@@ -957,7 +948,7 @@
 {
     TRACE("vm_throw_linking_exception, idx=" << cp_index << "\n");
     vm_rt_class_throw_linking_error(clss, cp_index, opcode);
-    ABORT("The last called function should not return");
+    DIE(("The last called function should not return"));
 } //vm_throw_linking_exception
 
 
@@ -1083,7 +1074,7 @@
     case VM_RT_GC_HEAP_WRITE_REF:
         return (void*)gc_heap_slot_write_ref;
     default:
-        ABORT("Unexpected helper id");
+        DIE(("Unexpected helper id"));
         return 0;
     }
 } //vm_helper_get_addr

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/optimize_ia32.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/optimize_ia32.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/optimize_ia32.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/optimize_ia32.cpp Fri Apr 18 00:26:23 2008
@@ -147,7 +147,7 @@
         s = mov(s,  ebx_opnd,  eax_opnd);
 #else
         // DO NOT RUN THIS OVERRIDE ON LINUX (it will not work)
-        ABORT("Not supported for this platform");
+        DIE(("Not supported for this platform"));
 #endif // !PLATFORM_POSIX
 
         s = mov(s,  eax_opnd,  M_Base_Opnd(ebx_reg, current_offset)); // ld r,[l1+current_offset]

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base_natives/java_lang_thread_ia32.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base_natives/java_lang_thread_ia32.h?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base_natives/java_lang_thread_ia32.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base_natives/java_lang_thread_ia32.h Fri Apr 18 00:26:23 2008
@@ -20,13 +20,12 @@
  */  
 
 
-#include "log_macro.h"
+#include "clog.h"
 
 #ifdef PLATFORM_POSIX
 
-
-#define OS_HW_REGS_TO_VM_THREAD_REGS()    ABORT("Not supported");
-#define OS_VM_THREAD_REGS_TO_HW_REGS()    ABORT("Not supported");
+#define OS_HW_REGS_TO_VM_THREAD_REGS()    DIE(("Not supported"));
+#define OS_VM_THREAD_REGS_TO_HW_REGS()    DIE(("Not supported"));
 
 #else
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/mem_alloc.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/mem_alloc.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/mem_alloc.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/mem_alloc.cpp Fri Apr 18 00:26:23 2008
@@ -64,10 +64,8 @@
     if (_use_large_pages && ps[1] != 0)
         _page_size = ps[1];
 
-    VERIFY(APR_SUCCESS == apr_pool_create(&aux_pool, 0), \
-        "Cannot initialize a memory pool");
-    VERIFY(APR_SUCCESS == apr_thread_mutex_create(&aux_mutex, APR_THREAD_MUTEX_NESTED, aux_pool), \
-        "Cannot initialize pool reallocation mutex");
+    VERIFY_SUCCESS(apr_pool_create(&aux_pool, 0));
+    VERIFY_SUCCESS(apr_thread_mutex_create(&aux_mutex, APR_THREAD_MUTEX_NESTED, aux_pool));
 
 #ifdef VM_STATS
     VM_Statistics::get_vm_stats().number_memorymanager_created++;
@@ -76,21 +74,18 @@
 
 BasePoolManager::~BasePoolManager()
 {
-    VERIFY(APR_SUCCESS == apr_thread_mutex_destroy(aux_mutex), \
-        "Cannot destroy the mutex");
+    VERIFY_SUCCESS(apr_thread_mutex_destroy(aux_mutex));
     apr_pool_destroy(aux_pool);
 }
 
 void BasePoolManager::_lock()
 {
-    VERIFY(APR_SUCCESS == apr_thread_mutex_lock(aux_mutex), \
-        "Cannot lock the pool's mutex");
+    VERIFY_SUCCESS(apr_thread_mutex_lock(aux_mutex));
 }
 
 void BasePoolManager::_unlock()
 {
-    VERIFY(APR_SUCCESS == apr_thread_mutex_unlock(aux_mutex), \
-        "Cannot unlock the pool's mutex");
+    VERIFY_SUCCESS(apr_thread_mutex_unlock(aux_mutex));
 }
 
 size_t BasePoolManager::round_up_to_page_size_multiple(size_t size)

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/natives_support.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/natives_support.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/natives_support.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/natives_support.cpp Fri Apr 18 00:26:23 2008
@@ -16,16 +16,15 @@
  */
 /** 
  * @author Pavel Rebriy, Ilya Berezhniuk
- * @version $Revision: 1.1.2.1.4.3 $
  */  
 
-
-#include <stdio.h>
 #include <string.h>
 #include <vector>
 #include <apr_strings.h>
 
-#include "assert.h"
+#define LOG_DOMAIN "natives"
+#include "cxxlog.h"
+
 #include "port_malloc.h"
 #include "port_dso.h"
 #include "exceptions.h"
@@ -39,9 +38,6 @@
 #include "jni_types.h"
 #include "jni_utils.h"
 
-#define LOG_DOMAIN "natives"
-#include "cxxlog.h"
-
 typedef jint (JNICALL *f_JNI_OnLoad) (JavaVM *vm, void *reserved);
 typedef void (JNICALL *f_JNI_OnUnload) (JavaVM *vm, void *reserved);
 
@@ -783,4 +779,5 @@
     jni_libs.lock._unlock();
     return result;
 }
+
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmstart/src/compmgr/component_manager_impl.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmstart/src/compmgr/component_manager_impl.cpp?rev=649391&r1=649390&r2=649391&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmstart/src/compmgr/component_manager_impl.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmstart/src/compmgr/component_manager_impl.cpp Fri Apr 18 00:26:23 2008
@@ -25,6 +25,7 @@
 
 #include "open/compmgr.h"
 #include "component_manager_impl.h"
+#include "port_atomic.h"
 
 #define LOG_DOMAIN "compmgr"
 #include "clog.h"
@@ -183,7 +184,7 @@
 AddInstance(OpenInstanceHandle instance,
             ComponentInfoHandle component_info,
             apr_pool_t* pool) {
-    TRACE(("Cm.AddInstance()")); 
+    CTRACE(("Cm.AddInstance()")); 
 
     _InstanceInfo* instance_info =
         (_InstanceInfo*) apr_palloc(pool, sizeof(_InstanceInfo));
@@ -345,7 +346,7 @@
 
 static int
 DumpComponent(OpenComponentHandle component) {
-    TRACE(("%s-%s (Vendor: %s)\nDescription:\t\nInterfaces:\t",
+    CTRACE(("%s-%s (Vendor: %s)\nDescription:\t\nInterfaces:\t",
         component->GetName(), component->GetVersion(),
         component->GetVendor(), component->GetDescription()));
 
@@ -355,7 +356,7 @@
      * it becomes NULL.
      */
     for(; *p_name; p_name++) {
-        TRACE((" %s", *p_name));
+        CTRACE((" %s", *p_name));
     }
     return APR_SUCCESS;
 }
@@ -369,7 +370,7 @@
  */
 static int
 RemoveAndFreeComponentInfo(const char* component_name) {
-    TRACE(("static RemoveAndFreeComponentInfo()"));
+    CTRACE(("static RemoveAndFreeComponentInfo()"));
 
     _ComponentInfo** p_component_info;
     int ret = GetComponentInfoSlot(&p_component_info, component_name);
@@ -381,7 +382,7 @@
     DumpComponent(component_info->component);
 
     assert(component_info->num_clients > 0);
-    TRACE(("Removing one of %d component subscribers", component_info->num_clients));
+    CTRACE(("Removing one of %d component subscribers", component_info->num_clients));
 
     if (--component_info->num_clients > 0) {
         /* there are still clients for this component, stop here */
@@ -395,25 +396,31 @@
 
 static int
 InitializeGlobalLock() {
-   TRACE(("Cm.InitializeGlobalLock()"));
-    apr_pool_t* pool;
-    int ret = apr_pool_create(&pool, NULL);
+    CTRACE(("Cm.InitializeGlobalLock()"));
+    if (NULL != global_lock) {
+        return APR_SUCCESS;
+    }
+
+    int ret = apr_initialize();
     if (APR_SUCCESS != ret) {
         return ret;
     }
 
+    apr_pool_t* pool;
+    ret = apr_pool_create(&pool, NULL);
+    if (APR_SUCCESS != ret) {
+        goto pool_error;
+    }
+
     apr_thread_rwlock_t* lock;
     ret = apr_thread_rwlock_create(&lock, pool);
     if (APR_SUCCESS != ret) {
-        apr_pool_destroy(pool); /* Ignore errors */
-        return ret;
+        goto lock_error;
     }
 
     /* Atomic replacement of a global component manager lock */
-    void* old_value = apr_atomic_casptr((volatile void **) &global_lock,
-        (void*) lock, NULL);
-
-    if (NULL == old_value) {
+    if (NULL == port_atomic_casptr(
+        (volatile void **) &global_lock, (void*) lock, NULL)) {
         /* Successfully placed a lock to a static storage */
         global_pool = pool;
         return APR_SUCCESS;
@@ -429,9 +436,14 @@
          * apr_pool_destroy(pool);
          * return ret;
          */
-        apr_pool_destroy(pool);
-        return APR_SUCCESS; 
+        goto lock_error;
     }
+
+lock_error:
+    apr_pool_destroy(pool); /* Ignore errors */
+pool_error:
+    apr_terminate();
+    return ret;
 }
 
 /*
@@ -440,7 +452,7 @@
  */
 static int
 Destroy() {
-    TRACE(("Cm.Destroy()"));
+    CTRACE(("Cm.Destroy()"));
     int ret = APR_SUCCESS, ret_new;
 
     /* Deallocate all components */
@@ -468,7 +480,7 @@
 AddComponent(OpenComponentInitializer init_func,
              DllHandle lib,
              apr_pool_t* parent_pool) {
-    TRACE(("static AddComponent()"));
+    CTRACE(("static AddComponent()"));
 
     apr_pool_t* pool;
     int ret = apr_pool_create(&pool, parent_pool);
@@ -550,7 +562,7 @@
  */
 static int
 LoadLib(DllHandle* p_lib, const char* path) {
-    TRACE(("Cm.LoadLibrary(\"%s\")", path));
+    CTRACE(("Cm.LoadLibrary(\"%s\")", path));
     int ret = FindLibrary(p_lib, path);
     if (APR_SUCCESS == ret) {
         return APR_SUCCESS;
@@ -586,7 +598,7 @@
         char buffer[MAX_ERROR_BUFFER_SIZE];
         apr_dso_error(lib->descriptor,
                 buffer, MAX_ERROR_BUFFER_SIZE);
-        TRACE(("Error loading %s: %s", path, buffer));
+        CTRACE(("Error loading %s: %s", path, buffer));
         apr_pool_destroy(pool);
         return ret;
     }
@@ -714,7 +726,7 @@
  */
 static int
 Create() {
-    TRACE(("Cm.Create()"));
+    CTRACE(("Cm.Create()"));
 
     apr_pool_t* pool;
     int ret = apr_pool_create(&pool, global_pool);
@@ -747,7 +759,7 @@
  */
 int
 CmAcquire(OpenComponentManagerHandle* p_cm) {
-    TRACE(("Cm.Acquire()"));
+    CTRACE(("Cm.Acquire()"));
     InitializeGlobalLock();
 
     VERIFY_SUCCESS(apr_thread_rwlock_wrlock(global_lock));
@@ -760,7 +772,7 @@
     } else {
         component_manager_impl->num_clients++;
     }
-    TRACE(("Cm.Acquire(): component_manager_impl->num_clients = %d", component_manager_impl->num_clients));
+    CTRACE(("Cm.Acquire(): component_manager_impl->num_clients = %d", component_manager_impl->num_clients));
     *p_cm = (OpenComponentManagerHandle) component_manager_impl;
     VERIFY_SUCCESS(apr_thread_rwlock_unlock(global_lock));
     return APR_SUCCESS;
@@ -782,7 +794,7 @@
 
 int
 CmAddComponent(OpenComponentInitializer init_func) {
-    TRACE(("Cm.AddComponent()"));
+    CTRACE(("Cm.AddComponent()"));
     VERIFY_SUCCESS(apr_thread_rwlock_wrlock(global_lock));
 
     int ret = AddComponent(init_func, NULL, component_manager_impl->pool);
@@ -794,21 +806,21 @@
 int
 CmLoadComponent(const char* path,
                 const char* init_func_name) {
-    TRACE(("Cm.LoadComponent(\"%s\", %s())", path, init_func_name));
+    CTRACE(("Cm.LoadComponent(\"%s\", %s())", path, init_func_name));
 
     VERIFY_SUCCESS(apr_thread_rwlock_wrlock(global_lock));
 
     DllHandle lib;
     int ret = LoadLib(&lib, path);
     if (APR_SUCCESS != ret) {
-        TRACE(("failed to load: %d %s\n", ret, path));
+        CTRACE(("failed to load: %d %s\n", ret, path));
         goto load_error;
     }
     
     OpenComponentInitializer init_func;
     ret = GetOpenComponentInitializer(&init_func, lib, init_func_name);
     if (APR_SUCCESS != ret) {
-        TRACE(("failed to init: %d\n", ret));
+        CTRACE(("failed to init: %d\n", ret));
         goto init_error;
     }
 



Mime
View raw message