Commit 5ba24c3b authored by Eric Bruneton's avatar Eric Bruneton
Browse files

Revert the ConstantInvokeDynamic rename to follow the latest spec draft.

parent 03779ff7
......@@ -188,7 +188,8 @@ class ClassDump {
* @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.1">JVMS
* 4.1</a>
*/
private static void dumpAttributeList(final Parser parser, final Builder builder) throws IOException {
private static void dumpAttributeList(final Parser parser, final Builder builder)
throws IOException {
int attributeCount = builder.add("attributes_count: ", parser.u2());
SortedBuilder sortedBuilder = builder.addSortedBuilder();
for (int i = 0; i < attributeCount; ++i) {
......@@ -206,7 +207,8 @@ class ClassDump {
* @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.4">JVMS
* 4.4</a>
*/
private static CpInfo parseCpInfo(final Parser parser, final ClassContext classContext) throws IOException {
private static CpInfo parseCpInfo(final Parser parser, final ClassContext classContext)
throws IOException {
int tag = parser.u1();
switch (tag) {
case 7:
......@@ -238,7 +240,7 @@ class ClassDump {
case 17:
return new ConstantDynamicInfo(parser, classContext);
case 18:
return new ConstantDynamicCallSiteInfo(parser, classContext);
return new ConstantInvokeDynamicInfo(parser, classContext);
case 19:
return new ConstantModuleInfo(parser, classContext);
case 20:
......@@ -409,7 +411,8 @@ class ClassDump {
* @param classContext a context to lookup constant pool items from their index.
* @throws IOException if the class can't be parsed.
*/
ConstantInterfaceMethodRefInfo(final Parser parser, final ClassContext classContext) throws IOException {
ConstantInterfaceMethodRefInfo(final Parser parser, final ClassContext classContext)
throws IOException {
super(classContext);
this.classIndex = parser.u2();
this.nameAndTypeIndex = parser.u2();
......@@ -553,7 +556,8 @@ class ClassDump {
* @param classContext a context to lookup constant pool items from their index.
* @throws IOException if the class can't be parsed.
*/
ConstantNameAndTypeInfo(final Parser parser, final ClassContext classContext) throws IOException {
ConstantNameAndTypeInfo(final Parser parser, final ClassContext classContext)
throws IOException {
super(classContext);
this.nameIndex = parser.u2();
this.descriptorIndex = parser.u2();
......@@ -602,7 +606,8 @@ class ClassDump {
* @param classContext a context to lookup constant pool items from their index.
* @throws IOException if the class can't be parsed.
*/
ConstantMethodHandleInfo(final Parser parser, final ClassContext classContext) throws IOException {
ConstantMethodHandleInfo(final Parser parser, final ClassContext classContext)
throws IOException {
super(classContext);
this.referenceKind = parser.u1();
this.referenceIndex = parser.u2();
......@@ -630,7 +635,8 @@ class ClassDump {
* @param classContext a context to lookup constant pool items from their index.
* @throws IOException if the class can't be parsed.
*/
ConstantMethodTypeInfo(final Parser parser, final ClassContext classContext) throws IOException {
ConstantMethodTypeInfo(final Parser parser, final ClassContext classContext)
throws IOException {
super(classContext);
this.descriptorIndex = parser.u2();
}
......@@ -642,23 +648,24 @@ class ClassDump {
}
/**
* A CONSTANT_DynamicCallSite_info item.
* A CONSTANT_InvokeDynamic_info item.
*
* @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.4.10">JVMS
* 4.4.10</a>
*/
private static class ConstantDynamicCallSiteInfo extends CpInfo {
private static class ConstantInvokeDynamicInfo extends CpInfo {
private final int bootstrapMethodAttrIndex;
private final int nameAndTypeIndex;
/**
* Parses a CONSTANT_DynamicCallSite_info item.
* Parses a CONSTANT_InvokeDynamic_info item.
*
* @param parser a class parser.
* @param classContext a context to lookup constant pool items from their index.
* @throws IOException if the class can't be parsed.
*/
ConstantDynamicCallSiteInfo(final Parser parser, final ClassContext classContext) throws IOException {
ConstantInvokeDynamicInfo(final Parser parser, final ClassContext classContext)
throws IOException {
super(classContext);
this.bootstrapMethodAttrIndex = parser.u2();
this.nameAndTypeIndex = parser.u2();
......@@ -782,7 +789,8 @@ class ClassDump {
* @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.6">JVMS
* 4.6</a>
*/
private static void dumpMethodInfo(final Parser parser, final Builder builder) throws IOException {
private static void dumpMethodInfo(final Parser parser, final Builder builder)
throws IOException {
// method_info has the same top level structure as field_info.
dumpFieldInfo(parser, builder);
}
......@@ -888,7 +896,8 @@ class ClassDump {
* @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.3">JVMS
* 4.7.3</a>
*/
private static void dumpCodeAttribute(final Parser parser, final Builder builder) throws IOException {
private static void dumpCodeAttribute(final Parser parser, final Builder builder)
throws IOException {
builder.add("max_stack: ", parser.u2());
builder.add("max_locals: ", parser.u2());
int codeLength = parser.u4();
......@@ -942,8 +951,8 @@ class ClassDump {
* @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-6.html#jvms-6.5">JVMS
* 6.5</a>
*/
private static void dumpInstructions(final int codeLength, final Parser parser, final Builder builder)
throws IOException {
private static void dumpInstructions(
final int codeLength, final Parser parser, final Builder builder) throws IOException {
int bytecodeOffset = 0; // Number of bytes parsed so far.
int insnIndex = 0; // Number of instructions parsed so far.
while (bytecodeOffset < codeLength) {
......@@ -1452,7 +1461,8 @@ class ClassDump {
* @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.2">JVMS
* 4.7.2</a>
*/
private static void dumpVerificationTypeInfo(final Parser parser, final Builder builder) throws IOException {
private static void dumpVerificationTypeInfo(final Parser parser, final Builder builder)
throws IOException {
int tag = builder.add("tag: ", parser.u1());
if (tag > 8) {
throw new IOException("Unknown verification_type_info tag: " + tag);
......@@ -1473,7 +1483,8 @@ class ClassDump {
* @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.5">JVMS
* 4.7.5</a>
*/
private static void dumpExceptionsAttribute(final Parser parser, final Builder builder) throws IOException {
private static void dumpExceptionsAttribute(final Parser parser, final Builder builder)
throws IOException {
int exceptionCount = builder.add("number_of_exceptions: ", parser.u2());
for (int i = 0; i < exceptionCount; ++i) {
builder.addCpInfo("exception_index: ", parser.u2());
......@@ -1489,7 +1500,8 @@ class ClassDump {
* @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.6">JVMS
* 4.7.6</a>
*/
private static void dumpInnerClassesAttribute(final Parser parser, final Builder builder) throws IOException {
private static void dumpInnerClassesAttribute(final Parser parser, final Builder builder)
throws IOException {
int classCount = builder.add("number_of_classes: ", parser.u2());
for (int i = 0; i < classCount; ++i) {
builder.addCpInfo("inner_class_info_index: ", parser.u2());
......@@ -1533,7 +1545,8 @@ class ClassDump {
* @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.9">JVMS
* 4.7.9</a>
*/
private static void dumpSignatureAttribute(final Parser parser, final Builder builder) throws IOException {
private static void dumpSignatureAttribute(final Parser parser, final Builder builder)
throws IOException {
builder.addCpInfo("signature_index: ", parser.u2());
}
......@@ -1546,7 +1559,8 @@ class ClassDump {
* @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.10">JVMS
* 4.7.10</a>
*/
private static void dumpSourceFileAttribute(final Parser parser, final Builder builder) throws IOException {
private static void dumpSourceFileAttribute(final Parser parser, final Builder builder)
throws IOException {
builder.addCpInfo("sourcefile_index: ", parser.u2());
}
......@@ -1560,8 +1574,8 @@ class ClassDump {
* @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.11">JVMS
* 4.7.11</a>
*/
private static void dumpSourceDebugAttribute(final int attributeLength, final Parser parser, final Builder builder)
throws IOException {
private static void dumpSourceDebugAttribute(
final int attributeLength, final Parser parser, final Builder builder) throws IOException {
byte[] attributeData = parser.bytes(attributeLength);
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < attributeData.length; ++i) {
......@@ -1618,8 +1632,8 @@ class ClassDump {
* @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.14">JVMS
* 4.7.14</a>
*/
private static void dumpLocalVariableTypeTableAttribute(final Parser parser, final Builder builder)
throws IOException {
private static void dumpLocalVariableTypeTableAttribute(
final Parser parser, final Builder builder) throws IOException {
int localVariableCount = builder.add("local_variable_type_table_length: ", parser.u2());
for (int i = 0; i < localVariableCount; ++i) {
int startPc = builder.addInsnIndex("start_pc: ", parser.u2());
......@@ -1649,8 +1663,8 @@ class ClassDump {
* @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.16">JVMS
* 4.7.16</a>
*/
private static void dumpRuntimeVisibleAnnotationsAttribute(final Parser parser, final Builder builder)
throws IOException {
private static void dumpRuntimeVisibleAnnotationsAttribute(
final Parser parser, final Builder builder) throws IOException {
int annotationCount = builder.add("num_annotations: ", parser.u2());
for (int i = 0; i < annotationCount; ++i) {
dumpAnnotation(parser, builder);
......@@ -1666,7 +1680,8 @@ class ClassDump {
* @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.16">JVMS
* 4.7.16</a>
*/
private static void dumpAnnotation(final Parser parser, final Builder builder) throws IOException {
private static void dumpAnnotation(final Parser parser, final Builder builder)
throws IOException {
builder.addCpInfo("type_index: ", parser.u2());
int elementValuePairCount = builder.add("num_element_value_pairs: ", parser.u2());
for (int i = 0; i < elementValuePairCount; ++i) {
......@@ -1685,7 +1700,8 @@ class ClassDump {
* href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.16.1">JVMS
* 4.7.16.1</a>
*/
private static void dumpElementValue(final Parser parser, final Builder builder) throws IOException {
private static void dumpElementValue(final Parser parser, final Builder builder)
throws IOException {
int tag = parser.u1();
switch (tag) {
case 'B':
......@@ -1730,8 +1746,8 @@ class ClassDump {
* @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.17">JVMS
* 4.7.17</a>
*/
private static void dumpRuntimeInvisibleAnnotationsAttribute(final Parser parser, final Builder builder)
throws IOException {
private static void dumpRuntimeInvisibleAnnotationsAttribute(
final Parser parser, final Builder builder) throws IOException {
dumpRuntimeVisibleAnnotationsAttribute(parser, builder);
}
......@@ -1778,8 +1794,8 @@ class ClassDump {
* @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.20">JVMS
* 4.7.20</a>
*/
private static void dumpRuntimeVisibleTypeAnnotationsAttribute(final Parser parser, final Builder builder)
throws IOException {
private static void dumpRuntimeVisibleTypeAnnotationsAttribute(
final Parser parser, final Builder builder) throws IOException {
int annotationCount = builder.add("num_annotations: ", parser.u2());
SortedBuilder sortedBuilder = builder.addSortedBuilder();
for (int i = 0; i < annotationCount; ++i) {
......@@ -1898,8 +1914,8 @@ class ClassDump {
* @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.21">JVMS
* 4.7.21</a>
*/
private static void dumpRuntimeInvisibleTypeAnnotationsAttribute(final Parser parser, final Builder builder)
throws IOException {
private static void dumpRuntimeInvisibleTypeAnnotationsAttribute(
final Parser parser, final Builder builder) throws IOException {
dumpRuntimeVisibleTypeAnnotationsAttribute(parser, builder);
}
......@@ -1965,7 +1981,8 @@ class ClassDump {
* @see <a href="https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.7.25">JVMS
* 4.7.25</a>
*/
private static void dumpModuleAttribute(final Parser parser, final Builder builder) throws IOException {
private static void dumpModuleAttribute(final Parser parser, final Builder builder)
throws IOException {
builder.addCpInfo("name: ", parser.u2());
builder.add("access: ", parser.u2());
builder.addCpInfo("version: ", parser.u2());
......@@ -2047,7 +2064,8 @@ class ClassDump {
* @see <a
* href="http://docs.oracle.com/javame/config/cldc/opt-pkgs/api/cldc/api/Appendix1-verifier.pdf">CLDC</a>
*/
private static void dumpStackMapAttribute(final Parser parser, final Builder builder) throws IOException {
private static void dumpStackMapAttribute(final Parser parser, final Builder builder)
throws IOException {
int entryCount = builder.add("number_of_entries: ", parser.u2());
for (int i = 0; i < entryCount; ++i) {
builder.addInsnIndex("offset: ", parser.u2());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment