Skip to main content
Sign in
Snippets Groups Projects
Commit bae013d4 authored by Jesper's avatar Jesper
Browse files

[incremental] Remove redundant flag from AST state

IN_CONSTRUCTION was unnecessary, can test the construction counter directly
instead. Renamed the construction counter to disableDeps, replaced uses of
IN_CONSTRUCTION by disableDeps.
parent 5271ace3
No related branches found
No related tags found
No related merge requests found
...@@ -28,24 +28,24 @@ ...@@ -28,24 +28,24 @@
ASTNode.incHookSetParent = [[ ASTNode.incHookSetParent = [[
$if (IncrementalEnabled) $if (IncrementalEnabled)
$if (IncrementalLevelParam) $if (IncrementalLevelParam)
if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { if (state().disableDeps == 0 && !state().IN_ATTR_STORE_EVAL) {
getParent_handler.notifyDependencies(); getParent_handler.notifyDependencies();
} }
$endif $endif
$if (IncrementalLevelAttr) $if (IncrementalLevelAttr)
if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { if (state().disableDeps == 0 && !state().IN_ATTR_STORE_EVAL) {
getParent_handler.notifyDependencies(); getParent_handler.notifyDependencies();
} }
$endif $endif
$if (IncrementalLevelNode) $if (IncrementalLevelNode)
if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { if (state().disableDeps == 0 && !state().IN_ATTR_STORE_EVAL) {
if (parent != null) { if (parent != null) {
parent.handler.flushRegion(); parent.handler.flushRegion();
} }
} }
$endif $endif
$if (IncrementalLevelRegion) $if (IncrementalLevelRegion)
if (!state().IN_CONSTRUCTION && !(state().IN_COMPUTATION > 0)) { if (state().disableDeps == 0 && !(state().IN_COMPUTATION > 0)) {
if (parent != null) { if (parent != null) {
parent.handler().flushRegion(); parent.handler().flushRegion();
} }
...@@ -65,7 +65,7 @@ ASTNode.incHookSetChild1 = [[ ...@@ -65,7 +65,7 @@ ASTNode.incHookSetChild1 = [[
$if(IncrementalEnabled) $if(IncrementalEnabled)
$if(IncrementalLevelParam) $if(IncrementalLevelParam)
if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { if (state().disableDeps == 0 && !state().IN_ATTR_STORE_EVAL) {
if (children != null && i < children.length && children[i] != null) { if (children != null && i < children.length && children[i] != null) {
children[i].inc_notifyForRemove(); children[i].inc_notifyForRemove();
} }
...@@ -86,7 +86,7 @@ if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { ...@@ -86,7 +86,7 @@ if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) {
$endif $endif
$if(IncrementalLevelAttr) $if(IncrementalLevelAttr)
if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { if (state().disableDeps == 0 && !state().IN_ATTR_STORE_EVAL) {
if (children != null && i < children.length && children[i] != null) { if (children != null && i < children.length && children[i] != null) {
children[i].inc_notifyForRemove(); children[i].inc_notifyForRemove();
} }
...@@ -94,7 +94,7 @@ if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { ...@@ -94,7 +94,7 @@ if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) {
$endif $endif
$if(IncrementalLevelNode) $if(IncrementalLevelNode)
if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { if (state().disableDeps == 0 && !state().IN_ATTR_STORE_EVAL) {
if (children != null && i < children.length && children[i] != null) { if (children != null && i < children.length && children[i] != null) {
children[i].inc_notifyForRemove(); children[i].inc_notifyForRemove();
} }
...@@ -107,7 +107,7 @@ if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { ...@@ -107,7 +107,7 @@ if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) {
$endif $endif
$if(IncrementalLevelRegion) $if(IncrementalLevelRegion)
if (!state().IN_CONSTRUCTION && !(state().IN_COMPUTATION > 0)) { if (state().disableDeps == 0 && !(state().IN_COMPUTATION > 0)) {
if (children != null && i < children.length && children[i] != null) { if (children != null && i < children.length && children[i] != null) {
children[i].inc_notifyForRemove(); children[i].inc_notifyForRemove();
} }
...@@ -170,7 +170,7 @@ ASTNode.incHookInsertChild1 = [[ ...@@ -170,7 +170,7 @@ ASTNode.incHookInsertChild1 = [[
$if(IncrementalEnabled) $if(IncrementalEnabled)
$if(IncrementalLevelParam) $if(IncrementalLevelParam)
if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { if (state().disableDeps == 0 && !state().IN_ATTR_STORE_EVAL) {
numChildren_handler.notifyDependencies(); numChildren_handler.notifyDependencies();
if (children != null && i <= numChildren) { if (children != null && i <= numChildren) {
for (int k = i; k < children.length; k++) { for (int k = i; k < children.length; k++) {
...@@ -182,7 +182,7 @@ if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { ...@@ -182,7 +182,7 @@ if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) {
$endif $endif
$if(IncrementalLevelAttr) $if(IncrementalLevelAttr)
if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { if (state().disableDeps == 0 && !state().IN_ATTR_STORE_EVAL) {
numChildren_handler.notifyDependencies(); numChildren_handler.notifyDependencies();
if (children != null && i <= numChildren) { if (children != null && i <= numChildren) {
getChild_handler.flushRegion(); getChild_handler.flushRegion();
...@@ -190,7 +190,7 @@ if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { ...@@ -190,7 +190,7 @@ if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) {
$endif $endif
$if(IncrementalLevelNode) $if(IncrementalLevelNode)
if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { if (state().disableDeps == 0 && !state().IN_ATTR_STORE_EVAL) {
for (int k = i; k < children.length; k++) { for (int k = i; k < children.length; k++) {
$ASTNode child = children[i]; $ASTNode child = children[i];
if (child != null) { if (child != null) {
...@@ -200,7 +200,7 @@ if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { ...@@ -200,7 +200,7 @@ if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) {
$endif $endif
$if(IncrementalLevelRegion) $if(IncrementalLevelRegion)
if (!state().IN_CONSTRUCTION && !(state().IN_COMPUTATION > 0)) { if (state().disableDeps == 0 && !(state().IN_COMPUTATION > 0)) {
for (int k = i; k < children.length; k++) { for (int k = i; k < children.length; k++) {
$ASTNode child = children[i]; $ASTNode child = children[i];
if (child != null) { if (child != null) {
...@@ -244,7 +244,7 @@ ASTNode.incHookRemoveChild1 = [[ ...@@ -244,7 +244,7 @@ ASTNode.incHookRemoveChild1 = [[
$if(IncrementalEnabled) $if(IncrementalEnabled)
$if(IncrementalLevelParam) $if(IncrementalLevelParam)
if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { if (state().disableDeps == 0 && !state().IN_ATTR_STORE_EVAL) {
if (children[i] != null) { if (children[i] != null) {
children[i].inc_notifyForRemove(); children[i].inc_notifyForRemove();
} }
...@@ -257,7 +257,7 @@ if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { ...@@ -257,7 +257,7 @@ if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) {
$endif $endif
$if(IncrementalLevelAttr) $if(IncrementalLevelAttr)
if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { if (state().disableDeps == 0 && !state().IN_ATTR_STORE_EVAL) {
if (children[i] != null) { if (children[i] != null) {
children[i].inc_notifyForRemove(); children[i].inc_notifyForRemove();
} }
...@@ -265,7 +265,7 @@ if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { ...@@ -265,7 +265,7 @@ if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) {
$endif $endif
$if(IncrementalLevelNode) $if(IncrementalLevelNode)
if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { if (state().disableDeps == 0 && !state().IN_ATTR_STORE_EVAL) {
if (children[i] != null) { if (children[i] != null) {
children[i].inc_notifyForRemove(); children[i].inc_notifyForRemove();
} }
...@@ -279,7 +279,7 @@ if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { ...@@ -279,7 +279,7 @@ if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) {
$endif $endif
$if(IncrementalLevelRegion) $if(IncrementalLevelRegion)
if (!state().IN_CONSTRUCTION && !(state().IN_COMPUTATION > 0)) { if (state().disableDeps == 0 && !(state().IN_COMPUTATION > 0)) {
if (children[i] != null) { if (children[i] != null) {
children[i].inc_notifyForRemove(); children[i].inc_notifyForRemove();
} }
...@@ -322,7 +322,7 @@ TokenComponent.incHookSetToken = [[ ...@@ -322,7 +322,7 @@ TokenComponent.incHookSetToken = [[
$if(IncrementalEnabled) $if(IncrementalEnabled)
$if(IncrementalLevelParam) $if(IncrementalLevelParam)
if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { if (state().disableDeps == 0 && !state().IN_ATTR_STORE_EVAL) {
$if(#isNTA) $if(#isNTA)
if (get$(Id)_computed) { if (get$(Id)_computed) {
get$(Id)_computed = false; get$(Id)_computed = false;
...@@ -337,7 +337,7 @@ if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { ...@@ -337,7 +337,7 @@ if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) {
$endif $endif
$if(IncrementalLevelAttr) $if(IncrementalLevelAttr)
if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { if (state().disableDeps == 0 && !state().IN_ATTR_STORE_EVAL) {
$if(#isNTA) $if(#isNTA)
if (get$(Id)_computed) { if (get$(Id)_computed) {
get$(Id)_computed = false; get$(Id)_computed = false;
...@@ -352,7 +352,7 @@ if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { ...@@ -352,7 +352,7 @@ if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) {
$endif $endif
$if(IncrementalLevelNode) $if(IncrementalLevelNode)
if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { if (state().disableDeps == 0 && !state().IN_ATTR_STORE_EVAL) {
$if(#isNTA) $if(#isNTA)
if (get$(Id)_computed) { if (get$(Id)_computed) {
get$(Id)_computed = false; get$(Id)_computed = false;
...@@ -371,7 +371,7 @@ if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) { ...@@ -371,7 +371,7 @@ if (!state().IN_CONSTRUCTION && !state().IN_ATTR_STORE_EVAL) {
$endif $endif
$if(IncrementalLevelRegion) $if(IncrementalLevelRegion)
if (!state().IN_CONSTRUCTION && !(state().IN_COMPUTATION > 0)) { if (state().disableDeps == 0 && !(state().IN_COMPUTATION > 0)) {
$if(#isNTA) $if(#isNTA)
if (get$(Id)_computed) { if (get$(Id)_computed) {
get$(Id)_computed = false; get$(Id)_computed = false;
... ...
......
...@@ -77,19 +77,14 @@ $endif ...@@ -77,19 +77,14 @@ $endif
exitAttrStoreEval(handler); exitAttrStoreEval(handler);
} }
public boolean IN_CONSTRUCTION = false; public int disableDeps = 0;
private int inc_constructionCount = 0;
public void enterConstruction() { public void enterConstruction() {
IN_CONSTRUCTION = true; disableDeps++;
inc_constructionCount++;
} }
public void exitConstruction() { public void exitConstruction() {
inc_constructionCount--; disableDeps--;
if (inc_constructionCount == 0)
IN_CONSTRUCTION = false;
} }
protected void pushHandler(java.util.Stack stack, $ASTNode$$DepGraphNode handler) { protected void pushHandler(java.util.Stack stack, $ASTNode$$DepGraphNode handler) {
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment