diff options
| author | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-22 16:04:29 +0000 |
|---|---|---|
| committer | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-22 16:04:29 +0000 |
| commit | e5ae3cca6624e212a6406075b1ce2a8475b2330b (patch) | |
| tree | 6696718c8f49918771b4fb127ff32d843597aa2f /libjava/include | |
| parent | 75890282a0dff1e7bec432b68637babcb22fc37d (diff) | |
| download | ppe42-gcc-e5ae3cca6624e212a6406075b1ce2a8475b2330b.tar.gz ppe42-gcc-e5ae3cca6624e212a6406075b1ce2a8475b2330b.zip | |
2008-08-22 Andrew Haley <aph@redhat.com>
PR libgcj/8895:
* interpret-run.cc (REWRITE_INSN): Null this macro.
* include/jvm.h (class _Jv_Linker): Declare resolve_mutex, init.
(read_cpool_entry, write_cpool_entry): New functions.
* link.cc (_Jv_Linker::resolve_mutex): new.
(_Jv_Linker::init): New function.
(_Jv_Linker::resolve_pool_entry): Use {read,write}_cpool_entry
to ensure atomic access to constant pool entries.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139492 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/include')
| -rw-r--r-- | libjava/include/jvm.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libjava/include/jvm.h b/libjava/include/jvm.h index 64cd6b5d7f9..ec74f295a5f 100644 --- a/libjava/include/jvm.h +++ b/libjava/include/jvm.h @@ -308,6 +308,9 @@ private: s = signature; } + static _Jv_Mutex_t resolve_mutex; + static void init (void) __attribute__((constructor)); + public: static bool has_field_p (jclass, _Jv_Utf8Const *); @@ -325,6 +328,27 @@ public: _Jv_Utf8Const *, bool check_perms = true); static void layout_vtable_methods(jclass); + + static jbyte read_cpool_entry (_Jv_word *data, + const _Jv_Constants *const pool, + int index) + { + _Jv_MutexLock (&resolve_mutex); + jbyte tags = pool->tags[index]; + *data = pool->data[index]; + _Jv_MutexUnlock (&resolve_mutex); + return tags; + } + + static void write_cpool_entry (_Jv_word data, jbyte tags, + _Jv_Constants *pool, + int index) + { + _Jv_MutexLock (&resolve_mutex); + pool->data[index] = data; + pool->tags[index] = tags; + _Jv_MutexUnlock (&resolve_mutex); + } }; /* Type of pointer used as finalizer. */ |

