Skip to content
Snippets Groups Projects
Commit 1321258e authored by Emma Söderberg's avatar Emma Söderberg
Browse files

Renames dependant to listeners in incremental/param.

This is to make the code easier to read.

Tested with incremental/param.
parent 3cdf9a92
No related branches found
No related tags found
No related merge requests found
...@@ -39,7 +39,7 @@ aspect IncrementalDDG { ...@@ -39,7 +39,7 @@ aspect IncrementalDDG {
/** /**
* Generate DDG cleanup methods, * Generate DDG cleanup methods,
* *
* Methods: cleanupDependants, cleanupDependantsInTree * Methods: cleanupListeners, cleanupListenersInTree
* *
* After introducing single direction edges in the DDG flushed (emptied) * After introducing single direction edges in the DDG flushed (emptied)
* dependants (or listeners) may remain in the DDG. The purpose of these * dependants (or listeners) may remain in the DDG. The purpose of these
...@@ -48,11 +48,11 @@ aspect IncrementalDDG { ...@@ -48,11 +48,11 @@ aspect IncrementalDDG {
public void ASTDecl.genIncrementalCleanup(PrintWriter out) { public void ASTDecl.genIncrementalCleanup(PrintWriter out) {
if (!config().incremental()) return; if (!config().incremental()) return;
TemplateContext tt = templateContext(); TemplateContext tt = templateContext();
tt.bind("CleanupTokenDependants", genCleanupTokenDependantsString()); tt.bind("CleanupTokenListeners", genCleanupTokenListenersString());
tt.bind("CleanupAttributeDependants", genCleanupAttributeDependantsString()); tt.bind("CleanupAttributeListeners", genCleanupAttributeListenersString());
tt.expand("ASTDecl.cleanupDependantsMethod", out); tt.expand("ASTDecl.cleanupListenersMethod", out);
tt.bind("CleanupDependantsInNTAs", genCleanupDependantsInNTAsString()); tt.bind("CleanupListenersInNTAs", genCleanupListenersInNTAsString());
tt.expand("ASTDecl.cleanupDependantsInTreeMethod", out); tt.expand("ASTDecl.cleanupListenersInTreeMethod", out);
} }
/** /**
...@@ -142,7 +142,7 @@ aspect IncrementalDDG { ...@@ -142,7 +142,7 @@ aspect IncrementalDDG {
/** /**
* Generate string with code for cleaning up dependants in NTAs. * Generate string with code for cleaning up dependants in NTAs.
*/ */
public String ASTDecl.genCleanupDependantsInNTAsString() { public String ASTDecl.genCleanupListenersInNTAsString() {
StringBuffer res = new StringBuffer(); StringBuffer res = new StringBuffer();
TemplateContext tt = templateContext(); TemplateContext tt = templateContext();
for (AttrDecl attr : listOfCachedAttributes()) { for (AttrDecl attr : listOfCachedAttributes()) {
...@@ -150,7 +150,7 @@ aspect IncrementalDDG { ...@@ -150,7 +150,7 @@ aspect IncrementalDDG {
!(attr.type().equals("String") || attr.type().equals("java.lang.String"))) { !(attr.type().equals("String") || attr.type().equals("java.lang.String"))) {
tt.bind("IsParameterized", attr.getNumParameter() > 0); tt.bind("IsParameterized", attr.getNumParameter() > 0);
tt.bind("AttrSign", attr.signature()); tt.bind("AttrSign", attr.signature());
res.append(tt.expand("ASTDecl.checkAndCleanupNTADependants")); res.append(tt.expand("ASTDecl.checkAndCleanupNTAListeners"));
} }
} }
return res.toString(); return res.toString();
...@@ -159,7 +159,7 @@ aspect IncrementalDDG { ...@@ -159,7 +159,7 @@ aspect IncrementalDDG {
/** /**
* Generate string with code for cleaning up dependants. * Generate string with code for cleaning up dependants.
*/ */
public String ASTDecl.genCleanupAttributeDependantsString() { public String ASTDecl.genCleanupAttributeListenersString() {
StringBuffer res = new StringBuffer(); StringBuffer res = new StringBuffer();
TemplateContext tt = templateContext(); TemplateContext tt = templateContext();
// Add dump string for each attribute // Add dump string for each attribute
...@@ -168,7 +168,7 @@ aspect IncrementalDDG { ...@@ -168,7 +168,7 @@ aspect IncrementalDDG {
tt.bind("IsNTA", (attr.isNTA() || attr.getNTA()) && !attr.isPrimitive() && tt.bind("IsNTA", (attr.isNTA() || attr.getNTA()) && !attr.isPrimitive() &&
!(attr.type().equals("String") || attr.type().equals("java.lang.String"))); !(attr.type().equals("String") || attr.type().equals("java.lang.String")));
tt.bind("AttrSign", attr.signature()); tt.bind("AttrSign", attr.signature());
res.append(tt.expand("ASTDecl.checkAndCleanupAttributeDependants")); res.append(tt.expand("ASTDecl.checkAndCleanupAttributeListeners"));
} }
return res.toString(); return res.toString();
} }
...@@ -176,14 +176,14 @@ aspect IncrementalDDG { ...@@ -176,14 +176,14 @@ aspect IncrementalDDG {
/** /**
* Generate string with code for cleaning up token dependants. * Generate string with code for cleaning up token dependants.
*/ */
public String ASTDecl.genCleanupTokenDependantsString() { public String ASTDecl.genCleanupTokenListenersString() {
StringBuffer res = new StringBuffer(); StringBuffer res = new StringBuffer();
TemplateContext tt = templateContext(); TemplateContext tt = templateContext();
if (config().incrementalLevelParam() || config().incrementalLevelAttr()) { if (config().incrementalLevelParam() || config().incrementalLevelAttr()) {
for (Component c : components()) { for (Component c : components()) {
if (c instanceof TokenComponent && !c.isNTA()) { if (c instanceof TokenComponent && !c.isNTA()) {
tt.bind("Id", ((TokenComponent)c).getTokenId().getID()); tt.bind("Id", ((TokenComponent)c).getTokenId().getID());
res.append(tt.expand("ASTDecl.checkAndCleanupTokenDependants")); res.append(tt.expand("ASTDecl.checkAndCleanupTokenListeners"));
} }
} }
} }
......
...@@ -120,7 +120,7 @@ $if (IncrementalLevelAttr) ...@@ -120,7 +120,7 @@ $if (IncrementalLevelAttr)
java.util.HashSet<$DDGNodeName> k = fDependencySet; java.util.HashSet<$DDGNodeName> k = fDependencySet;
fDependencySet = new java.util.HashSet<$DDGNodeName>(4); fDependencySet = new java.util.HashSet<$DDGNodeName>(4);
for ($DDGNodeName node : k) { for ($DDGNodeName node : k) {
node.removeDependant(this); node.removeListener(this);
} }
fNode.reactToDependencyChange(fAttrID); fNode.reactToDependencyChange(fAttrID);
} }
...@@ -148,7 +148,7 @@ $if (IncrementalLevelNode) ...@@ -148,7 +148,7 @@ $if (IncrementalLevelNode)
java.util.HashSet<$DDGNodeName> k = fDependencySet; java.util.HashSet<$DDGNodeName> k = fDependencySet;
fDependencySet = new java.util.HashSet<$DDGNodeName>(4); fDependencySet = new java.util.HashSet<$DDGNodeName>(4);
for ($DDGNodeName node : k) { for ($DDGNodeName node : k) {
node.removeDependant(this); node.removeListener(this);
} }
fNode.reactToDependencyChange(); fNode.reactToDependencyChange();
} }
...@@ -176,7 +176,7 @@ $if (IncrementalLevelRegion) ...@@ -176,7 +176,7 @@ $if (IncrementalLevelRegion)
java.util.HashSet<$DDGNodeName> k = fDependencySet; java.util.HashSet<$DDGNodeName> k = fDependencySet;
fDependencySet = new java.util.HashSet<$DDGNodeName>(4); fDependencySet = new java.util.HashSet<$DDGNodeName>(4);
for ($DDGNodeName node : k) { for ($DDGNodeName node : k) {
node.removeDependant(this); node.removeListener(this);
} }
fNode.reactToDependencyChange(); fNode.reactToDependencyChange();
} }
...@@ -186,19 +186,19 @@ $endif ...@@ -186,19 +186,19 @@ $endif
public java.util.HashSet<$DDGNodeName> fListenerSet = new java.util.HashSet<$DDGNodeName>(4); public java.util.HashSet<$DDGNodeName> fListenerSet = new java.util.HashSet<$DDGNodeName>(4);
public boolean hasDependants() { public boolean hasListeners() {
return !fListenerSet.isEmpty(); return !fListenerSet.isEmpty();
} }
public void addDependant($DDGNodeName node) { public void addListener($DDGNodeName node) {
fListenerSet.add(node); fListenerSet.add(node);
} }
public void removeDependant($DDGNodeName node) { public void removeListener($DDGNodeName node) {
fListenerSet.remove(node); fListenerSet.remove(node);
} }
public void cleanupDependants() { public void cleanupListeners() {
java.util.Iterator<$DDGNodeName> itr = fListenerSet.iterator(); java.util.Iterator<$DDGNodeName> itr = fListenerSet.iterator();
while (itr.hasNext()) { while (itr.hasNext()) {
$DDGNodeName node = itr.next(); $DDGNodeName node = itr.next();
...@@ -208,7 +208,7 @@ $endif ...@@ -208,7 +208,7 @@ $endif
} }
} }
public void clearDependants() { public void clearListeners() {
fListenerSet.clear(); fListenerSet.clear();
} }
...@@ -220,10 +220,10 @@ $endif ...@@ -220,10 +220,10 @@ $endif
return; return;
for ($DDGNodeName l : node.fListenerSet) { for ($DDGNodeName l : node.fListenerSet) {
if (!l.isGarbage()) { if (!l.isGarbage()) {
this.addDependant(l); this.addListener(l);
} }
} }
node.clearDependants(); node.clearListeners();
node.throwAway(); node.throwAway();
} }
...@@ -270,7 +270,7 @@ $else ...@@ -270,7 +270,7 @@ $else
java.util.HashSet<$DDGNodeName> k = fDependencySet; java.util.HashSet<$DDGNodeName> k = fDependencySet;
fDependencySet = new java.util.HashSet<$DDGNodeName>(4); fDependencySet = new java.util.HashSet<$DDGNodeName>(4);
for ($DDGNodeName node : k) { for ($DDGNodeName node : k) {
node.removeDependant(this); node.removeListener(this);
} }
$if (IncrementalLevelAttr) $if (IncrementalLevelAttr)
fNode.reactToDependencyChange(fAttrID); fNode.reactToDependencyChange(fAttrID);
...@@ -525,109 +525,109 @@ $if (IncrementalLevelParam) ...@@ -525,109 +525,109 @@ $if (IncrementalLevelParam)
$endif $endif
]] ]]
# Generate code for cleanup dependants method. # Generate code for cleanup listeners method.
ASTDecl.cleanupDependantsMethod = [[ ASTDecl.cleanupListenersMethod = [[
private boolean #name.inc_cleanupDependants_visited = false; private boolean #name.inc_cleanupListeners_visited = false;
public void #name.cleanupDependants() { public void #name.cleanupListeners() {
if (inc_cleanupDependants_visited) { if (inc_cleanupListeners_visited) {
return; return;
} }
inc_cleanupDependants_visited = true; inc_cleanupListeners_visited = true;
$if (#isASTNodeDecl) $if (#isASTNodeDecl)
$if (IncrementalLevelParam) $if (IncrementalLevelParam)
getParent_handler.cleanupDependants(); getParent_handler.cleanupListeners();
numChildren_handler.cleanupDependants(); numChildren_handler.cleanupListeners();
for (int k = 0; getChild_handler != null && k < getChild_handler.length; k++) { for (int k = 0; getChild_handler != null && k < getChild_handler.length; k++) {
if (getChild_handler[k] != null) { if (getChild_handler[k] != null) {
getChild_handler[k].cleanupDependants(); getChild_handler[k].cleanupListeners();
} }
} }
$endif $endif
$endif $endif
$if (IncrementalLevelRegion) $if (IncrementalLevelRegion)
$if (IsRegionRoot) $if (IsRegionRoot)
handler.cleanupDependants(); handler.cleanupListeners();
$endif $endif
$endif $endif
$CleanupTokenDependants $CleanupTokenListeners
$CleanupAttributeDependants $CleanupAttributeListeners
$if (!#isASTNodeDecl) $if (!#isASTNodeDecl)
$if (IncrementalLevelRegion) $if (IncrementalLevelRegion)
$if (!IsRegionRoot) $if (!IsRegionRoot)
super.cleanupDependants(); super.cleanupListeners();
$endif $endif
$else $else
super.cleanupDependants(); super.cleanupListeners();
$endif $endif
$endif $endif
inc_cleanupDependants_visited = false; inc_cleanupListeners_visited = false;
} }
]] ]]
# Generate code for checking token handler and cleaning up dependants. # Generate code for checking token handler and cleaning up listeners.
ASTDecl.checkAndCleanupTokenDependants = [[ ASTDecl.checkAndCleanupTokenListeners = [[
if (get$(Id)_handler != null) { if (get$(Id)_handler != null) {
get$(Id)_handler.cleanupDependants(); get$(Id)_handler.cleanupListeners();
} }
]] ]]
# Generate code for checking attribute handler and cleaning up dependants. # Generate code for checking attribute handler and cleaning up listeners.
ASTDecl.checkAndCleanupAttributeDependants = [[ ASTDecl.checkAndCleanupAttributeListeners = [[
$if (IncrementalLevelParam) $if (IncrementalLevelParam)
$if (IsParameterized) $if (IsParameterized)
for (java.util.Iterator itr = $(AttrSign)_handler.values().iterator(); itr.hasNext();) { for (java.util.Iterator itr = $(AttrSign)_handler.values().iterator(); itr.hasNext();) {
$DDGNodeName handler = ($DDGNodeName)itr.next(); $DDGNodeName handler = ($DDGNodeName)itr.next();
handler.cleanupDependants(); handler.cleanupListeners();
} }
$else $else
if ($(AttrSign)_handler != null) { if ($(AttrSign)_handler != null) {
$(AttrSign)_handler.cleanupDependants(); $(AttrSign)_handler.cleanupListeners();
} }
$endif $endif
$if (IsNTA) $if (IsNTA)
$if (IsParameterized) $if (IsParameterized)
if ($(AttrSign)_proxy != null) { if ($(AttrSign)_proxy != null) {
$(AttrSign)_proxy.cleanupDependants(); $(AttrSign)_proxy.cleanupListeners();
} }
$else $else
if ($(AttrSign)_computed && ($(AttrSign)_value instanceof $ASTNode)) { if ($(AttrSign)_computed && ($(AttrSign)_value instanceof $ASTNode)) {
$(AttrSign)_value.cleanupDependants(); $(AttrSign)_value.cleanupListeners();
} }
$endif $endif
$endif $endif
$endif $endif
]] ]]
# Generate code for method cleanupDependantsInTree. # Generate code for method cleanupListenersInTree.
ASTDecl.cleanupDependantsInTreeMethod = [[ ASTDecl.cleanupListenersInTreeMethod = [[
private boolean #name.inc_cleanupDependantsInTree_visited = false; private boolean #name.inc_cleanupListenersInTree_visited = false;
public void #name.cleanupDependantsInTree() { public void #name.cleanupListenersInTree() {
if (inc_cleanupDependantsInTree_visited) { if (inc_cleanupListenersInTree_visited) {
return; return;
} }
inc_cleanupDependantsInTree_visited = true; inc_cleanupListenersInTree_visited = true;
cleanupDependants(); cleanupListeners();
for (int i = 0; children != null && i < children.length; i++) { for (int i = 0; children != null && i < children.length; i++) {
$ASTNode child = children[i]; $ASTNode child = children[i];
if (child == null) { if (child == null) {
continue; continue;
} }
child.cleanupDependantsInTree(); child.cleanupListenersInTree();
} }
$CleanupDependantsInNTAs $CleanupListenersInNTAs
inc_cleanupDependantsInTree_visited = false; inc_cleanupListenersInTree_visited = false;
} }
]] ]]
# Generate string with code for cleaning up dependants in NTAs. # Generate string with code for cleaning up listeners in NTAs.
ASTDecl.checkAndCleanupNTADependants = [[ ASTDecl.checkAndCleanupNTAListeners = [[
$if (IsParameterized) $if (IsParameterized)
if ($(AttrSign)_proxy != null) { if ($(AttrSign)_proxy != null) {
$(AttrSign)_proxy.cleanupDependantsInTree(); $(AttrSign)_proxy.cleanupListenersInTree();
} }
$else $else
if ($(AttrSign)_computed && ($(AttrSign)_value instanceof $ASTNode)) { if ($(AttrSign)_computed && ($(AttrSign)_value instanceof $ASTNode)) {
$(AttrSign)_value.cleanupDependantsInTree(); $(AttrSign)_value.cleanupListenersInTree();
} }
$endif $endif
]] ]]
......
...@@ -90,7 +90,7 @@ ASTDecl.trackGetParentForRegionMethod = [[ ...@@ -90,7 +90,7 @@ ASTDecl.trackGetParentForRegionMethod = [[
public $ASTNode #name.getParent() { public $ASTNode #name.getParent() {
$ASTNode parent = super.getParent(); $ASTNode parent = super.getParent();
if (state().IN_COMPUTATION > 0 && parent != null) { if (state().IN_COMPUTATION > 0 && parent != null) {
parent.handler().addDependant(handler); parent.handler().addListener(handler);
} }
return parent; return parent;
} }
...@@ -104,7 +104,7 @@ $if(IsListOrOpt) ...@@ -104,7 +104,7 @@ $if(IsListOrOpt)
public T #name.getChild(int i) { public T #name.getChild(int i) {
$ASTNode child = super.getChild(i); $ASTNode child = super.getChild(i);
if (state().IN_COMPUTATION > 0 && child.isRegionRoot()) { if (state().IN_COMPUTATION > 0 && child.isRegionRoot()) {
child.handler().addDependant(handler()); child.handler().addListener(handler());
} }
return (T) child; return (T) child;
} }
...@@ -112,7 +112,7 @@ $else ...@@ -112,7 +112,7 @@ $else
public $ASTNode #name.getChild(int i) { public $ASTNode #name.getChild(int i) {
$ASTNode child = super.getChild(i); $ASTNode child = super.getChild(i);
if (state().IN_COMPUTATION > 0 && child.isRegionRoot()) { if (state().IN_COMPUTATION > 0 && child.isRegionRoot()) {
child.handler().addDependant(handler()); child.handler().addListener(handler());
} }
return child; return child;
} }
...@@ -127,7 +127,7 @@ $if(IsListOrOpt) ...@@ -127,7 +127,7 @@ $if(IsListOrOpt)
public T #name.getChildNoTransform(int i) { public T #name.getChildNoTransform(int i) {
$ASTNode child = super.getChildNoTransform(i); $ASTNode child = super.getChildNoTransform(i);
if (state().IN_COMPUTATION > 0 && child.isRegionRoot()) { if (state().IN_COMPUTATION > 0 && child.isRegionRoot()) {
child.handler().addDependant(handler()); child.handler().addListener(handler());
} }
return (T) child; return (T) child;
} }
...@@ -135,7 +135,7 @@ $else ...@@ -135,7 +135,7 @@ $else
public $ASTNode #name.getChildNoTransform(int i) { public $ASTNode #name.getChildNoTransform(int i) {
$ASTNode child = super.getChildNoTransform(i); $ASTNode child = super.getChildNoTransform(i);
if (state().IN_COMPUTATION > 0 && child.isRegionRoot()) { if (state().IN_COMPUTATION > 0 && child.isRegionRoot()) {
child.handler().addDependant(handler()); child.handler().addListener(handler());
} }
return child; return child;
} }
......
...@@ -50,7 +50,7 @@ $endif ...@@ -50,7 +50,7 @@ $endif
if (!handlerStack.isEmpty()) { if (!handlerStack.isEmpty()) {
//throw new Error("Handler stack is empty at addition of dependency!"); //throw new Error("Handler stack is empty at addition of dependency!");
$ASTNode$$DepGraphNode top = ($ASTNode$$DepGraphNode) handlerStack.peek(); $ASTNode$$DepGraphNode top = ($ASTNode$$DepGraphNode) handlerStack.peek();
handler.addDependant(top); handler.addListener(top);
$if(IncrementalPropLimit) $if(IncrementalPropLimit)
if (!handler.cacheInDependent) if (!handler.cacheInDependent)
......
...@@ -44,7 +44,7 @@ $endif ...@@ -44,7 +44,7 @@ $endif
$if (IncrementalLevelRegion) $if (IncrementalLevelRegion)
$if (#isRegionRoot) $if (#isRegionRoot)
if (state().IN_COMPUTATION > 0 && parent != null) { if (state().IN_COMPUTATION > 0 && parent != null) {
parent.handler().addDependant(handler); parent.handler().addListener(handler);
} }
$endif $endif
$endif $endif
...@@ -266,14 +266,14 @@ $endif ...@@ -266,14 +266,14 @@ $endif
$if(IncrementalLevelNode) $if(IncrementalLevelNode)
if (node != null) { if (node != null) {
this.state().addHandlerDepTo(node.handler); this.state().addHandlerDepTo(node.handler);
this.handler.addDependant(node.handler); this.handler.addListener(node.handler);
} }
$endif $endif
$if(IncrementalLevelRegion) $if(IncrementalLevelRegion)
if (node != null && node.isRegionRoot()) { if (node != null && node.isRegionRoot()) {
this.handler().addDependant(node.handler()); this.handler().addListener(node.handler());
node.handler().addDependant(this.handler()); node.handler().addListener(this.handler());
} }
$endif $endif
...@@ -286,7 +286,7 @@ $if(IncrementalEnabled) ...@@ -286,7 +286,7 @@ $if(IncrementalEnabled)
$if(IncrementalLevelRegion) $if(IncrementalLevelRegion)
$if(#isRegionRoot) $if(#isRegionRoot)
if (state().IN_COMPUTATION > 0) { if (state().IN_COMPUTATION > 0) {
node.handler().addDependant(handler); node.handler().addListener(handler);
} }
$endif $endif
$endif $endif
...@@ -321,7 +321,7 @@ $endif ...@@ -321,7 +321,7 @@ $endif
$if(IncrementalLevelRegion) $if(IncrementalLevelRegion)
$if(#isRegionRoot) $if(#isRegionRoot)
if (state().IN_COMPUTATION > 0 && child != null) { if (state().IN_COMPUTATION > 0 && child != null) {
child.handler().addDependant(handler); child.handler().addListener(handler);
} }
$endif $endif
$endif $endif
...@@ -356,7 +356,7 @@ $endif ...@@ -356,7 +356,7 @@ $endif
$if(IncrementalLevelRegion) $if(IncrementalLevelRegion)
$if(#isRegionRoot) $if(#isRegionRoot)
if (state().IN_COMPUTATION > 0 && child != null) { if (state().IN_COMPUTATION > 0 && child != null) {
child.handler().addDependant(handler); child.handler().addListener(handler);
} }
$endif $endif
$endif $endif
...@@ -417,7 +417,7 @@ $if(IncrementalLevelRegion) ...@@ -417,7 +417,7 @@ $if(IncrementalLevelRegion)
$if(!IsStringToken) $if(!IsStringToken)
$if(!#isPrimitive) $if(!#isPrimitive)
if (token$(TypeInSignature)_$(Id) instanceof $ASTNode && token$(TypeInSignature)_$(Id).isRegionRoot()) { if (token$(TypeInSignature)_$(Id) instanceof $ASTNode && token$(TypeInSignature)_$(Id).isRegionRoot()) {
(($ASTNode) token$(TypeInSignature)_$(Id)).handler().addDependant(handler()); (($ASTNode) token$(TypeInSignature)_$(Id)).handler().addListener(handler());
} }
$endif $endif
$endif $endif
...@@ -506,7 +506,7 @@ $if(#getNTA) ...@@ -506,7 +506,7 @@ $if(#getNTA)
// Creating a dummy handler to collect dependencies // Creating a dummy handler to collect dependencies
$DDGNodeName newHandler = new $DDGNodeName(this); $DDGNodeName newHandler = new $DDGNodeName(this);
// Adding dependency to this region because it may be read during the computation // Adding dependency to this region because it may be read during the computation
handler.addDependant(newHandler); handler.addListener(newHandler);
state().enterAttrStoreEval(newHandler); state().enterAttrStoreEval(newHandler);
$else $else
$DDGNodeName tmpHandler = new $DDGNodeName(this); $DDGNodeName tmpHandler = new $DDGNodeName(this);
...@@ -543,7 +543,7 @@ $if(#getNTA) ...@@ -543,7 +543,7 @@ $if(#getNTA)
// Creating a dummy handler to collect dependencies // Creating a dummy handler to collect dependencies
$DDGNodeName newHandler = new $DDGNodeName(this); $DDGNodeName newHandler = new $DDGNodeName(this);
// Adding dep. to this region because it may be read during the computation // Adding dep. to this region because it may be read during the computation
handler.addDependant(newHandler); handler.addListener(newHandler);
state().enterAttrStoreEval(newHandler); state().enterAttrStoreEval(newHandler);
$else $else
state().enterAttrStoreEval(handler); state().enterAttrStoreEval(handler);
...@@ -592,8 +592,8 @@ state().IN_COMPUTATION--; ...@@ -592,8 +592,8 @@ state().IN_COMPUTATION--;
$if(#getNTA) $if(#getNTA)
if (#(signature)_value != null && #(signature)_value.isRegionRoot()) { if (#(signature)_value != null && #(signature)_value.isRegionRoot()) {
$DDGNodeName nodeHandler = handler(); $DDGNodeName nodeHandler = handler();
nodeHandler.addDependant(#(signature)_value.handler()); nodeHandler.addListener(#(signature)_value.handler());
#(signature)_value.handler().addDependant(nodeHandler); #(signature)_value.handler().addListener(nodeHandler);
} }
$endif $endif
$endif $endif
...@@ -634,8 +634,8 @@ state().IN_COMPUTATION--; ...@@ -634,8 +634,8 @@ state().IN_COMPUTATION--;
$if(#getNTA) $if(#getNTA)
if (#(signature)_value.isRegionRoot()) { if (#(signature)_value.isRegionRoot()) {
$DDGNodeName nodeHandler = handler(); $DDGNodeName nodeHandler = handler();
nodeHandler.addDependant(#(signature)_value.handler()); nodeHandler.addListener(#(signature)_value.handler());
#(signature)_value.handler().addDependant(nodeHandler); #(signature)_value.handler().addListener(nodeHandler);
} }
$endif $endif
$endif $endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment