# HG changeset patch # User Josef Eisl # Date 1449827351 -3600 # Node ID ff575266cf15255b7299acac1d4090692d0b1e7e # Parent f2a8407253da65ae5abe53cd73821dd17f3766a6 createBenchmarkCounters: throw exception if benchmark counter are not enabled. diff -r f2a8407253da -r ff575266cf15 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Thu Dec 10 18:22:07 2015 +0100 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Fri Dec 11 10:49:11 2015 +0100 @@ -615,7 +615,7 @@ if (BenchmarkCounters.enabled) { return new AMD64HotSpotCounterOp(name, group, increment, getProviders().getRegisters(), config, getOrInitRescueSlot()); } - return null; + throw JVMCIError.shouldNotReachHere("BenchmarkCounters are not enabled!"); } @Override @@ -623,7 +623,7 @@ if (BenchmarkCounters.enabled) { return new AMD64HotSpotCounterOp(names, groups, increments, getProviders().getRegisters(), config, getOrInitRescueSlot()); } - return null; + throw JVMCIError.shouldNotReachHere("BenchmarkCounters are not enabled!"); } @Override diff -r f2a8407253da -r ff575266cf15 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java Thu Dec 10 18:22:07 2015 +0100 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java Fri Dec 11 10:49:11 2015 +0100 @@ -494,18 +494,16 @@ public LIRInstruction createBenchmarkCounter(String name, String group, Value increment) { if (BenchmarkCounters.enabled) { return new SPARCHotSpotCounterOp(name, group, increment, getProviders().getRegisters(), config); - } else { - return null; } + throw JVMCIError.shouldNotReachHere("BenchmarkCounters are not enabled!"); } @Override public LIRInstruction createMultiBenchmarkCounter(String[] names, String[] groups, Value[] increments) { if (BenchmarkCounters.enabled) { return new SPARCHotSpotCounterOp(names, groups, increments, getProviders().getRegisters(), config); - } else { - return null; } + throw JVMCIError.shouldNotReachHere("BenchmarkCounters are not enabled!"); } public AllocatableValue getSafepointAddressValue() {