예제 #1
0
 Item invoke() {
   MethodType mtype = (MethodType) member.erasure(types);
   int argsize = Code.width(mtype.argtypes);
   int rescode = Code.typecode(mtype.restype);
   int sdiff = Code.width(rescode) - argsize;
   code.emitInvokestatic(pool.put(member), mtype);
   return stackItem[rescode];
 }
예제 #2
0
 Item invoke() {
   MethodType mtype = (MethodType) member.externalType(types);
   int rescode = Code.typecode(mtype.restype);
   if ((member.owner.flags() & Flags.INTERFACE) != 0) {
     code.emitInvokeinterface(pool.put(member), mtype);
   } else if (nonvirtual) {
     code.emitInvokespecial(pool.put(member), mtype);
   } else {
     code.emitInvokevirtual(pool.put(member), mtype);
   }
   return stackItem[rescode];
 }
예제 #3
0
 ImmediateItem(Type type, Object value) {
   super(Code.typecode(type));
   this.value = value;
 }
예제 #4
0
 MemberItem(Symbol member, boolean nonvirtual) {
   super(Code.typecode(member.erasure(types)));
   this.member = member;
   this.nonvirtual = nonvirtual;
 }
예제 #5
0
 StaticItem(Symbol member) {
   super(Code.typecode(member.erasure(types)));
   this.member = member;
 }
예제 #6
0
 LocalItem(Type type, int reg) {
   super(Code.typecode(type));
   assert reg >= 0;
   this.type = type;
   this.reg = reg;
 }
예제 #7
0
 IndexedItem(Type type) {
   super(Code.typecode(type));
 }
예제 #8
0
 /**
  * Generate code to coerce item to given type.
  *
  * @param targettype The type to coerce to.
  */
 Item coerce(Type targettype) {
   return coerce(Code.typecode(targettype));
 }
예제 #9
0
 /**
  * Make an item representing a value on stack.
  *
  * @param type The value's type.
  */
 Item makeStackItem(Type type) {
   return stackItem[Code.typecode(type)];
 }
예제 #10
0
 Item invoke() {
   MethodType mtype = (MethodType) member.erasure(types);
   int rescode = Code.typecode(mtype.restype);
   code.emitInvokestatic(pool.put(member), mtype);
   return stackItem[rescode];
 }