Mercurial > hg > truffle
diff src/share/vm/oops/cpCacheKlass.cpp @ 726:be93aad57795
6655646: dynamic languages need dynamically linked call sites
Summary: invokedynamic instruction (JSR 292 RI)
Reviewed-by: twisti, never
author | jrose |
---|---|
date | Tue, 21 Apr 2009 23:21:04 -0700 |
parents | 0fbdb4381b99 |
children | 4e6abf09f540 |
line wrap: on
line diff
--- a/src/share/vm/oops/cpCacheKlass.cpp Mon Apr 20 14:48:03 2009 -0700 +++ b/src/share/vm/oops/cpCacheKlass.cpp Tue Apr 21 23:21:04 2009 -0700 @@ -169,11 +169,47 @@ void constantPoolCacheKlass::oop_copy_contents(PSPromotionManager* pm, oop obj) { assert(obj->is_constantPoolCache(), "should be constant pool"); + if (EnableInvokeDynamic) { + constantPoolCacheOop cache = (constantPoolCacheOop)obj; + // during a scavenge, it is safe to inspect my pool, since it is perm + constantPoolOop pool = cache->constant_pool(); + assert(pool->is_constantPool(), "should be constant pool"); + if (pool->has_invokedynamic()) { + for (int i = 0; i < cache->length(); i++) { + ConstantPoolCacheEntry* e = cache->entry_at(i); + oop* p = (oop*)&e->_f1; + if (e->is_secondary_entry()) { + if (PSScavenge::should_scavenge(p)) + pm->claim_or_forward_breadth(p); + assert(!(e->is_vfinal() && PSScavenge::should_scavenge((oop*)&e->_f2)), + "no live oops here"); + } + } + } + } } void constantPoolCacheKlass::oop_push_contents(PSPromotionManager* pm, oop obj) { assert(obj->is_constantPoolCache(), "should be constant pool"); + if (EnableInvokeDynamic) { + constantPoolCacheOop cache = (constantPoolCacheOop)obj; + // during a scavenge, it is safe to inspect my pool, since it is perm + constantPoolOop pool = cache->constant_pool(); + assert(pool->is_constantPool(), "should be constant pool"); + if (pool->has_invokedynamic()) { + for (int i = 0; i < cache->length(); i++) { + ConstantPoolCacheEntry* e = cache->entry_at(i); + oop* p = (oop*)&e->_f1; + if (e->is_secondary_entry()) { + if (PSScavenge::should_scavenge(p)) + pm->claim_or_forward_depth(p); + assert(!(e->is_vfinal() && PSScavenge::should_scavenge((oop*)&e->_f2)), + "no live oops here"); + } + } + } + } } int