comparison agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java @ 6725:da91efe96a93

6964458: Reimplement class meta-data storage to use native memory Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author coleenp
date Sat, 01 Sep 2012 13:25:18 -0400
parents 0a8e0d4345b3
children
comparison
equal deleted inserted replaced
6724:36d1d483d5d6 6725:da91efe96a93
1 /* 1 /*
2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
53 53
54 // returns the name of the invoked method 54 // returns the name of the invoked method
55 public Symbol name() { 55 public Symbol name() {
56 ConstantPool cp = method().getConstants(); 56 ConstantPool cp = method().getConstants();
57 if (isInvokedynamic()) { 57 if (isInvokedynamic()) {
58 int[] nt = cp.getNameAndTypeAt(indexForFieldOrMethod()); 58 return cp.uncachedGetNameRefAt(indexForFieldOrMethod());
59 return cp.getSymbolAt(nt[0]);
60 } 59 }
61 return cp.getNameRefAt(index()); 60 return cp.getNameRefAt(index());
62 } 61 }
63 62
64 // returns the signature of the invoked method 63 // returns the signature of the invoked method
65 public Symbol signature() { 64 public Symbol signature() {
66 ConstantPool cp = method().getConstants(); 65 ConstantPool cp = method().getConstants();
67 if (isInvokedynamic()) { 66 if (isInvokedynamic()) {
68 int[] nt = cp.getNameAndTypeAt(indexForFieldOrMethod()); 67 return cp.uncachedGetSignatureRefAt(indexForFieldOrMethod());
69 return cp.getSymbolAt(nt[1]);
70 } 68 }
71 return cp.getSignatureRefAt(index()); 69 return cp.getSignatureRefAt(index());
72 }
73
74 public int getSecondaryIndex() {
75 if (isInvokedynamic()) {
76 // change byte-ordering of 4-byte integer
77 return VM.getVM().getBytes().swapInt(javaSignedWordAt(1));
78 }
79 return super.getSecondaryIndex(); // throw an error
80 } 70 }
81 71
82 public Method getInvokedMethod() { 72 public Method getInvokedMethod() {
83 return method().getConstants().getMethodRefAt(index()); 73 return method().getConstants().getMethodRefAt(index());
84 } 74 }
121 buf.append(spaces); 111 buf.append(spaces);
122 buf.append('#'); 112 buf.append('#');
123 buf.append(Integer.toString(indexForFieldOrMethod())); 113 buf.append(Integer.toString(indexForFieldOrMethod()));
124 if (isInvokedynamic()) { 114 if (isInvokedynamic()) {
125 buf.append('('); 115 buf.append('(');
126 buf.append(Integer.toString(getSecondaryIndex())); 116 buf.append(Integer.toString(index()));
127 buf.append(')'); 117 buf.append(')');
128 } 118 }
129 buf.append(" [Method "); 119 buf.append(" [Method ");
130 StringBuffer sigBuf = new StringBuffer(); 120 StringBuffer sigBuf = new StringBuffer();
131 new SignatureConverter(signature(), sigBuf).iterateReturntype(); 121 new SignatureConverter(signature(), sigBuf).iterateReturntype();