Author: Remi Meier <[email protected]>
Branch: stmgc-c4
Changeset: r67429:3a991051a045
Date: 2013-10-16 17:52 +0200
http://bitbucket.org/pypy/pypy/changeset/3a991051a045/
Log: import stmgc for nursery optimizations in JIT
diff --git a/rpython/translator/stm/src_stm/et.c
b/rpython/translator/stm/src_stm/et.c
--- a/rpython/translator/stm/src_stm/et.c
+++ b/rpython/translator/stm/src_stm/et.c
@@ -24,7 +24,7 @@
i++;
}
cur += sprintf(cur, "tid=%ld", stm_get_tid(obj));
- cur += sprintf(cur, " : rev=%lx : orig=%lx",
+ cur += sprintf(cur, " : rev=0x%lx : orig=0x%lx",
(long)obj->h_revision, (long)obj->h_original);
return tmp_buf;
}
diff --git a/rpython/translator/stm/src_stm/et.h
b/rpython/translator/stm/src_stm/et.h
--- a/rpython/translator/stm/src_stm/et.h
+++ b/rpython/translator/stm/src_stm/et.h
@@ -168,7 +168,7 @@
gcptr **shadowstack_end_ref;
gcptr *thread_local_obj_ref;
gcptr old_thread_local_obj;
-
+ /* sync with pypy stmgc: */
NURSERY_FIELDS_DECL
long atomic; /* 0 = not atomic, > 0 atomic */
diff --git a/rpython/translator/stm/src_stm/revision
b/rpython/translator/stm/src_stm/revision
--- a/rpython/translator/stm/src_stm/revision
+++ b/rpython/translator/stm/src_stm/revision
@@ -1,1 +1,1 @@
-9149deb7e746
+3acc863a00a8
diff --git a/rpython/translator/stm/src_stm/stmgc.h
b/rpython/translator/stm/src_stm/stmgc.h
--- a/rpython/translator/stm/src_stm/stmgc.h
+++ b/rpython/translator/stm/src_stm/stmgc.h
@@ -202,6 +202,7 @@
#define stm_pop_root() (*--stm_shadowstack)
extern __thread revision_t stm_private_rev_num;
+extern __thread struct tx_descriptor *thread_descriptor; /* XXX: stm_ prefix */
gcptr stm_DirectReadBarrier(gcptr);
gcptr stm_WriteBarrier(gcptr);
gcptr stm_RepeatReadBarrier(gcptr);
diff --git a/rpython/translator/stm/src_stm/stmsync.c
b/rpython/translator/stm/src_stm/stmsync.c
--- a/rpython/translator/stm/src_stm/stmsync.c
+++ b/rpython/translator/stm/src_stm/stmsync.c
@@ -223,14 +223,14 @@
}
else {
CommitTransaction();
- if (d->active != 2) {
- unsigned long limit = d->reads_size_limit_nonatomic;
- if (limit != 0 && limit < (stm_regular_length_limit >> 1))
- limit = (limit << 1) | 1;
- else
- limit = stm_regular_length_limit;
- d->reads_size_limit_nonatomic = limit;
- }
+
+ unsigned long limit = d->reads_size_limit_nonatomic;
+ if (limit != 0 && limit < (stm_regular_length_limit >> 1))
+ limit = (limit << 1) | 1;
+ else
+ limit = stm_regular_length_limit;
+ d->reads_size_limit_nonatomic = limit;
+
stm_begin_transaction(buf, longjmp_callback);
}
}
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit