aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bcel-builder/src/org/aspectj/apache/bcel/ConstantsInitializer.java5
-rw-r--r--bcel-builder/src/org/aspectj/apache/bcel/ExceptionConstants.java1
-rw-r--r--bcel-builder/src/org/aspectj/apache/bcel/classfile/BootstrapMethods.java10
-rw-r--r--bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantInvokeDynamic.java4
-rw-r--r--bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantPool.java39
-rw-r--r--bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionList.java3
-rw-r--r--lib/bcel/bcel-src.zipbin326466 -> 326849 bytes
-rw-r--r--lib/bcel/bcel-verifier.jarbin161556 -> 161556 bytes
-rw-r--r--lib/bcel/bcel.jarbin287014 -> 287677 bytes
9 files changed, 58 insertions, 4 deletions
diff --git a/bcel-builder/src/org/aspectj/apache/bcel/ConstantsInitializer.java b/bcel-builder/src/org/aspectj/apache/bcel/ConstantsInitializer.java
index 9e19c417d..b9bc0d49f 100644
--- a/bcel-builder/src/org/aspectj/apache/bcel/ConstantsInitializer.java
+++ b/bcel-builder/src/org/aspectj/apache/bcel/ConstantsInitializer.java
@@ -337,6 +337,11 @@ public class ConstantsInitializer {
| Constants.INDEXED;
Constants.instExcs[Constants.INVOKEVIRTUAL] = ExceptionConstants.EXCS_INTERFACE_METHOD_RESOLUTION_INVOKESPECIAL_INVOKEVIRTUAL;
+ Constants.instFlags[Constants.INVOKEDYNAMIC] = Constants.EXCEPTION_THROWER | Constants.CP_INST | Constants.LOADCLASS_INST
+ | Constants.INDEXED;
+ // TBD
+ // Constants.instExcs[Constants.INVOKEDYNAMIC] = ExceptionConstants.EXCS_INTERFACE_METHOD_RESOLUTION_INVOKESPECIAL_INVOKEVIRTUAL;
+
//@formatter:off
char[] lengths = // . = varies in length, / = undefined
("1111111111111111" + // nop > dconst_1
diff --git a/bcel-builder/src/org/aspectj/apache/bcel/ExceptionConstants.java b/bcel-builder/src/org/aspectj/apache/bcel/ExceptionConstants.java
index 34455be35..0c918c8ea 100644
--- a/bcel-builder/src/org/aspectj/apache/bcel/ExceptionConstants.java
+++ b/bcel-builder/src/org/aspectj/apache/bcel/ExceptionConstants.java
@@ -135,6 +135,7 @@ public interface ExceptionConstants {
ILLEGAL_ACCESS_ERROR, ABSTRACT_METHOD_ERROR, UNSATISFIED_LINK_ERROR };
public static final Class[] EXCS_INTERFACE_METHOD_RESOLUTION_INVOKESPECIAL_INVOKEVIRTUAL = { INCOMPATIBLE_CLASS_CHANGE_ERROR,
NULL_POINTER_EXCEPTION, ABSTRACT_METHOD_ERROR, UNSATISFIED_LINK_ERROR };
+// public static final Class[] EXCS_INVOKEDYNAMIC = { BOOTSTRAP_METHOD_ERROR};
public static final Class[] EXCS_INTERFACE_METHOD_RESOLUTION_INVOKESTATIC = { INCOMPATIBLE_CLASS_CHANGE_ERROR,
UNSATISFIED_LINK_ERROR };
diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/BootstrapMethods.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/BootstrapMethods.java
index b4638bc29..a5216f2ef 100644
--- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/BootstrapMethods.java
+++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/BootstrapMethods.java
@@ -99,7 +99,7 @@ public final class BootstrapMethods extends Attribute {
isInPackedState = true;
}
- static class BootstrapMethod {
+ public static class BootstrapMethod {
private int bootstrapMethodRef;
private int[] bootstrapArguments;
@@ -116,7 +116,7 @@ public final class BootstrapMethods extends Attribute {
return bootstrapArguments;
}
- BootstrapMethod(int bootstrapMethodRef, int[] bootstrapArguments) {
+ public BootstrapMethod(int bootstrapMethodRef, int[] bootstrapArguments) {
this.bootstrapMethodRef = bootstrapMethodRef;
this.bootstrapArguments = bootstrapArguments;
}
@@ -138,6 +138,12 @@ public final class BootstrapMethods extends Attribute {
}
}
+ public final int getLength() {
+ return 2 /*bootstrapMethodRef*/+
+ 2 /*number of arguments*/+
+ 2 * bootstrapArguments.length;
+ }
+
}
// Unpacks the byte array into the table
diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantInvokeDynamic.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantInvokeDynamic.java
index be71b4e8e..0d263aa65 100644
--- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantInvokeDynamic.java
+++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantInvokeDynamic.java
@@ -109,6 +109,10 @@ public final class ConstantInvokeDynamic extends Constant {
public final int getNameAndTypeIndex() {
return nameAndTypeIndex;
}
+
+ public final int getBootstrapMethodAttrIndex() {
+ return bootstrapMethodAttrIndex;
+ }
@Override
public final String toString() {
diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantPool.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantPool.java
index fe27b5fe5..4e160ba3d 100644
--- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantPool.java
+++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/ConstantPool.java
@@ -586,6 +586,20 @@ public class ConstantPool implements Node {
return addNameAndType(u8.getValue(), u8_2.getValue());
}
+
+ case Constants.CONSTANT_InvokeDynamic: {
+ ConstantInvokeDynamic cid = (ConstantInvokeDynamic)c;
+ int index1 = cid.getBootstrapMethodAttrIndex();
+ ConstantNameAndType cnat = (ConstantNameAndType)constants[cid.getNameAndTypeIndex()];
+ ConstantUtf8 name = (ConstantUtf8) constants[cnat.getNameIndex()];
+ ConstantUtf8 signature = (ConstantUtf8) constants[cnat.getSignatureIndex()];
+ int index2 = addNameAndType(name.getValue(), signature.getValue());
+ return addInvokeDynamic(index1,index2);
+ }
+
+ case Constants.CONSTANT_MethodHandle:
+ ConstantMethodHandle cmh = (ConstantMethodHandle)c;
+ return addMethodHandle(cmh.getReferenceKind(),addConstant(constants[cmh.getReferenceIndex()],cp));
case Constants.CONSTANT_Utf8:
return addUtf8(((ConstantUtf8) c).getValue());
@@ -601,6 +615,10 @@ public class ConstantPool implements Node {
case Constants.CONSTANT_Integer:
return addInteger(((ConstantInteger) c).getValue());
+
+ case Constants.CONSTANT_MethodType:
+ ConstantMethodType cmt = (ConstantMethodType)c;
+ return addMethodType(addConstant(constants[cmt.getDescriptorIndex()],cp));
case Constants.CONSTANT_InterfaceMethodref:
case Constants.CONSTANT_Methodref:
@@ -636,6 +654,20 @@ public class ConstantPool implements Node {
throw new RuntimeException("Unknown constant type " + c);
}
}
+
+ public int addMethodHandle(byte referenceKind, int referenceIndex) {
+ adjustSize();
+ int ret = poolSize;
+ pool[poolSize++] = new ConstantMethodHandle(referenceKind, referenceIndex);
+ return ret;
+ }
+
+ public int addMethodType(int descriptorIndex) {
+ adjustSize();
+ int ret = poolSize;
+ pool[poolSize++] = new ConstantMethodType(descriptorIndex);
+ return ret;
+ }
// OPTIMIZE should put it in the cache now
public int addMethodref(String class_name, String method_name, String signature) {
@@ -651,6 +683,13 @@ public class ConstantPool implements Node {
pool[poolSize++] = new ConstantMethodref(class_index, name_and_type_index);
return ret;
}
+
+ public int addInvokeDynamic(int bootstrapMethodIndex, int constantNameAndTypeIndex) {
+ adjustSize();
+ int ret = poolSize;
+ pool[poolSize++] = new ConstantInvokeDynamic(bootstrapMethodIndex, constantNameAndTypeIndex);
+ return ret;
+ }
public int addInterfaceMethodref(String class_name, String method_name, String signature) {
int ret = lookupInterfaceMethodref(class_name, method_name, signature);
diff --git a/bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionList.java b/bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionList.java
index 25f97836f..b08a2b77c 100644
--- a/bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionList.java
+++ b/bcel-builder/src/org/aspectj/apache/bcel/generic/InstructionList.java
@@ -1150,7 +1150,6 @@ public class InstructionList implements Serializable {
public void replaceConstantPool(ConstantPool old_cp, ConstantPool new_cp) {
for (InstructionHandle ih = start; ih != null; ih = ih.next) {
Instruction i = ih.instruction;
-
if (i.isConstantPoolInstruction()) {
InstructionCP ci = (InstructionCP) i;
Constant c = old_cp.getConstant(ci.getIndex());
@@ -1165,7 +1164,7 @@ public class InstructionList implements Serializable {
}
/**
- * Delete contents of list. Provides besser memory utilization, because the system then may reuse the instruction handles. This
+ * Delete contents of list. Provides better memory utilization, because the system then may reuse the instruction handles. This
* method is typically called right after <href="MethodGen.html#getMethod()">MethodGen.getMethod()</a>.
*/
public void dispose() {
diff --git a/lib/bcel/bcel-src.zip b/lib/bcel/bcel-src.zip
index 5996c3ced..2d0a3b5f3 100644
--- a/lib/bcel/bcel-src.zip
+++ b/lib/bcel/bcel-src.zip
Binary files differ
diff --git a/lib/bcel/bcel-verifier.jar b/lib/bcel/bcel-verifier.jar
index 246522439..46a5a0c44 100644
--- a/lib/bcel/bcel-verifier.jar
+++ b/lib/bcel/bcel-verifier.jar
Binary files differ
diff --git a/lib/bcel/bcel.jar b/lib/bcel/bcel.jar
index 5da7b4842..097532e75 100644
--- a/lib/bcel/bcel.jar
+++ b/lib/bcel/bcel.jar
Binary files differ