Package org.jnode.vm.x86.compiler.l1a

Examples of org.jnode.vm.x86.compiler.l1a.X86BytecodeVisitor


        } else {
            gprPool = new X86RegisterPool.GPRs64();
            xmmPool = new X86RegisterPool.XMMs64();
        }
        this.ifac = ItemFactory.getFactory();
        final AbstractX86StackManager stackMgr = vstack.createStackMgr(gprPool,
            ifac);
        this.helper = new X86CompilerHelper(os, stackMgr, context, isBootstrap);
        this.cm = cm;
        final int slotSize = helper.SLOTSIZE;
        this.arrayLengthOffset = VmArray.LENGTH_OFFSET * slotSize;
 
View Full Code Here


            gprPool = new X86RegisterPool.GPRs64();
            xmmPool = new X86RegisterPool.XMMs64();
        }
        this.ifac = ItemFactory.getFactory();
        final AbstractX86StackManager stackMgr = vstack.createStackMgr(gprPool, ifac);
        this.helper = new X86CompilerHelper(os, stackMgr, context, isBootstrap);
        this.cm = cm;
        final int slotSize = helper.SLOTSIZE;
        this.arrayLengthOffset = VmArray.LENGTH_OFFSET * slotSize;
        this.arrayDataOffset = VmArray.DATA_OFFSET * slotSize;
        this.tibOffset = ObjectLayout.TIB_SLOT * slotSize;
 
View Full Code Here

            xmmPool = new X86RegisterPool.XMMs64();
        }
        this.ifac = ItemFactory.getFactory();
        final AbstractX86StackManager stackMgr = vstack.createStackMgr(gprPool,
            ifac);
        this.helper = new X86CompilerHelper(os, stackMgr, context, isBootstrap);
        this.cm = cm;
        final int slotSize = helper.SLOTSIZE;
        this.arrayLengthOffset = VmArray.LENGTH_OFFSET * slotSize;
        this.arrayDataOffset = VmArray.DATA_OFFSET * slotSize;
        this.tibOffset = ObjectLayout.TIB_SLOT * slotSize;
 
View Full Code Here

    protected void loadToConstant(EmitterContext ec, X86Assembler os,
                                  GPR reg) {
        if (value == null) {
            os.writeXOR(reg, reg);
        } else {
            X86CompilerHelper helper = ec.getHelper();
            final Label l = new Label(Long.toString(labelCounter++));
            if (os.isCode32()) {
                helper.writeGetStaticsEntry(l, reg, value);
            } else {
                helper.writeGetStaticsEntry64(l, (GPR64) reg, value);
            }
        }
    }
View Full Code Here

        if (value == null) {
            // Push const not supported in 64-bit mode,
            // but PUSH imm32 will sign-extend to 64-bit
            os.writePUSH(0);
        } else {
            X86CompilerHelper helper = ec.getHelper();
            Label l = new Label(Long.toString(labelCounter++));
            helper.writePushStaticsEntry(l, value);
        }
    }
View Full Code Here

    protected void loadToConstant(EmitterContext ec, X86Assembler os,
                                  GPR reg) {
        if (value == null) {
            os.writeXOR(reg, reg);
        } else {
            X86CompilerHelper helper = ec.getHelper();
            final Label l = new Label(Long.toString(labelCounter++));
            if (os.isCode32()) {
                helper.writeGetStaticsEntry(l, reg, value);
            } else {
                helper.writeGetStaticsEntry64(l, (GPR64) reg, value);
            }
        }
    }
View Full Code Here

        if (value == null) {
            // Push const not supported in 64-bit mode,
            // but PUSH imm32 will sign-extend to 64-bit
            os.writePUSH(0);
        } else {
            X86CompilerHelper helper = ec.getHelper();
            Label l = new Label(Long.toString(labelCounter++));
            helper.writePushStaticsEntry(l, value);
        }
    }
View Full Code Here

            if (method.isNative()) {
                Object label = new Label(method.getMangledName());
                cm.setCodeStart(os.getObjectRef(label));
            } else {
                EntryPoints entryPoints = getEntryPoints();
                X86CompilerHelper helper = new X86CompilerHelper((X86Assembler) os, null, entryPoints, isBootstrap);
                helper.setMethod(method);
                X86StackFrame stackFrame = new X86StackFrame((X86Assembler) os, helper, method, entryPoints, cm);
                TypeSizeInfo typeSizeInfo = getTypeSizeInfo();

                VmByteCode bytecode = method.getBytecode();
                IRControlFlowGraph cfg = new IRControlFlowGraph(bytecode);
View Full Code Here

            cm.setCodeStart(nos.getObjectRef(label));
        } else {
            final X86Assembler os = (X86Assembler) nos;
            final EntryPoints context = getEntryPoints();
            // Create the helper
            final X86CompilerHelper ih = new X86CompilerHelper(os, null, context, isBootstrap);
            // Start an "object"
            final NativeStream.ObjectInfo objectInfo = os.startObject(context.getVmMethodCodeClass());
            // Start the code creation
            cm.setCodeStart(os.setObjectRef(new Label(method.getMangledName() + "$$start")));

            // Setup call to {@link VmMethod#recompileMethod(int, int)}
            final VmType<?> declClass = method.getDeclaringClass();
            os.writePUSH(declClass.getSharedStaticsIndex());
            os.writePUSH(declClass.indexOf(method));
            final int recompileStatOfs = ih.getSharedStaticsOffset(context.getRecompileMethod());
            os.writeCALL(ih.STATICS, recompileStatOfs);

            // Emit jump to the newly compiled code.
            final int methodStatOfs = ih.getSharedStaticsOffset(method);
            os.writeJMP(ih.STATICS, methodStatOfs);

            // Close the "object"
            objectInfo.markEnd();
            // The end
View Full Code Here

        final VirtualStack vstack = ec.getVStack();
        final X86Assembler os = ec.getStream();
        final ItemFactory ifac = ec.getItemFactory();
        final X86RegisterPool pool = ec.getGPRPool();
//        final EntryPoints context = ec.getContext(); 
        final X86CompilerHelper helper = ec.getHelper();
        final int slotSize = os.isCode32() ? 4 : 8;

        // Test magic permission first
        testMagicPermission(mcode, caller);
View Full Code Here

TOP

Related Classes of org.jnode.vm.x86.compiler.l1a.X86BytecodeVisitor

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.