Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8241231: Update Graal
Reviewed-by: kvn
  • Loading branch information
dean-long committed Mar 19, 2020
1 parent caa0884 commit 4f629193a913555f191287adcad1969fd41780eb
Showing with 651 additions and 609 deletions.
  1. +3 −2 src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CallInfo.java
  2. +3 −2 src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/MarkId.java
  3. +3 −1 ...are/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAssembler.java
  4. +18 −18 ...lasses/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRGenerator.java
  5. +12 −3 ...r/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/Fields.java
  6. +8 −1 ...asses/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CheckGraalInvariants.java
  7. +4 −2 ...lasses/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OptionsVerifierTest.java
  8. +10 −8 ...ler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/LIRGenerationPhase.java
  9. +5 −8 ...ler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeLIRBuilder.java
  10. +3 −2 ...nal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Node.java
  11. +1 −1 ...m.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeClass.java
  12. +2 −1 ...alvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackend.java
  13. +8 −7 ...mpiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackendFactory.java
  14. +4 −3 ...iler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLoweringProvider.java
  15. +8 −7 ...lvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackendFactory.java
  16. +4 −3 ...m.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoweringProvider.java
  17. +4 −4 ...mpiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotPatchReturnAddressOp.java
  18. +5 −4 ...lvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackendFactory.java
  19. +4 −3 ...m.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLoweringProvider.java
  20. +3 −3 ...g.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompilationWrapperTest.java
  21. +1 −1 ...ses/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/NodeCostDumpUtil.java
  22. +3 −3 ...lasses/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReplacementsImpl.java
  23. +44 −24 ...classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/SymbolicSnippetEncoder.java
  24. +4 −17 ...raalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/DefaultHotSpotLoweringProvider.java
  25. +18 −17 ....compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotPlatformConfigurationProvider.java
  26. +1 −2 ...classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/EndLockScopeNode.java
  27. +11 −2 ...aalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java
  28. +4 −4 ....graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeCopyMemoryNode.java
  29. +0 −74 ...rg.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeLoadSnippets.java
  30. +11 −12 ...m.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/LambdaUtils.java
  31. +4 −3 ...iler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6196102.java
  32. +3 −3 ...iler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6753639.java
  33. +5 −6 ...iler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6823354.java
  34. +3 −3 ...iler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6850611.java
  35. +3 −3 ...iler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test7005594.java
  36. +8 −5 ...hare/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64FrameMap.java
  37. +3 −3 ...iler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValueClass.java
  38. +7 −7 ...iler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstructionClass.java
  39. +16 −5 ...ompiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRIntrospection.java
  40. +7 −6 ...mpiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMap.java
  41. +5 −15 ...ompiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerator.java
  42. +1 −48 ...ler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGeneratorTool.java
  43. +12 −6 ...iler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/MemoryProxyNode.java
  44. +3 −3 ...m.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ProxyNode.java
  45. +2 −1 ...iler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StructuredGraph.java
  46. +3 −3 ...mpiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNodeUtil.java
  47. +3 −1 ...ses/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BytecodeExceptionNode.java
  48. +2 −2 ...share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MonitorExit.java
  49. +15 −0 ...mpiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/gc/BarrierSet.java
  50. +46 −1 ...are/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/gc/CardTableBarrierSet.java
  51. +58 −11 ...iler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/gc/G1BarrierSet.java
  52. +2 −2 ...sses/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/UnsafeCompareAndSwapNode.java
  53. +3 −3 ...are/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FixedAccessNode.java
  54. +7 −7 ...re/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatingReadNode.java
  55. +4 −4 .../share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAccess.java
  56. +12 −3 ...re/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAnchorNode.java
  57. +8 −5 ...er/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryKill.java
  58. +2 −2 ...ler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMap.java
  59. +15 −10 ...share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMapNode.java
  60. +8 −3 ...share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryPhiNode.java
  61. +2 −3 ...are/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MultiMemoryKill.java
  62. +3 −3 ...re/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/SingleMemoryKill.java
  63. +4 −4 ...aalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/{MemoryProxy.java → MemoryEdgeProxy.java}
  64. +1 −12 ...are/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeLIRBuilderTool.java
  65. +22 −5 ...e.java → org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptorsMap.java}
  66. +5 −2 ...ler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionValues.java
  67. +9 −10 .../org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FloatingReadPhase.java
  68. +3 −1 ...sses/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoweringPhase.java
  69. +2 −2 ...es/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/ScheduleVerification.java
  70. +5 −5 ...replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64ArrayIndexOfDispatchNode.java
  71. +5 −5 ...ompiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64ArrayIndexOfNode.java
  72. +4 −4 ....replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringLatin1InflateNode.java
  73. +4 −4 ....replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringUTF16CompressNode.java
  74. +12 −5 ...alvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SubstitutionsTest.java
  75. +40 −83 ...alvm.compiler.replacements/src/org/graalvm/compiler/replacements/DefaultJavaLoweringProvider.java
  76. +5 −5 ...aalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetLowerableMemoryNode.java
  77. +11 −12 ...sses/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetTemplate.java
  78. +4 −4 ...alvm.compiler.replacements/src/org/graalvm/compiler/replacements/arraycopy/ArrayCopyCallNode.java
  79. +11 −8 ...alvm.compiler.replacements/src/org/graalvm/compiler/replacements/arraycopy/ArrayCopySnippets.java
  80. +5 −5 ...graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ArrayCompareToNode.java
  81. +4 −4 ...rg.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ArrayEqualsNode.java
  82. +4 −4 ...alvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ArrayRegionEqualsNode.java
  83. +4 −4 ...graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicArrayCopyNode.java
  84. +3 −2 ...g.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReadRegisterNode.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -40,7 +40,8 @@ static boolean isStaticTarget(Call call) {

private static boolean isStaticOpcode(Call call) {
int opcode = getByteCode(call) & 0xFF;
return opcode == Bytecodes.INVOKESTATIC || opcode == Bytecodes.INVOKEDYNAMIC || opcode == Bytecodes.INVOKEVIRTUAL /* invokehandle */;
return opcode == Bytecodes.INVOKESTATIC || opcode == Bytecodes.INVOKEDYNAMIC ||
opcode == Bytecodes.INVOKEVIRTUAL /* invokehandle */;
}

static boolean isStaticCall(Call call) {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -57,13 +57,14 @@ enum MarkId {
INLINE_CONTIGUOUS_ALLOCATION_SUPPORTED("CodeInstaller::INLINE_CONTIGUOUS_ALLOCATION_SUPPORTED");

private final int value;
private static HashMap<Integer, MarkId> lookup = new HashMap<Integer, MarkId>();
private static HashMap<Integer, MarkId> lookup = new HashMap<>();

static {
for (MarkId e : values()) {
lookup.put(e.value, e);
}
}

MarkId(String name) {
this.value = (int) (long) HotSpotJVMCIRuntime.runtime().getConfigStore().getConstants().get(name);
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -547,6 +547,7 @@ public String toString() {
public enum Annul {
ANNUL(1),
NOT_ANNUL(0);

public final int flag;

Annul(int flag) {
@@ -557,6 +558,7 @@ public enum Annul {
public enum BranchPredict {
PREDICT_TAKEN(1),
PREDICT_NOT_TAKEN(0);

public final int flag;

BranchPredict(int flag) {
@@ -253,9 +253,7 @@ private Value emitCompareAndSwap(boolean isLogic, LIRKind accessKind, Value addr

if (isLogic) {
assert trueValue.getValueKind().equals(falseValue.getValueKind());
Variable result = newVariable(trueValue.getValueKind());
append(new CondMoveOp(result, Condition.EQ, asAllocatable(trueValue), falseValue));
return result;
return emitCondMoveOp(Condition.EQ, trueValue, falseValue, false, false);
} else {
if (isXmm) {
return arithmeticLIRGen.emitReinterpret(accessKind, aRes);
@@ -461,41 +459,43 @@ public Variable emitConditionalMove(PlatformKind cmpKind, Value left, Value righ
finalCondition = emitCompare(cmpKind, left, right, cond);
}

boolean isParityCheckNecessary = isFloatComparison && unorderedIsTrue != AMD64ControlFlow.trueOnUnordered(finalCondition);
Variable result = newVariable(finalTrueValue.getValueKind());
if (!isParityCheckNecessary && isIntConstant(finalTrueValue, 1) && isIntConstant(finalFalseValue, 0)) {
return emitCondMoveOp(finalCondition, finalTrueValue, finalFalseValue, isFloatComparison, unorderedIsTrue);
}

private Variable emitCondMoveOp(Condition condition, Value trueValue, Value falseValue, boolean isFloatComparison, boolean unorderedIsTrue) {
boolean isParityCheckNecessary = isFloatComparison && unorderedIsTrue != AMD64ControlFlow.trueOnUnordered(condition);
Variable result = newVariable(trueValue.getValueKind());
if (!isParityCheckNecessary && isIntConstant(trueValue, 1) && isIntConstant(falseValue, 0)) {
if (isFloatComparison) {
append(new FloatCondSetOp(result, finalCondition));
append(new FloatCondSetOp(result, condition));
} else {
append(new CondSetOp(result, finalCondition));
append(new CondSetOp(result, condition));
}
} else if (!isParityCheckNecessary && isIntConstant(finalTrueValue, 0) && isIntConstant(finalFalseValue, 1)) {
} else if (!isParityCheckNecessary && isIntConstant(trueValue, 0) && isIntConstant(falseValue, 1)) {
if (isFloatComparison) {
if (unorderedIsTrue == AMD64ControlFlow.trueOnUnordered(finalCondition.negate())) {
append(new FloatCondSetOp(result, finalCondition.negate()));
if (unorderedIsTrue == AMD64ControlFlow.trueOnUnordered(condition.negate())) {
append(new FloatCondSetOp(result, condition.negate()));
} else {
append(new FloatCondSetOp(result, finalCondition));
append(new FloatCondSetOp(result, condition));
Variable negatedResult = newVariable(result.getValueKind());
append(new AMD64Binary.ConstOp(AMD64BinaryArithmetic.XOR, OperandSize.get(result.getPlatformKind()), negatedResult, result, 1));
result = negatedResult;
}
} else {
append(new CondSetOp(result, finalCondition.negate()));
append(new CondSetOp(result, condition.negate()));
}
} else if (isFloatComparison) {
append(new FloatCondMoveOp(result, finalCondition, unorderedIsTrue, load(finalTrueValue), load(finalFalseValue)));
append(new FloatCondMoveOp(result, condition, unorderedIsTrue, load(trueValue), load(falseValue)));
} else {
append(new CondMoveOp(result, finalCondition, load(finalTrueValue), loadNonConst(finalFalseValue)));
append(new CondMoveOp(result, condition, load(trueValue), loadNonConst(falseValue)));
}
return result;
}

@Override
public Variable emitIntegerTestMove(Value left, Value right, Value trueValue, Value falseValue) {
emitIntegerTest(left, right);
Variable result = newVariable(trueValue.getValueKind());
append(new CondMoveOp(result, Condition.EQ, load(trueValue), loadNonConst(falseValue)));
return result;
return emitCondMoveOp(Condition.EQ, load(trueValue), loadNonConst(falseValue), false, false);
}

protected static AVXSize getRegisterSize(Value a) {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import org.graalvm.compiler.debug.GraalError;

@@ -40,6 +41,7 @@
public class Fields {

private static final Unsafe UNSAFE = getUnsafe();
private static final Fields EMPTY_FIELDS = new Fields(Collections.emptyList());

/**
* Offsets used with {@link Unsafe} to access the fields.
@@ -61,10 +63,10 @@ public class Fields {
public static Fields forClass(Class<?> clazz, Class<?> endClazz, boolean includeTransient, FieldsScanner.CalcOffset calcOffset) {
FieldsScanner scanner = new FieldsScanner(calcOffset == null ? new FieldsScanner.DefaultCalcOffset() : calcOffset);
scanner.scan(clazz, endClazz, includeTransient);
return new Fields(scanner.data);
return create(scanner.data);
}

public Fields(ArrayList<? extends FieldsScanner.FieldInfo> fields) {
protected Fields(List<? extends FieldsScanner.FieldInfo> fields) {
Collections.sort(fields);
this.offsets = new long[fields.size()];
this.names = new String[offsets.length];
@@ -80,6 +82,13 @@ public Fields(ArrayList<? extends FieldsScanner.FieldInfo> fields) {
}
}

public static Fields create(ArrayList<? extends FieldsScanner.FieldInfo> fields) {
if (fields.size() == 0) {
return EMPTY_FIELDS;
}
return new Fields(fields);
}

/**
* Gets the number of fields represented by this object.
*/
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -221,6 +221,13 @@ public boolean shouldCheckUsage(OptionDescriptor option) {
*/
return false;
}
if (declaringClass.getName().equals("org.graalvm.compiler.truffle.compiler.TruffleCompilerOptions")) {
/*
* These options are deprecated and will be removed in GraalVM 20.2.0. The
* TruffleIntrinsifyFrameAccess option has no replacement and is unused.
*/
return false;
}
if (option.getOptionKey().getClass().isAnonymousClass()) {
/*
* Probably a derived option such as
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -57,7 +57,9 @@ public class OptionsVerifierTest {

private static Set<String> WHITELIST = new TreeSet<>(Arrays.asList(//
// Generated options delegating default values to PolyglotCompilerOptions
"org.graalvm.compiler.truffle.compiler.SharedTruffleCompilerOptions"));
"org.graalvm.compiler.truffle.compiler.SharedTruffleCompilerOptions",
// Deprecated options delegating default values to PolyglotCompilerOptions
"org.graalvm.compiler.truffle.compiler.TruffleCompilerOptions"));

@Test
public void verifyOptions() throws IOException {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,11 +28,13 @@

import org.graalvm.compiler.core.common.cfg.AbstractBlockBase;
import org.graalvm.compiler.core.common.cfg.BlockMap;
import org.graalvm.compiler.core.gen.NodeLIRBuilder;
import org.graalvm.compiler.debug.CounterKey;
import org.graalvm.compiler.debug.DebugContext;
import org.graalvm.compiler.graph.Node;
import org.graalvm.compiler.lir.LIR;
import org.graalvm.compiler.lir.gen.LIRGenerationResult;
import org.graalvm.compiler.lir.gen.LIRGenerator;
import org.graalvm.compiler.lir.gen.LIRGeneratorTool;
import org.graalvm.compiler.lir.phases.LIRPhase;
import org.graalvm.compiler.lir.ssa.SSAUtil;
@@ -46,13 +48,13 @@
public class LIRGenerationPhase extends LIRPhase<LIRGenerationPhase.LIRGenerationContext> {

public static final class LIRGenerationContext {
private final NodeLIRBuilderTool nodeLirBuilder;
private final NodeLIRBuilder nodeLirBuilder;
private final LIRGeneratorTool lirGen;
private final StructuredGraph graph;
private final ScheduleResult schedule;

public LIRGenerationContext(LIRGeneratorTool lirGen, NodeLIRBuilderTool nodeLirBuilder, StructuredGraph graph, ScheduleResult schedule) {
this.nodeLirBuilder = nodeLirBuilder;
this.nodeLirBuilder = (NodeLIRBuilder) nodeLirBuilder;
this.lirGen = lirGen;
this.graph = graph;
this.schedule = schedule;
@@ -64,17 +66,17 @@ public LIRGenerationContext(LIRGeneratorTool lirGen, NodeLIRBuilderTool nodeLirB

@Override
protected final void run(TargetDescription target, LIRGenerationResult lirGenRes, LIRGenerationPhase.LIRGenerationContext context) {
NodeLIRBuilderTool nodeLirBuilder = context.nodeLirBuilder;
NodeLIRBuilder nodeLirBuilder = context.nodeLirBuilder;
StructuredGraph graph = context.graph;
ScheduleResult schedule = context.schedule;
AbstractBlockBase<?>[] blocks = lirGenRes.getLIR().getControlFlowGraph().getBlocks();
for (AbstractBlockBase<?> b : blocks) {
matchBlock(nodeLirBuilder, (Block) b, graph, schedule);
matchBlock(nodeLirBuilder, (Block) b, schedule);
}
for (AbstractBlockBase<?> b : blocks) {
emitBlock(nodeLirBuilder, lirGenRes, (Block) b, graph, schedule.getBlockToNodesMap());
}
context.lirGen.beforeRegisterAllocation();
((LIRGenerator) context.lirGen).beforeRegisterAllocation();
assert SSAUtil.verifySSAForm(lirGenRes.getLIR());
nodeCount.add(graph.getDebug(), graph.getNodeCount());
}
@@ -88,8 +90,8 @@ private static void emitBlock(NodeLIRBuilderTool nodeLirGen, LIRGenerationResult
instructionCounter.add(debug, lir.getLIRforBlock(b).size());
}

private static void matchBlock(NodeLIRBuilderTool nodeLirGen, Block b, StructuredGraph graph, ScheduleResult schedule) {
nodeLirGen.matchBlock(b, graph, schedule);
private static void matchBlock(NodeLIRBuilder nodeLirGen, Block b, ScheduleResult schedule) {
nodeLirGen.matchBlock(b, schedule);
}

private static boolean verifyPredecessors(LIRGenerationResult lirGenRes, Block block) {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -417,9 +417,8 @@ public void doBlock(Block block, StructuredGraph graph, BlockMap<List<Node>> blo
}
}

@Override
@SuppressWarnings("try")
public void matchBlock(Block block, StructuredGraph graph, StructuredGraph.ScheduleResult schedule) {
public void matchBlock(Block block, StructuredGraph.ScheduleResult schedule) {
try (DebugCloseable matchScope = gen.getMatchScope(block)) {
// Allow NodeLIRBuilder subclass to specialize code generation of any interesting groups
// of instructions
@@ -625,7 +624,6 @@ public void emitInvoke(Invoke x) {

protected abstract void emitIndirectCall(IndirectCallTargetNode callTarget, Value result, Value[] parameters, Value[] temps, LIRFrameState callState);

@Override
public Value[] visitInvokeArguments(CallingConvention invokeCc, Collection<ValueNode> arguments) {
// for each argument, load it into the correct location
Value[] result = new Value[arguments.size()];
@@ -752,19 +750,18 @@ public void visitFullInfopointNode(FullInfopointNode i) {
append(new FullInfopointOp(stateFor(i, i.getState()), i.getReason()));
}

@Override
public void setSourcePosition(NodeSourcePosition position) {
private void setSourcePosition(NodeSourcePosition position) {
gen.setSourcePosition(position);
}

@Override
public LIRGeneratorTool getLIRGeneratorTool() {
public LIRGenerator getLIRGeneratorTool() {
return gen;
}

@Override
public void emitReadExceptionObject(ValueNode node) {
LIRGeneratorTool lirGenTool = getLIRGeneratorTool();
LIRGenerator lirGenTool = getLIRGeneratorTool();
Value returnRegister = lirGenTool.getRegisterConfig().getReturnRegister(node.getStackKind()).asValue(
LIRKind.fromJavaKind(lirGenTool.target().arch, node.getStackKind()));
lirGenTool.emitIncomingValues(new Value[]{returnRegister});
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -1095,7 +1095,8 @@ protected boolean verifyInputs() {
} else {
assertFalse(input.isDeleted(), "input was deleted %s", input);
assertTrue(input.isAlive(), "input is not alive yet, i.e., it was not yet added to the graph");
assertTrue(pos.getInputType() == InputType.Unchecked || input.isAllowedUsageType(pos.getInputType()), "invalid usage type %s %s", input, pos.getInputType());
assertTrue(pos.getInputType() == InputType.Unchecked || input.isAllowedUsageType(pos.getInputType()), "invalid usage type input:%s inputType:%s inputField:%s", input,
pos.getInputType(), pos.getName());
Class<?> expectedType = pos.getType();
assertTrue(expectedType.isAssignableFrom(input.getClass()), "Invalid input type for %s: expected a %s but was a %s", pos, expectedType, input.getClass());
}
@@ -231,7 +231,7 @@ public NodeClass(Class<T> clazz, NodeClass<? super T> superNodeClass, FieldsScan
inputsIteration = computeIterationMask(inputs.type(), inputs.getDirectCount(), inputs.getOffsets());
}
try (DebugCloseable t1 = Init_Data.start(debug)) {
data = new Fields(fs.data);
data = Fields.create(fs.data);
}

isLeafNode = inputs.getCount() + successors.getCount() == 0;
@@ -119,9 +119,10 @@ public NodeLIRBuilderTool newNodeLIRBuilder(StructuredGraph graph, LIRGeneratorT
@Override
protected void bangStackWithOffset(CompilationResultBuilder crb, int bangOffset) {
AArch64MacroAssembler masm = (AArch64MacroAssembler) crb.asm;
boolean allowOverwrite = false;
try (ScratchRegister sc = masm.getScratchRegister()) {
Register scratch = sc.getRegister();
AArch64Address address = masm.makeAddress(sp, -bangOffset, scratch, 8, /* allowOverwrite */false);
AArch64Address address = masm.makeAddress(sp, -bangOffset, scratch, 8, allowOverwrite);
masm.str(64, zr, address);
}
}

0 comments on commit 4f62919

Please sign in to comment.