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 @@ -1549,10 +1549,7 @@ static class TargetContent {
/** All references in deopt frames are compressed when compressed references are enabled. */
private final int sizeofCompressedReference = ConfigurationValues.getObjectLayout().getReferenceSize();
private final int sizeofUncompressedReference = FrameAccess.uncompressedReferenceSize();
/**
* The offset of the within the array object. I do not have to scale the offsets.
*/
private static final int arrayBaseOffset = ConfigurationValues.getObjectLayout().getArrayBaseOffset(JavaKind.Byte);
private final int arrayBaseOffset = ConfigurationValues.getObjectLayout().getArrayBaseOffset(JavaKind.Byte);

private static final ArrayIndexOutOfBoundsException arrayIndexOutOfBoundsException = new ArrayIndexOutOfBoundsException("TargetContent.offsetCheck");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,20 @@
import java.util.function.Supplier;

import org.graalvm.collections.EconomicMap;
import jdk.graal.compiler.api.replacements.Fold;
import org.graalvm.nativeimage.ImageSingletons;
import org.graalvm.nativeimage.Platform;
import org.graalvm.nativeimage.Platforms;
import org.graalvm.word.UnsignedWord;

import com.oracle.svm.core.config.ConfigurationValues;
import com.oracle.svm.core.hub.DynamicHub;
import com.oracle.svm.core.hub.Hybrid;
import com.oracle.svm.core.hub.LayoutEncoding;
import com.oracle.svm.core.util.ImageHeapMap;
import com.oracle.svm.core.util.UnsignedUtils;

import jdk.graal.compiler.api.replacements.Fold;
import jdk.graal.compiler.word.BarrieredAccess;
import jdk.vm.ci.meta.JavaKind;

/**
Expand All @@ -58,6 +60,12 @@
* storing "plain old data" without further object-oriented features such as method dispatching or
* type information, apart from having a Java superclass.
*
* Pods are {@link Hybrid} objects. All fields that are not inherited from an actual Java class are
* layouted in the array part of the hybrid object. For object fields, the GC will use the provided
* {@link #referenceMap} to keep all the object references up-to-date. However, be aware that it is
* necessary to manually emit the correct GC read/write barriers (for example via
* {@link BarrieredAccess}) whenever such an object field is accessed.
*
* @param <T> The interface of the {@linkplain #getFactory() factory} that allocates instances.
*/
public final class Pod<T> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@

/**
* Persisted execution state of a yielded continuation, use via {@link StoredContinuationAccess}.
*
* Stored continuations are {@link Hybrid} objects where the array part contains the raw stack data.
* After writing the stack data into the object, we manually emit the correct GC write barriers for
* all the references (see {@link Heap#dirtyAllReferencesOf}).
*/
@Hybrid(componentType = Word.class)
public final class StoredContinuation {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*
* <p>
* The location of the identity hashcode is configuration-dependent and will follow the same
* placement convention as an array. The See {@link ObjectLayout} for more information on where the
* placement convention as an array. See {@link ObjectLayout} for more information on where the
* identity hash can be placed. @Hybrid objects are treated the same way as instance classes for
* determining whether (and where) they have a monitor slot; See {@link MultiThreadedMonitorSupport}
* for more information on monitor slot placement.
Expand All @@ -65,6 +65,11 @@
* return {@code true} and {@link Class#isArray()} will return {@code false}, while
* {@link LayoutEncoding#isPureInstance} will return {@code false} and
* {@link LayoutEncoding#isArrayLike} will return {@code true} for hybrid objects.
*
* <p>
* Note that the array part of a hybrid object may only contain primitive data but no object
* references because the GC treats hybrid objects similar to normal instance objects. So, it would
* not be aware of any object references in the array part.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,7 @@ private void checkOverrides(HostedMethod method, Uninterruptible methodAnnotatio
Uninterruptible implAnnotation = Uninterruptible.Utils.getAnnotation(impl);
if (implAnnotation != null) {
if (methodAnnotation.callerMustBe() != implAnnotation.callerMustBe()) {
// GR-45784: temporarily disabled so that we can remove legacy code
// violations.add("callerMustBe: " + method.format("%H.%n(%p):%r") + " != " +
// impl.format("%H.%n(%p):%r"));
violations.add("callerMustBe: " + method.format("%H.%n(%p):%r") + " != " + impl.format("%H.%n(%p):%r"));
}
if (methodAnnotation.calleeMustBe() != implAnnotation.calleeMustBe()) {
violations.add("calleeMustBe: " + method.format("%H.%n(%p):%r") + " != " + impl.format("%H.%n(%p):%r"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@
* </pre>
*
* <p>
* Like {@link Hybrid}, DynamicHub objects have an instance {@link HubType}, but a
* {@link LayoutEncoding} like an array. See the javadoc for {@link Hybrid} more details its
* implications.
* Like {@link Hybrid} objects, DynamicHubs have an instance {@link HubType}, but a
* {@link LayoutEncoding} like an array (see the javadoc for {@link Hybrid}).
*/
public class DynamicHubLayout {

Expand Down
Loading