Skip to content

Commit 2805efd

Browse files
committed
Rename option UseLazyDeopt to LazyDeoptimization.
1 parent c120907 commit 2805efd

File tree

9 files changed

+58
-54
lines changed

9 files changed

+58
-54
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateDiagnostics.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ public int maxInvocationCount() {
696696
@RestrictHeapAccess(access = RestrictHeapAccess.Access.NO_ALLOCATION, reason = "Must not allocate while printing diagnostics.")
697697
public void printDiagnostics(Log log, ErrorContext context, int maxDiagnosticLevel, int invocationCount) {
698698
log.string("EagerDeoptStub address: ").zhex(DeoptimizationSupport.getEagerDeoptStubPointer()).newline();
699-
if (Deoptimizer.Options.UseLazyDeopt.getValue()) {
699+
if (Deoptimizer.Options.LazyDeoptimization.getValue()) {
700700
log.string("LazyDeoptStubPrimitiveReturn address: ").zhex(DeoptimizationSupport.getLazyDeoptStubPrimitiveReturnPointer()).newline();
701701
log.string("LazyDeoptStubObjectReturn address: ").zhex(DeoptimizationSupport.getLazyDeoptStubObjectReturnPointer()).newline();
702702
}

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/code/CodeInfoDecoder.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@
2525
package com.oracle.svm.core.code;
2626

2727
import static com.oracle.svm.core.Uninterruptible.CALLED_FROM_UNINTERRUPTIBLE_CODE;
28+
import static com.oracle.svm.core.deopt.Deoptimizer.Options.LazyDeoptimization;
2829
import static com.oracle.svm.core.util.VMError.shouldNotReachHereUnexpectedInput;
29-
import static com.oracle.svm.core.deopt.Deoptimizer.Options.UseLazyDeopt;
3030

31-
import com.oracle.svm.core.deopt.DeoptimizationSupport;
3231
import org.graalvm.nativeimage.ImageSingletons;
3332
import org.graalvm.nativeimage.Platform;
3433
import org.graalvm.nativeimage.Platforms;
@@ -41,6 +40,7 @@
4140
import com.oracle.svm.core.c.NonmovableArrays;
4241
import com.oracle.svm.core.c.NonmovableObjectArray;
4342
import com.oracle.svm.core.code.FrameInfoDecoder.ConstantAccess;
43+
import com.oracle.svm.core.deopt.DeoptimizationSupport;
4444
import com.oracle.svm.core.heap.ReferenceMapIndex;
4545
import com.oracle.svm.core.jdk.UninterruptibleUtils;
4646
import com.oracle.svm.core.option.HostedOptionKey;
@@ -226,7 +226,7 @@ static long lookupDeoptimizationEntrypoint(CodeInfo info, long method, long enco
226226
codeInfo.exceptionOffset = loadExceptionOffset(info, entryOffset, entryFlags);
227227
codeInfo.referenceMapIndex = loadReferenceMapIndex(info, entryOffset, entryFlags);
228228
codeInfo.frameInfo = loadFrameInfo(info, entryOffset, entryFlags, constantAccess);
229-
if (UseLazyDeopt.getValue()) {
229+
if (LazyDeoptimization.getValue()) {
230230
codeInfo.deoptReturnValueIsObject = loadDeoptReturnValueIsObject(info, entryOffset, entryFlags) != 0;
231231
}
232232
assert codeInfo.frameInfo.isDeoptEntry() && codeInfo.frameInfo.getCaller() == null : "Deoptimization entry must not have inlined frames";
@@ -286,7 +286,7 @@ private static int loadDeoptReturnValueIsObject(CodeInfo info, long entryOffset,
286286
* The byte which encodes whether a return value is an object is stored at the end of the
287287
* codeInfo and is only present for deopt entry points if lazy deoptimization is enabled.
288288
*/
289-
assert UseLazyDeopt.getValue() : "must have lazy deoptimization enabled to have this information in the codeinfo";
289+
assert LazyDeoptimization.getValue() : "must have lazy deoptimization enabled to have this information in the code info";
290290
long rvoOffset = getU1(AFTER_FI_OFFSET, entryFlags);
291291
return NonmovableByteArrayReader.getU1(CodeInfoAccess.getCodeInfoEncodings(info), entryOffset + rvoOffset);
292292
}
@@ -570,7 +570,7 @@ private static boolean endOfTable(long entryIP) {
570570
int maxFlag = 1 << TOTAL_BITS;
571571

572572
/*
573-
* When we enable useLazyDeopt, we have an extra byte in the codeinfo, which keeps track of
573+
* With lazy deoptimization, we have an extra byte in the code info, which keeps track of
574574
* whether each infopoint is at a call that returns an object. This byte is stored after the
575575
* FI (frameInfo) section. It is accounted for by the advanceOffset() method.
576576
*/
@@ -647,7 +647,7 @@ private static long offsetFI(long entryOffset, int entryFlags) {
647647
private static long advanceOffset(long entryOffset, int entryFlags) {
648648
counters().advanceOffset.inc();
649649
long returnValueIsObjectSize = 0;
650-
if (DeoptimizationSupport.enabled() && UseLazyDeopt.getValue() && extractFI(entryFlags) == FI_DEOPT_ENTRY_INDEX_S4) {
650+
if (DeoptimizationSupport.enabled() && LazyDeoptimization.getValue() && extractFI(entryFlags) == FI_DEOPT_ENTRY_INDEX_S4) {
651651
returnValueIsObjectSize = Byte.BYTES;
652652
}
653653
return entryOffset + getU1(AFTER_FI_OFFSET, entryFlags) + returnValueIsObjectSize;

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/code/CodeInfoEncoder.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
*/
2525
package com.oracle.svm.core.code;
2626

27+
import static com.oracle.svm.core.deopt.Deoptimizer.Options.LazyDeoptimization;
2728
import static com.oracle.svm.core.util.VMError.shouldNotReachHereUnexpectedInput;
28-
import static com.oracle.svm.core.deopt.Deoptimizer.Options.UseLazyDeopt;
2929

3030
import java.util.BitSet;
3131
import java.util.EnumSet;
@@ -35,9 +35,6 @@
3535
import java.util.function.IntFunction;
3636
import java.util.stream.Stream;
3737

38-
import com.oracle.svm.core.deopt.DeoptimizationSupport;
39-
import jdk.vm.ci.meta.JavaType;
40-
import jdk.graal.compiler.word.Word;
4138
import org.graalvm.collections.EconomicSet;
4239
import org.graalvm.collections.Equivalence;
4340
import org.graalvm.nativeimage.ImageSingletons;
@@ -57,6 +54,7 @@
5754
import com.oracle.svm.core.config.ConfigurationValues;
5855
import com.oracle.svm.core.config.ObjectLayout;
5956
import com.oracle.svm.core.deopt.DeoptEntryInfopoint;
57+
import com.oracle.svm.core.deopt.DeoptimizationSupport;
6058
import com.oracle.svm.core.feature.AutomaticallyRegisteredImageSingleton;
6159
import com.oracle.svm.core.graal.RuntimeCompilation;
6260
import com.oracle.svm.core.heap.CodeReferenceMapDecoder;
@@ -91,6 +89,7 @@
9189
import jdk.graal.compiler.core.common.util.UnsafeArrayTypeWriter;
9290
import jdk.graal.compiler.nodes.FrameState;
9391
import jdk.graal.compiler.options.Option;
92+
import jdk.graal.compiler.word.Word;
9493
import jdk.vm.ci.code.BytecodeFrame;
9594
import jdk.vm.ci.code.DebugInfo;
9695
import jdk.vm.ci.code.RegisterValue;
@@ -103,6 +102,7 @@
103102
import jdk.vm.ci.code.site.Infopoint;
104103
import jdk.vm.ci.meta.JavaConstant;
105104
import jdk.vm.ci.meta.JavaKind;
105+
import jdk.vm.ci.meta.JavaType;
106106
import jdk.vm.ci.meta.JavaValue;
107107
import jdk.vm.ci.meta.ResolvedJavaMethod;
108108

@@ -396,7 +396,7 @@ public void addMethod(SharedMethod method, CompilationResult compilation, int co
396396
assert entry.referenceMap == null && (entry.frameData == null || entry.frameData.isDefaultFrameData) : entry;
397397
entry.referenceMap = (ReferenceMapEncoder.Input) debugInfo.getReferenceMap();
398398
entry.frameData = frameInfoEncoder.addDebugInfo(method, compilation, infopoint, totalFrameSize);
399-
if (DeoptimizationSupport.enabled() && UseLazyDeopt.getValue() && entry.frameData.frame.isDeoptEntry && infopoint instanceof Call call && call.target != null) {
399+
if (DeoptimizationSupport.enabled() && LazyDeoptimization.getValue() && entry.frameData.frame.isDeoptEntry && infopoint instanceof Call call && call.target != null) {
400400
ResolvedJavaMethod invokeTarget = (ResolvedJavaMethod) call.target;
401401
JavaType returnType = invokeTarget.getSignature().getReturnType(null);
402402
entry.deoptReturnValueIsObject = ((SharedType) returnType).getStorageKind().isObject();
@@ -515,9 +515,9 @@ private void encodeIPData() {
515515
writeReferenceMapIndex(encodingBuffer, data, entryFlags);
516516
writeEncodedFrameInfo(encodingBuffer, data, entryFlags);
517517

518-
if (DeoptimizationSupport.enabled() && UseLazyDeopt.getValue() && data.frameData != null && data.frameData.frame.isDeoptEntry) {
518+
if (DeoptimizationSupport.enabled() && LazyDeoptimization.getValue() && data.frameData != null && data.frameData.frame.isDeoptEntry) {
519519
/*
520-
* When we enable useLazyDeopt, we have an extra byte in the codeinfo, which keeps
520+
* With lazy deoptimization, we have an extra byte in the code info, which keeps
521521
* track for each deopt entry point whether it is at a call that returns an object.
522522
*/
523523
encodingBuffer.putU1(data.deoptReturnValueIsObject ? 1 : 0);

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/code/CodeInfoQueryResult.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@
2424
*/
2525
package com.oracle.svm.core.code;
2626

27-
import static com.oracle.svm.core.deopt.Deoptimizer.Options.UseLazyDeopt;
27+
import static com.oracle.svm.core.deopt.Deoptimizer.Options.LazyDeoptimization;
2828

2929
import org.graalvm.nativeimage.c.function.CodePointer;
30+
3031
import com.oracle.svm.core.Uninterruptible;
32+
import com.oracle.svm.core.deopt.Deoptimizer.Options;
3133
import com.oracle.svm.core.heap.CodeReferenceMapDecoder;
3234
import com.oracle.svm.core.heap.CodeReferenceMapEncoder;
3335

@@ -58,8 +60,7 @@ public class CodeInfoQueryResult {
5860
protected long exceptionOffset;
5961
protected long referenceMapIndex;
6062
/**
61-
* deoptReturnValueIsObject is only set for deopt entry points and only if
62-
* {@link com.oracle.svm.core.deopt.Deoptimizer.Options#UseLazyDeopt UseLazyDeopt} is enabled.
63+
* Only set for deopt entry points and only if {@link Options#LazyDeoptimization} is enabled.
6364
*/
6465
protected boolean deoptReturnValueIsObject;
6566
protected FrameInfoQueryResult frameInfo;
@@ -129,7 +130,7 @@ public long getReferenceMapIndex() {
129130
}
130131

131132
public boolean getDeoptReturnValueIsObject() {
132-
assert UseLazyDeopt.getValue();
133+
assert LazyDeoptimization.getValue();
133134
return deoptReturnValueIsObject;
134135
}
135136

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/code/CodeInfoTable.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@
2424
*/
2525
package com.oracle.svm.core.code;
2626

27+
import static com.oracle.svm.core.deopt.Deoptimizer.Options.LazyDeoptimization;
28+
2729
import java.util.Arrays;
2830
import java.util.List;
2931

30-
import jdk.graal.compiler.word.Word;
3132
import org.graalvm.nativeimage.ImageSingletons;
3233
import org.graalvm.nativeimage.c.function.CodePointer;
3334
import org.graalvm.nativeimage.hosted.Feature;
@@ -57,10 +58,9 @@
5758

5859
import jdk.graal.compiler.api.replacements.Fold;
5960
import jdk.graal.compiler.options.Option;
61+
import jdk.graal.compiler.word.Word;
6062
import jdk.vm.ci.code.InstalledCode;
6163

62-
import static com.oracle.svm.core.deopt.Deoptimizer.Options.UseLazyDeopt;
63-
6464
/**
6565
* Provides the main entry points to look up metadata for code, either {@link #getImageCodeCache()
6666
* ahead-of-time compiled code in the native image} or {@link CodeInfoTable#getRuntimeCodeCache()
@@ -227,7 +227,7 @@ private static void invalidateInstalledCodeAtSafepoint(SubstrateInstalledCode in
227227
invalidateCodeAtSafepoint0(info);
228228
}
229229
// If lazy deoptimization is enabled, the CodeInfo will not be removed immediately.
230-
if (UseLazyDeopt.getValue()) {
230+
if (LazyDeoptimization.getValue()) {
231231
assert CodeInfoAccess.getState(info) == CodeInfo.STATE_NON_ENTRANT;
232232
} else {
233233
assert CodeInfoAccess.getState(info) == CodeInfo.STATE_REMOVED_FROM_CODE_CACHE;

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/code/RuntimeCodeCache.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@
2424
*/
2525
package com.oracle.svm.core.code;
2626

27+
import static com.oracle.svm.core.deopt.Deoptimizer.Options.LazyDeoptimization;
2728
import static com.oracle.svm.core.option.RuntimeOptionKey.RuntimeOptionKeyFlag.RelevantForCompilationIsolates;
2829
import static com.oracle.svm.core.snippets.KnownIntrinsics.readCallerStackPointer;
29-
import static com.oracle.svm.core.deopt.Deoptimizer.Options.UseLazyDeopt;
3030

31-
import jdk.graal.compiler.word.Word;
3231
import org.graalvm.collections.EconomicMap;
3332
import org.graalvm.nativeimage.CurrentIsolate;
3433
import org.graalvm.nativeimage.IsolateThread;
@@ -58,6 +57,7 @@
5857
import jdk.graal.compiler.options.Option;
5958
import jdk.graal.compiler.options.OptionKey;
6059
import jdk.graal.compiler.options.OptionType;
60+
import jdk.graal.compiler.word.Word;
6161

6262
public class RuntimeCodeCache {
6363

@@ -212,7 +212,7 @@ protected void invalidateMethod(CodeInfo info) {
212212
*/
213213
Deoptimizer.deoptimizeInRange(CodeInfoAccess.getCodeStart(info), CodeInfoAccess.getCodeEnd(info), false);
214214

215-
boolean removeNow = !UseLazyDeopt.getValue();
215+
boolean removeNow = !LazyDeoptimization.getValue();
216216
continueInvalidation(info, removeNow);
217217
}
218218

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/deopt/DeoptimizationSupport.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
*/
2525
package com.oracle.svm.core.deopt;
2626

27-
import jdk.graal.compiler.api.replacements.Fold;
27+
import static com.oracle.svm.core.Uninterruptible.CALLED_FROM_UNINTERRUPTIBLE_CODE;
28+
2829
import org.graalvm.nativeimage.ImageSingletons;
2930
import org.graalvm.nativeimage.Platform;
3031
import org.graalvm.nativeimage.Platforms;
@@ -35,7 +36,7 @@
3536
import com.oracle.svm.core.Uninterruptible;
3637
import com.oracle.svm.core.heap.UnknownPrimitiveField;
3738

38-
import static com.oracle.svm.core.Uninterruptible.CALLED_FROM_UNINTERRUPTIBLE_CODE;
39+
import jdk.graal.compiler.api.replacements.Fold;
3940

4041
public class DeoptimizationSupport {
4142

@@ -74,14 +75,14 @@ public static void setEagerDeoptStubPointer(CFunctionPointer ptr) {
7475
@Platforms(Platform.HOSTED_ONLY.class)
7576
public static void setLazyDeoptStubPrimitiveReturnPointer(CFunctionPointer ptr) {
7677
assert get().lazyDeoptStubPrimitiveReturnPointer == null : "multiple lazyDeoptStubPrimitiveReturn methods registered";
77-
assert Deoptimizer.Options.UseLazyDeopt.getValue() : "lazy deoptimization not enabled";
78+
assert Deoptimizer.Options.LazyDeoptimization.getValue() : "lazy deoptimization not enabled";
7879
get().lazyDeoptStubPrimitiveReturnPointer = ptr;
7980
}
8081

8182
@Platforms(Platform.HOSTED_ONLY.class)
8283
public static void setLazyDeoptStubObjectReturnPointer(CFunctionPointer ptr) {
8384
assert get().lazyDeoptStubObjectReturnPointer == null : "multiple lazyDeoptStubObjectReturn methods registered";
84-
assert Deoptimizer.Options.UseLazyDeopt.getValue() : "lazy deoptimization not enabled";
85+
assert Deoptimizer.Options.LazyDeoptimization.getValue() : "lazy deoptimization not enabled";
8586
get().lazyDeoptStubObjectReturnPointer = ptr;
8687
}
8788

@@ -94,15 +95,15 @@ public static CFunctionPointer getEagerDeoptStubPointer() {
9495

9596
@Uninterruptible(reason = CALLED_FROM_UNINTERRUPTIBLE_CODE, mayBeInlined = true)
9697
public static CFunctionPointer getLazyDeoptStubPrimitiveReturnPointer() {
97-
assert Deoptimizer.Options.UseLazyDeopt.getValue() : "lazy deoptimization not enabled";
98+
assert Deoptimizer.Options.LazyDeoptimization.getValue() : "lazy deoptimization not enabled";
9899
CFunctionPointer ptr = get().lazyDeoptStubPrimitiveReturnPointer;
99100
assert ptr.rawValue() != 0;
100101
return ptr;
101102
}
102103

103104
@Uninterruptible(reason = CALLED_FROM_UNINTERRUPTIBLE_CODE, mayBeInlined = true)
104105
public static CFunctionPointer getLazyDeoptStubObjectReturnPointer() {
105-
assert Deoptimizer.Options.UseLazyDeopt.getValue() : "lazy deoptimization not enabled";
106+
assert Deoptimizer.Options.LazyDeoptimization.getValue() : "lazy deoptimization not enabled";
106107
CFunctionPointer ptr = get().lazyDeoptStubObjectReturnPointer;
107108
assert ptr.rawValue() != 0;
108109
return ptr;

0 commit comments

Comments
 (0)