From eac5c7419333b4bc6be601536e161c102fdcdf56 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Fri, 17 Apr 2009 00:46:32 +0000 Subject: [PATCH] optimizations --- Robust/src/Runtime/STM/stm.c | 4 ---- Robust/src/Runtime/STM/tm.h | 3 ++- Robust/src/Runtime/garbage.c | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Robust/src/Runtime/STM/stm.c b/Robust/src/Runtime/STM/stm.c index 6543380c..a891ee3b 100644 --- a/Robust/src/Runtime/STM/stm.c +++ b/Robust/src/Runtime/STM/stm.c @@ -186,10 +186,6 @@ __attribute__((pure)) void *transRead(void * oid) { objheader_t *objcopy; int size; - //quick case for new objects - if (((struct ___Object___ *)oid)->___objstatus___ & NEW) - return oid; - /* Read from the main heap */ //No lock for now objheader_t *header = (objheader_t *)(((char *)oid) - sizeof(objheader_t)); diff --git a/Robust/src/Runtime/STM/tm.h b/Robust/src/Runtime/STM/tm.h index 1da40df5..1631d666 100644 --- a/Robust/src/Runtime/STM/tm.h +++ b/Robust/src/Runtime/STM/tm.h @@ -93,7 +93,8 @@ chashlistnode_t * cnodetmp=&c_table[(((unsigned INTPTR)inputvalue)&c_mask)>>4]; do { \ if (cnodetmp->key==inputvalue) {x=cnodetmp->val;break;} \ cnodetmp=cnodetmp->next;\ - if (cnodetmp==NULL) {x=transRead(inputvalue); asm volatile("":"=m"(c_table),"=m"(c_mask));break;} \ + if (cnodetmp==NULL) {if (((struct ___Object___*)inputvalue)->___objstatus___&NEW) {x=inputvalue;break;} else \ +{x=transRead(inputvalue); asm volatile("":"=m"(c_table),"=m"(c_mask));break;}} \ } while(1);\ }} diff --git a/Robust/src/Runtime/garbage.c b/Robust/src/Runtime/garbage.c index 182342d1..a565825d 100644 --- a/Robust/src/Runtime/garbage.c +++ b/Robust/src/Runtime/garbage.c @@ -266,7 +266,7 @@ void enqueuetag(struct ___TagDescriptor___ *ptr) { } #endif -#ifdef STM +#if defined(STM)||defined(THREADS) __thread char * memorybase=NULL; __thread char * memorytop=NULL; #endif @@ -637,7 +637,7 @@ void restartaftergc(struct listitem * litem) { } #endif -#ifdef STM +#if defined(STM)||defined(THREADS) #define MEMORYBLOCK 65536 void * helper(struct garbagelist *, int); void * mygcmalloc(struct garbagelist * stackptr, int size) { -- 2.34.1