diff options
author | delphinemartin <delphinemartin@google.com> | 2014-04-10 17:35:15 +0200 |
---|---|---|
committer | delphinemartin <delphinemartin@google.com> | 2014-04-24 14:32:46 +0200 |
commit | ca29013fb315b5c1e335eec175151a60cc56d5ad (patch) | |
tree | ae5163ffce1511ff186ecf76b6bf8e9552174ae9 /jill/src | |
parent | a219a81483f36c05618e5e6acb792e082af8b847 (diff) | |
download | toolchain_jill-ca29013fb315b5c1e335eec175151a60cc56d5ad.zip toolchain_jill-ca29013fb315b5c1e335eec175151a60cc56d5ad.tar.gz toolchain_jill-ca29013fb315b5c1e335eec175151a60cc56d5ad.tar.bz2 |
Write thrown exceptions in a marker.
Change-Id: I860fcdf03c8776ac2798cc35b3a636ec7508d85a
Diffstat (limited to 'jill/src')
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 = |