diff options
3 files changed, 13 insertions, 3 deletions
diff --git a/jill/src/com/android/jill/backend/jayce/Token.java b/jill/src/com/android/jill/backend/jayce/Token.java index f0be016..424afbe 100644 --- a/jill/src/com/android/jill/backend/jayce/Token.java +++ b/jill/src/com/android/jill/backend/jayce/Token.java @@ -148,6 +148,7 @@ public enum Token { THIS_REF("this"), THIS_REF_TYPE_INFO("this-type-info"), THROW_STATEMENT("throw"), + THROWN_EXCEPTION("thrown-exception"), TRY_STATEMENT("try"), UNLOCK("unlock"), WHILE_STATEMENT("while") diff --git a/jill/src/com/android/jill/frontend/java/JavaTransformer.java b/jill/src/com/android/jill/frontend/java/JavaTransformer.java index 462bdb1..272eaa1 100644 --- a/jill/src/com/android/jill/frontend/java/JavaTransformer.java +++ b/jill/src/com/android/jill/frontend/java/JavaTransformer.java @@ -280,7 +280,7 @@ public class JavaTransformer { JayceWriter writer = new JayceWriter(os); writer.writeHeader( - "jayce(2.09 \"" + Jill.FILE_ENCODING + "\" \"Jill version : " + version + "\")"); + "jayce(2.10 \"" + Jill.FILE_ENCODING + "\" \"Jill version : " + version + "\")"); return writer; } diff --git a/jill/src/com/android/jill/frontend/java/MethodBodyWriter.java b/jill/src/com/android/jill/frontend/java/MethodBodyWriter.java index e228be5..a2f748c 100644 --- a/jill/src/com/android/jill/frontend/java/MethodBodyWriter.java +++ b/jill/src/com/android/jill/frontend/java/MethodBodyWriter.java @@ -215,12 +215,12 @@ public class MethodBodyWriter extends JillWriter implements Opcodes { writer.writeKeyword(Token.CONSTRUCTOR); writer.writeOpen(); writeParameters(); - writer.writeIds(AsmHelper.getDescriptorsFromInternalNames(currentMethod.exceptions)); writer.writeInt(AsmHelper.getModifiers(currentMethod)); annotWriter.writeAnnotations(currentMethod); writeMethodBody(); writer.writeOpenNodeList(); // Markers writeOriginalTypeInfoMarker(); + writeThrownExceptionMarker(); writer.writeCloseNodeList(); sourceInfoWriter.writeDebugEnd(currentClass, endLine); writer.writeClose(); @@ -245,13 +245,13 @@ public class MethodBodyWriter extends JillWriter implements Opcodes { } writer.writeMethodKindEnum(methodKind); - writer.writeIds(AsmHelper.getDescriptorsFromInternalNames(currentMethod.exceptions)); writer.writeInt(AsmHelper.isStaticInit(currentMethod) ? AsmHelper.getModifiers(currentMethod) | CONSTRUCTOR : AsmHelper.getModifiers(currentMethod)); annotWriter.writeAnnotations(currentMethod); writeMethodBody(); writer.writeOpenNodeList(); // Markers writeOriginalTypeInfoMarker(); + writeThrownExceptionMarker(); writer.writeCloseNodeList(); sourceInfoWriter.writeDebugEnd(currentClass, endLine); writer.writeClose(); @@ -291,6 +291,15 @@ public class MethodBodyWriter extends JillWriter implements Opcodes { } } + private void writeThrownExceptionMarker() throws IOException { + if (currentMethod.exceptions != null && !currentMethod.exceptions.isEmpty()) { + writer.writeKeyword(Token.THROWN_EXCEPTION); + writer.writeOpen(); + writer.writeIds(AsmHelper.getDescriptorsFromInternalNames(currentMethod.exceptions)); + writer.writeClose(); + } + } + @Nonnull private MethodNode getMethodWithoutJSR(@Nonnull MethodNode mn) { JSRInlinerAdapter jsrInliner = |