Author: Armin Rigo <[email protected]>
Branch:
Changeset: r1015:240faf17faf5
Date: 2014-03-14 22:39 +0100
http://bitbucket.org/pypy/stmgc/changeset/240faf17faf5/
Log: Add ((always_inline)) on the three major places that *must* be
inlined
diff --git a/c7/stmgc.h b/c7/stmgc.h
--- a/c7/stmgc.h
+++ b/c7/stmgc.h
@@ -147,6 +147,7 @@
stm_write() is called, or immediately after getting the object from
stm_allocate(), as long as the rules above are respected.
*/
+__attribute__((always_inline))
static inline void stm_read(object_t *obj)
{
((stm_read_marker_t *)(((uintptr_t)obj) >> 4))->rm =
@@ -158,6 +159,7 @@
the next one, then stm_write() needs to be called again. It is not
necessary to call it immediately after stm_allocate().
*/
+__attribute__((always_inline))
static inline void stm_write(object_t *obj)
{
if (UNLIKELY((obj->stm_flags & _STM_GCFLAG_WRITE_BARRIER) != 0))
@@ -177,6 +179,7 @@
of 8 and at least 16. In the fast-path, this is inlined to just
a few assembler instructions.
*/
+__attribute__((always_inline))
static inline object_t *stm_allocate(ssize_t size_rounded_up)
{
OPT_ASSERT(size_rounded_up >= 16);
diff --git a/gil-c7/stmgc.h b/gil-c7/stmgc.h
--- a/gil-c7/stmgc.h
+++ b/gil-c7/stmgc.h
@@ -52,6 +52,7 @@
object_t *_stm_allocate_slowpath(ssize_t);
object_t *stm_allocate_weakref(ssize_t size_rounded_up);
+__attribute__((always_inline))
inline static object_t *stm_allocate(ssize_t size_rounded_up) {
OPT_ASSERT(size_rounded_up >= 16);
OPT_ASSERT((size_rounded_up & 7) == 0);
@@ -101,6 +102,7 @@
void _stm_write_slowpath(object_t *);
+__attribute__((always_inline))
inline static void stm_write(object_t *ob) {
if (UNLIKELY(ob->gil_flags & _STM_GCFLAG_WRITE_BARRIER))
_stm_write_slowpath(ob);
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit