Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ private static RuntimeException reportUncommitFailed(Pointer mapBegin, UnsignedW
}

private static RuntimeException reportUncommitFailedInterruptibly(Pointer mapBegin, UnsignedWord mappingSize) {
Log.log().string("Uncommitting ").unsigned(mappingSize).string(" bytes of unused memory at ").hex(mapBegin).string(" failed.").newline();
Log.log().string("Uncommitting ").unsigned(mappingSize).string(" bytes of unused memory at ").zhex(mapBegin).string(" failed.").newline();
throw VMError.shouldNotReachHere(UNCOMMIT_FAILED_ERROR_MSG);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ public boolean printLocationInfo(Log log, UnsignedWord value, boolean allowJavaH
if (value.equal(heapBase)) {
log.string("is the heap base");
return true;
} else if (value.aboveThan(heapBase) && value.belowThan(getImageHeapStart())) {
} else if (value.aboveThan(heapBase) && value.belowThan(heapBase.add(SerialAndEpsilonGCOptions.getNullRegionSize()))) {
log.string("points into the protected memory between the heap base and the image heap");
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,9 @@ private static boolean verifyObject(Object obj, AlignedHeader aChunk, UnalignedH
// Not all objects in the image heap have the remembered set bit in the header, so
// we can't verify that this bit is set.

} else if (space.isOldSpace()) {
} else if (space.isOldSpace() || space.isMetaspace()) {
if (SerialGCOptions.useRememberedSet() && !RememberedSet.get().hasRememberedSet(header)) {
Log.log().string("Object ").zhex(ptr).string(" is in old generation chunk ").zhex(chunk).string(" but does not have a remembered set.").newline();
Log.log().string("Object ").zhex(ptr).string(" is in ").string(space.getName()).string(" chunk ").zhex(chunk).string(" but does not have a remembered set.").newline();
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public static void visitObjectReferences(Pointer sp, CodePointer ip, CodeInfo in

@Uninterruptible(reason = "Not really uninterruptible, but we are about to fail.", calleeMustBe = false)
public static RuntimeException fatalErrorNoReferenceMap(Pointer sp, CodePointer ip, CodeInfo info) {
Log.log().string("ip: ").hex(ip).string(" sp: ").hex(sp).string(" info:");
Log.log().string("ip: ").zhex(ip).string(", sp: ").zhex(sp).string(", ");
CodeInfoAccess.log(info, Log.log()).newline();
throw VMError.shouldNotReachHere("No reference map information found");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
import java.util.function.BiFunction;
import java.util.function.IntFunction;

import com.oracle.svm.core.code.RuntimeMetadataDecoderImpl;
import org.graalvm.nativeimage.AnnotationAccess;
import org.graalvm.nativeimage.ImageSingletons;
import org.graalvm.nativeimage.Platform;
Expand All @@ -113,6 +112,7 @@
import com.oracle.svm.core.annotate.TargetElement;
import com.oracle.svm.core.classinitialization.ClassInitializationInfo;
import com.oracle.svm.core.classinitialization.EnsureClassInitializedNode;
import com.oracle.svm.core.code.RuntimeMetadataDecoderImpl;
import com.oracle.svm.core.config.ConfigurationValues;
import com.oracle.svm.core.config.ObjectLayout;
import com.oracle.svm.core.configure.RuntimeDynamicAccessMetadata;
Expand Down Expand Up @@ -633,7 +633,7 @@ public static DynamicHub allocate(String name, DynamicHub superHub, Object inter
writeInt(hub, dynamicHubOffsets.getReferenceMapCompressedOffsetOffset(), referenceMapCompressedOffset);
writeByte(hub, dynamicHubOffsets.getLayerIdOffset(), NumUtil.safeToByte(DynamicImageLayerInfo.CREMA_LAYER_ID));

// skip vtable (special treatment)
/* Skip vtable (special treatment). */

return finishInitialization(hub, companion);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
*/
package com.oracle.svm.core.hub;

import static com.oracle.svm.core.Uninterruptible.CALLED_FROM_UNINTERRUPTIBLE_CODE;

import org.graalvm.nativeimage.Platform;
import org.graalvm.nativeimage.Platforms;
import org.graalvm.word.Pointer;
Expand All @@ -35,6 +37,7 @@
import com.oracle.svm.core.config.ObjectLayout;
import com.oracle.svm.core.heap.Heap;
import com.oracle.svm.core.heap.ObjectHeader;
import com.oracle.svm.core.metaspace.Metaspace;
import com.oracle.svm.core.snippets.KnownIntrinsics;
import com.oracle.svm.core.util.DuplicatedInNativeCode;
import com.oracle.svm.core.util.VMError;
Expand Down Expand Up @@ -406,11 +409,20 @@ public static Pointer getObjectEndInlineInGC(Object obj) {

@Uninterruptible(reason = "Called from uninterruptible code.", mayBeInlined = true)
public static Pointer getImageHeapObjectEnd(Object obj) {
// Image heap objects never move and always have an identity hash code field.
assert Heap.getHeap().isInImageHeap(obj);
/* Image heap objects never move and always have an identity hash code field. */
UnsignedWord size = getSizeFromObjectInline(obj, true);
return Word.objectToUntrackedPointer(obj).add(size);
}

@Uninterruptible(reason = CALLED_FROM_UNINTERRUPTIBLE_CODE, mayBeInlined = true)
public static Pointer getMetaspaceObjectEnd(Object obj) {
assert Metaspace.isSupported() && Metaspace.singleton().isInAddressSpace(obj);
/* Metaspace objects don't move and have no identity hash code field. */
UnsignedWord size = getSizeFromObjectInline(obj, false);
return Word.objectToUntrackedPointer(obj).add(size);
}

public static boolean isArray(Object obj) {
final int encoding = KnownIntrinsics.readHub(obj).getLayoutEncoding();
return isArray(encoding);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@
*/
package com.oracle.svm.core.hub.crema;

import java.util.List;

import org.graalvm.nativeimage.ImageSingletons;
import org.graalvm.nativeimage.Platform;
import org.graalvm.nativeimage.Platforms;

import com.oracle.svm.core.hub.DynamicHub;
import com.oracle.svm.core.hub.RuntimeClassLoading.ClassDefinitionInfo;
import com.oracle.svm.core.hub.registry.SymbolsSupport;
import com.oracle.svm.core.invoke.Target_java_lang_invoke_MemberName;
import com.oracle.svm.espresso.classfile.ParserKlass;
Expand All @@ -48,8 +47,6 @@ public interface CremaSupport {
@Platforms(Platform.HOSTED_ONLY.class)
ResolvedJavaType createInterpreterType(DynamicHub hub, ResolvedJavaType analysisType);

int getAfterFieldsOffset(DynamicHub hub);

Target_java_lang_invoke_MemberName resolveMemberName(Target_java_lang_invoke_MemberName mn, Class<?> caller);

Object invokeBasic(Target_java_lang_invoke_MemberName memberName, Object methodHandle, Object[] args);
Expand All @@ -64,19 +61,7 @@ public interface CremaSupport {

Object getStaticStorage(ResolvedJavaField resolved);

interface CremaDispatchTable {
int vtableLength();

int itableLength(Class<?> iface);

int afterFieldsOffset(int superAfterFieldsOffset);

int[] getDeclaredInstanceReferenceFieldOffsets();
}

CremaDispatchTable getDispatchTable(ParserKlass parsed, Class<?> superClass, List<Class<?>> superInterfaces);

void fillDynamicHubInfo(DynamicHub hub, CremaDispatchTable table, List<Class<?>> transitiveSuperInterfaces, int[] interfaceIndices);
DynamicHub createHub(ParserKlass parsed, ClassDefinitionInfo info, int typeID, String externalName, Module module, ClassLoader classLoader, Class<?> superClass, Class<?>[] superInterfaces);

/**
* Creates a new instance of {@code type} without running any constructor yet. The caller should
Expand Down
Loading