Broken debug output

Andreas Woess andreas.woess at jku.at
Fri Apr 11 14:02:13 UTC 2014


Thanks for the report, I'll push a fix.

-andreas

On 10/04/14 16:27, Stefan Marr wrote:
> Dear Graal/Truffle team:
>
> I have another little request: could you please add a job on your CI infrastructure that runs a few of selected benchmarks with all your debugging output enabled?
>
> Please find below a patch, that might fix at least two issues. The last one was already broken for a long time, but I was not sure whether it is just something that’s showing up in TruffleSOM. Also, for the second part, I really don’t know what I am doing here.
> But, `(ConstantNode) methodCallTargetNode.arguments().first()` seems to me as if it is a rather brittle construct. If you got such strong assumptions about that collection, perhaps it would be better to document that by extracting it as a method with a name.
> That also might give people like me a few more clues about what’s going on there.
>
>
> diff --git a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java
> index 802e759..6376fab 100644
> --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java
> +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java
> @@ -86,7 +86,7 @@ public class PartialEvaluator {
>               throw Debug.handle(e);
>           }
>   
> -        if (TraceTruffleCompilationHistogram.getValue()) {
> +        if (TraceTruffleCompilationHistogram.getValue() || TraceTruffleCompilationDetails.getValue()) {
>               constantReceivers = new HashSet<>();
>           }
>   
> @@ -203,8 +203,14 @@ public class PartialEvaluator {
>                           }
>   
>                           if (TraceTruffleCompilationDetails.getValue() && kind == InvokeKind.Special) {
> -                            ConstantNode constantNode = (ConstantNode) methodCallTargetNode.arguments().first();
> -                            constantReceivers.add(constantNode.asConstant());
> +                            ValueNode val = methodCallTargetNode.arguments().first();
> +                            ConstantNode cat;  // I don’t know what I am doing here, but if it ain’t the first, perhaps it is the second...
> +                            if (val instanceof ConstantNode) {
> +                                cst = (ConstantNode) val;
> +                            } else {
> +                                cst = (ConstantNode) methodCallTargetNode.arguments().get(1);
> +                            }
> +                            constantReceivers.add(cst.asConstant());
>                           }
>   
>                           StructuredGraph inlineGraph = replacements.getMethodSubstitution(methodCallTargetNode.targetMethod());
>
>
>
> Thanks a lot
> Stefan
>
>



More information about the graal-dev mailing list