harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfur...@apache.org
Subject svn commit: r646364 - in /harmony/enhanced/drlvm/trunk/vm/jitrino/src: jet/ optimizer/abcd/ shared/
Date Wed, 09 Apr 2008 14:09:39 GMT
Author: mfursov
Date: Wed Apr  9 07:09:36 2008
New Revision: 646364

URL: http://svn.apache.org/viewvc?rev=646364&view=rev
Log:
Fix for HARMONY-5700 [drlvm][jit] VM crashes during serialization


Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/bcproc.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_arith.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_dbg.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_fld_arr.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_instr.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_meth.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_obj.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/abcd/classic_abcd.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/mkernel.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/mkernel.h

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/bcproc.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/bcproc.cpp?rev=646364&r1=646363&r2=646364&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/bcproc.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/bcproc.cpp Wed Apr  9 07:09:36 2008
@@ -441,32 +441,32 @@
     }
     switch(jinst.opcode) {
     case OPCODE_IRETURN: {
-        static const CallSig cs(CCONV_MANAGED, i32);
+        SYNC_FIRST(static const CallSig cs(CCONV_MANAGED, i32));
         gen_return(cs);
         break;
     }
     case OPCODE_LRETURN: {
-        static const CallSig cs(CCONV_MANAGED, i64);
+        SYNC_FIRST(static const CallSig cs(CCONV_MANAGED, i64));
         gen_return(cs);
         break;
     }
     case OPCODE_FRETURN: {
-        static const CallSig cs(CCONV_MANAGED, flt32);
+        SYNC_FIRST(static const CallSig cs(CCONV_MANAGED, flt32));
         gen_return(cs);
         break;
     }
     case OPCODE_DRETURN: {
-        static const CallSig cs(CCONV_MANAGED, dbl64);
+        SYNC_FIRST(static const CallSig cs(CCONV_MANAGED, dbl64));
         gen_return(cs);
         break;
     }
     case OPCODE_ARETURN: {
-        static const CallSig cs(CCONV_MANAGED, jobj);
+        SYNC_FIRST(static const CallSig cs(CCONV_MANAGED, jobj));
         gen_return(cs);
         break;
     }
     case OPCODE_RETURN: {
-        static const CallSig cs(CCONV_MANAGED, jvoid);
+        SYNC_FIRST(static const CallSig cs(CCONV_MANAGED, jvoid));
         gen_return(cs);   
         break;
     }

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_arith.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_arith.cpp?rev=646364&r1=646363&r2=646364&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_arith.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_arith.cpp Wed Apr  9 07:09:36 2008
@@ -306,8 +306,8 @@
         char * helper = NULL;
         bool is_dbl = jt == dbl64;
         if (op == OPCODE_INEG) {
-            static const CallSig cs_dbl(CCONV_STDCALL, dbl64, dbl64);
-            static const CallSig cs_flt(CCONV_STDCALL, flt32, flt32);
+            SYNC_FIRST(static const CallSig cs_dbl(CCONV_STDCALL, dbl64, dbl64));
+            SYNC_FIRST(static const CallSig cs_flt(CCONV_STDCALL, flt32, flt32));
             rcs = is_dbl? &cs_dbl : &cs_flt;
             stackFix = gen_stack_to_args(true, *rcs, 0, 1);
             helper = is_dbl ? (char*)&rt_h_neg_dbl64 : (char*)&rt_h_neg_flt32;
@@ -316,8 +316,8 @@
         }
         else {
             //if (m_jframe->dip(1).stype == st_imm && )
-            static const CallSig cs_dbl(CCONV_STDCALL, dbl64, dbl64, dbl64, i32);
-            static const CallSig cs_flt(CCONV_STDCALL, flt32, flt32, flt32, i32);
+            SYNC_FIRST(static const CallSig cs_dbl(CCONV_STDCALL, dbl64, dbl64, dbl64, i32));
+            SYNC_FIRST(static const CallSig cs_flt(CCONV_STDCALL, flt32, flt32, flt32, i32));
             rcs = is_dbl? &cs_dbl : &cs_flt;
             stackFix = gen_stack_to_args(true, *rcs, 0, 2);
             helper = is_dbl ? (char*)&rt_h_dbl_a : (char*)&rt_h_flt_a;
@@ -327,21 +327,21 @@
     }
     else if (jt==i64) {
         if (op == OPCODE_INEG) {
-            static const CallSig cs(CCONV_STDCALL, i64, i64);
+            SYNC_FIRST(static const CallSig cs(CCONV_STDCALL, i64, i64));
             rcs = &cs;
             stackFix = gen_stack_to_args(true, *rcs, 0, 1);
             gen_call_novm(*rcs, (void*)&rt_h_neg_i64, 1);
             runlock(*rcs);
         }
         else if (shft) {
-            static const CallSig cs(CCONV_STDCALL, i64, i64, i32, i32);
+            SYNC_FIRST(static const CallSig cs(CCONV_STDCALL, i64, i64, i32, i32));
             rcs = &cs;
             stackFix = gen_stack_to_args(true, *rcs, 0, 2);
             gen_call_novm(*rcs, (void*)&rt_h_i64_shift, 2, op);
             runlock(*rcs);
         }
         else {
-            static const CallSig cs(CCONV_STDCALL, i64, i64, i64, i32);
+            SYNC_FIRST(static const CallSig cs(CCONV_STDCALL, i64, i64, i64, i32));
             rcs = &cs;
             stackFix = gen_stack_to_args(true, *rcs, 0, 2);
             gen_call_novm(*rcs, (void*)&rt_h_i64_a, 2, op);
@@ -351,7 +351,7 @@
     else {
         assert(jt==i32);
         if (op == OPCODE_INEG) {
-            static const CallSig cs(CCONV_STDCALL, i32, i32);
+            SYNC_FIRST(static const CallSig cs(CCONV_STDCALL, i32, i32));
             rcs = &cs;
             stackFix = gen_stack_to_args(true, *rcs, 0, 1);
             gen_call_novm(*rcs, (void*)&rt_h_neg_i32, 1);
@@ -375,7 +375,7 @@
             return;
         }
         else {
-            static const CallSig cs(CCONV_STDCALL, i32, i32, i32, i32);
+            SYNC_FIRST(static const CallSig cs(CCONV_STDCALL, i32, i32, i32, i32));
             rcs = &cs;
             stackFix = gen_stack_to_args(true, *rcs, 0, 2);
             gen_call_novm(*rcs, (void*)&rt_h_i32_a, 2, op);
@@ -432,7 +432,7 @@
     }
     assert(op == OPCODE_LCMP);
     char *helper = (char *)rt_h_lcmp;
-    static const CallSig cs(CCONV_STDCALL, i32, i64, i64);
+    SYNC_FIRST(static const CallSig cs(CCONV_STDCALL, i32, i64, i64));
     unsigned stackFix = gen_stack_to_args(true, cs, 0);
     gen_call_novm(cs, helper, 2);
     if (stackFix != 0) {

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_dbg.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_dbg.cpp?rev=646364&r1=646363&r2=646364&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_dbg.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_dbg.cpp Wed Apr  9 07:09:36 2008
@@ -137,7 +137,7 @@
     strcpy(lost, tmp_buf);
     strcat(lost, id_buf);
     if (save_regs) { push_all(); }
-    static const CallSig cs(CCONV_STDCALL, jvoid, jobj);
+    SYNC_FIRST(static const CallSig cs(CCONV_STDCALL, jvoid, jobj));
     call(is_set(DBG_CHECK_STACK), gr0, (void*)&dbg_rt_out, cs, 0, lost);
     if (save_regs) { pop_all(); }
 }

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_fld_arr.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_fld_arr.cpp?rev=646364&r1=646363&r2=646364&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_fld_arr.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_fld_arr.cpp Wed Apr  9 07:09:36 2008
@@ -135,7 +135,7 @@
     // stack: [.., aref, idx, val]
     if (jt == jobj && helperOk) {
         gen_write_barrier(m_curr_inst->opcode, NULL, Opnd(0));
-        static const CallSig cs_aastore(CCONV_HELPERS, jvoid, jobj, i32, jobj);
+        SYNC_FIRST(static const CallSig cs_aastore(CCONV_HELPERS, jvoid, jobj, i32, jobj));
         unsigned stackFix = gen_stack_to_args(true, cs_aastore, 0);
         gen_call_vm(cs_aastore, rt_helper_aastore, 3);
         if (stackFix != 0) {
@@ -242,7 +242,7 @@
             Val& ref = vstack(ref_depth, true);
             where = Opnd(jt, ref.reg(), fld_offset);
         }  else { //field is not resolved -> generate code to request offset
-            static const CallSig cs_get_offset(CCONV_HELPERS, iplatf, iplatf, i32, i32);
+            SYNC_FIRST(static const CallSig cs_get_offset(CCONV_HELPERS, iplatf, iplatf,
i32, i32));
             gen_call_vm(cs_get_offset, rt_helper_field_get_offset_withresolve, 0, fieldOp.enclClass,
fieldOp.cpIndex, fieldOp.isPut());
             runlock(cs_get_offset);
             AR gr_ret = cs_get_offset.ret_reg(0);
@@ -257,7 +257,7 @@
             char * fld_addr = (char*)field_get_address(fieldOp.fld);
             where = vaddr(jt, fld_addr);
         }  else { //field is not resolved -> generate code to request address
-            static const CallSig cs_get_addr(CCONV_HELPERS, iplatf, iplatf, i32, i32);
+            SYNC_FIRST(static const CallSig cs_get_addr(CCONV_HELPERS, iplatf, iplatf, i32,
i32));
             gen_call_vm(cs_get_addr, rt_helper_field_get_address_withresolve, 0, fieldOp.enclClass,
fieldOp.cpIndex, fieldOp.isPut());
             runlock(cs_get_addr);
             AR gr_ret = cs_get_addr.ret_reg(0);

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_instr.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_instr.cpp?rev=646364&r1=646363&r2=646364&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_instr.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_instr.cpp Wed Apr  9 07:09:36 2008
@@ -127,11 +127,11 @@
 
 #ifndef _EM64T_
     // Workaround since do_mov do not put jlong on stack in gen_args on ia32
-    static const CallSig cs_ti_fmodif(CCONV_HELPERS, jvoid, jobj, jobj, i32, i32, jobj, jobj);
+    SYNC_FIRST(static const CallSig cs_ti_fmodif(CCONV_HELPERS, jvoid, jobj, jobj, i32, i32,
jobj, jobj));
     Val vlocation((jlong)m_pc);
     Val vlocationHi((jlong)0);
 #else
-    static const CallSig cs_ti_fmodif(CCONV_HELPERS, jvoid, jobj, jobj, i64, jobj, jobj);
+    SYNC_FIRST(static const CallSig cs_ti_fmodif(CCONV_HELPERS, jvoid, jobj, jobj, i64, jobj,
jobj));
     Val vlocation((jlong)m_pc);
 #endif
 
@@ -224,11 +224,11 @@
 
 #ifndef _EM64T_
     // Workaround since do_mov do not put jlong on stack in gen_args on ia32
-    static const CallSig cs_ti_faccess(CCONV_HELPERS, jvoid, jobj, jobj, i32, i32, jobj);
+    SYNC_FIRST(static const CallSig cs_ti_faccess(CCONV_HELPERS, jvoid, jobj, jobj, i32,
i32, jobj));
     Val vlocation((jlong)m_pc);
     Val vlocationHi((jlong)0);
 #else
-    static const CallSig cs_ti_faccess(CCONV_HELPERS, jvoid, jobj, jobj, i64, jobj);
+    SYNC_FIRST(static const CallSig cs_ti_faccess(CCONV_HELPERS, jvoid, jobj, jobj, i64,
jobj));
     Val vlocation((jlong)m_pc);
 #endif
     rlock(cs_ti_faccess);
@@ -356,7 +356,7 @@
 
     // WB4C has the following signature:
     //(object written to, slot written to, value written to slot)
-    static const CallSig wb4c_sig(CCONV_CDECL, jvoid, jobj, jobj, jobj);
+    SYNC_FIRST(static const CallSig wb4c_sig(CCONV_CDECL, jvoid, jobj, jobj, jobj));
     //static char* wb4c_helper = xxx_gc_heap_slot_write_ref
     static char* wb4c_helper = (char*)vm_helper_get_addr(VM_RT_GC_HEAP_WRITE_REF);
 
@@ -367,7 +367,7 @@
     }
     // WB4J has the following signature:
     //(object written to, slot written to, value written to slot, metaA, metaB, mode)
-    static const CallSig wb4j_sig(CCONV_CDECL, jvoid, jobj, jobj, jobj, i32, i32, i32);
+    SYNC_FIRST(static const CallSig wb4j_sig(CCONV_CDECL, jvoid, jobj, jobj, jobj, i32, i32,
i32));
     static char* wb4j_helper = NULL;
     
 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_meth.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_meth.cpp?rev=646364&r1=646363&r2=646364&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_meth.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_meth.cpp Wed Apr  9 07:09:36 2008
@@ -515,7 +515,7 @@
         alu(alu_cmp, mem, Opnd(0));
         unsigned br_off = br(z, 0, 0, taken);
         
-        static const CallSig cs_ti_menter(CCONV_HELPERS, jvoid, jobj);
+        SYNC_FIRST(static const CallSig cs_ti_menter(CCONV_HELPERS, jvoid, jobj));
         gen_call_vm(cs_ti_menter, rt_helper_ti_method_enter, 0, m_method);
         
         patch(br_off, ip());
@@ -609,7 +609,7 @@
     if (compilation_params.exe_notify_method_exit) {
 
         // JVMTI helper takes pointer to return value and method handle
-        static const CallSig cs_ti_mexit(CCONV_HELPERS, jvoid, jobj, jobj);
+        SYNC_FIRST(static const CallSig cs_ti_mexit(CCONV_HELPERS, jvoid, jobj, jobj));
         // The call is a bit unusual, and is processed as follows:
         // we load an address of the top of the operand stack into 
         // a temporary register, and then pass this value as pointer
@@ -805,7 +805,7 @@
         AR gr_ret = ar_x;
         //1. get method address
         if (opcod == OPCODE_INVOKESTATIC || opcod == OPCODE_INVOKESPECIAL) {
-            static const CallSig cs_get_is_addr(CCONV_HELPERS, iplatf, iplatf, i32);
+            SYNC_FIRST(static const CallSig cs_get_is_addr(CCONV_HELPERS, iplatf, iplatf,
i32));
             char* helper = opcod == OPCODE_INVOKESTATIC ?  rt_helper_get_invokestatic_addr_withresolve
:
                                                            rt_helper_get_invokespecial_addr_withresolve;
             gen_call_vm(cs_get_is_addr, helper, 0, m_klass, cpIndex);
@@ -813,7 +813,7 @@
             gr_ret = cs_get_is_addr.ret_reg(0);
         } else {
             assert(opcod == OPCODE_INVOKEVIRTUAL || opcod == OPCODE_INVOKEINTERFACE);
-            static const CallSig cs_get_iv_addr(CCONV_HELPERS, iplatf, iplatf, i32, jobj);
+            SYNC_FIRST(static const CallSig cs_get_iv_addr(CCONV_HELPERS, iplatf, iplatf,
i32, jobj));
             char * helper = opcod == OPCODE_INVOKEVIRTUAL ? rt_helper_get_invokevirtual_addr_withresolve
: 
                                                             rt_helper_get_invokeinterface_addr_withresolve;
             // setup constant parameters first,

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_obj.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_obj.cpp?rev=646364&r1=646363&r2=646364&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_obj.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_obj.cpp Wed Apr  9 07:09:36 2008
@@ -57,7 +57,7 @@
         return;
     } 
     assert(lazy);
-    static const CallSig cs_newarray_withresolve(CCONV_HELPERS, jobj, iplatf, i32, i32);
+    SYNC_FIRST(static const CallSig cs_newarray_withresolve(CCONV_HELPERS, jobj, iplatf,
i32, i32));
     Val sizeVal = vstack(0);
     // setup constant parameters first,
     Val vclass(iplatf, enclClass);
@@ -84,7 +84,7 @@
         gen_call_throw(ci_helper_linkerr, rt_helper_throw_linking_exc, 0,
                        m_klass, jinst.op0, jinst.opcode);
     }
-    static const CallSig cs_new_arr(CCONV_HELPERS, jobj, i32, jobj);
+    SYNC_FIRST(static const CallSig cs_new_arr(CCONV_HELPERS, jobj, i32, jobj));
     unsigned stackFix = gen_stack_to_args(true, cs_new_arr, 0, 1);
     gen_call_vm(cs_new_arr, rt_helper_new_array, 1, ah);
     runlock(cs_new_arr);
@@ -120,7 +120,7 @@
     bool resolve = !lazy || class_cp_is_entry_resolved(enclClass, cpIndex);
     if(!resolve) {
         assert(lazy);
-        static const CallSig ci_get_class_withresolve(CCONV_HELPERS, jobj, iplatf, i32);
+        SYNC_FIRST(static const CallSig ci_get_class_withresolve(CCONV_HELPERS, jobj, iplatf,
i32));
         gen_call_vm(ci_get_class_withresolve, rt_helper_get_class_withresolve, 0, enclClass,
cpIndex);
         runlock(ci_get_class_withresolve);
         AR gr_ret = ci_get_class_withresolve.ret_reg(0);
@@ -163,7 +163,7 @@
     bool resolve = !lazy || class_cp_is_entry_resolved(enclClass, cpIndex);
     const CallSig* ci = NULL; 
     if (resolve) {
-        static const CallSig ci_new(CCONV_HELPERS, jobj, i32, jobj);
+        SYNC_FIRST(static const CallSig ci_new(CCONV_HELPERS, jobj, i32, jobj));
         ci = &ci_new;
 
         Class_Handle klass = resolve_class_new(m_compileHandle, enclClass, cpIndex);
@@ -179,7 +179,7 @@
         }
     } else {
         assert(lazy);
-        static const CallSig ci_new_with_resolve(CCONV_HELPERS, jobj, iplatf, i32);
+        SYNC_FIRST(static const CallSig ci_new_with_resolve(CCONV_HELPERS, jobj, iplatf,
i32));
         ci = &ci_new_with_resolve;
         gen_call_vm(ci_new_with_resolve, rt_helper_new_withresolve, 0, enclClass, cpIndex);
     }
@@ -200,8 +200,8 @@
             // resolution has failed
             gen_call_throw(ci_helper_linkerr, rt_helper_throw_linking_exc, 0, enclClass,
cpIdx, opcode);
         }
-        static const CallSig cs_checkcast(CCONV_HELPERS, jobj, jobj, jobj);
-        static const CallSig cs_instanceof(CCONV_HELPERS, i32, jobj, jobj);
+        SYNC_FIRST(static const CallSig cs_checkcast(CCONV_HELPERS, jobj, jobj, jobj));
+        SYNC_FIRST(static const CallSig cs_instanceof(CCONV_HELPERS, i32, jobj, jobj));
         const CallSig& cs = (opcode == OPCODE_CHECKCAST) ? cs_checkcast : cs_instanceof;
  
         char * helper = (opcode == OPCODE_CHECKCAST) ? rt_helper_checkcast : rt_helper_instanceof;
         unsigned stackFix = gen_stack_to_args(true, cs, 0, 1);
@@ -213,8 +213,8 @@
         gen_save_ret(cs);
     } else {
         assert(lazy);
-        static const CallSig cs_checkcast_with_resolve(CCONV_HELPERS, jobj, iplatf, i32,
jobj);
-        static const CallSig cs_instanceof_with_resolve(CCONV_HELPERS, i32, iplatf, i32,
jobj);
+        SYNC_FIRST(static const CallSig cs_checkcast_with_resolve(CCONV_HELPERS, jobj, iplatf,
i32, jobj));
+        SYNC_FIRST(static const CallSig cs_instanceof_with_resolve(CCONV_HELPERS, i32, iplatf,
i32, jobj));
         const CallSig& cs_with_resolve = (opcode == OPCODE_CHECKCAST) ? cs_checkcast_with_resolve
: cs_instanceof_with_resolve;
         char * helper = (opcode == OPCODE_CHECKCAST) ? rt_helper_checkcast_withresolve :
rt_helper_instanceof_withresolve;
         Val tos = vstack(0);
@@ -233,7 +233,7 @@
 {
     const JInst& jinst = *m_curr_inst;
     gen_check_null(0);
-    static const CallSig cs_mon(CCONV_HELPERS, jvoid, jobj);
+    SYNC_FIRST(static const CallSig cs_mon(CCONV_HELPERS, jvoid, jobj));
     unsigned stackFix = gen_stack_to_args(true, cs_mon, 0);
     gen_call_vm(cs_mon,
             jinst.opcode == OPCODE_MONITORENTER ? 
@@ -246,7 +246,7 @@
 
 void CodeGen::gen_athrow(void)
 {
-    static const CallSig cs_throw(CCONV_HELPERS, jvoid, jobj);
+    SYNC_FIRST(static const CallSig cs_throw(CCONV_HELPERS, jvoid, jobj));
     unsigned stackFix = gen_stack_to_args(true, cs_throw, 0);
     gen_call_vm(cs_throw, rt_helper_throw, 1);
     runlock(cs_throw);

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp?rev=646364&r1=646363&r2=646364&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp Wed Apr  9 07:09:36 2008
@@ -1037,7 +1037,7 @@
         // That's why the exception object acts like a return value - for 
         // example on IA32 it's in EAX.
         //
-        static const CallSig cs(CCONV_MANAGED, jobj);
+        SYNC_FIRST(static const CallSig cs(CCONV_MANAGED, jobj));
         gen_save_ret(cs);
     }
     

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/abcd/classic_abcd.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/abcd/classic_abcd.cpp?rev=646364&r1=646363&r2=646364&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/abcd/classic_abcd.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/abcd/classic_abcd.cpp Wed Apr  9
07:09:36 2008
@@ -586,11 +586,11 @@
 
 void ClassicAbcd::runPass()
 {
-    static bool run_once = true;
-    if ( run_once && _runTests ) {
+    static bool SYNC_FIRST = true;
+    if ( SYNC_FIRST && _runTests ) {
         classic_abcd_test_main();
         _runTests = false;
-        run_once = false;
+        SYNC_FIRST = false;
     }
 
     MethodDesc& method_desc  = _irManager.getMethodDesc();

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/mkernel.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/mkernel.cpp?rev=646364&r1=646363&r2=646364&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/mkernel.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/mkernel.cpp Wed Apr  9 07:09:36 2008
@@ -34,10 +34,14 @@
 
 namespace Jitrino {
 
+Mutex Mutex::appGlobal;
+
 #ifdef _WIN32
 typedef void (*RELEASE_FPTR)(void *);
 class FMAP : public map<TlsKey, RELEASE_FPTR>, public Mutex
 {};
+
+
 
 /**
  * Creates, initializes and caches the map to store RELEASE_FPTS functions.

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/mkernel.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/mkernel.h?rev=646364&r1=646363&r2=646364&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/mkernel.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/mkernel.h Wed Apr  9 07:09:36 2008
@@ -142,13 +142,37 @@
      * @brief Disallows copying.
      */
     const Mutex& operator=(const Mutex&);
+
+public:
+    static Mutex appGlobal;
+
 };
 
+
+#define _LINE_VAR_CAT( name, line ) name##line
+#define _LINE_VAR( name, line ) _LINE_VAR_CAT( name, line )
+#define LINE_VAR(name) _LINE_VAR( name, __LINE__ )
+
+#define SYNC_FIRST(Expression) \
+    static bool LINE_VAR(first) = true;\
+    bool LINE_VAR(locked) = false;\
+    if (LINE_VAR(first)) {\
+        Mutex::appGlobal.lock();\
+        LINE_VAR(locked) = true;\
+    }\
+    Expression;\
+    LINE_VAR(first) = false;\
+    if (LINE_VAR(locked)) {\
+        Mutex::appGlobal.unlock();\
+    }\
+
+
+
 /**
  * @brief Automatically unlocks a Mutex when AutoLock object goes out of 
  * scope.
  *
- * Class AutoUnlock is an utility class to handy acquire and [automagically]
+ * Class AutoUnlock is an utility class to handy acquire and [automatically]
  * release Mutex lock.
  *
  * A trivial C++ trick, which, I believe, is used everywhere with Mutexes - 



Mime
View raw message