Skip to content

Commit 3e7ecec

Browse files
author
Christian Wimmer
committed
[GR-43476] [GR-43658] Reduce image build time.
PullRequest: graal/13570
2 parents eeb870e + 4e6be5e commit 3e7ecec

File tree

64 files changed

+196
-263
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+196
-263
lines changed

compiler/src/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyDebugUsage.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ protected void verify(StructuredGraph graph, CoreProviders context) {
121121
"org.graalvm.compiler.core.test.VerifyDebugUsageTest$InvalidConcatDumpUsagePhase.run",
122122
"org.graalvm.compiler.core.test.VerifyDebugUsageTest$InvalidDumpUsagePhase.run",
123123
"org.graalvm.compiler.hotspot.SymbolicSnippetEncoder.verifySnippetEncodeDecode",
124+
"com.oracle.graal.pointsto.phases.InlineBeforeAnalysis.decodeGraph",
124125
"org.graalvm.compiler.truffle.compiler.phases.inlining.CallTree.dumpBasic"));
125126

126127
/**

substratevm/src/com.oracle.graal.pointsto.standalone/src/com/oracle/graal/pointsto/standalone/PointsToAnalyzer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ private PointsToAnalyzer(String mainEntryClass, OptionValues options) {
135135

136136
JavaKind wordKind = JavaKind.fromWordSize(wordSize);
137137
AnalysisUniverse aUniverse = new AnalysisUniverse(standaloneHost, wordKind,
138-
analysisPolicy, SubstitutionProcessor.IDENTITY, originalMetaAccess, snippetReflection, snippetReflection, new PointsToAnalysisFactory(), null);
138+
analysisPolicy, SubstitutionProcessor.IDENTITY, originalMetaAccess, snippetReflection, new PointsToAnalysisFactory(), null);
139139
AnalysisMetaAccess aMetaAccess = new AnalysisMetaAccess(aUniverse, originalMetaAccess);
140140
StandaloneConstantReflectionProvider aConstantReflection = new StandaloneConstantReflectionProvider(aUniverse, HotSpotJVMCIRuntime.runtime());
141141
StandaloneConstantFieldProvider aConstantFieldProvider = new StandaloneConstantFieldProvider(aMetaAccess);

substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/flow/MethodFlowsGraph.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ private synchronized void linearizeGraph(boolean isRedo) {
182182
int slotNum = flow.getSlot();
183183
if (slotNum != -1) {
184184
assert flow instanceof FormalParamTypeFlow || flow instanceof FormalReturnTypeFlow : "Unexpected flow " + flow;
185-
AnalysisError.guarantee(isRedo && flow.getSlot() == resultFlows.size(), "Flow already discovered: " + flow);
185+
AnalysisError.guarantee(isRedo && flow.getSlot() == resultFlows.size(), "Flow already discovered: %s", flow);
186186
} else {
187187
flow.setSlot(resultFlows.size());
188188
}

substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/flow/MethodTypeFlow.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public void ensureFlowsGraphCreated(PointsToAnalysis bb, InvokeTypeFlow reason)
158158
private synchronized void createFlowsGraph(PointsToAnalysis bb, InvokeTypeFlow reason) {
159159
if (flowsGraph == null) {
160160
AnalysisError.guarantee(reason == null || reason.getSource() == null ||
161-
!reason.getSource().getMethod().equals(method), "Parsing reason cannot be in the target method itself " + method.format("%H.%n"));
161+
!reason.getSource().getMethod().equals(method), "Parsing reason cannot be in the target method itself: %s", method);
162162

163163
parsingReason = reason;
164164
try {

substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/flow/MethodTypeFlowBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ private void insertPlaceholderParamAndReturnFlows() {
453453
AnalysisType paramType = (AnalysisType) paramTypes[index];
454454
FormalParamTypeFlow parameter;
455455
if (!isStatic && index == 0) {
456-
assert paramType == method.getDeclaringClass();
456+
assert paramType.equals(method.getDeclaringClass());
457457
parameter = new FormalReceiverTypeFlow(position, paramType);
458458
} else {
459459
parameter = new FormalParamTypeFlow(position, paramType, index);

substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/heap/HeapSnapshotVerifier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ private void ensureTypeScanned(JavaConstant typeConstant, AnalysisType type, Sca
298298

299299
@SuppressWarnings({"unchecked", "rawtypes"})
300300
private void ensureTypeScanned(JavaConstant value, JavaConstant typeConstant, AnalysisType type, ScanReason reason) {
301-
AnalysisError.guarantee(type.isReachable(), "The heap snapshot verifier discovered a type not marked as reachable " + type.toJavaName());
301+
AnalysisError.guarantee(type.isReachable(), "The heap snapshot verifier discovered a type not marked as reachable: %s", type);
302302
Object task = imageHeap.getTask(typeConstant);
303303
/* Make sure the DynamicHub value is scanned. */
304304
if (task == null) {

substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/heap/ImageHeapScanner.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -435,14 +435,14 @@ JavaConstant onFieldValueReachable(AnalysisField field, ImageHeapInstance receiv
435435
}
436436

437437
JavaConstant onFieldValueReachable(AnalysisField field, ImageHeapInstance receiver, ValueSupplier<JavaConstant> rawValue, ScanReason reason, Consumer<ScanReason> onAnalysisModified) {
438-
AnalysisError.guarantee(field.isReachable(), "Field value is only reachable when field is reachable " + field.format("%H.%n"));
438+
AnalysisError.guarantee(field.isReachable(), "Field value is only reachable when field is reachable: %s", field);
439439

440440
/*
441441
* Check if the field value is available. If not, trying to access it is an error. This
442442
* forces the callers to only trigger the execution of the future task when the value is
443443
* ready to be materialized.
444444
*/
445-
AnalysisError.guarantee(rawValue.isAvailable(), "Value not yet available for " + field.format("%H.%n"));
445+
AnalysisError.guarantee(rawValue.isAvailable(), "Value not yet available for %s", field);
446446

447447
JavaConstant transformedValue;
448448
try {
@@ -544,7 +544,7 @@ public boolean isValueAvailable(@SuppressWarnings("unused") AnalysisField field)
544544
@SuppressWarnings({"unchecked", "rawtypes"})
545545
private void snapshotFieldValue(AnalysisField field, Object fieldTask) {
546546
if (fieldTask instanceof AnalysisFuture<?>) {
547-
AnalysisError.guarantee(field.isReachable(), "Field value snapshot computed for field not reachable " + field.format("%H.%n"));
547+
AnalysisError.guarantee(field.isReachable(), "Field value snapshot computed for field not reachable: %s", field);
548548
postTask((AnalysisFuture<JavaConstant>) fieldTask);
549549
}
550550
}

substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/infrastructure/AnalysisConstantPool.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@
2727
import jdk.vm.ci.meta.ConstantPool;
2828
import jdk.vm.ci.meta.JavaField;
2929
import jdk.vm.ci.meta.ResolvedJavaMethod;
30+
import jdk.vm.ci.meta.ResolvedJavaType;
3031

3132
public class AnalysisConstantPool extends WrappedConstantPool {
3233

33-
public AnalysisConstantPool(Universe universe, ConstantPool wrapped, WrappedJavaType defaultAccessingClass) {
34+
public AnalysisConstantPool(Universe universe, ConstantPool wrapped, ResolvedJavaType defaultAccessingClass) {
3435
super(universe, wrapped, defaultAccessingClass);
3536
}
3637

substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/infrastructure/OriginalClassProvider.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@
2424
*/
2525
package com.oracle.graal.pointsto.infrastructure;
2626

27-
import org.graalvm.compiler.api.replacements.SnippetReflectionProvider;
27+
import com.oracle.graal.pointsto.util.GraalAccess;
2828

2929
import jdk.vm.ci.meta.ResolvedJavaType;
3030

3131
public interface OriginalClassProvider {
3232

33-
static Class<?> getJavaClass(SnippetReflectionProvider reflectionProvider, ResolvedJavaType javaType) {
33+
static Class<?> getJavaClass(ResolvedJavaType javaType) {
3434
if (javaType instanceof OriginalClassProvider) {
3535
return ((OriginalClassProvider) javaType).getJavaClass();
3636
} else {
37-
return reflectionProvider.originalClass(javaType);
37+
return GraalAccess.getOriginalSnippetReflection().originalClass(javaType);
3838
}
3939
}
4040

substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/infrastructure/OriginalFieldProvider.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@
2626

2727
import java.lang.reflect.Field;
2828

29-
import org.graalvm.compiler.api.replacements.SnippetReflectionProvider;
29+
import com.oracle.graal.pointsto.util.GraalAccess;
3030

3131
import jdk.vm.ci.meta.ResolvedJavaField;
3232

3333
public interface OriginalFieldProvider {
3434

35-
static Field getJavaField(SnippetReflectionProvider reflectionProvider, ResolvedJavaField field) {
35+
static Field getJavaField(ResolvedJavaField field) {
3636
if (field instanceof OriginalFieldProvider) {
3737
return ((OriginalFieldProvider) field).getJavaField();
3838
} else {
39-
return reflectionProvider.originalField(field);
39+
return GraalAccess.getOriginalSnippetReflection().originalField(field);
4040
}
4141
}
4242

0 commit comments

Comments
 (0)