* src/mm/cacao-gc/region.h (regioninfo_t): Added object header for locking.
authormichi <none@none>
Sun, 11 Mar 2007 23:32:09 +0000 (23:32 +0000)
committermichi <none@none>
Sun, 11 Mar 2007 23:32:09 +0000 (23:32 +0000)
* src/mm/cacao-gc/region.c (region_create): Header mentioned above is initiated.
* src/mm/cacao-gc/heap.c (heap_alloc_intern): Lock regions while allocating.

--HG--
branch : exact-gc

15 files changed:
configure.ac
src/mm/cacao-gc/heap.c
src/mm/cacao-gc/region.c
src/mm/cacao-gc/region.h
src/vm/builtin.c
src/vm/jit/alpha/patcher.c
src/vm/jit/jit.c
src/vm/jit/jit.h
src/vm/jit/mips/md.c
src/vm/jit/mips/patcher.c
src/vm/jit/parse.c
src/vm/jit/powerpc/patcher.c
src/vm/jit/powerpc64/patcher.c
src/vm/jit/s390/asmpart.S
src/vm/jit/x86_64/asmpart.S

index 05284e9099bc4a68726a95941f2c8a17c058d101..c2ca770c0ffaab9c23037250ded6543161a94b36 100644 (file)
@@ -22,7 +22,7 @@ dnl along with this program; if not, write to the Free Software
 dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 dnl 02110-1301, USA.
 dnl 
-dnl $Id: configure.ac 7441 2007-03-02 23:13:10Z michi $
+dnl $Id: configure.ac 7434 2007-03-02 19:44:53Z edwin $
 
 dnl Process this file with autoconf to produce a configure script.
 
index 6704e647b52cbbde4d873400c1dd4569bafef0cc..b7f8c1f9615e6206fd4c4568a03a03280176ce46 100644 (file)
@@ -174,11 +174,13 @@ static java_objectheader *heap_alloc_intern(u4 bytelength, regioninfo_t *region)
        /* align objects in memory */
        bytelength = GC_ALIGN(bytelength, GC_ALIGN_SIZE);
 
+       /* lock the region */
+       LOCK_MONITOR_ENTER(region);
+
        /* check for sufficient free space */
        if (bytelength > region->free) {
                dolog("GC: Region out of memory!");
-               /* TODO: change this to gc_collect() !!! */
-               /*gc_call();*/
+               gc_collect();
                return NULL;
        }
 
@@ -187,6 +189,10 @@ static java_objectheader *heap_alloc_intern(u4 bytelength, regioninfo_t *region)
        region->ptr += bytelength;
        region->free -= bytelength;
 
+       /* unlock the region */
+       LOCK_MONITOR_EXIT(region);
+       GC_LOG( region = NULL; );
+
        /* clear allocated memory region */
        GC_ASSERT(p);
        MSET(p, 0, u1, bytelength);
index 44301265245a93cbe41d3a95343a64d34f79d798..a2d83b9ae617b407e691fdc05ccc26bb30791114 100644 (file)
@@ -66,6 +66,11 @@ void *region_create(regioninfo_t *region, u4 size)
        region->size = size;
        region->free = size;
 
+#if defined(ENABLE_THREADS)
+       /* initiate the header for locking */
+       lock_init_object_lock((java_objectheader *) region);
+#endif
+
 #if defined(ENABLE_MEMCHECK)
        /* poison this region */
        /* TODO: this should really be done MNEW above! */
index 143f217d072adfc7e481a6356d124dd8e8e787ff..3a6a8c0ca42cda94607970efa86b97da2ead291a 100644 (file)
@@ -48,6 +48,9 @@ typedef struct regioninfo_t regioninfo_t;
 /* Structures *****************************************************************/
 
 struct regioninfo_t {
+#if defined(ENABLE_THREADS)
+       java_objectheader header; /* needed for locking */
+#endif
        u1 *base;     /* pointer to the start of this region */
        u1 *end;      /* pointer to the end of this region */
        u1 *ptr;      /* pointer to the beginning of the free space */
index 75a55f6bce360f3c288bb63fd83c6be655a64d25..1daead141581be1bfde332d52e806513fa84ef42 100644 (file)
@@ -28,7 +28,7 @@
    calls instead of machine instructions, using the C calling
    convention.
 
-   $Id: builtin.c 7483 2007-03-08 13:17:40Z michi $
+   $Id: builtin.c 7459 2007-03-05 17:34:43Z edwin $
 
 */
 
index 2c37a890760009bb18ef11f30b369845462acdc8..51a1190eda66aa3d428506d0bb28e09f21cfb357 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: patcher.c 7483 2007-03-08 13:17:40Z michi $
+   $Id: patcher.c 7464 2007-03-06 00:26:31Z edwin $
 
 */
 
index 647208c91611fd32417a1842350a44820ae3747e..03392eea2046344b1f7e13428c16afd1901f36dd 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: jit.c 7483 2007-03-08 13:17:40Z michi $
+   $Id: jit.c 7451 2007-03-04 20:10:18Z edwin $
 
 */
 
index 37d9c3bfa6943d824edaa39ff608108cdd42558a..bef4a05a210d1307d7f275fd35c13f384d99c4d1 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: jit.h 7483 2007-03-08 13:17:40Z michi $
+   $Id: jit.h 7464 2007-03-06 00:26:31Z edwin $
 
 */
 
index b8b0e9dff3de3a323113fb19aeec95ac51fa3933..fedd7447247df8b0ce314a228ec0aea10858bbb7 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: md.c 7483 2007-03-08 13:17:40Z michi $
+   $Id: md.c 7477 2007-03-07 14:05:04Z twisti $
 
 */
 
index 32a21599f8effb56ac219a012cb8b3b18a45ae06..b45876cd7478810db48fde10531d54b4d4b893e4 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: patcher.c 7483 2007-03-08 13:17:40Z michi $
+   $Id: patcher.c 7464 2007-03-06 00:26:31Z edwin $
 
 */
 
index 7742cb28e52680f20564d34eefdff21555644479..b8cb836b11912fb8ea320ef0cf36c5ec6365a4f6 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: parse.c 7483 2007-03-08 13:17:40Z michi $
+   $Id: parse.c 7464 2007-03-06 00:26:31Z edwin $
 
 */
 
index 77f12f21032d291580cc4b619587b21326952af9..11f4438f9ab24873bd9cd2c0da6877a2ff8442ea 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: patcher.c 7483 2007-03-08 13:17:40Z michi $
+   $Id: patcher.c 7464 2007-03-06 00:26:31Z edwin $
 
 */
 
index 6f5add6cc7bfa6ce5ba53c918284aeddc6f15fad..f1b0e595fea123ece354f62320983fbd20493b79 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: patcher.c 7483 2007-03-08 13:17:40Z michi $
+   $Id: patcher.c 7464 2007-03-06 00:26:31Z edwin $
 
 */
 
index d656e4c595c0e8d3527c7d6dc34c15c515a26fb7..9da2c79b4e89ef978e84141118fb5e511891ac82 100644 (file)
@@ -30,7 +30,7 @@
 
    Changes: Edwin Steiner
 
-   $Id: asmpart.S 7483 2007-03-08 13:17:40Z michi $
+   $Id: asmpart.S 7442 2007-03-02 23:28:37Z pm $
 
 */
 
index 79d21ea83f91f3b5c4750f68248a3b872cac7877..0cac95447e6b37dbf00fa41ef461992f643b73bd 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: asmpart.S 7483 2007-03-08 13:17:40Z michi $
+   $Id: asmpart.S 7475 2007-03-07 12:37:34Z twisti $
 
 */