RFR: PR to fix failing CountedLoop unit tests
Andrew Dinn
adinn at redhat.com
Fri Jun 16 11:13:57 UTC 2017
After fixing the issues with tbz on AArch64 there were still 12 test
failures in the CountedLoop tests. It turns out they were to do with the
way Div/Rem nodes were being replaced with snippets including some
underlying AArch64-specific SafeDiv/Rem nodes. The following PR fixes
the tests:
https://github.com/graalvm/graal/pull/226
The SafeDiv/Rem nodes override the corresponding Div/Rem nodes
inheriting their state and behaviour. he latter includes a eforeState
used to pass a FrameState in the call to the generators emitDiv/Rem methods.
The snippet deals with any cases that might generate exceptions. Hence
the SafeDiv/Rem don't need to be assigned a a beforeState. Ditto, the
generator doesn't need to construct a FrameState to pass to emitDev/Rem.
Unfortunately, the SafeDiv/Rem nodes inherit their generate call and so
inherit an intervening call to gen.state(this). The problme is fixed by
overriding generate on classes DivNode, UnsignedDivMode, RemNode and
UnsignedRemNode to make the same call as their parent except with the
FrameState argument passed as null.
regards,
Andrew Dinn
-----------
Senior Principal Software Engineer
Red Hat UK Ltd
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander
More information about the graal-dev
mailing list