src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRVerifier.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
23 |
23 |
24 |
24 |
25 package org.graalvm.compiler.lir; |
25 package org.graalvm.compiler.lir; |
26 |
26 |
27 import static org.graalvm.compiler.lir.LIRValueUtil.asVariable; |
27 import static org.graalvm.compiler.lir.LIRValueUtil.asVariable; |
28 import static org.graalvm.compiler.lir.LIRValueUtil.isJavaConstant; |
28 import static org.graalvm.compiler.lir.LIRValueUtil.isConstantValue; |
29 import static org.graalvm.compiler.lir.LIRValueUtil.isStackSlotValue; |
29 import static org.graalvm.compiler.lir.LIRValueUtil.isStackSlotValue; |
30 import static org.graalvm.compiler.lir.LIRValueUtil.isVariable; |
30 import static org.graalvm.compiler.lir.LIRValueUtil.isVariable; |
31 import static jdk.vm.ci.code.ValueUtil.asRegister; |
31 import static jdk.vm.ci.code.ValueUtil.asRegister; |
32 import static jdk.vm.ci.code.ValueUtil.isIllegal; |
32 import static jdk.vm.ci.code.ValueUtil.isIllegal; |
33 import static jdk.vm.ci.code.ValueUtil.isRegister; |
33 import static jdk.vm.ci.code.ValueUtil.isRegister; |
240 // @formatter:off |
240 // @formatter:off |
241 private static void allowed(Object op, Value value, OperandMode mode, EnumSet<OperandFlag> flags) { |
241 private static void allowed(Object op, Value value, OperandMode mode, EnumSet<OperandFlag> flags) { |
242 if ((isVariable(value) && flags.contains(OperandFlag.REG)) || |
242 if ((isVariable(value) && flags.contains(OperandFlag.REG)) || |
243 (isRegister(value) && flags.contains(OperandFlag.REG)) || |
243 (isRegister(value) && flags.contains(OperandFlag.REG)) || |
244 (isStackSlotValue(value) && flags.contains(OperandFlag.STACK)) || |
244 (isStackSlotValue(value) && flags.contains(OperandFlag.STACK)) || |
245 (isJavaConstant(value) && flags.contains(OperandFlag.CONST) && mode != OperandMode.DEF) || |
245 (isConstantValue(value) && flags.contains(OperandFlag.CONST) && mode != OperandMode.DEF) || |
246 (isIllegal(value) && flags.contains(OperandFlag.ILLEGAL))) { |
246 (isIllegal(value) && flags.contains(OperandFlag.ILLEGAL))) { |
247 return; |
247 return; |
248 } |
248 } |
249 throw new GraalError("Invalid LIR%n Instruction: %s%n Mode: %s%n Flags: %s%n Unexpected value: %s %s", |
249 throw new GraalError("Invalid LIR%n Instruction: %s%n Mode: %s%n Flags: %s%n Unexpected value: %s %s", |
250 op, mode, flags, value.getClass().getSimpleName(), value); |
250 op, mode, flags, value.getClass().getSimpleName(), value); |