Mercurial > hg > graal-compiler
changeset 16051:da9b9b625818
Truffle FrameDescriptor: add compiler asserts
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Fri, 06 Jun 2014 09:40:22 +0200 |
parents | 7b37f1b6d188 |
children | 80b0bd9e29c8 |
files | graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/substitutions/CompilerAssertsSubstitutions.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerAsserts.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/FrameDescriptor.java |
diffstat | 3 files changed, 19 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/substitutions/CompilerAssertsSubstitutions.java Thu Jun 05 17:44:13 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/substitutions/CompilerAssertsSubstitutions.java Fri Jun 06 09:40:22 2014 +0200 @@ -33,6 +33,9 @@ @MacroSubstitution(macro = NeverPartOfCompilationNode.class, isStatic = true) public static native void neverPartOfCompilation(); + @MacroSubstitution(macro = NeverPartOfCompilationNode.class, isStatic = true) + public static native void neverPartOfCompilation(String message); + @MacroSubstitution(macro = CompilationConstantNode.class, isStatic = true) public static native boolean compilationConstant(boolean value);
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerAsserts.java Thu Jun 05 17:44:13 2014 +0200 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerAsserts.java Fri Jun 06 09:40:22 2014 +0200 @@ -29,7 +29,7 @@ * either executed in the interpreter or in the compiled code. The assertions are checked during * code generation and the Truffle compiler produces for failing assertions a stack trace that * identifies the code position of the assertion in the context of the current compilation. - * + * */ public class CompilerAsserts { @@ -42,9 +42,12 @@ public static void neverPartOfCompilation() { } + public static void neverPartOfCompilation(@SuppressWarnings("unused") String message) { + } + /** * Assertion that the corresponding value is reduced to a constant during compilation. - * + * * @param value the value that must be constant during compilation * @return the value given as parameter */ @@ -54,7 +57,7 @@ /** * Assertion that the corresponding value is reduced to a constant during compilation. - * + * * @param value the value that must be constant during compilation * @return the value given as parameter */ @@ -64,7 +67,7 @@ /** * Assertion that the corresponding value is reduced to a constant during compilation. - * + * * @param value the value that must be constant during compilation * @return the value given as parameter */ @@ -74,7 +77,7 @@ /** * Assertion that the corresponding value is reduced to a constant during compilation. - * + * * @param value the value that must be constant during compilation * @return the value given as parameter */ @@ -84,7 +87,7 @@ /** * Assertion that the corresponding value is reduced to a constant during compilation. - * + * * @param value the value that must be constant during compilation * @return the value given as parameter */ @@ -94,7 +97,7 @@ /** * Assertion that the corresponding value is reduced to a constant during compilation. - * + * * @param value the value that must be constant during compilation * @return the value given as parameter */ @@ -104,7 +107,7 @@ /** * Assertion that the corresponding value is reduced to a constant during compilation. - * + * * @param value the value that must be constant during compilation * @return the value given as parameter */ @@ -114,7 +117,7 @@ /** * Assertion that the corresponding value is reduced to a constant during compilation. - * + * * @param value the value that must be constant during compilation * @return the value given as parameter */ @@ -124,7 +127,7 @@ /** * Assertion that the corresponding value is reduced to a constant during compilation. - * + * * @param value the value that must be constant during compilation * @return the value given as parameter */
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/FrameDescriptor.java Thu Jun 05 17:44:13 2014 +0200 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/FrameDescriptor.java Fri Jun 06 09:40:22 2014 +0200 @@ -57,6 +57,7 @@ } public FrameSlot addFrameSlot(Object identifier, FrameSlotKind kind) { + CompilerAsserts.neverPartOfCompilation("interpreter-only. includes hashmap operations."); assert !identifierToSlotMap.containsKey(identifier); FrameSlot slot = new FrameSlot(this, identifier, slots.size(), kind); slots.add(slot); @@ -87,6 +88,7 @@ } public void removeFrameSlot(Object identifier) { + CompilerAsserts.neverPartOfCompilation("interpreter-only. includes hashmap operations."); assert identifierToSlotMap.containsKey(identifier); slots.remove(identifierToSlotMap.get(identifier)); identifierToSlotMap.remove(identifier); @@ -104,7 +106,7 @@ /** * Retrieve the list of all the identifiers associated with this frame descriptor. - * + * * @return the list of all the identifiers in this frame descriptor */ public Set<Object> getIdentifiers() {