12.03.2019 17:24, Adriano dos Santos Fernandes wrote:
On 11/03/2019 09:35, Vlad Khorsun wrote:
I just committed few patches and have few more things to ask here:
Vlad, the change just broke reason for NodeRef/NodeRefImpl existence
(which is still commented but not working):
// This class and NodeRefImpl exists for nodes to replace themselves
(eg. pass1) in a type-safe way.
Let me demonstrate it. With this (wrong) patch now the code compiles:
--------------
diff --git a/src/dsql/ExprNodes.cpp b/src/dsql/ExprNodes.cpp
index 4ff5253a2b..26f826ae09 100644
--- a/src/dsql/ExprNodes.cpp
+++ b/src/dsql/ExprNodes.cpp
@@ -10836,6 +10836,7 @@ void SubQueryNode::getChildren(NodeRefsHolder&
holder, bool dsql) const
holder.add(value1);
holder.add(value2);
+ holder.add(test);
}
string SubQueryNode::internalPrint(NodePrinter& printer) const
diff --git a/src/dsql/ExprNodes.h b/src/dsql/ExprNodes.h
index 3478e4056b..38469e826e 100644
--- a/src/dsql/ExprNodes.h
+++ b/src/dsql/ExprNodes.h
@@ -1860,6 +1860,7 @@ public:
NestConst<ValueExprNode> value1;
NestConst<ValueExprNode> value2;
NestConst<SubQuery> subQuery;
+ NestConst<CastNode> test;
};
--------------
While previously it correctly detected the problem, as a specialized
node cannot become some other node not inherited from it.
Please, define "specialized node". I assumed it is descendants of the
ExprNode, but it seems it is not enough. What makes node "specialized" ?
...
If the change really increases performance, then I suppose it should be
conditionally defined based on DEBUG build, so debug could use NodeRef
with virtual method and NodeRefImpl, and release something like
currently (non-virtual method and no NodeRefImpl usage).
According to profiler, new\delete of NodeRefImpl takes near 28% of
request compilation time.
Regards,
Vlad
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel