# HG changeset patch # User Thomas Wuerthinger # Date 1359646092 -3600 # Node ID 16b5195c5f304c7f1e6f3bf8989176ba652c2dd5 # Parent f3fcc94f7120ae8721de3d7db9cc90b9bcc83f55 Remove more TODOs. Introduce implicitNullCheckLimit as target parameter. diff -r f3fcc94f7120 -r 16b5195c5f30 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/TargetDescription.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/TargetDescription.java Thu Jan 31 16:10:56 2013 +0100 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/TargetDescription.java Thu Jan 31 16:28:12 2013 +0100 @@ -82,6 +82,12 @@ public final int cacheAlignment; /** + * Maximum constant displacement at which a memory access can no longer be an implicit null + * check. + */ + public final int implicitNullCheckLimit; + + /** * Specifies how {@code long} and {@code double} constants are to be stored in * {@linkplain BytecodeFrame frames}. This is useful for VMs such as HotSpot where convention * the interpreter uses is that the second local holds the first raw word of the native long or @@ -91,7 +97,8 @@ */ public final boolean debugInfoDoubleWordsInSecondSlot; - public TargetDescription(Architecture arch, boolean isMP, int stackAlignment, int stackBias, int pageSize, int cacheAlignment, boolean inlineObjects, boolean debugInfoDoubleWordsInSecondSlot) { + public TargetDescription(Architecture arch, boolean isMP, int stackAlignment, int stackBias, int implicitNullCheckLimit, int pageSize, int cacheAlignment, boolean inlineObjects, + boolean debugInfoDoubleWordsInSecondSlot) { this.arch = arch; this.pageSize = pageSize; this.isMP = isMP; @@ -99,6 +106,7 @@ this.wordKind = Kind.fromWordSize(wordSize); this.stackAlignment = stackAlignment; this.stackBias = stackBias; + this.implicitNullCheckLimit = implicitNullCheckLimit; this.cacheAlignment = cacheAlignment; this.inlineObjects = inlineObjects; this.debugInfoDoubleWordsInSecondSlot = debugInfoDoubleWordsInSecondSlot; diff -r f3fcc94f7120 -r 16b5195c5f30 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java Thu Jan 31 16:10:56 2013 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java Thu Jan 31 16:28:12 2013 +0100 @@ -1056,7 +1056,6 @@ changeSpillDefinitionPos(interval, defPos); if (registerPriority == RegisterPriority.None && interval.spillState().ordinal() <= SpillState.StartInMemory.ordinal()) { // detection of method-parameters and roundfp-results - // TODO: move this directly to position where use-kind is computed interval.setSpillState(SpillState.StartInMemory); } } diff -r f3fcc94f7120 -r 16b5195c5f30 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Thu Jan 31 16:10:56 2013 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Thu Jan 31 16:28:12 2013 +0100 @@ -467,9 +467,9 @@ ((LIRLowerable) node).generate(this); } - private static boolean canBeNullCheck(LocationNode location) { + private boolean canBeNullCheck(LocationNode location) { // TODO: Make this part of TargetDescription - return !(location instanceof IndexedLocationNode) && location.displacement() < 4096; + return !(location instanceof IndexedLocationNode) && location.displacement() < this.target().implicitNullCheckLimit; } protected CallingConvention createCallingConvention() { diff -r f3fcc94f7120 -r 16b5195c5f30 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotGraalRuntime.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotGraalRuntime.java Thu Jan 31 16:10:56 2013 +0100 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotGraalRuntime.java Thu Jan 31 16:28:12 2013 +0100 @@ -49,7 +49,7 @@ protected TargetDescription createTarget() { final int wordSize = 8; final int stackFrameAlignment = 16; - return new TargetDescription(new AMD64(), true, stackFrameAlignment, 0, config.vmPageSize, wordSize, true, true); + return new TargetDescription(new AMD64(), true, stackFrameAlignment, 0, 4096, config.vmPageSize, wordSize, true, true); } @Override