diff options
author | 2015-11-09 17:05:29 +0000 | |
---|---|---|
committer | 2015-11-10 10:23:08 +0000 | |
commit | a1c377b0a6e7ecc3ad69c1577aec3706ca2a7512 (patch) | |
tree | 8698f193c334fc5a687fd7e22da9c673a5df502f /src/main/java/com/google/devtools/build/lib/syntax/compiler/ByteCodeMethodCalls.java | |
parent | 277fb52f716ff154ac0ea6934fb9c9a5407ef6d1 (diff) |
Compile for loops with break/continue to byte code
--
MOS_MIGRATED_REVID=107389651
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/syntax/compiler/ByteCodeMethodCalls.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/syntax/compiler/ByteCodeMethodCalls.java | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/compiler/ByteCodeMethodCalls.java b/src/main/java/com/google/devtools/build/lib/syntax/compiler/ByteCodeMethodCalls.java index 5027610e29..55e9cc1bf6 100644 --- a/src/main/java/com/google/devtools/build/lib/syntax/compiler/ByteCodeMethodCalls.java +++ b/src/main/java/com/google/devtools/build/lib/syntax/compiler/ByteCodeMethodCalls.java @@ -18,6 +18,8 @@ import com.google.common.collect.ImmutableMap; import net.bytebuddy.implementation.bytecode.StackManipulation; +import java.util.Iterator; +import java.util.List; import java.util.Map; /** @@ -31,6 +33,14 @@ import java.util.Map; public class ByteCodeMethodCalls { /** + * Byte code invocations for {@link Object}. + */ + public static class BCObject { + public static final StackManipulation equals = + ByteCodeUtils.invoke(Object.class, "equals", Object.class); + } + + /** * Byte code invocations for {@link Boolean}. */ public static class BCBoolean { @@ -67,15 +77,24 @@ public class ByteCodeMethodCalls { public static final StackManipulation builder = ByteCodeUtils.invoke(ImmutableList.class, "builder"); + public static final StackManipulation copyOf = + ByteCodeUtils.invoke(ImmutableList.class, "copyOf", Iterable.class); + + public static final StackManipulation iterator = + ByteCodeUtils.invoke(ImmutableList.class, "iterator"); + /** - * Byte code invocations for {@link com.google.common.collect.ImmutableList.Builder}. - */ + * Byte code invocations for {@link ImmutableList.Builder}. + */ public static class Builder { public static final StackManipulation build = ByteCodeUtils.invoke(ImmutableList.Builder.class, "build"); public static final StackManipulation add = ByteCodeUtils.invoke(ImmutableList.Builder.class, "add", Object.class); + + public static final StackManipulation addAll = + ByteCodeUtils.invoke(ImmutableList.Builder.class, "addAll", Iterable.class); } } @@ -86,4 +105,22 @@ public class ByteCodeMethodCalls { public static final StackManipulation valueOf = ByteCodeUtils.invoke(Integer.class, "valueOf", int.class); } + + /** + * Byte code invocations for {@link Iterator}. + */ + public static class BCIterator { + + public static final StackManipulation hasNext = ByteCodeUtils.invoke(Iterator.class, "hasNext"); + + public static final StackManipulation next = ByteCodeUtils.invoke(Iterator.class, "next"); + } + + /** + * Byte code invocations for {@link List}. + */ + public static class BCList { + public static final StackManipulation add = + ByteCodeUtils.invoke(List.class, "add", Object.class); + } } |