当前位置: 首页>>代码示例>>Java>>正文


Java VM.print方法代码示例

本文整理汇总了Java中com.sun.squawk.VM.print方法的典型用法代码示例。如果您正苦于以下问题:Java VM.print方法的具体用法?Java VM.print怎么用?Java VM.print使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.squawk.VM的用法示例。


在下文中一共展示了VM.print方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: allocateMemory

import com.sun.squawk.VM; //导入方法依赖的package包/类
/**
 * Attempt to allocate backing memory for the structure.
 * 
 * @param size in bytes ito allocate
 * @throws IllegalArgumentException if the requested size is smaller than the default size
 * @throws OutOfMemoryError if backing native memory cannot be allocated.
 * @throws IllegalStateException if this structure already has memory allocated
 */
public void allocateMemory(int size) throws OutOfMemoryError {
    int defaultsize = size();
    if (size < defaultsize) {
        throw new IllegalArgumentException();
    }
    if (backingNativeMemory != null &&
        backingNativeMemory.isValid()) {
        throw new IllegalStateException();
    }
    backingNativeMemory = new Pointer(size);
    if (DEBUG) {
        VM.print("Allocated memory of special size for ");
        VMprintStruct();
    }
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:24,代码来源:Structure.java

示例2: dispose

import com.sun.squawk.VM; //导入方法依赖的package包/类
/**
 * Close the library, as in dlclose.
 * @throws RuntimeException if dlcose fails
 */
public void dispose() {
    if (closed || ptr.isZero()) {
        throw new RuntimeException("closed or RTLD_DEFAULT");
    }
    if (DEBUG) {
        VM.print("Calling DLCLOSE on ");
        VM.println(name);
    }
    Pointer name0 = Pointer.createStringBuffer(name);
    int result = VM.execSyncIO(ChannelConstants.DLCLOSE, ptr.toUWord().toInt(), 0, 0, 0, 0, 0, 0, null, null);
    name0.free();
    if (result != 0) {
        throw new RuntimeException("Error on dlclose: " + errorStr());
    }
    closed = true;
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:21,代码来源:NativeLibrary.java

示例3: printTable

import com.sun.squawk.VM; //导入方法依赖的package包/类
public static void printTable(SquawkHashtable table) {
    HashtableEntry[] array = table.entryTable;
    for (int i = 0; i < array.length; i++) {
        HashtableEntry entry = array[i];
        if (entry != null) {
            VM.print("    key: ");
            if (entry.key != null) {
                GC.printObject(entry.key);
            } else {
                VM.print("null");
            }
            VM.print("    value: ");
            if (entry.value != null) {
                GC.printObject(entry.value);
            } else {
                VM.print("null");
            }
        }
    }
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:21,代码来源:SquawkHashtable.java

示例4: write

import com.sun.squawk.VM; //导入方法依赖的package包/类
synchronized public void write(int b) throws IOException {
    int old;
    if (err) {
        old = VM.setStream(VM.STREAM_STDERR);
    } else {
        old = VM.setStream(VM.STREAM_STDOUT);
    }
    VM.print((char)b);
    VM.setStream(old);
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:11,代码来源:System.java

示例5: freeMemory

import com.sun.squawk.VM; //导入方法依赖的package包/类
/**
 * Free the backing memory for the structure.
 * 
 * @throws IllegalStateException if the memory has already been freed.
 */
public void freeMemory() throws IllegalStateException {
    if (DEBUG) {
        VM.print("Freeing memory for ");
        VMprintStruct();
    }
    backingNativeMemory.free();
    backingNativeMemory = null;
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:14,代码来源:Structure.java

示例6: newError

import com.sun.squawk.VM; //导入方法依赖的package包/类
/** Read errno, try to clean up fd, and create exception. */
private IOException newError(int fd, String msg)  {
    if (DEBUG) {
    VM.print(msg);
    VM.print(": errno: ");
    }
    int err_code = LibCUtil.errno();
    if (DEBUG) {
    VM.print(err_code);
    VM.println();
    }
    sockets.shutdown(fd, 2);
    libc.close(fd);
    return new IOException(" errno: " + err_code + " on fd: " + fd + " during " + msg);
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:16,代码来源:GCFSocketsImpl.java

示例7: release

import com.sun.squawk.VM; //导入方法依赖的package包/类
/**
 * Release the backing memory for the structure, if it was malloced
 *
 * @throws IllegalStateException if the memory has already been freed.
 */
public void release() throws IllegalStateException {
    if (DEBUG) {
        VM.print("Releasing memory for ");
        VMprintStruct();
    }
    backingNativeMemory.release();
    backingNativeMemory = null;
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:14,代码来源:Structure.java

示例8: getSymbolAddress

import com.sun.squawk.VM; //导入方法依赖的package包/类
/**
 * getFunction a symbol's address by name (warpper around dlsym)
 * @param name
 * @return Address of symbol
 */
private Address getSymbolAddress(String name) {
    if (closed) {
        throw new IllegalStateException("closed");
    }
    if (DEBUG) {
        VM.print("Calling DLSYM on ");
        VM.println(name);
    }
    Pointer name0 = Pointer.createStringBuffer(name);
    int result = VM.execSyncIO(ChannelConstants.DLSYM, ptr.toUWord().toInt(), name0.address().toUWord().toInt(), 0, 0, 0, 0, null, null);
    name0.free();
    return Address.fromPrimitive(result);
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:19,代码来源:NativeLibrary.java

示例9: passed

import com.sun.squawk.VM; //导入方法依赖的package包/类
static void passed(String name) {
    if (VM.isVerbose()) {
        VM.print("Test ");
        VM.print(name);
        VM.print(" passed\n");
    }
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:8,代码来源:MiniTestHelper.java

示例10: postscript

import com.sun.squawk.VM; //导入方法依赖的package包/类
protected void postscript(int result) {
    VM.print("DONE: ");
    VM.print(name);
    VM.print(".blockingCall returned: ");
    VM.print(result);
    VM.println();
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:8,代码来源:BlockingFunction.java

示例11: newError

import com.sun.squawk.VM; //导入方法依赖的package包/类
/** Read errno, try to clean up fd, and create exception. */
private IOException newError(int fd, String msg)  {
    if (DEBUG) {
        VM.print(msg);
        VM.print(": errno: ");
    }
    int err_code = LibCUtil.errno();
    if (DEBUG) {
        VM.print(err_code);
        VM.println();
    }
    sockets.shutdown(fd, 2);
    libc.close(fd);
    return new IOException(" errno: " + err_code + " on fd: " + fd + " during " + msg);
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:16,代码来源:GCFSocketsImpl.java

示例12: preamble

import com.sun.squawk.VM; //导入方法依赖的package包/类
protected void preamble() {
    VM.print(toString());
    VM.println(".call...");
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:5,代码来源:BlockingFunction.java

示例13: preamble

import com.sun.squawk.VM; //导入方法依赖的package包/类
protected void preamble() {
    VM.print(toString());
    VM.println(".call");
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:5,代码来源:Function.java

示例14: postscript

import com.sun.squawk.VM; //导入方法依赖的package包/类
protected void postscript(int result) {
    VM.print("call returned: ");
    VM.print(result);
    VM.println();
}
 
开发者ID:tomatsu,项目名称:squawk,代码行数:6,代码来源:Function.java


注:本文中的com.sun.squawk.VM.print方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。