On the 0x20F day of Apache Harmony Ivan Kollegov wrote:
> Hi JIT developers.
>
> I've wrote 4 templates and about 20 tests to test Jitrino's internal
> algorithms. I put them all into JIRA-1586
>
> Also I've founded a problem with testing simplifier.cpp (test
> testSimplifyIf). The problem was in
>
> FlowGraph::foldBranch(ControlFlowGraph& fg, Node* block, BranchInst*
> br, bool isTaken)
>
> {
> assert(br == block->getLastInst());
> assert(block->getOutDegree() == 2);
> fg.removeEdge(block->getOutEdge(isTaken ? Edge::Kind_False :
> Edge::Kind_True));
> br->unlink();
> }
>
> The variable "block" can be null.
did it happen? do you have any reproducer? maybe, one of your
regression tests uncovered this? cool..
could you show it?
> This problem can be fixed with patch in JIRA-1986
I would rather put assert(block)
> Also, I had problems with race condition with initializing of static
> section in TestRegistry* TestRegistry::getInstance(){
>
> Could you check the changes?
>
you removed some asserts. why? is it a real usecase when we remove the
entry node?
+++ vm/jitrino/src/shared/ControlFlowGraph.cpp (working copy)
@@ -223,13 +223,14 @@
void ControlFlowGraph::removeNode(Nodes::iterator pos, bool erase) {
Node* node = *pos;
- assert(node!=entryNode);
+ if (node == entryNode) {
+ entryNode=NULL;
+ }
if (node == returnNode) {
returnNode = NULL;
} else if(node == unwindNode) {
unwindNode = NULL;
} else if (node == exitNode) {
- assert(0);
exitNode = NULL;
}
--
Egor Pasko, Intel Managed Runtime Division