aboutsummaryrefslogtreecommitdiff
path: root/src/jdk/nashorn/internal/ir/AccessNode.java
diff options
context:
space:
mode:
authorattila <none@none>2013-03-23 00:58:39 +0100
committerattila <none@none>2013-03-23 00:58:39 +0100
commitebc14e4a45a24a142e037257044489785adf14e4 (patch)
tree9d968c2ec16fcd5a78deb13d84b163ae107be4f6 /src/jdk/nashorn/internal/ir/AccessNode.java
parent41e989d90bb27a388391bc687caa6174f71b77a0 (diff)
8010652: Eliminate non-child references in Block/FunctionNode, and make few node types immutable
Reviewed-by: jlaskey, lagergren
Diffstat (limited to 'src/jdk/nashorn/internal/ir/AccessNode.java')
-rw-r--r--src/jdk/nashorn/internal/ir/AccessNode.java15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/jdk/nashorn/internal/ir/AccessNode.java b/src/jdk/nashorn/internal/ir/AccessNode.java
index 481e3855..b7b76684 100644
--- a/src/jdk/nashorn/internal/ir/AccessNode.java
+++ b/src/jdk/nashorn/internal/ir/AccessNode.java
@@ -36,7 +36,7 @@ import jdk.nashorn.internal.runtime.Source;
* IR representation of a property access (period operator.)
*
*/
-public class AccessNode extends BaseNode implements TypeOverride {
+public class AccessNode extends BaseNode implements TypeOverride<AccessNode> {
/** Property ident. */
private IdentNode property;
@@ -56,9 +56,7 @@ public class AccessNode extends BaseNode implements TypeOverride {
super(source, token, finish, base);
this.start = base.getStart();
- this.property = property;
-
- this.property.setIsPropertyName();
+ this.property = property.setIsPropertyName();
}
/**
@@ -106,10 +104,10 @@ public class AccessNode extends BaseNode implements TypeOverride {
*/
@Override
public Node accept(final NodeVisitor visitor) {
- if (visitor.enter(this) != null) {
+ if (visitor.enterAccessNode(this) != null) {
base = base.accept(visitor);
property = (IdentNode)property.accept(visitor);
- return visitor.leave(this);
+ return visitor.leaveAccessNode(this);
}
return this;
@@ -150,13 +148,14 @@ public class AccessNode extends BaseNode implements TypeOverride {
}
@Override
- public void setType(final Type type) {
+ public AccessNode setType(final Type type) {
if (DEBUG_FIELDS && !Type.areEquivalent(getSymbol().getSymbolType(), type)) {
ObjectClassGenerator.LOG.info(getClass().getName() + " " + this + " => " + type + " instead of " + getType());
}
- property.setType(type);
+ property = property.setType(type);
getSymbol().setTypeOverride(type); //always a temp so this is fine.
hasCallSiteType = true;
+ return this;
}
@Override