Examples of VmHeapManager


Examples of org.jnode.vm.facade.VmHeapManager

     * @throws InvocationTargetException
     */
    public static Object newInstance(VmMethod constructor, Object[] args)
        throws InstantiationException, IllegalAccessException,
        InvocationTargetException {
        final VmHeapManager hm = VmUtils.getVm().getHeapManager();
        final Object obj = hm.newInstance(constructor.getDeclaringClass());
        invoke(constructor, obj, args);
        return obj;
    }
View Full Code Here

Examples of org.jnode.vm.facade.VmHeapManager

     * @throws InvocationTargetException
     */
    public static Object newInstance(VmMethod constructor)
        throws InstantiationException, IllegalAccessException,
        InvocationTargetException {
        final VmHeapManager hm = VmUtils.getVm().getHeapManager();
        final Object obj = hm.newInstance(constructor.getDeclaringClass());
        Unsafe.pushObject(obj);
        Unsafe.invokeVoid(constructor);
        return obj;
    }
View Full Code Here

Examples of org.jnode.vm.facade.VmHeapManager

     * @param vmClass
     * @param size
     * @return Object The new object
     */
    public static Object allocObject(VmType<?> vmClass, int size) {
        VmHeapManager hm = heapManager;
        if (hm == null) {
            heapManager = hm = VmUtils.getVm().getHeapManager();
        }
        final Object result;
        if (size < 0) {
            result = hm.newInstance(vmClass);
        } else {
            result = hm.newInstance(vmClass, size);
        }
        return result;
    }
View Full Code Here

Examples of org.jnode.vm.facade.VmHeapManager

     * @return Object The new array
     */
    public static Object anewarray(VmType<?> vmClass, int elements) {

        final VmArrayClass<?> arrCls = vmClass.getArrayClass();
        VmHeapManager hm = heapManager;
        if (hm == null) {
            heapManager = hm = VmUtils.getVm().getHeapManager();
        }
        final Object result = hm.newArray(arrCls, elements);

        // Screen.debug("}");
        return result;
    }
View Full Code Here

Examples of org.jnode.vm.facade.VmHeapManager

     * @param elements
     * @return Object The new array
     */
    public static Object allocPrimitiveArray(VmType<?> currentClass,
                                             int atype, int elements) {
        VmHeapManager hm = heapManager;
        if (hm == null) {
            heapManager = hm = VmUtils.getVm().getHeapManager();
        }
        if (false) {
            if (atype == 5) {
                if (VmSystem.isInitialized()) {
                    // Trace new char[]
                    VmUtils.getVm().getCounter(currentClass.getName()).add(elements);
                }
            }
        }
        final Object result = hm.newArray(VmType.getPrimitiveArrayClass(atype),
            elements);
        return result;
    }
View Full Code Here

Examples of org.jnode.vm.facade.VmHeapManager

     * @param vmClass
     * @param elements
     * @return Object The new array
     */
    public static Object allocArray(VmType vmClass, int elements) {
        VmHeapManager hm = heapManager;
        if (hm == null) {
            heapManager = hm = VmUtils.getVm().getHeapManager();
        }
        final Object result = hm.newArray((VmArrayClass) vmClass, elements);
        return result;
    }
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.