langtools/src/share/classes/com/sun/tools/javac/jvm/Items.java
changeset 1206 3a05355982a9
parent 10 06bc494ca11e
child 1264 076a3cde30d5
equal deleted inserted replaced
1205:b316e32eb90c 1206:3a05355982a9
    23  * have any questions.
    23  * have any questions.
    24  */
    24  */
    25 
    25 
    26 package com.sun.tools.javac.jvm;
    26 package com.sun.tools.javac.jvm;
    27 
    27 
    28 import com.sun.tools.javac.util.*;
       
    29 import com.sun.tools.javac.code.*;
    28 import com.sun.tools.javac.code.*;
    30 
    29 
    31 import com.sun.tools.javac.code.Symbol.*;
    30 import com.sun.tools.javac.code.Symbol.*;
    32 import com.sun.tools.javac.code.Type.*;
    31 import com.sun.tools.javac.code.Type.*;
    33 import com.sun.tools.javac.jvm.Code.*;
    32 import com.sun.tools.javac.jvm.Code.*;
    34 import com.sun.tools.javac.tree.JCTree;
    33 import com.sun.tools.javac.tree.JCTree;
    35 
    34 
    36 import static com.sun.tools.javac.code.TypeTags.*;
       
    37 import static com.sun.tools.javac.jvm.ByteCodes.*;
    35 import static com.sun.tools.javac.jvm.ByteCodes.*;
    38 
    36 
    39 /** A helper class for code generation. Items are objects
    37 /** A helper class for code generation. Items are objects
    40  *  that stand for addressable entities in the bytecode. Each item
    38  *  that stand for addressable entities in the bytecode. Each item
    41  *  supports a fixed protocol for loading the item on the stack, storing
    39  *  supports a fixed protocol for loading the item on the stack, storing
   447             code.emitop2(putstatic, pool.put(member));
   445             code.emitop2(putstatic, pool.put(member));
   448         }
   446         }
   449 
   447 
   450         Item invoke() {
   448         Item invoke() {
   451             MethodType mtype = (MethodType)member.erasure(types);
   449             MethodType mtype = (MethodType)member.erasure(types);
   452             int argsize = Code.width(mtype.argtypes);
       
   453             int rescode = Code.typecode(mtype.restype);
   450             int rescode = Code.typecode(mtype.restype);
   454             int sdiff = Code.width(rescode) - argsize;
       
   455             code.emitInvokestatic(pool.put(member), mtype);
   451             code.emitInvokestatic(pool.put(member), mtype);
   456             return stackItem[rescode];
   452             return stackItem[rescode];
   457         }
   453         }
   458 
   454 
   459         public String toString() {
   455         public String toString() {