[gwt-contrib] [google-web-toolkit commit] r5469 - Update branch-info.txt to record merge of 5466, 5467.
Author: b...@google.com Date: Sun May 24 18:38:38 2009 New Revision: 5469 Modified: branches/snapshot-2009.05.12-r5406/branch-info.txt Log: Update branch-info.txt to record merge of 5466, 5467. Modified: branches/snapshot-2009.05.12-r5406/branch-info.txt == --- branches/snapshot-2009.05.12-r5406/branch-info.txt (original) +++ branches/snapshot-2009.05.12-r5406/branch-info.txt Sun May 24 18:38:38 2009 @@ -10,3 +10,6 @@ /trunk c5460 was merged (r5463) into this branch (radio button fix) /trunk c5450 was merged into this branch svn merge -c5450 https://google-web-toolkit.googlecode.com/svn/trunk . +/trunk c5466,5467 were merged (r5468) into this branch + svn merge -c5466,5467 http://google-web-toolkit.googlecode.com/svn/trunk/ + --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r5468 - Merge SingleJso fixes into 2009.5.12 snapshot.
Author: b...@google.com Date: Sun May 24 18:37:00 2009 New Revision: 5468 Added: branches/snapshot-2009.05.12-r5406/user/test/com/google/gwt/dev/jjs/test/singlejso/ - copied from r5466, /trunk/user/test/com/google/gwt/dev/jjs/test/singlejso/ branches/snapshot-2009.05.12-r5406/user/test/com/google/gwt/dev/jjs/test/singlejso/A.java - copied unchanged from r5466, /trunk/user/test/com/google/gwt/dev/jjs/test/singlejso/A.java branches/snapshot-2009.05.12-r5406/user/test/com/google/gwt/dev/jjs/test/singlejso/B1.java - copied unchanged from r5466, /trunk/user/test/com/google/gwt/dev/jjs/test/singlejso/B1.java branches/snapshot-2009.05.12-r5406/user/test/com/google/gwt/dev/jjs/test/singlejso/B2.java - copied unchanged from r5466, /trunk/user/test/com/google/gwt/dev/jjs/test/singlejso/B2.java branches/snapshot-2009.05.12-r5406/user/test/com/google/gwt/dev/jjs/test/singlejso/IA.java - copied unchanged from r5466, /trunk/user/test/com/google/gwt/dev/jjs/test/singlejso/IA.java branches/snapshot-2009.05.12-r5406/user/test/com/google/gwt/dev/jjs/test/singlejso/IB.java - copied unchanged from r5466, /trunk/user/test/com/google/gwt/dev/jjs/test/singlejso/IB.java branches/snapshot-2009.05.12-r5406/user/test/com/google/gwt/dev/jjs/test/singlejso/TypeHierarchyTest.java - copied unchanged from r5466, /trunk/user/test/com/google/gwt/dev/jjs/test/singlejso/TypeHierarchyTest.java Modified: branches/snapshot-2009.05.12-r5406/ (props changed) branches/snapshot-2009.05.12-r5406/dev/core/src/com/google/gwt/core/ext/ServletContainer.java (props changed) branches/snapshot-2009.05.12-r5406/dev/core/src/com/google/gwt/core/ext/ServletContainerLauncher.java (props changed) branches/snapshot-2009.05.12-r5406/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java branches/snapshot-2009.05.12-r5406/dev/core/src/com/google/gwt/dev/jjs/impl/CastNormalizer.java branches/snapshot-2009.05.12-r5406/dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java branches/snapshot-2009.05.12-r5406/dev/core/src/com/google/gwt/dev/shell/CompilingClassLoader.java branches/snapshot-2009.05.12-r5406/dev/core/src/com/google/gwt/dev/shell/rewrite/HostedModeClassRewriter.java branches/snapshot-2009.05.12-r5406/dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteSingleJsoImplDispatches.java (contents, props changed) branches/snapshot-2009.05.12-r5406/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerDisableAggressiveOptimization.java (props changed) branches/snapshot-2009.05.12-r5406/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerEnableAssertions.java (props changed) branches/snapshot-2009.05.12-r5406/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerOutDir.java (props changed) branches/snapshot-2009.05.12-r5406/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerWorkDirOptional.java (props changed) branches/snapshot-2009.05.12-r5406/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerWorkDirRequired.java (props changed) branches/snapshot-2009.05.12-r5406/distro-source/linux/src/webAppCreator (props changed) branches/snapshot-2009.05.12-r5406/distro-source/mac/src/webAppCreator (props changed) branches/snapshot-2009.05.12-r5406/distro-source/windows/src/webAppCreator.cmd (props changed) branches/snapshot-2009.05.12-r5406/eclipse/samples/Hello/Hello-gwtc.launch (props changed) branches/snapshot-2009.05.12-r5406/samples/dynatable/war/DynaTable.css (props changed) branches/snapshot-2009.05.12-r5406/samples/dynatable/war/DynaTable.html (props changed) branches/snapshot-2009.05.12-r5406/samples/hello/war/Hello.html (props changed) branches/snapshot-2009.05.12-r5406/samples/i18n/war/I18N.css (props changed) branches/snapshot-2009.05.12-r5406/samples/i18n/war/I18N.html (props changed) branches/snapshot-2009.05.12-r5406/samples/json/war/JSON.css (props changed) branches/snapshot-2009.05.12-r5406/samples/json/war/JSON.html (props changed) branches/snapshot-2009.05.12-r5406/samples/mail/war/Mail.css (props changed) branches/snapshot-2009.05.12-r5406/samples/mail/war/Mail.html (props changed) branches/snapshot-2009.05.12-r5406/samples/mail/war/gradient.gif (props changed) branches/snapshot-2009.05.12-r5406/samples/mail/war/leftCorner.gif (props changed) branches/snapshot-2009.05.12-r5406/samples/mail/war/rightCorner.gif (props changed) branches/snapshot-2009.05.12-r5406/samples/showcase/war/Showcase.html (props changed) branches/snapshot-2009.05.12-r5406/samples/simplerpc/war/SimpleRPC.css (props changed) branches/snapshot-2009.05.12-r5406/samples/simplerpc/war/SimpleRPC.html (props changed) branches/snapshot-2009.05.12-r5406/samples/simplexml/war/SimpleXML.css (pr
[gwt-contrib] [google-web-toolkit commit] r5467 - Additional SingleJso fixes for tag interfaces.
Author: b...@google.com Date: Sun May 24 16:56:31 2009 New Revision: 5467 Modified: trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java trunk/dev/core/src/com/google/gwt/dev/jjs/impl/CastNormalizer.java trunk/user/test/com/google/gwt/dev/jjs/test/SingleJsoImplTest.java Log: Additional SingleJso fixes for tag interfaces. Also changes how CastNormalizer selects Cast / instanceof methods for SingleJso types. Patch by: bobv Review by: spoon (TBR) Verified by: macpherson Modified: trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java == --- trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java (original) +++ trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java Sun May 24 16:56:31 2009 @@ -692,7 +692,15 @@ assert intr.getMethods().size() == 0 || intr.getMethods().get(0).getName().equals("$clinit"); jsoSingleImpls.put(intr, program.getJavaScriptObject()); + + /* + * Pretend JSO had always implemented the tag interface. This helps + * simplify cast operations. + */ jsoType.addImplements(intr); + add(couldBeImplementedMap, intr, jsoType); + add(isImplementedMap, intr, jsoType); + add(implementsMap, jsoType, intr); continue; } Modified: trunk/dev/core/src/com/google/gwt/dev/jjs/impl/CastNormalizer.java == --- trunk/dev/core/src/com/google/gwt/dev/jjs/impl/CastNormalizer.java (original) +++ trunk/dev/core/src/com/google/gwt/dev/jjs/impl/CastNormalizer.java Sun May 24 16:56:31 2009 @@ -27,7 +27,6 @@ import com.google.gwt.dev.jjs.ast.JExpression; import com.google.gwt.dev.jjs.ast.JInstanceOf; import com.google.gwt.dev.jjs.ast.JIntLiteral; -import com.google.gwt.dev.jjs.ast.JInterfaceType; import com.google.gwt.dev.jjs.ast.JMethod; import com.google.gwt.dev.jjs.ast.JMethodCall; import com.google.gwt.dev.jjs.ast.JModVisitor; @@ -412,12 +411,6 @@ */ private class ReplaceTypeChecksVisitor extends JModVisitor { -private final Set dualImpls; - -public ReplaceTypeChecksVisitor(JProgram program) { - dualImpls = program.typeOracle.getInterfacesWithJavaAndJsoImpls(); -} - @Override public void endVisit(JCastOperation x, Context ctx) { JExpression replaceExpr; @@ -455,10 +448,10 @@ JMethod method; boolean isJsoCast = program.isJavaScriptObject(toType); if (isJsoCast) { -// A cast to JSO +// A cast to a concrete JSO subtype method = program.getIndexedMethod("Cast.dynamicCastJso"); - } else if (dualImpls.contains(toType)) { -// A cast that may succeed when the object is a JSO + } else if (program.typeOracle.getSingleJsoImpls().containsKey(toType)) { +// An interface that should succeed when the object is a JSO method = program.getIndexedMethod("Cast.dynamicCastAllowJso"); } else { // A regular cast @@ -569,11 +562,12 @@ ctx.replaceMe(eq); } else { JMethod method; -boolean isJsoCast = program.isJavaScriptObject(toType); -if (isJsoCast) { - method = program.getIndexedMethod("Cast.instanceOfJso"); -} else if (dualImpls.contains(toType)) { +boolean isJsoCast = false; +if (program.typeOracle.getSingleJsoImpls().containsKey(toType)) { method = program.getIndexedMethod("Cast.instanceOfOrJso"); +} else if (program.isJavaScriptObject(toType)) { + isJsoCast = true; + method = program.getIndexedMethod("Cast.instanceOfJso"); } else { method = program.getIndexedMethod("Cast.instanceOf"); } @@ -618,7 +612,7 @@ assigner.computeTypeIds(); } { - ReplaceTypeChecksVisitor replacer = new ReplaceTypeChecksVisitor(program); + ReplaceTypeChecksVisitor replacer = new ReplaceTypeChecksVisitor(); replacer.accept(program); } } Modified: trunk/user/test/com/google/gwt/dev/jjs/test/SingleJsoImplTest.java == --- trunk/user/test/com/google/gwt/dev/jjs/test/SingleJsoImplTest.java (original) +++ trunk/user/test/com/google/gwt/dev/jjs/test/SingleJsoImplTest.java Sun May 24 16:56:31 2009 @@ -70,6 +70,13 @@ String foo(); } + interface CreatedWithCastToTag { + } + + interface CreatedWithCastToTagSub extends CreatedWithCastToTag { +String foo(); + } + interface Divider extends Multiplier { int divide(int a, int b); } @@ -94,6 +101,12 @@ } } + static class JavaCreatedWithCastToTag implements CreatedWithCastToTagSub { +public String foo() { + return "foo"; +
[gwt-contrib] Re: Comment on UsingOOPHM in google-web-toolkit
Worked for me. Did you use the XPI or XPCOM one? On Sun, May 24, 2009 at 5:11 PM, wrote: > > Comment by henr...@yahoo.fr: > > The provided firefox plugin doesn't work for me (Linux x86_64). > > I had to build a new firefox plugin from SVN. > > > For more information: > http://code.google.com/p/google-web-toolkit/wiki/UsingOOPHM > > > > --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Comment on UsingOOPHM in google-web-toolkit
Comment by henr...@yahoo.fr: The provided firefox plugin doesn't work for me (Linux x86_64). I had to build a new firefox plugin from SVN. For more information: http://code.google.com/p/google-web-toolkit/wiki/UsingOOPHM --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] [google-web-toolkit commit] r5466 - This patch improves the correctness of SingleJso types by following all super-interfaces ...
Author: b...@google.com Date: Sun May 24 10:37:46 2009 New Revision: 5466 Added: trunk/user/test/com/google/gwt/dev/jjs/test/singlejso/ trunk/user/test/com/google/gwt/dev/jjs/test/singlejso/A.java (contents, props changed) trunk/user/test/com/google/gwt/dev/jjs/test/singlejso/B1.java (contents, props changed) trunk/user/test/com/google/gwt/dev/jjs/test/singlejso/B2.java (contents, props changed) trunk/user/test/com/google/gwt/dev/jjs/test/singlejso/IA.java (contents, props changed) trunk/user/test/com/google/gwt/dev/jjs/test/singlejso/IB.java (contents, props changed) trunk/user/test/com/google/gwt/dev/jjs/test/singlejso/TypeHierarchyTest.java (contents, props changed) Modified: trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java trunk/dev/core/src/com/google/gwt/dev/shell/CompilingClassLoader.java trunk/dev/core/src/com/google/gwt/dev/shell/rewrite/HostedModeClassRewriter.java trunk/dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteSingleJsoImplDispatches.java trunk/user/test/com/google/gwt/dev/jjs/CompilerSuite.java trunk/user/test/com/google/gwt/dev/jjs/test/SingleJsoImplTest.java Log: This patch improves the correctness of SingleJso types by following all super-interfaces when calculating singleJso data. Additionally, casts to singleJso interfaces will trigger a rescue of the concrete JSO type. Without these changes, singleJso types that are referred to only via cast operations would generate incorrect code at the cast site, as a Cast.throwClassCastExceptionUnlessNull() call would be made instead of a dynamicCastJso() as the compiler would decide there are no concrete implementations of the singleJso interface type. Patch by: bobv, mtsui Review by: spoon Reported by: macpherson, mtsui Modified: trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java == --- trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java (original) +++ trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java Sun May 24 10:37:46 2009 @@ -183,8 +183,8 @@ * * @param type any type * @param instantiatedTypes a set of types assumed to be instantiated. If - * null, then there are no assumptions about which - * types are instantiated. + * null, then there are no assumptions about which types + * are instantiated. * @return whether the type is instantiated */ private static boolean isInstantiatedType(JReferenceType type, @@ -536,6 +536,25 @@ } /** + * Computes the set of all interfaces implemented by a type. + */ + private Set allSuperInterfaces(JDeclaredType type) { +Set toReturn = new IdentityHashSet(); +List q = new LinkedList(); +q.addAll(type.getImplements()); + +while (!q.isEmpty()) { + JInterfaceType t = q.remove(0); + + if (toReturn.add(t)) { +q.addAll(t.getImplements()); + } +} + +return toReturn; + } + + /** * Compute all of the things I might conceivably implement, either through * super types or sub types. */ @@ -653,7 +672,7 @@ for (JDeclaredType type : program.getDeclaredTypes()) { if (!program.isJavaScriptObject(type)) { if (type instanceof JClassType) { - dualImpl.addAll(type.getImplements()); + dualImpl.addAll(allSuperInterfaces(type)); } continue; } Modified: trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java == --- trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java (original) +++ trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java Sun May 24 10:37:46 2009 @@ -175,7 +175,23 @@ JType targetType = x.getCastType(); if (program.isJavaScriptObject(targetType)) { rescue((JReferenceType) targetType, true, true); + } else { +/* + * If there's a cast to a SingleJso interface, rescue the implementing + * JSO type. If the JSO type isn't rescued (and there's no other regular + * Java type implementing the interface), then the cast operation will + * be replaced with a throwCCEUnlessNull() call, since there's no type + * left in the type system that implements the interface. If there is an + * implementing Java type, then a dynamicCast() will be emitted which + * will throw a CCE if it hits a JSO type. + */ +JClassType maybeSingleJso = program.typeOracle.getSingleJsoImpls().get( +targetType); +if (maybeSingleJso != null) { + rescue(maybeSingleJso, true, true); +} } + return true; }