Package alt.jiapi.reflect

Examples of alt.jiapi.reflect.Instruction


            }
        }
        else if ("void".equals(rType)){
            // Pop out the return value(probably null) of
            // the invocation handler if it was a 'void' method
            il.add(new Instruction(new byte[]{Opcodes.POP}));
        }
        else { // Cast to correct Object
            il.add(factory.cast(rType));
        }
    }
View Full Code Here


         for (int i = argList.length - 1; i >= 0; i--) {
            int stackUsage = ins.stackConsumption();
            InstructionList pList = il.createEmptyList();

            boolean primitive = SignatureUtil.isPrimitive(paramTypes[i]);
            Instruction pr_ins = null;

            if (primitive) {
                pr_ins = handlePrimitiveType(paramTypes[i], pList);
            }

            int insertIdx = pList.size();
            // When stack usage is 1, we have reached an argument in stack
//             while (stackUsage != 1) {
             while ((stackUsage > 0 && ins.getOpcode() == Opcodes.INVOKESTATIC)||
                    (stackUsage > 1 && ins.getOpcode() == Opcodes.INVOKEVIRTUAL)) {
                Instruction pIns = il.get(pIdx);
//                  System.out.println(">> pIdx: " + pIdx + ": " + pIns +
//                                     ", stackusage: " + stackUsage);
                stackUsage -= pIns.stackUsage();

                // Insert pIns allways to same index. We are scanning
                // Instructions backwards!
//                  System.out.println("Adding " + pIns + " to plist");
                pList.insert(insertIdx, pIns);
View Full Code Here

            cName = "java.lang.Double";
        }

         il.add(f.newClass(cName));
         il.add(f.dup());
         Instruction ins = f.invoke(Modifier.PUBLIC, cName, "<init>", s);
         return ins;
    }
View Full Code Here

            }
        }
        else if ("void".equals(rType)){
            // Pop out the return value(probably null) of
            // the invocation handler if it was a 'void' method
            il.add(new Instruction(new byte[]{Opcodes.POP}));
        }
        else { // Cast to correct Object
            il.add(factory.cast(ins.getReturnType()));
        }
    }
View Full Code Here

TOP

Related Classes of alt.jiapi.reflect.Instruction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.