本文整理汇总了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();
}
}
示例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;
}
示例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");
}
}
}
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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");
}
}
示例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();
}
示例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);
}
示例12: preamble
import com.sun.squawk.VM; //导入方法依赖的package包/类
protected void preamble() {
VM.print(toString());
VM.println(".call...");
}
示例13: preamble
import com.sun.squawk.VM; //导入方法依赖的package包/类
protected void preamble() {
VM.print(toString());
VM.println(".call");
}
示例14: postscript
import com.sun.squawk.VM; //导入方法依赖的package包/类
protected void postscript(int result) {
VM.print("call returned: ");
VM.print(result);
VM.println();
}