Trufle DLS @Specialization error
Christian Humer
christian.humer at gmail.com
Wed Aug 21 04:56:49 PDT 2013
Hi Wei,
Actually you discovered two bugs.
(1) There is a new feature if a specialization is defined statically in
another class and cannot reach the fields of the node, these fields can be
optionally passed to the specialization method (if they are at least
protected). In your case the protected fields in StatementNode are
recognized as such fields but should not be recognized as such since they
are directly accessible within the method.
(2) The DSL failed to parse the method signature because it recognized the
first boolean always as reference to a local field in StatementNode and not
to the actual value of the left child node. This should clearly also be
parseable by the DSL.
I attached a simple patch as workaround for the bug, so you don't have to
wait for my fix.
Thanks for the report.
- Christian Humer
BTW.: I failed to run "mx eclipseinit" the first time. The link to the
jline and jython library seemed to be outdated.
Updating these lines in projects helped me:
library at JLINE09@path=lib/jline-0.9.95-SNAPSHOT.jar
library at JLINE09@urls=
http://search.maven.org/remotecontent?filepath=jline/jline/0.9.94/jline-0.9.94.jar
library at JYTHON@path=lib/jython-standalone-2.7-b1.jar
library at JYTHON@urls=
http://search.maven.org/remotecontent?filepath=org/python/jython-standalone/2.7-b1/jython-standalone-2.7-b1.jar
On Wed, Aug 21, 2013 at 7:12 AM, Wei Zhang <wei.zhang at uci.edu> wrote:
> Hi guys,
>
> I'm writing a Python interpreter using Truffle.
> After I merged with the tip of basic-truffle today, I got some errors
> complaining about @Specialization annotation only on methods with
> boolean parameters.
> Like this one:
>
> @Specialization
> boolean doBoolean(boolean operand) {
> return operand;
> }
>
> The full source code file is at:
>
> https://bitbucket.org/ssllab/zippy/src/0a48f75b9f38bbc42882fa8c781533a2aff5fcf4/graal/edu.uci.python.nodes/src/edu/uci/python/nodes/expressions/BooleanCastNode.java?at=default
>
> The error prompt shown in eclipse is:
> Method signature (boolean) does not match to the expected signature:
>
> <types0> doBoolean([VirtualFrame frame], [FunctionRootNode
> funcRoot], [boolean isBreak], [StatementNode loopHeader], <types0>
> operand)
>
>
> <types0> = {void, int, BigInteger, double, PComplex, char,
> boolean, String, PDictionary, PList, PTuple, PSequence, PSet,
> PFrozenSet, PBaseSet, PIntegerArray, PDoubleArray, PCharArray, PArray,
> PSlice, PObject, PCallable, Object}
>
> Which, I think, doesn't really explain what it is complaining about.
> Any recent change regarding how this annotation should be used?
> Thanks in advance.
>
> /Wei
> Zhang, Wei
> UCI-EECS-CSS
>
More information about the graal-dev
mailing list