Examples of VmType


Examples of org.jnode.vm.classmgr.VmType

            }
        } else {
            final VmType[] list = bootClasses;
            final int count = list.length;
            for (int i = 0; i < count; i++) {
                VmType vmClass = list[i];
                if (vmClass.nameEquals(name)) {
                    return vmClass;
                }
            }
            return null;
        }
View Full Code Here

Examples of org.jnode.vm.classmgr.VmType

            } catch (ClassNotFoundException ex) {
                // Don't care, try it ourselves.
            }
        }

        VmType cls = findLoadedClass(name);
        if (cls != null) {
            return cls;
        }
        if (classInfos == null) {
            // Unsafe.debug("classInfos==null");
View Full Code Here

Examples of org.jnode.vm.classmgr.VmType

        if (classInfos == null) {
            final TreeMap<String, ClassInfo> classInfos = new TreeMap<String, ClassInfo>();
            final VmType[] list = bootClasses;
            final int count = list.length;
            for (int i = 0; i < count; i++) {
                final VmType vmClass = list[i];
                final ClassInfo ci = new ClassInfo(vmClass);
                classInfos.put(ci.getName(), ci);
            }
            this.classInfos = classInfos;
        }
View Full Code Here

Examples of org.jnode.vm.classmgr.VmType

    }

    private static VmByteCode loadByteCode(String className)
        throws MalformedURLException, ClassNotFoundException {
        VmSystemClassLoader vmc = new VmSystemClassLoader(new File(".").toURL(), new VmX86Architecture32());
        VmType type = vmc.loadClass(className, true);
        VmMethod arithMethod = null;
        int nMethods = type.getNoDeclaredMethods();
        for (int i = 0; i < nMethods; i += 1) {
            VmMethod method = type.getDeclaredMethod(i);
            if ("const1".equals(method.getName())) {
                arithMethod = method;
                break;
            }
        }
View Full Code Here

Examples of org.jnode.vm.classmgr.VmType

        if (VmMagic.isFinalized(object)) {
            // Ignore finalized objects that need to be freed
            return true;
        }

        VmType vmClass;
        try {       
            vmClass = VmMagic.getObjectType(object);
        } catch (NullPointerException ex) {
            if (object == null) {
                helper.die("GCVerifyError: null object");
            } else if (VmMagic.getTIB(object) == null) {
                helper.die("GCVerifyError: null TIB");
            } else {
                helper.die("GCVerifyError: other NPE");
            }
            /* not reached */
            throw ex;
        }
        if (vmClass == null) {
            helper.die("GCVerifyError: vmClass");
        } else if (vmClass.isArray()) {
            if (!vmClass.isPrimitiveArray()) {
                verifyArray(object);
            }
        } else {
            verifyObject(object, (VmNormalClass) vmClass);
        }
View Full Code Here

Examples of org.jnode.vm.classmgr.VmType

    @NoInline
    protected final void mark() {
        while (!stack.isEmpty()) {
            final Object object = stack.pop();
            markedObjects++;
            VmType vmClass;
            try {
                vmClass = VmMagic.getObjectType(object);
            } catch (NullPointerException ex) {
                // This is a symptom of heap corruption
                if (object == null) {
                    helper.die("GCMarkError: null object");
                } else {
                    final Address objAddr = ObjectReference.fromObject(object).toAddress();
                    Unsafe.debug("Object address is ");
                    Unsafe.debug(objAddr);
                    Unsafe.debug(", tib is ");
                    Object[] tib = VmMagic.getTIB(object);
                    Unsafe.debug(ObjectReference.fromObject(tib).toAddress());
                    Unsafe.debug(", flags word is ");
                    Word flags = VmMagic.getObjectFlags(object);
                    Unsafe.debug(flags);
                    Unsafe.debug(", markedObjects is ");
                    Unsafe.debug(markedObjects);
                    Unsafe.debug('\n');
                    helper.die("GCMarkError: NPE");
                }
                throw ex;
            }
            if (vmClass == null) {
                Unsafe.debug("Oops vmClass == null in (");
                Unsafe.debug(markedObjects);
                Unsafe.debug(")");
                helper.die("vmClass == null in mark()");
            } else if (vmClass.isArray()) {
                if (!vmClass.isPrimitiveArray()) {
                    markArray(object);
                }
            } else {
                markObject(object, (VmNormalClass) vmClass);
            }
View Full Code Here

Examples of org.jnode.vm.classmgr.VmType

    static void redefineClass(Class oldClass, byte[] classData){
        if(debug())
            System.out.println("NativeVMVirtualMachine.redefineClass()");

        String name = oldClass.getName();
        VmType old_type = VmType.fromClass(oldClass);
        VmClassLoader loader = VmType.fromClass(oldClass).getLoader();
        ProtectionDomain pd = oldClass.getProtectionDomain();
        VmType new_type = ClassDecoder.defineClass(name, ByteBuffer.wrap(classData), false, loader, pd);
        for(int i = 0; i < old_type.getNoDeclaredMethods(); i++){
            VmMethod old_method = old_type.getDeclaredMethod(i);
            if (!old_method.isNative()) {
                VmMethod new_method = new_type.getDeclaredMethod(old_method.getName(), old_method.getSignature());
                if(new_method == null) continue;

                old_method.setBytecode(new_method.getBytecode());
                old_method.resetOptLevel();
                old_method.recompile();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.