Mercurial > hg > truffle
comparison src/share/vm/prims/jvmtiClassFileReconstituter.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 | a61af66fc99e |
children | bd02caa94611 |
comparison
equal
deleted
inserted
replaced
725:928912ce8438 | 726:be93aad57795 |
---|---|
657 case Bytecodes::_getfield : // fall through | 657 case Bytecodes::_getfield : // fall through |
658 case Bytecodes::_putfield : // fall through | 658 case Bytecodes::_putfield : // fall through |
659 case Bytecodes::_invokevirtual : // fall through | 659 case Bytecodes::_invokevirtual : // fall through |
660 case Bytecodes::_invokespecial : // fall through | 660 case Bytecodes::_invokespecial : // fall through |
661 case Bytecodes::_invokestatic : // fall through | 661 case Bytecodes::_invokestatic : // fall through |
662 case Bytecodes::_invokedynamic : // fall through | |
662 case Bytecodes::_invokeinterface : | 663 case Bytecodes::_invokeinterface : |
663 assert(len == 3 || (code == Bytecodes::_invokeinterface && len ==5), | 664 assert(len == 3 || (code == Bytecodes::_invokeinterface && len ==5), |
664 "sanity check"); | 665 "sanity check"); |
666 int cpci = Bytes::get_native_u2(bcp+1); | |
667 bool is_invokedynamic = (EnableInvokeDynamic && code == Bytecodes::_invokedynamic); | |
668 if (is_invokedynamic) | |
669 cpci = Bytes::get_native_u4(bcp+1); | |
665 // cache cannot be pre-fetched since some classes won't have it yet | 670 // cache cannot be pre-fetched since some classes won't have it yet |
666 ConstantPoolCacheEntry* entry = | 671 ConstantPoolCacheEntry* entry = |
667 mh->constants()->cache()->entry_at(Bytes::get_native_u2(bcp+1)); | 672 mh->constants()->cache()->main_entry_at(cpci); |
668 int i = entry->constant_pool_index(); | 673 int i = entry->constant_pool_index(); |
669 assert(i < mh->constants()->length(), "sanity check"); | 674 assert(i < mh->constants()->length(), "sanity check"); |
670 Bytes::put_Java_u2((address)(p+1), (u2)i); // java byte ordering | 675 Bytes::put_Java_u2((address)(p+1), (u2)i); // java byte ordering |
676 if (is_invokedynamic) *(p+3) = *(p+4) = 0; | |
671 break; | 677 break; |
672 } | 678 } |
673 } | 679 } |
674 | 680 |
675 p += len; | 681 p += len; |