com.android.dx.gen
Class Code

java.lang.Object
  extended by com.android.dx.gen.Code

public final class Code
extends Object

Builds a sequence of instructions.


Method Summary
 void addCatchClause(Type<?> throwable, Label catchClause)
           
 void aget(Local<?> array, Local<Integer> index, Local<?> target)
           
 void aput(Local<?> array, Local<Integer> index, Local<?> source)
           
<T> void
arrayLength(Local<T> array, Local<Integer> target)
           
<T> void
compare(Comparison comparison, Local<T> a, Local<T> b, Label trueLabel)
          Compare ints.
<T> void
compare(Local<T> a, Local<T> b, Local<?> target)
          Compare longs.
<T extends Number>
void
compare(Local<T> a, Local<T> b, Local<Integer> target, int nanValue)
          Compare floats or doubles.
<T> Local<T>
getParameter(int index, Type<T> type)
           
<T> Local<T>
getThis(Type<T> type)
           
<D,V> void
iget(FieldId<D,V> fieldId, Local<D> instance, Local<V> target)
           
 void instanceOfType(Local<?> target, Local<?> source, Type<?> type)
           
<D,R> void
invokeDirect(MethodId<D,R> method, Local<? super R> target, Local<? extends D> object, Local<?>... args)
           
<D,R> void
invokeInterface(MethodId<D,R> method, Local<? super R> target, Local<? extends D> object, Local<?>... args)
           
<R> void
invokeStatic(MethodId<?,R> method, Local<? super R> target, Local<?>... args)
           
<D,R> void
invokeSuper(MethodId<D,R> method, Local<? super R> target, Local<? extends D> object, Local<?>... args)
           
<D,R> void
invokeVirtual(MethodId<D,R> method, Local<? super R> target, Local<? extends D> object, Local<?>... args)
           
<D,V> void
iput(FieldId<D,V> fieldId, Local<D> instance, Local<V> source)
           
 void jump(Label target)
           
<T> void
loadConstant(Local<T> target, T value)
           
 void mark(Label label)
          Start defining instructions for the named label.
<T> void
negate(Local<T> source, Local<T> target)
           
<T> void
newArray(Local<Integer> length, Local<T> target)
           
<T> void
newInstance(Local<T> target, MethodId<T,Void> constructor, Local<?>... args)
           
 Label newLabel()
          Creates a new label for use as a branch target.
<T> Local<T>
newLocal(Type<T> type)
           
<T> void
not(Local<T> source, Local<T> target)
           
 void numericCast(Local<?> source, Local<?> target)
           
<T> void
op(BinaryOp op, Local<T> target, Local<T> a, Local<T> b)
           
 Label removeCatchClause(Type<?> throwable)
           
 void returnValue(Local<?> result)
           
 void returnVoid()
           
<V> void
sget(FieldId<?,V> fieldId, Local<V> target)
           
<V> void
sput(FieldId<?,V> fieldId, Local<V> source)
           
 void throwValue(Local<?> throwable)
           
 void typeCast(Local<?> source, Local<?> target)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newLocal

public <T> Local<T> newLocal(Type<T> type)

getParameter

public <T> Local<T> getParameter(int index,
                                 Type<T> type)

getThis

public <T> Local<T> getThis(Type<T> type)

newLabel

public Label newLabel()
Creates a new label for use as a branch target. The new label must have code attached to it later by calling mark(Label).


mark

public void mark(Label label)
Start defining instructions for the named label.


jump

public void jump(Label target)

addCatchClause

public void addCatchClause(Type<?> throwable,
                           Label catchClause)

removeCatchClause

public Label removeCatchClause(Type<?> throwable)

throwValue

public void throwValue(Local<?> throwable)

loadConstant

public <T> void loadConstant(Local<T> target,
                             T value)

negate

public <T> void negate(Local<T> source,
                       Local<T> target)

not

public <T> void not(Local<T> source,
                    Local<T> target)

numericCast

public void numericCast(Local<?> source,
                        Local<?> target)

op

public <T> void op(BinaryOp op,
                   Local<T> target,
                   Local<T> a,
                   Local<T> b)

compare

public <T> void compare(Comparison comparison,
                        Local<T> a,
                        Local<T> b,
                        Label trueLabel)
Compare ints. If the comparison is true, execution jumps to trueLabel. If it is false, execution continues to the next instruction.


compare

public <T extends Number> void compare(Local<T> a,
                                       Local<T> b,
                                       Local<Integer> target,
                                       int nanValue)
Compare floats or doubles.


compare

public <T> void compare(Local<T> a,
                        Local<T> b,
                        Local<?> target)
Compare longs.


iget

public <D,V> void iget(FieldId<D,V> fieldId,
                       Local<D> instance,
                       Local<V> target)

iput

public <D,V> void iput(FieldId<D,V> fieldId,
                       Local<D> instance,
                       Local<V> source)

sget

public <V> void sget(FieldId<?,V> fieldId,
                     Local<V> target)

sput

public <V> void sput(FieldId<?,V> fieldId,
                     Local<V> source)

newInstance

public <T> void newInstance(Local<T> target,
                            MethodId<T,Void> constructor,
                            Local<?>... args)

invokeStatic

public <R> void invokeStatic(MethodId<?,R> method,
                             Local<? super R> target,
                             Local<?>... args)

invokeVirtual

public <D,R> void invokeVirtual(MethodId<D,R> method,
                                Local<? super R> target,
                                Local<? extends D> object,
                                Local<?>... args)

invokeDirect

public <D,R> void invokeDirect(MethodId<D,R> method,
                               Local<? super R> target,
                               Local<? extends D> object,
                               Local<?>... args)

invokeSuper

public <D,R> void invokeSuper(MethodId<D,R> method,
                              Local<? super R> target,
                              Local<? extends D> object,
                              Local<?>... args)

invokeInterface

public <D,R> void invokeInterface(MethodId<D,R> method,
                                  Local<? super R> target,
                                  Local<? extends D> object,
                                  Local<?>... args)

instanceOfType

public void instanceOfType(Local<?> target,
                           Local<?> source,
                           Type<?> type)

typeCast

public void typeCast(Local<?> source,
                     Local<?> target)

arrayLength

public <T> void arrayLength(Local<T> array,
                            Local<Integer> target)

newArray

public <T> void newArray(Local<Integer> length,
                         Local<T> target)

aget

public void aget(Local<?> array,
                 Local<Integer> index,
                 Local<?> target)

aput

public void aput(Local<?> array,
                 Local<Integer> index,
                 Local<?> source)

returnVoid

public void returnVoid()

returnValue

public void returnValue(Local<?> result)


Copyright © 2012. All Rights Reserved.