Examples of BaseVmArchitecture


Examples of org.jnode.vm.BaseVmArchitecture

            // Load all resources
            final Map<String, byte[]> resources = loadSystemResource(piRegistry);

            /* Now create the processor */
            final BaseVmArchitecture arch = getArchitecture();
            final NativeStream os = createNativeStream();
            clsMgr = new VmSystemClassLoader(null/*classesURL*/, arch,
                new BuildObjectResolver(os, this));
            blockedObjects.add(clsMgr);
            blockedObjects.add(clsMgr.getSharedStatics());
            blockedObjects.add(clsMgr.getSharedStatics().getTable());
            blockedObjects.add(clsMgr.getIsolatedStatics());
            blockedObjects.add(clsMgr.getIsolatedStatics().getTable());
            blockedObjects.add(resources);
            clsMgr.setSystemRtJar(resources);

            // Initialize the statics table.
            initializeStatics(clsMgr.getSharedStatics());

            if (debug) {
                log("Building in DEBUG mode", Project.MSG_WARN);
            }

            // Create the VM
            final VmImpl vm = new VmImpl(version, arch, clsMgr.getSharedStatics(), debug, clsMgr, piRegistry);
            blockedObjects.add(vm);
            blockedObjects.add(VmUtils.getVm().getCompiledMethods());

            final VmProcessor proc = createProcessor(vm, clsMgr.getSharedStatics(),
                clsMgr.getIsolatedStatics());
            log("Building for " + proc.getCPUID());

            final Label clInitCaller = new Label("$$clInitCaller");
            VmType<?> systemClasses[] = VmType.initializeForBootImage(clsMgr);
            for (int i = 0; i < systemClasses.length; i++) {
                clsMgr.addLoadedClass(systemClasses[i].getName(),
                    systemClasses[i]);
            }

            // First copy the native kernel file
            if (enableJNasm) {
                compileKernel(os, asmSourceInfo);
            } else {
                copyKernel(os);
            }
            os.setObjectRef(bootHeapStart);

            // Setup a call to our first java method
            initImageHeader(os, clInitCaller, vm, piRegistry);

            // Create the initial stack
            createInitialStack(os, initialStack, initialStackPtr);

            /* Now load the classes */
            loadClass(VmMethodCode.class);
            loadClass(Unsafe.class);
            loadClass(VmSystemClassLoader.class);
            loadClass(VmType[].class);
            loadClass(Vm.class);
            loadClass(VirtualMemoryRegion.class).link();
            vm.getHeapManager().loadClasses(clsMgr);
            loadClass(VmHeapManager.class);
            loadClass(VmSharedStatics.class);
            loadClass(VmIsolatedStatics.class);
            loadClass(VmUtils.getVm().getHeapManager().getClass());
            loadClass(HeapHelper.class);
            loadClass("org.jnode.vm.HeapHelperImpl");
            loadClass(VmUtils.getVm().getCompiledMethods().getClass());
            loadClass(VmCompiledCode[].class);
            loadSystemClasses(resources.keySet());

            /* Now emit the processor */
            os.getObjectRef(proc);

            /* Let the compilers load its native symbol offsets */
            final NativeCodeCompiler[] cmps = arch.getCompilers();
            for (int i = 0; i < cmps.length; i++) {
                final NativeCodeCompiler cmp = cmps[i];
                cmp.initialize(clsMgr);
                os.getObjectRef(cmp);
            }
            /* Let the test compilers load its native symbol offsets */
            final NativeCodeCompiler[] testCmps = arch.getTestCompilers();
            if (testCmps != null) {
                for (int i = 0; i < testCmps.length; i++) {
                    final NativeCodeCompiler cmp = testCmps[i];
                    cmp.initialize(clsMgr);
                    os.getObjectRef(cmp);
                }
            }
            log("Compiling using " + cmps[0].getName() + " and "
                + cmps[cmps.length - 1].getName() + " compilers");
            // Initialize the IMT compiler.
            arch.getIMTCompiler().initialize(clsMgr);

            // Load the jarfile as byte-array
//            copyJarFile(blockedObjects, piRegistry);

            // Now emit all object images to the actual image
View Full Code Here

Examples of org.jnode.vm.BaseVmArchitecture

     * @throws InstantiationException
     */
    private void doExecute()
        throws BuildException, ClassNotFoundException, IllegalAccessException, IOException, InstantiationException {

        final BaseVmArchitecture arch = getArchitecture();
        String[] urls = classesURL.split(",");
        URL[] urla = new URL[urls.length];
        for (int i = 0; i < urls.length; i++)
            urla[i] = new URL(urls[i].trim());

View Full Code Here

Examples of org.jnode.vm.BaseVmArchitecture

    // ------------------------------------------

    protected void initialize() {
        // Set the basic fields
        helper.bootArchitecture(false);
        final BaseVmArchitecture arch = getCurrentProcessor().getArchitecture();
        final int slotSize = arch.getReferenceSize();

        // Initialize the boot heap.
        bootHeap.initialize(helper.getBootHeapStart(), helper.getBootHeapEnd(),
            slotSize);
View Full Code Here

Examples of org.jnode.vm.BaseVmArchitecture

    }

    public void start() {
        // Create a Heap monitor
        heapMonitor = new Monitor();
        final BaseVmArchitecture arch = getCurrentProcessor().getArchitecture();
        this.gcManager = new GCManager(this, arch);
        this.gcThread = new GCThread(gcManager, heapMonitor);
        this.finalizerThread = new FinalizerThread(this);
        gcThread.start();
        finalizerThread.start();
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.