Package org.apache.harmony.unpack200.bytecode

Examples of org.apache.harmony.unpack200.bytecode.CodeAttribute


                   if (!staticModifier.matches(methodFlag))
                       maxLocal++; // one for 'this' parameter
                   maxLocal += SegmentUtils.countArgs(methodDescr[c][m]);
                   // TODO Move creation of code attribute until after constant
                   // pool resolved
                   CodeAttribute attr = new CodeAttribute(maxStack, maxLocal,
                           methodByteCodePacked[c][m]);
                   methodAttributes[c][m].add(attr);
                   i++;
               }
           }
View Full Code Here


                   maxLocal += SegmentUtils.countArgs(methodDescr[c][m]);
                   // TODO Move creation of code attribute until after constant
                   // pool resolved
                   operandManager.setCurrentClass(segment.getClassBands().getClassThis()[c]);
                   operandManager.setSuperClass(segment.getClassBands().getClassSuper()[c]);
                   CodeAttribute attr = new CodeAttribute(maxStack, maxLocal,
                           methodByteCodePacked[c][m], segment, operandManager);
                   methodAttributes[c][m].add(attr);
                   // Should I add all the attributes in here?
                 ArrayList currentAttributes = (ArrayList)orderedCodeAttributes.get(i);
                 for(int index=0;index < currentAttributes.size(); index++) {
View Full Code Here

    public void testMixedByteCodes() {
        OperandManager operandManager = new MockOperandManager();
        operandManager.setSegment(segment);
        operandManager.setCurrentClass("java/lang/Foo");

        CodeAttribute attribute = new CodeAttribute(3, // maxStack
                2, // maxLocals
                mixedByteArray, // codePacked
                segment, // segment
                operandManager, // operandManager
                new ArrayList()
View Full Code Here

    public void testSingleByteCodes() {
        OperandManager operandManager = new MockOperandManager();
        operandManager.setSegment(segment);
        operandManager.setCurrentClass("java/lang/Foo");

        CodeAttribute attribute = new CodeAttribute(4, // maxStack
                3, // maxLocals
                singleByteArray, // codePacked
                segment, // segment
                operandManager, // operandManager
                new ArrayList()
View Full Code Here

                                    handlerStartPCs[i][j], handlerEndPCs[i][j],
                                    handlerCatchPCs[i][j], cpHandlerClass);
                            exceptionTable.add(entry);
                        }
                    }
                    CodeAttribute codeAttr = new CodeAttribute(maxStack,
                            maxLocal, methodByteCodePacked[c][m], segment,
                            operandManager, exceptionTable);
                    methodAttributes[c][m].add(codeAttr);
                    codeAttr.renumber(codeAttr.byteCodeOffsets);
                 ArrayList currentAttributes = (ArrayList)orderedCodeAttributes.get(i);
                 for(int index=0;index < currentAttributes.size(); index++) {
                     Attribute currentAttribute = (Attribute)currentAttributes.get(index);
                     codeAttr.addAttribute(currentAttribute);
                     // Fix up the line numbers if needed
                     if(currentAttribute.hasBCIRenumbering()) {
                         ((BCIRenumberedAttribute)currentAttribute).renumber(codeAttr.byteCodeOffsets);
                     }
                 }
View Full Code Here

    public void testMixedByteCodes() {
        OperandManager operandManager = new MockOperandManager();
        operandManager.setSegment(segment);
        operandManager.setCurrentClass("java/lang/Foo");

        CodeAttribute attribute = new CodeAttribute(3, // maxStack
                2, // maxLocals
                mixedByteArray, // codePacked
                segment, // segment
                operandManager // operandManager
        );
View Full Code Here

    public void testSingleByteCodes() {
        OperandManager operandManager = new MockOperandManager();
        operandManager.setSegment(segment);
        operandManager.setCurrentClass("java/lang/Foo");

        CodeAttribute attribute = new CodeAttribute(4, // maxStack
                3, // maxLocals
                singleByteArray, // codePacked
                segment, // segment
                operandManager // operandManager
        );
View Full Code Here

    public void testJustResourcesGZip() throws Exception {
        in = Archive.class
                .getResourceAsStream("/org/apache/harmony/pack200/tests/JustResources.pack.gz");
        file = File.createTempFile("Just", "ResourcesGz.jar");
        out = new JarOutputStream(new FileOutputStream(file));
        Archive archive = new Archive(in, out);
        archive.unpack();
    }
View Full Code Here

    public void testWithSqlE1() throws Exception {
        in = Archive.class
                .getResourceAsStream("/org/apache/harmony/pack200/tests/sql-e1.pack.gz");
        file = File.createTempFile("sql-e1", ".jar");
        out = new JarOutputStream(new FileOutputStream(file));
        Archive archive = new Archive(in, out);
        archive.unpack();
    }
View Full Code Here

    public void testWithSql() throws Exception {
        in = Archive.class
                .getResourceAsStream("/org/apache/harmony/pack200/tests/sql.pack.gz");
        file = File.createTempFile("sql", ".jar");
        out = new JarOutputStream(new FileOutputStream(file));
        Archive archive = new Archive(in, out);
        archive.unpack();
        JarFile jarFile = new JarFile(file);
        file.deleteOnExit();

        JarFile jarFile2 = new JarFile(new File(Archive.class.getResource(
                "/org/apache/harmony/pack200/tests/sqlUnpacked.jar").toURI()));
View Full Code Here

TOP

Related Classes of org.apache.harmony.unpack200.bytecode.CodeAttribute

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.