本文整理汇总了Java中com.sun.max.vm.heap.Heap类的典型用法代码示例。如果您正苦于以下问题:Java Heap类的具体用法?Java Heap怎么用?Java Heap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Heap类属于com.sun.max.vm.heap包,在下文中一共展示了Heap类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeBasicFeatures
import com.sun.max.vm.heap.Heap; //导入依赖的package包/类
/**
* Initializes basic features of the VM, including all of the VM schemes and the trap handling mechanism.
* It also parses some program arguments that were not parsed earlier.
*/
protected final void initializeBasicFeatures() {
MaxineVM vm = vm();
vm.phase = MaxineVM.Phase.STARTING;
// Now we can decode all the other VM arguments using the full language
if (VMOptions.parseStarting()) {
VMLog.checkLogOptions();
vmConfig().initializeSchemes(MaxineVM.Phase.STARTING);
if (Heap.ExcessiveGCFrequency != 0) {
new ExcessiveGCDaemon(Heap.ExcessiveGCFrequency).start();
}
if (Deoptimization.DeoptimizeALot != 0 && Deoptimization.UseDeopt) {
new DeoptimizeALot(Deoptimization.DeoptimizeALot).start();
}
// Install the signal handler for dumping threads when SIGHUP is received
Signal.handle(new Signal("QUIT"), new PrintThreads(false));
}
}
示例2: setHeapSizeInfo
import com.sun.max.vm.heap.Heap; //导入依赖的package包/类
private void setHeapSizeInfo() {
// Unless overridden on the command line, we set the heap sizes
// based on the current and maximum memory allocated by the hypervisor,
// what we have used to date and the code region size (which is managed by the heap)
final long extra = GUKPagePool.getMaximumReservation() - GUKPagePool.getCurrentReservation();
long initialHeapSize = toUnit(GUKPagePool.getFreeBulkPages() * 4096);
initialHeapSize -= toUnit(CodeManager.runtimeCodeRegionSize.getValue().toLong()) +
toUnit(maxDirectBufferSize.getValue().toLong());
if (Inspectable.isVmInspected()) {
/* some slop for inspectable heap info, should be provided by Inspector not guessed at */
initialHeapSize -= toUnit(initialHeapSize / 100);
}
final long maxHeapSize = toUnit(initialHeapSize + extra * 4096);
initialSize = Heap.initialHeapSizeOption.isPresent() ? super.getInitialSize() : Size.fromLong(initialHeapSize);
maxSize = Heap.maxHeapSizeOption.isPresent() ? super.getMaxSize() : Size.fromLong(maxHeapSize);
set = true;
}
示例3: getFileSystem
import com.sun.max.vm.heap.Heap; //导入依赖的package包/类
@SUBSTITUTE
private static/* FileSystem */Object getFileSystem() {
// return new UnixFileSystem();
if (_singleton == null) {
try {
final Object fileSystem = Heap.createTuple(ClassActor.fromJava(Class.forName("java.io.UnixFileSystem")).dynamicHub());
JDK_java_io_FileSystem thisFileSystem = asThis(fileSystem);
thisFileSystem.init();
_singleton = fileSystem;
} catch (Exception ex) {
VEError.unexpected("failed to construct java.io.UnixFileSystem: " + ex);
return null;
}
}
return _singleton;
}
示例4: gcCallback
import com.sun.max.vm.heap.Heap; //导入依赖的package包/类
public void gcCallback(Heap.GCCallbackPhase gcCallbackPhase) {
if (gcCallbackPhase == Heap.GCCallbackPhase.BEFORE) {
JVMTI.event(E.GARBAGE_COLLECTION_START);
} else if (gcCallbackPhase == Heap.GCCallbackPhase.AFTER) {
JVMTI.event(E.GARBAGE_COLLECTION_FINISH);
}
}
示例5: allocObject
import com.sun.max.vm.heap.Heap; //导入依赖的package包/类
private static Object allocObject(Class javaClass) throws InstantiationException {
final ClassActor classActor = ClassActor.fromJava(javaClass);
if (classActor.isTupleClass() && !classActor.isAbstract()) {
return Heap.createTuple(classActor.dynamicHub());
}
throw new InstantiationException();
}
示例6: ReleasePrimitiveArrayCritical
import com.sun.max.vm.heap.Heap; //导入依赖的package包/类
@VM_ENTRY_POINT
private static void ReleasePrimitiveArrayCritical(Pointer env, JniHandle array, Pointer elements, int mode) {
// Source: JniFunctionsSource.java:1687
Pointer anchor = prologue(env);
if (logger.enabled()) {
logger.log(LogOperations.ReleasePrimitiveArrayCritical.ordinal(), UPCALL_ENTRY, anchor, env, array, elements, Address.fromInt(mode));
}
try {
final Object arrayObject = array.unhand();
if (Heap.releasedDirectPointer(arrayObject)) {
return;
}
if (arrayObject instanceof boolean[]) {
releaseBooleanArrayElements(array, elements, mode);
} else if (arrayObject instanceof byte[]) {
releaseByteArrayElements(array, elements, mode);
} else if (arrayObject instanceof char[]) {
releaseCharArrayElements(array, elements, mode);
} else if (arrayObject instanceof short[]) {
releaseShortArrayElements(array, elements, mode);
} else if (arrayObject instanceof int[]) {
releaseIntArrayElements(array, elements, mode);
} else if (arrayObject instanceof long[]) {
releaseLongArrayElements(array, elements, mode);
} else if (arrayObject instanceof float[]) {
releaseFloatArrayElements(array, elements, mode);
} else if (arrayObject instanceof double[]) {
releaseDoubleArrayElements(array, elements, mode);
}
} catch (Throwable t) {
VmThread.fromJniEnv(env).setJniException(t);
} finally {
epilogue(anchor);
if (logger.enabled()) {
logger.log(LogOperations.ReleasePrimitiveArrayCritical.ordinal(), UPCALL_EXIT);
}
}
}
示例7: allocateInstance
import com.sun.max.vm.heap.Heap; //导入依赖的package包/类
/**
* Creates an instance of the specified class, without the typical safety checks.
* @see Unsafe#allocateInstance(Class)
* @param javaClass the class to create
* @return a new instance of the specified class
*/
@SUBSTITUTE
public Object allocateInstance(Class javaClass) {
final ClassActor classActor = ClassActor.fromJava(javaClass);
Snippets.makeClassInitialized(classActor);
if (classActor.isArrayClass()) {
return Heap.createArray(classActor.dynamicHub(), 0);
}
if (classActor.isTupleClass()) {
return Heap.createTuple(classActor.dynamicHub());
}
return null;
}
示例8: gcCallback
import com.sun.max.vm.heap.Heap; //导入依赖的package包/类
public void gcCallback(Heap.GCCallbackPhase gcCallbackPhase) {
if (gcCallbackPhase == Heap.GCCallbackPhase.BEFORE) {
vmConfig().monitorScheme().beforeGarbageCollection();
} else if (gcCallbackPhase == Heap.GCCallbackPhase.AFTER) {
vmConfig().monitorScheme().afterGarbageCollection();
}
}
示例9: initialize
import com.sun.max.vm.heap.Heap; //导入依赖的package包/类
@Override
public void initialize(MaxineVM.Phase phase) {
if (phase == MaxineVM.Phase.STARTING) {
// make sure we have console output in case of exceptions
FSTable.basicInit();
// install our custom direct byte buffer factory
System.setProperty(ByteBufferFactory.BYTEBUFFER_FACTORY_CLASS_PROPERTY_NAME, "org.jnode.fs.ext2.cache.PageByteBufferFactory");
Logger.resetLogger();
}
super.initialize(phase);
if (MaxineVM.isHosted() && phase == MaxineVM.Phase.BOOTSTRAPPING) {
Heap.registerHeapSizeInfo(HeapPool.getHeapSizeInfo());
}
if (phase == MaxineVM.Phase.PRIMORDIAL) {
GUK.initialize();
GUKScheduler.initialize();
} else if (phase == MaxineVM.Phase.RUNNING) {
System.setProperty("max.ve.version", Version.ID);
System.setProperty("os.version", Version.ID);
SchedulerFactory.scheduler().starting();
GUKPagePool.createTargetMemoryThread(GUKPagePool.getCurrentReservation() * 4096);
BBNativeDispatcher.resetNativeDispatchers();
NetInit.init();
NFSExports.initNFSExports();
checkRmiRegistry();
AttachListener.create();
checkGUKTrace();
checkTickProfiler();
} else if (phase == MaxineVM.Phase.TERMINATING) {
FSTable.close();
}
}
示例10: createInet4Address
import com.sun.max.vm.heap.Heap; //导入依赖的package包/类
static Inet4Address createInet4Address(String hostname, int ipAddr) {
// Use the ALIAS mechanism to avoid reflection
final Inet4Address inet4Address = UnsafeCast.asInet4Address(Heap.createTuple(ClassActor.fromJava(Inet4Address.class).dynamicHub()));
JDK_java_net_Inet4AddressImpl thisInet4Address = asJDK_java_net_Inet4AddressImpl(inet4Address);
thisInet4Address.init(hostname, ipAddr);
return inet4Address;
}
示例11: createNetworkInterface
import com.sun.max.vm.heap.Heap; //导入依赖的package包/类
static NetworkInterface createNetworkInterface(String name, int index, InetAddress[] addrs) {
// Use the ALIAS mechanism to avoid reflection
final NetworkInterface networkInterface = UnsafeCast.asNetworkInterface(Heap.createTuple(ClassActor.fromJava(NetworkInterface.class).dynamicHub()));
JDK_java_net_NetworkInterface thisNetworkInterface = asJDK_java_net_NetworkInterface(networkInterface);
thisNetworkInterface.init(name, index, addrs);
return networkInterface;
}
示例12: allocateDirect
import com.sun.max.vm.heap.Heap; //导入依赖的package包/类
public static ByteBuffer allocateDirect(int cap) {
final ByteBuffer byteBuffer = asByteBuffer(Heap.createTuple(directByteBufferActor.dynamicHub()));
PageDirectByteBuffer thisByteBuffer = asPageDirectByteBuffer(byteBuffer);
long va = VirtualMemory.allocate(Size.fromInt(cap), VirtualMemory.Type.DATA).toLong();
if (va == 0) {
VEError.unexpected("can't allocate direct byte buffer of size: " + cap);
}
thisByteBuffer.init(va, cap);
return byteBuffer;
}
示例13: GetPrimitiveArrayCritical
import com.sun.max.vm.heap.Heap; //导入依赖的package包/类
@VM_ENTRY_POINT
private static Pointer GetPrimitiveArrayCritical(Pointer env, JniHandle array, Pointer isCopy) {
// Source: JniFunctionsSource.java:1659
Pointer anchor = prologue(env);
if (logger.enabled()) {
logger.log(LogOperations.GetPrimitiveArrayCritical.ordinal(), UPCALL_ENTRY, anchor, env, array, isCopy);
}
try {
final Object arrayObject = array.unhand();
if (Heap.useDirectPointer(arrayObject)) {
setCopyPointer(isCopy, false);
return Reference.fromJava(arrayObject).toOrigin().plus(Layout.byteArrayLayout().getElementOffsetFromOrigin(0));
}
if (arrayObject instanceof boolean[]) {
return getBooleanArrayElements(array, isCopy);
} else if (arrayObject instanceof byte[]) {
return getByteArrayElements(array, isCopy);
} else if (arrayObject instanceof char[]) {
return getCharArrayElements(array, isCopy);
} else if (arrayObject instanceof short[]) {
return getShortArrayElements(array, isCopy);
} else if (arrayObject instanceof int[]) {
return getIntArrayElements(array, isCopy);
} else if (arrayObject instanceof long[]) {
return getLongArrayElements(array, isCopy);
} else if (arrayObject instanceof float[]) {
return getFloatArrayElements(array, isCopy);
} else if (arrayObject instanceof double[]) {
return getDoubleArrayElements(array, isCopy);
}
return Pointer.zero();
} catch (Throwable t) {
VmThread.fromJniEnv(env).setJniException(t);
return asPointer(0L);
} finally {
epilogue(anchor);
if (logger.enabled()) {
logger.log(LogOperations.GetPrimitiveArrayCritical.ordinal(), UPCALL_EXIT);
}
}
}
示例14: getHeapSizeInfo
import com.sun.max.vm.heap.Heap; //导入依赖的package包/类
public static Heap.HeapSizeInfo getHeapSizeInfo() {
return heapSizeInfo;
}