Mercurial > hg > truffle
comparison src/share/vm/oops/instanceKlass.cpp @ 989:148e5441d916
6863023: need non-perm oops in code cache for JSR 292
Summary: Make a special root-list for those few nmethods which might contain non-perm oops.
Reviewed-by: twisti, kvn, never, jmasa, ysr
author | jrose |
---|---|
date | Tue, 15 Sep 2009 21:53:47 -0700 |
parents | 1413494da700 |
children | 54b3b351d6f9 |
comparison
equal
deleted
inserted
replaced
987:00977607da34 | 989:148e5441d916 |
---|---|
2023 // only one compilation can be active | 2023 // only one compilation can be active |
2024 NEEDS_CLEANUP | 2024 NEEDS_CLEANUP |
2025 // This is a short non-blocking critical region, so the no safepoint check is ok. | 2025 // This is a short non-blocking critical region, so the no safepoint check is ok. |
2026 OsrList_lock->lock_without_safepoint_check(); | 2026 OsrList_lock->lock_without_safepoint_check(); |
2027 assert(n->is_osr_method(), "wrong kind of nmethod"); | 2027 assert(n->is_osr_method(), "wrong kind of nmethod"); |
2028 n->set_link(osr_nmethods_head()); | 2028 n->set_osr_link(osr_nmethods_head()); |
2029 set_osr_nmethods_head(n); | 2029 set_osr_nmethods_head(n); |
2030 // Remember to unlock again | 2030 // Remember to unlock again |
2031 OsrList_lock->unlock(); | 2031 OsrList_lock->unlock(); |
2032 } | 2032 } |
2033 | 2033 |
2039 nmethod* last = NULL; | 2039 nmethod* last = NULL; |
2040 nmethod* cur = osr_nmethods_head(); | 2040 nmethod* cur = osr_nmethods_head(); |
2041 // Search for match | 2041 // Search for match |
2042 while(cur != NULL && cur != n) { | 2042 while(cur != NULL && cur != n) { |
2043 last = cur; | 2043 last = cur; |
2044 cur = cur->link(); | 2044 cur = cur->osr_link(); |
2045 } | 2045 } |
2046 if (cur == n) { | 2046 if (cur == n) { |
2047 if (last == NULL) { | 2047 if (last == NULL) { |
2048 // Remove first element | 2048 // Remove first element |
2049 set_osr_nmethods_head(osr_nmethods_head()->link()); | 2049 set_osr_nmethods_head(osr_nmethods_head()->osr_link()); |
2050 } else { | 2050 } else { |
2051 last->set_link(cur->link()); | 2051 last->set_osr_link(cur->osr_link()); |
2052 } | 2052 } |
2053 } | 2053 } |
2054 n->set_link(NULL); | 2054 n->set_osr_link(NULL); |
2055 // Remember to unlock again | 2055 // Remember to unlock again |
2056 OsrList_lock->unlock(); | 2056 OsrList_lock->unlock(); |
2057 } | 2057 } |
2058 | 2058 |
2059 nmethod* instanceKlass::lookup_osr_nmethod(const methodOop m, int bci) const { | 2059 nmethod* instanceKlass::lookup_osr_nmethod(const methodOop m, int bci) const { |
2066 (bci == InvocationEntryBci || osr->osr_entry_bci() == bci)) { | 2066 (bci == InvocationEntryBci || osr->osr_entry_bci() == bci)) { |
2067 // Found a match - return it. | 2067 // Found a match - return it. |
2068 OsrList_lock->unlock(); | 2068 OsrList_lock->unlock(); |
2069 return osr; | 2069 return osr; |
2070 } | 2070 } |
2071 osr = osr->link(); | 2071 osr = osr->osr_link(); |
2072 } | 2072 } |
2073 OsrList_lock->unlock(); | 2073 OsrList_lock->unlock(); |
2074 return NULL; | 2074 return NULL; |
2075 } | 2075 } |
2076 | 2076 |