comparison agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java @ 20456:64156d22e49d

8032247: SA: Constantpool lookup for invokedynamic is not implemented Summary: implement constant pool lookup for invokedynamic Reviewed-by: sla, sspitsyn
author dsamersoff
date Thu, 11 Sep 2014 11:55:30 -0700
parents c7957b458bf8
children 7848fc12602b
comparison
equal deleted inserted replaced
20455:07f629123254 20456:64156d22e49d
96 else 96 else
97 cpCacheIndex = method.getBytecodeIntArg(bci); 97 cpCacheIndex = method.getBytecodeIntArg(bci);
98 break; 98 break;
99 default: throw new IllegalArgumentException(); 99 default: throw new IllegalArgumentException();
100 } 100 }
101
101 if (cpCache == null) { 102 if (cpCache == null) {
102 return (short) cpCacheIndex; 103 return (short) cpCacheIndex;
103 } else if (fmt.indexOf("JJJJ") >= 0) { 104 } else if (fmt.indexOf("JJJJ") >= 0) {
104 // change byte-ordering and go via secondary cache entry 105 // Invokedynamic require special handling
105 throw new InternalError("unimplemented"); 106 cpCacheIndex = ~cpCacheIndex;
107 cpCacheIndex = bytes.swapInt(cpCacheIndex);
108 return (short) cpCache.getEntryAt(cpCacheIndex).getConstantPoolIndex();
106 } else if (fmt.indexOf("JJ") >= 0) { 109 } else if (fmt.indexOf("JJ") >= 0) {
107 // change byte-ordering and go via cache 110 // change byte-ordering and go via cache
108 return (short) cpCache.getEntryAt((int) (0xFFFF & bytes.swapShort((short)cpCacheIndex))).getConstantPoolIndex(); 111 return (short) cpCache.getEntryAt((int) (0xFFFF & bytes.swapShort((short)cpCacheIndex))).getConstantPoolIndex();
109 } else if (fmt.indexOf("j") >= 0) { 112 } else if (fmt.indexOf("j") >= 0) {
110 // go via cache 113 // go via cache