Package org.jnode.assembler

Examples of org.jnode.assembler.Label


        val.load(eContext);

        if (os.isCode32()) {
            final GPR v1_lsb = val.getLsbRegister(eContext);
            final GPR v1_msb = val.getMsbRegister(eContext);
            final Label curInstrLabel = getCurInstrLabel();

            os.writeAND(ECX, 63);
            os.writeCMP_Const(ECX, 32);
            final Label gt32Label = new Label(curInstrLabel + "gt32");
            final Label endLabel = new Label(curInstrLabel + "end");
            os.writeJCC(gt32Label, X86Constants.JAE); // JAE
            /** ECX < 32 */
            os.writeSHLD_CL(v1_msb, v1_lsb);
            os.writeSHL_CL(v1_lsb);
            os.writeJMP(endLabel);
View Full Code Here


        val.load(eContext);

        if (os.isCode32()) {
            final X86Register.GPR lsb = val.getLsbRegister(eContext);
            final X86Register.GPR msb = val.getMsbRegister(eContext);
            final Label curInstrLabel = getCurInstrLabel();

            // Calculate
            os.writeAND(ECX, 63);
            os.writeCMP_Const(ECX, 32);
            final Label gt32Label = new Label(curInstrLabel + "gt32");
            final Label endLabel = new Label(curInstrLabel + "end");
            os.writeJCC(gt32Label, X86Constants.JAE); // JAE
            /** ECX < 32 */
            os.writeSHRD_CL(lsb, msb);
            os.writeSAR_CL(msb);
            os.writeJMP(endLabel);
View Full Code Here

        val.load(eContext);

        if (os.isCode32()) {
            final X86Register.GPR lsb = val.getLsbRegister(eContext);
            final X86Register.GPR msb = val.getMsbRegister(eContext);
            final Label curInstrLabel = getCurInstrLabel();

            // Calculate
            os.writeAND(ECX, 63);
            os.writeCMP_Const(ECX, 32);
            final Label gt32Label = new Label(curInstrLabel + "gt32");
            final Label endLabel = new Label(curInstrLabel + "end");
            os.writeJCC(gt32Label, X86Constants.JAE); // JAE
            /** ECX < 32 */
            os.writeSHRD_CL(lsb, msb);
            os.writeSHR_CL(msb);
            os.writeJMP(endLabel);
View Full Code Here

        if (countBytecode) {
            counters.getCounter("putstatic").inc();
        }

        final Label curInstrLabel = getCurInstrLabel();
        fieldRef.resolve(loader);
        final VmStaticField sf = (VmStaticField) fieldRef.getResolvedVmField();

        // Initialize class if needed
        if (!sf.getDeclaringClass().isAlwaysInitialized()) {
View Full Code Here

            }
            // If outsite low-high range, jump to default
            os.writeCMP_Const(valr, n);
            os.writeJCC(helper.getInstrLabel(defAddress), X86Constants.JAE);

            final Label curInstrLabel = getCurInstrLabel();
            final Label l1 = new Label(curInstrLabel + "$$l1");
            final Label l2 = new Label(curInstrLabel + "$$l2");
            final int l12distance = os.isCode32() ? 12 : 23;

            // Get absolute address of l1 into S0. (do not use
            // stackMgr.writePOP!)
            os.writeCALL(l1);
View Full Code Here

        // the native code

        final VmType<?> declClass = fieldRef.getResolvedVmField()
            .getDeclaringClass();
        if (!declClass.isAlwaysInitialized()) {
            final Label curInstrLabel = getCurInstrLabel();

            // Allocate a register to hold the class
            final GPR classReg = (GPR) L1AHelper.requestRegister(eContext, JvmType.REFERENCE, false);

            // Load classRef into the register
            // Load the class from the statics table
            if (os.isCode32()) {
                helper.writeGetStaticsEntry(new Label(curInstrLabel + "$$ic"),
                    classReg, declClass);
            } else {
                helper.writeGetStaticsEntry64(new Label(curInstrLabel + "$$ic"),
                    (GPR64) classReg, (VmSharedStaticsEntry) declClass);
            }

            // Write class initialization code
            helper.writeClassInitialize(curInstrLabel, classReg, classReg, declClass);
View Full Code Here

    private final void writeResolveAndLoadClassToReg(VmConstClass classRef,
                                                     GPR dst) {
        // Resolve the class
        classRef.resolve(loader);
        final VmType type = classRef.getResolvedVmClass();
        final Label curInstrLabel = getCurInstrLabel();

        // Load the class from the statics table
        if (os.isCode32()) {
            helper.writeGetStaticsEntry(curInstrLabel, dst, type);
        } else {
View Full Code Here

     * @param ref
     * @param index
     */
    final void checkBounds(RefItem ref, IntItem index) {
        counters.getCounter("checkbounds").inc();
        final Label curInstrLabel = getCurInstrLabel();
        final Label test = new Label(curInstrLabel + "$$cbtest");
        final Label failed = new Label(curInstrLabel + "$$cbfailed");

        assertCondition(ref.isGPR(), "ref must be in a register");
        final GPR refr = ref.getRegister();

        os.writeJMP(test);
View Full Code Here

    private void instanceOfClass(GPR objectr, VmClassType<?> type, GPR tmpr,
                                 GPR resultr, Label trueLabel, boolean skipNullTest) {

        final int depth = type.getSuperClassDepth();
        final int staticsOfs = helper.getSharedStaticsOffset(type);
        final Label curInstrLabel = getCurInstrLabel();
        final Label notInstanceOfLabel = new Label(curInstrLabel
            + "notInstanceOf");

        if (!type.isAlwaysInitialized()) {
            if (os.isCode32()) {
                helper.writeGetStaticsEntry(curInstrLabel, tmpr, type);
View Full Code Here

     *                  directly after this method Register ECX must be free and it
     *                  destroyed.
     */
    private void instanceOf(GPR objectr, GPR typer, GPR tmpr, GPR cntr,
                            Label trueLabel, boolean skipNullTest) {
        final Label curInstrLabel = getCurInstrLabel();
        final Label loopLabel = new Label(curInstrLabel + "loop");
        final Label notInstanceOfLabel = new Label(curInstrLabel
            + "notInstanceOf");

        if (VmUtils.verifyAssertions()) {
            VmUtils._assert(objectr.getSize() == helper.ADDRSIZE, "objectr size");
            VmUtils._assert(typer.getSize() == helper.ADDRSIZE, "typer size");
View Full Code Here

TOP

Related Classes of org.jnode.assembler.Label

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.