Revision: 7700
Author: [email protected]
Date: Wed Mar 10 15:24:26 2010
Log: Sort, format, misc tweaks.
Review by: [email protected]
http://code.google.com/p/google-web-toolkit/source/detail?r=7700
Modified:
/trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JGwtCreate.java
/trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JMethod.java
/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/CastNormalizer.java
/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/DeadCodeElimination.java
/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java
/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/Pruner.java
/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/TypeTightener.java
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JGwtCreate.java Tue Mar
9 10:54:56 2010
+++ /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JGwtCreate.java Wed Mar
10 15:24:26 2010
@@ -64,7 +64,6 @@
private final ArrayList<JExpression> instantiationExpressions;
private final List<JClassType> resultTypes;
-
private final JReferenceType sourceType;
/*
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JMethod.java Tue Mar 9
10:54:56 2010
+++ /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JMethod.java Wed Mar 10
15:24:26 2010
@@ -42,13 +42,13 @@
System.out.println("---------------------------");
System.out.println(code);
}
+
+ private List<JAnnotation> annotations = Lists.create();
/**
* Special serialization treatment.
*/
private transient JAbstractMethodBody body = null;
-
- private List<JAnnotation> annotations = Lists.create();
private final JDeclaredType enclosingType;
private final boolean isAbstract;
private boolean isFinal;
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/CastNormalizer.java Wed
Dec 9 09:10:40 2009
+++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/CastNormalizer.java Wed
Mar 10 15:24:26 2010
@@ -176,7 +176,6 @@
JTypeOracle typeOracle = program.typeOracle;
JType rhsType = x.getRhs().getType();
assert (rhsType instanceof JReferenceType);
- JReferenceType refRhsType = (JReferenceType) rhsType;
for (JArrayType arrayType : instantiatedArrayTypes) {
if (typeOracle.canTheoreticallyCast(arrayType, lhsArrayType)) {
=======================================
---
/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/DeadCodeElimination.java
Tue Mar 9 10:54:56 2010
+++
/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/DeadCodeElimination.java
Wed Mar 10 15:24:26 2010
@@ -84,8 +84,8 @@
* operations in favor of pure side effects.
*
* TODO(spoon): move more simplifications into methods like
- * {...@link #cast(JExpression, SourceInfo, JType, JExpression)
simplifyCast},
- * so that more simplifications can be made on a single pass through a
tree.
+ * {...@link #cast(JExpression, SourceInfo, JType, JExpression)
simplifyCast}, so
+ * that more simplifications can be made on a single pass through a tree.
*/
public class DeadCodeVisitor extends JModVisitor {
@@ -94,8 +94,8 @@
/**
* Expressions whose result does not matter. A parent node should add
any
* children whose result does not matter to this set during the
parent's
- * <code>visit()</code> method. It should then remove those children
- * during its own <code>endVisit()</code>.
+ * <code>visit()</code> method. It should then remove those children
during
+ * its own <code>endVisit()</code>.
*
* TODO: there's a latent bug here: some immutable nodes (such as
literals)
* can be multiply referenced in the AST. In theory, one reference to
that
@@ -1346,23 +1346,23 @@
}
/**
- * Simplify <code>exp == bool</code>, where <code>bool</code> is a
- * boolean literal.
+ * Simplify <code>exp == bool</code>, where <code>bool</code> is a
boolean
+ * literal.
*/
private void simplifyBooleanEq(JExpression exp, boolean bool, Context
ctx) {
if (bool) {
ctx.replaceMe(exp);
} else {
- ctx.replaceMe(new JPrefixOperation(exp.getSourceInfo(),
JUnaryOperator.NOT,
- exp));
+ ctx.replaceMe(new JPrefixOperation(exp.getSourceInfo(),
+ JUnaryOperator.NOT, exp));
}
}
/**
* Simplify <code>lhs == rhs</code>, where <code>lhs</code> and
* <code>rhs</code> are known to be boolean. If <code>negate</code> is
- * <code>true</code>, then treat it as <code>lhs != rhs</code> instead
- * of <code>lhs == rhs</code>. Assumes that the case where both sides
are
+ * <code>true</code>, then treat it as <code>lhs != rhs</code> instead
of
+ * <code>lhs == rhs</code>. Assumes that the case where both sides are
* literals has already been checked.
*/
private void simplifyBooleanEq(JExpression lhs, JExpression rhs,
@@ -1394,8 +1394,8 @@
}
/**
- * Simplify <code>lhs == rhs</code>. If <code>negate</code> is true,
- * then it's actually static evaluation of <code>lhs != rhs</code>.
+ * Simplify <code>lhs == rhs</code>. If <code>negate</code> is true,
then
+ * it's actually static evaluation of <code>lhs != rhs</code>.
*/
private void simplifyEq(JExpression lhs, JExpression rhs, Context ctx,
boolean negated) {
@@ -1459,8 +1459,7 @@
if (original != null) {
return original;
}
- return new JPrefixOperation(exp.getSourceInfo(), JUnaryOperator.NEG,
- exp);
+ return new JPrefixOperation(exp.getSourceInfo(), JUnaryOperator.NEG,
exp);
}
private boolean simplifySub(JExpression lhs, JExpression rhs, Context
ctx,
@@ -1478,8 +1477,8 @@
private void simplifyXor(JExpression lhs, JBooleanLiteral rhs, Context
ctx) {
if (rhs.getValue()) {
- ctx.replaceMe(new JPrefixOperation(lhs.getSourceInfo(),
JUnaryOperator.NOT,
- lhs));
+ ctx.replaceMe(new JPrefixOperation(lhs.getSourceInfo(),
+ JUnaryOperator.NOT, lhs));
} else {
ctx.replaceMe(lhs);
}
@@ -1587,6 +1586,7 @@
if (method.getName().endsWith("hashCode")) {
// This cannot be computed at compile time because our
implementation
// differs from the JRE.
+ // TODO: actually, I think it DOES match now, so we can remove
this?
return;
}
@@ -1683,9 +1683,9 @@
if (caseStatement.getExpr() != null) {
// Create an if statement equivalent to the single-case switch.
- JBinaryOperation compareOperation = new
JBinaryOperation(x.getSourceInfo(),
- program.getTypePrimitiveBoolean(), JBinaryOperator.EQ,
- x.getExpr(), caseStatement.getExpr());
+ JBinaryOperation compareOperation = new JBinaryOperation(
+ x.getSourceInfo(), program.getTypePrimitiveBoolean(),
+ JBinaryOperator.EQ, x.getExpr(), caseStatement.getExpr());
JBlock block = new JBlock(x.getSourceInfo());
block.addStmt(statement);
JIfStatement ifStatement = new JIfStatement(x.getSourceInfo(),
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java
Tue Mar 9 10:54:56 2010
+++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java
Wed Mar 10 15:24:26 2010
@@ -2496,7 +2496,6 @@
return variable;
}
- @SuppressWarnings("unchecked")
private void processAnnotationProperties(SourceInfo sourceInfo,
JAnnotation annotation, ElementValuePair[] elementValuePairs) {
if (elementValuePairs == null) {
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/Pruner.java Tue Sep 8
09:08:10 2009
+++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/Pruner.java Wed Mar 10
15:24:26 2010
@@ -140,25 +140,6 @@
ctx.replaceMe(fieldRef);
}
}
-
- @Override
- public void endVisit(JNameOf x, Context ctx) {
- HasName node = x.getNode();
- boolean pruned;
- if (node instanceof JField) {
- pruned = isPruned((JField) node);
- } else if (node instanceof JMethod) {
- pruned = isPruned((JMethod) node);
- } else if (node instanceof JReferenceType) {
- pruned = !program.typeOracle.isInstantiatedType((JReferenceType)
node);
- } else {
- throw new InternalCompilerException("Unhandled JNameOf node: " +
node);
- }
-
- if (pruned) {
- ctx.replaceMe(program.getLiteralNull());
- }
- }
@Override
public void endVisit(JMethod x, Context ctx) {
@@ -225,6 +206,25 @@
ctx.replaceMe(newCall);
}
}
+
+ @Override
+ public void endVisit(JNameOf x, Context ctx) {
+ HasName node = x.getNode();
+ boolean pruned;
+ if (node instanceof JField) {
+ pruned = isPruned((JField) node);
+ } else if (node instanceof JMethod) {
+ pruned = isPruned((JMethod) node);
+ } else if (node instanceof JReferenceType) {
+ pruned = !program.typeOracle.isInstantiatedType((JReferenceType)
node);
+ } else {
+ throw new InternalCompilerException("Unhandled JNameOf node: " +
node);
+ }
+
+ if (pruned) {
+ ctx.replaceMe(program.getLiteralNull());
+ }
+ }
@Override
public void endVisit(JsniFieldRef x, Context ctx) {
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/TypeTightener.java Mon
Mar 1 09:59:34 2010
+++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/TypeTightener.java Wed
Mar 10 15:24:26 2010
@@ -369,8 +369,8 @@
public class TightenTypesVisitor extends JModVisitor {
/**
- * <code>true</code> if this visitor has changed the AST apart from
calls
- * to Context.
+ * <code>true</code> if this visitor has changed the AST apart from
calls to
+ * Context.
*/
private boolean myDidChange = false;
@@ -391,7 +391,7 @@
if (toType == null) {
toType = (JReferenceType) x.getCastType();
}
- JReferenceType fromType = getSingleConcreteType(argType);
+ JReferenceType fromType = getSingleConcreteType(argType);
if (fromType == null) {
fromType = (JReferenceType) argType;
}
@@ -475,7 +475,7 @@
if (toType == null) {
toType = x.getTestType();
}
- JReferenceType fromType = getSingleConcreteType(argType);
+ JReferenceType fromType = getSingleConcreteType(argType);
if (fromType == null) {
fromType = (JReferenceType) argType;
}
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors