nice-commit Mailing List for The Nice Programming Language (Page 46)
Brought to you by:
bonniot
You can subscribe to this list here.
2003 |
Jan
|
Feb
(60) |
Mar
(125) |
Apr
(183) |
May
(140) |
Jun
(227) |
Jul
(141) |
Aug
(181) |
Sep
(75) |
Oct
(89) |
Nov
(187) |
Dec
(162) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(69) |
Feb
(197) |
Mar
(98) |
Apr
(26) |
May
(10) |
Jun
(85) |
Jul
(88) |
Aug
(79) |
Sep
(80) |
Oct
(81) |
Nov
(53) |
Dec
(109) |
2005 |
Jan
(68) |
Feb
(77) |
Mar
(232) |
Apr
(79) |
May
(37) |
Jun
(37) |
Jul
(3) |
Aug
(18) |
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
(10) |
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(9) |
2007 |
Jan
(2) |
Feb
(8) |
Mar
(2) |
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
|
Oct
|
Nov
(17) |
Dec
(6) |
2008 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Daniel B. <bo...@us...> - 2004-06-26 10:41:29
|
Update of /cvsroot/nice/Nice/distrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24529/distrib Modified Files: Makefile Log Message: Updated to use cvs.sourceforge.net Index: Makefile =================================================================== RCS file: /cvsroot/nice/Nice/distrib/Makefile,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Makefile 21 Feb 2004 12:35:28 -0000 1.16 --- Makefile 26 Jun 2004 10:41:20 -0000 1.17 *************** *** 22,26 **** RPMFILE = Nice-${VERSION}-1.noarch.rpm ! CVSROOT=:pserver:ano...@cv...:/cvsroot/nice DOWNLOADROOT = http://prdownloads.sourceforge.net/nice --- 22,26 ---- RPMFILE = Nice-${VERSION}-1.noarch.rpm ! CVSROOT=:pserver:ano...@cv...:/cvsroot/nice DOWNLOADROOT = http://prdownloads.sourceforge.net/nice |
From: Daniel B. <bo...@us...> - 2004-06-25 12:53:47
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11281/stdlib/nice/lang Modified Files: source-lines.nice Log Message: Handle the cases where files appear after the lines, and also where the line numebr is not found even though there is a SMAP. Index: source-lines.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/source-lines.nice,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** source-lines.nice 25 Jun 2004 11:23:29 -0000 1.5 --- source-lines.nice 25 Jun 2004 12:53:35 -0000 1.6 *************** *** 145,152 **** stream.readFully(value); return new String(value, "UTF-8"); - - // Skip the two higher-order bytes. Problematic for large source maps? - //let dummy = stream.readUnsignedShort(); - //return stream.readUTF(); } --- 145,148 ---- *************** *** 213,217 **** var resultLine = 0; ! var resultId = 1; let r = new BufferedReader(new StringReader(map)); --- 209,213 ---- var resultLine = 0; ! var resultId = -1; let r = new BufferedReader(new StringReader(map)); *************** *** 282,286 **** resultId = id; ! if (files.get(id) != null) return (notNull(files.get(id)), resultLine); } --- 278,283 ---- resultId = id; ! // If we already know the file, we know everything we want. ! if (files.size() > id && files.get(id) != null) return (notNull(files.get(id)), resultLine); } *************** *** 294,297 **** --- 291,297 ---- } while (true); + if (resultId == -1) + return null; + return (notNull(files.get(resultId)), resultLine); } |
From: Daniel B. <bo...@us...> - 2004-06-25 11:23:38
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24710/stdlib/nice/lang Modified Files: source-lines.nice Log Message: Be extra-robust about printing a stack trace, since we don't want to mask the original trace. Index: source-lines.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/source-lines.nice,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** source-lines.nice 16 Feb 2004 15:54:26 -0000 1.4 --- source-lines.nice 25 Jun 2004 11:23:29 -0000 1.5 *************** *** 57,60 **** --- 57,68 ---- Use a JVM version 1.4 or later to get the correct line numbers."""); } + catch (Exception e) { + // We failed to print the source info for Nice, but we should + // at least print the original stack. + t.printStackTrace(w); + + w.println("\nError while computing Nice line numbers:"); + e.printStackTrace(w); + } } |
From: Daniel B. <bo...@us...> - 2004-06-24 14:02:54
|
Update of /cvsroot/nice/Nice/testsuite/compiler/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21194/testsuite/compiler/syntax Modified Files: expressions.testsuite Log Message: Moved string tests to the strings testsuite. Index: expressions.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/syntax/expressions.testsuite,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** expressions.testsuite 17 Dec 2003 14:33:39 -0000 1.6 --- expressions.testsuite 24 Jun 2004 14:02:42 -0000 1.7 *************** *** 21,31 **** /// TOPLEVEL String->String->void f4(String x) = String y => String z => {}; - - /// PASS - assert """abc - def\nghi - xyz""".equals("abc\n def\nghi\n xyz"); - - /// PASS - String x = """ " """; - assert x.equals(" \" "); --- 21,22 ---- |
From: Daniel B. <bo...@us...> - 2004-06-24 14:01:46
|
Update of /cvsroot/nice/Nice/testsuite/compiler/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20906/testsuite/compiler/syntax Modified Files: strings.testsuite Log Message: Prevent collapsing consecutive multiline string litterals into one. Index: strings.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/syntax/strings.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** strings.testsuite 21 Nov 2003 16:05:13 -0000 1.1 --- strings.testsuite 24 Jun 2004 14:01:28 -0000 1.2 *************** *** 10,11 **** --- 10,31 ---- s = "l has length " l.size; assert s.equals("l has length 0"); + + /// PASS + assert """abc + def\nghi + xyz""".equals("abc\n def\nghi\n xyz"); + + /// PASS + String x = """ " """; + assert x.equals(" \" "); + + /// PASS + boolean ok = false; + String s1 = """ + 1 + """; + ok = true; + String s2 = """ + 2 + """; + assert ok; |
From: Daniel B. <bo...@us...> - 2004-06-24 14:01:46
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20906/src/bossa/parser Modified Files: Parser.jj Log Message: Prevent collapsing consecutive multiline string litterals into one. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.244 retrieving revision 1.245 diff -C2 -d -r1.244 -r1.245 *** Parser.jj 3 Mar 2004 15:00:33 -0000 1.244 --- Parser.jj 24 Jun 2004 14:01:29 -0000 1.245 *************** *** 291,295 **** < MULTILINESTRING: "\"" "\"" "\"" ! ( (~["\\"]) | ("\\" ( ["n","t","b","r","f","\\","'","\""] --- 291,295 ---- < MULTILINESTRING: "\"" "\"" "\"" ! ( (~["\"","\\"]) | ("\\" ( ["n","t","b","r","f","\\","'","\""] *************** *** 298,305 **** ) ) ! | ( ["\n","\r"] ) )* "\"" "\"" "\"" ! > | < LSTRING: --- 298,305 ---- ) ) ! | "\"" ~["\""] )* "\"" "\"" "\"" ! > | < LSTRING: |
From: Daniel B. <bo...@us...> - 2004-06-24 12:14:57
|
Update of /cvsroot/nice/eclipse In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv784 Modified Files: build.xml Log Message: Use reverseLoader to make sure the referenced Nice compiler is used to compile the plugin, not the (possibly older) one installed on the system. Do not reference eclipse plugin using eclipse version, since there are always mismatches (e.g. a 2.1.1 plugin in a 2.1.2 build). Index: build.xml =================================================================== RCS file: /cvsroot/nice/eclipse/build.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** build.xml 11 Nov 2003 14:17:06 -0000 1.12 --- build.xml 24 Jun 2004 12:14:47 -0000 1.13 *************** *** 19,23 **** <project default="dist" basedir="."> ! <property name="plugin.version" value="0.1.11"/> --- 19,23 ---- <project default="dist" basedir="."> ! <property name="plugin.version" value="0.9.8"/> *************** *** 68,72 **** <taskdef name="nicec" classname="nice.tools.ant.Nicec" ! classpathref="classpath"/> </target> --- 68,72 ---- <taskdef name="nicec" classname="nice.tools.ant.Nicec" ! classpathref="classpath" reverseLoader="true"/> </target> *************** *** 130,135 **** jar="${build.dir}/${plugin.jar}"> <classpath> ! <pathelement location="${eclipse.home}/plugins/org.eclipse.core.resources_${eclipse.version}/resources.jar"/> ! <pathelement location="${eclipse.home}/plugins/org.eclipse.ui_${eclipse.version}/ui.jar"/> <fileset dir="${eclipse.home}/plugins"> <include name="org.eclipse.swt*/**/*.jar"/> --- 130,134 ---- jar="${build.dir}/${plugin.jar}"> <classpath> ! <pathelement location="${eclipse.home}/plugins/"/> <fileset dir="${eclipse.home}/plugins"> <include name="org.eclipse.swt*/**/*.jar"/> *************** *** 139,147 **** <include name="org.eclipse.ui.workbench.texteditor*/**/texteditor.jar"/> <include name="org.eclipse.ui.editors*/**/editors.jar"/> </fileset> - <pathelement location="${eclipse.home}/plugins/org.eclipse.jface_${eclipse.version}/jface.jar"/> - <pathelement location="${eclipse.home}/plugins/org.eclipse.ui.workbench_${eclipse.version}/workbench.jar"/> - <pathelement location="${eclipse.home}/plugins/org.eclipse.debug.ui_${eclipse.version}/dtui.jar"/> - <pathelement location="${eclipse.home}/plugins/org.eclipse.core.runtime_${eclipse.version}/runtime.jar"/> </classpath> </nicec> --- 138,148 ---- <include name="org.eclipse.ui.workbench.texteditor*/**/texteditor.jar"/> <include name="org.eclipse.ui.editors*/**/editors.jar"/> + <include name="org.eclipse.core.resources_*/resources.jar"/> + <include name="org.eclipse.ui_*/ui.jar"/> + <include name="org.eclipse.core.runtime_*/runtime.jar"/> + <include name="org.eclipse.ui.workbench_*/workbench.jar"/> + <include name="org.eclipse.jface_*/jface.jar"/> + <include name="org.eclipse.debug.ui_*/dtui.jar"/> </fileset> </classpath> </nicec> |
From: Daniel B. <bo...@us...> - 2004-06-24 08:11:20
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20546/src/bossa/syntax Modified Files: MethodDeclaration.java FormalParameters.java Log Message: In compiled packages, only call typecheck on parameters when they have default values, to save on loading time. Index: FormalParameters.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/FormalParameters.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** FormalParameters.java 23 Jun 2004 19:38:09 -0000 1.39 --- FormalParameters.java 24 Jun 2004 08:11:10 -0000 1.40 *************** *** 317,320 **** --- 317,329 ---- } + boolean hasDefaultValue() + { + for (int i = size; --i>=0; ) + if (parameters[i].value() != null) + return true; + + return false; + } + /**************************************************************** * Walk methods, used in NiceMethod.create Index: MethodDeclaration.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodDeclaration.java,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** MethodDeclaration.java 23 Jun 2004 19:38:09 -0000 1.60 --- MethodDeclaration.java 24 Jun 2004 08:11:09 -0000 1.61 *************** *** 133,137 **** ****************************************************************/ ! /** This is called in a pass before typechecking itself. This is important, to typecheck and disambiguate the default values --- 133,137 ---- ****************************************************************/ ! /** This is called in a pass before typechecking itself. This is important, to typecheck and disambiguate the default values *************** *** 140,143 **** --- 140,146 ---- void typedResolve() { + if (module.interfaceFile() && ! parameters.hasDefaultValue()) + return; + if (!Constraint.hasBinders(type.getConstraint())) { |
From: Daniel B. <bo...@us...> - 2004-06-23 21:27:55
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5508/src/bossa/syntax Modified Files: OverloadedSymbolExp.java Log Message: Minor: remove debugging statement. Index: OverloadedSymbolExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/OverloadedSymbolExp.java,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** OverloadedSymbolExp.java 23 Jun 2004 19:38:09 -0000 1.70 --- OverloadedSymbolExp.java 23 Jun 2004 21:27:46 -0000 1.71 *************** *** 238,242 **** if (usedArguments != null && usedArguments[i] == 0) { - System.out.println("Fixing " + i); if (domain == null) { --- 238,241 ---- |
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15202/src/bossa/syntax Modified Files: VarSymbol.java PolySymbol.java OverloadedSymbolExp.java MonoSymbol.java MethodDeclaration.java FormalParameters.java CallExp.java Log Message: Fix method default values using type parameters, in compiled packages. Index: OverloadedSymbolExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/OverloadedSymbolExp.java,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** OverloadedSymbolExp.java 10 Jun 2004 13:40:27 -0000 1.69 --- OverloadedSymbolExp.java 23 Jun 2004 19:38:09 -0000 1.70 *************** *** 151,157 **** Debug.println("Overloading: Trying with "+s); - Polytype[] argsType = - Expression.getType(arguments.getExpressions(s)); - // we clone the type to avoid clashes with another use // of the same symbol --- 151,154 ---- *************** *** 159,163 **** // and we check that cloneType() is not called twice // before the clone type is released ! s.makeClonedType(argsType, arguments.getUsedArguments(s)); Polytype t = CallExp.wellTyped(s.getClonedType(), argsType); --- 156,165 ---- // and we check that cloneType() is not called twice // before the clone type is released ! s.makeClonedType(); ! ! Polytype[] argsType = ! computeArgsType(arguments.getExpressions(s), ! s.getClonedType(), arguments.getUsedArguments(s)); ! Polytype t = CallExp.wellTyped(s.getClonedType(), argsType); *************** *** 202,209 **** VarSymbol res = (VarSymbol) symbols.get(0); // store the formal argument types for later use together with the type ! callExp.argTypes = nice.tools.typing.Types.parameters(res.getClonedType()); res.releaseClonedType(); - callExp.type = (Polytype) arguments.types.get(res); // store the expression (including default arguments) callExp.arguments.computedExpressions = arguments.getExpressions(res); --- 204,211 ---- VarSymbol res = (VarSymbol) symbols.get(0); // store the formal argument types for later use together with the type ! callExp.setComputedType((Polytype) arguments.types.get(res), ! nice.tools.typing.Types.parameters(res.getClonedType())); res.releaseClonedType(); // store the expression (including default arguments) callExp.arguments.computedExpressions = arguments.getExpressions(res); *************** *** 216,219 **** --- 218,256 ---- } + private Polytype[] computeArgsType(Expression[] args, + Polytype functionType, + int[] usedArguments) + { + Polytype[] res = new Polytype[args.length]; + + mlsub.typing.Monotype[] domain = null; + + /* Where a default value was used, use the declared argument type instead + of the value's type. This is more robust, as the application type will + not depend on the default value. + Furthermore, this avoids running into problems when the default value + refers to type parameters (in anonymous functions, by refering to + previous arguments, ...) which would not be in sync with the cloned + ones. + This is only needed when the type is polymorphic. + */ + for (int i = 0; i < res.length; i++) + if (usedArguments != null && usedArguments[i] == 0) + { + System.out.println("Fixing " + i); + if (domain == null) + { + mlsub.typing.Monotype fun = Types.rawType(functionType.getMonotype()); + domain = ((mlsub.typing.FunType) fun).domain(); + } + + res[i] = new Polytype(domain[i]); + } + else + res[i] = args[i].getType(); + + return res; + } + Expression resolveOverloading(Polytype expectedType) { *************** *** 232,236 **** { VarSymbol s = (VarSymbol) i.next(); ! s.makeClonedType(null, null); try{ Typing.leq(s.getClonedType(), expectedType); --- 269,273 ---- { VarSymbol s = (VarSymbol) i.next(); ! s.makeClonedType(); try{ Typing.leq(s.getClonedType(), expectedType); Index: CallExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/CallExp.java,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** CallExp.java 23 Mar 2004 20:28:43 -0000 1.93 --- CallExp.java 23 Jun 2004 19:38:09 -0000 1.94 *************** *** 276,291 **** // no default arguments { ! type = getTypeAndReportErrors(location(), function, ! arguments.inOrder()); arguments.computedExpressions = arguments.inOrder(); } if (! type.isMonomorphic() && argTypes != null) { ! /* We construct the instantiated version of the function type: ! the type of the function, constrained by the actual arguments. ! Then we simplify it. ! It is useful to constrain the arguments to have the expected bytecode types. */ --- 276,301 ---- // no default arguments { ! setComputedType(getTypeAndReportErrors(location(), function, ! arguments.inOrder()), ! null); arguments.computedExpressions = arguments.inOrder(); } + } + + /** @param argTypes + The types of the formal arguments of the function, in the same + polymorphic instance as the computed type. + */ + void setComputedType(Polytype type, Monotype[] argTypes) + { + this.type = type; if (! type.isMonomorphic() && argTypes != null) { ! /* We construct the instantiated version of the function type: ! the type of the function, constrained by the actual arguments. ! Then we simplify it. ! It is useful to constrain the arguments to have the expected bytecode types. */ *************** *** 300,309 **** if (! type.trySimplify()) User.warning(this, "This call might have a type error, or this might be a bug in the compiler. \nPlease contact bo...@us..."); - } ! /** The types of the formal arguments of the function, in the same ! polymorphic instance as the computed type. ! */ ! Monotype[] argTypes; /** The type of the function, constrained by the actual arguments. */ --- 310,315 ---- if (! type.trySimplify()) User.warning(this, "This call might have a type error, or this might be a bug in the compiler. \nPlease contact bo...@us..."); ! } /** The type of the function, constrained by the actual arguments. */ Index: MonoSymbol.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MonoSymbol.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** MonoSymbol.java 25 Feb 2004 11:23:29 -0000 1.29 --- MonoSymbol.java 23 Jun 2004 19:38:09 -0000 1.30 *************** *** 141,149 **** // explained in OverloadedSymbolExp ! final void makeClonedType(Polytype[] argTypes, int[] used) {} ! final void releaseClonedType() {} ! final Polytype getClonedType() { return getType(); --- 141,149 ---- // explained in OverloadedSymbolExp ! final void makeClonedType() {} ! final void releaseClonedType() {} ! final Polytype getClonedType() { return getType(); Index: PolySymbol.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/PolySymbol.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** PolySymbol.java 16 Jun 2004 20:59:34 -0000 1.19 --- PolySymbol.java 23 Jun 2004 19:38:09 -0000 1.20 *************** *** 70,102 **** private Polytype clonedType; ! ! final void makeClonedType(Polytype[] argTypes, int[] used) { if (clonedType != null) Internal.error(this, "clonedType in use"); - - clonedType = type.cloneType(); - - /* Where a default value was used, use the declared argument type instead - of the value's type. This is more robust, as the application type will - not depend on the default value. - Furthermore, this avoids running into problems when the default value - refers to type parameters (in anonymous functions, by refering to - previous arguments, ...) which would not be in sync with the cloned - ones. - This is only needed when the type is polymorphic. - */ - - if (clonedType == type || argTypes == null || used == null) - return; - - mlsub.typing.Monotype fun = Types.rawType(clonedType.getMonotype()); - mlsub.typing.Monotype[] domain = ((mlsub.typing.FunType) fun).domain(); ! for (int i = 0; i < argTypes.length; i++) ! if (used[i] == 0) ! argTypes[i] = new Polytype(domain[i]); } ! void releaseClonedType() { --- 70,82 ---- private Polytype clonedType; ! ! final void makeClonedType() { if (clonedType != null) Internal.error(this, "clonedType in use"); ! clonedType = type.cloneType(); } ! void releaseClonedType() { Index: FormalParameters.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/FormalParameters.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** FormalParameters.java 16 Jun 2004 14:56:14 -0000 1.38 --- FormalParameters.java 23 Jun 2004 19:38:09 -0000 1.39 *************** *** 210,215 **** } ! Expression value() ! { return defaultValue; } --- 210,215 ---- } ! Expression value() ! { return defaultValue; } *************** *** 229,233 **** { defaultValue = dispatch.analyse(defaultValue, scope, typeScope); - defaultValue = defaultValue.noOverloading(); super.resolve(scope, typeScope); } --- 229,232 ---- *************** *** 236,240 **** { defaultValue = dispatch.analyse(defaultValue, info); - defaultValue = defaultValue.noOverloading(); super.resolve(null, null); } --- 235,238 ---- Index: MethodDeclaration.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodDeclaration.java,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** MethodDeclaration.java 16 Jun 2004 21:03:49 -0000 1.59 --- MethodDeclaration.java 23 Jun 2004 19:38:09 -0000 1.60 *************** *** 140,148 **** void typedResolve() { - if (module.interfaceFile()) - return; - - Polytype type = getType(); - if (!Constraint.hasBinders(type.getConstraint())) { --- 140,143 ---- Index: VarSymbol.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/VarSymbol.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** VarSymbol.java 9 Dec 2003 15:21:05 -0000 1.36 --- VarSymbol.java 23 Jun 2004 19:38:09 -0000 1.37 *************** *** 117,126 **** // explained in OverloadedSymbolExp ! /** @param argTypes types of the arguments used in the call to this ! symbol. ! @param used default values were used at those indexes where ! the value in this array is 0. ! */ ! abstract void makeClonedType(Polytype[] argTypes, int[] used); abstract void releaseClonedType(); abstract Polytype getClonedType(); --- 117,121 ---- // explained in OverloadedSymbolExp ! abstract void makeClonedType(); abstract void releaseClonedType(); abstract Polytype getClonedType(); |
From: Daniel B. <bo...@us...> - 2004-06-23 19:38:18
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15202/testsuite/compiler/methods Modified Files: optionalParameters.testsuite Log Message: Fix method default values using type parameters, in compiled packages. Index: optionalParameters.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/methods/optionalParameters.testsuite,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** optionalParameters.testsuite 8 Aug 2003 19:16:31 -0000 1.8 --- optionalParameters.testsuite 23 Jun 2004 19:38:09 -0000 1.9 *************** *** 182,183 **** --- 182,215 ---- /// Toplevel int foo(int x = 0, int y = x + 1, int z = x) = z; + + /// PASS + // Default values using type parameters, in compiled packages + /// package a + /// Toplevel + + class A<T> { + int length() = 0; + } + + <T> void myslice(A<T> a, int to = a.length) {} + + /// package b import a + /// Toplevel + + <T> void foo(A<T> a) = myslice(a); + + /// PASS + // Default values using type parameters, in compiled packages + /// package a + /// Toplevel + + abstract class A<T> { + T get(); + } + + <T> void myslice(A<T> a, T to = a.get) {} + + /// package b import a + /// Toplevel + + <T> void foo(A<T> a) = myslice(a); |
From: Daniel B. <bo...@us...> - 2004-06-22 09:51:40
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8438/stdlib/nice/lang Modified Files: collections.nice Log Message: Do not refer to HashMap.Values, which is not a public class, but provide a default implementation of similarEmptyCollection that is valid for anonymous and invisible classes. Index: collections.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/collections.nice,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** collections.nice 26 May 2004 22:12:46 -0000 1.67 --- collections.nice 22 Jun 2004 09:51:24 -0000 1.68 *************** *** 152,156 **** similarEmptyCollection(c) { ! throw new Error("The method similarEmptyCollection is not yet implemented for " + c.getClass()); } --- 152,159 ---- similarEmptyCollection(c) { ! // This implementation is type-correct for any anonymous or ! // invisible (private) collection class (hence the cast). ! // It should be overriden for others. ! return cast(new ArrayList(c.size())); } *************** *** 165,170 **** similarEmptyCollection(c#HashSet) = new HashSet(c.size()); - similarEmptyCollection(c#HashMap.Values) = new ArrayList(c.size()); - /**************************************************************** * Sort --- 168,171 ---- |
From: Daniel B. <bo...@us...> - 2004-06-21 17:08:45
|
Update of /cvsroot/nice/Nice/src/nice/tools/code In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22779/src/nice/tools/code Modified Files: LiteralArrayProc.java Log Message: Better use of context information for compiling tuples (fixes #976723). Index: LiteralArrayProc.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/code/LiteralArrayProc.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** LiteralArrayProc.java 11 Feb 2004 12:46:39 -0000 1.7 --- LiteralArrayProc.java 21 Jun 2004 17:08:37 -0000 1.8 *************** *** 50,54 **** CodeAttr code = comp.getCode(); ! Type componentType = getComponentType(args); code.emitPushInt(nbElements); --- 50,54 ---- CodeAttr code = comp.getCode(); ! Type componentType = arrayType.getComponentType().getImplementationType(); code.emitPushInt(nbElements); *************** *** 57,63 **** // Set a special type, not the legacy array type. code.popType(); ! code.pushType(SpecialTypes.array(componentType)); - /* Optimization: --- 57,62 ---- // Set a special type, not the legacy array type. code.popType(); ! code.pushType(arrayType); /* Optimization: *************** *** 103,127 **** } - private Type getComponentType (Expression[] args) - { - Type type = Types.lowestUpperBound(args); - - if (type.isSubtype(arrayType.getComponentType())) - { - // We could precise that type of the array, but this is not - // necessary given the context, and it would even be bas for primitive - // types (byte[] will need conversion if int[] is expected). - // Just keep the original type. - type = arrayType.getComponentType(); - } - - if (type == Type.nullType) - // All we know is that this array will contain only null, and will be - // used generically. Let's make that Object. - type = Type.pointer_type; - - return type; - } - public Type getReturnType(Expression[] args) { --- 102,105 ---- *************** *** 129,133 **** return ClassType.make("java.util.List"); ! return SpecialTypes.array(getComponentType(args)); } --- 107,111 ---- return ClassType.make("java.util.List"); ! return arrayType; } |
From: Daniel B. <bo...@us...> - 2004-06-21 17:08:45
|
Update of /cvsroot/nice/Nice/testsuite/compiler/expressions/tuples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22779/testsuite/compiler/expressions/tuples Modified Files: compilation.testsuite Log Message: Better use of context information for compiling tuples (fixes #976723). Index: compilation.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/expressions/tuples/compilation.testsuite,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** compilation.testsuite 25 Nov 2003 19:22:58 -0000 1.8 --- compilation.testsuite 21 Jun 2004 17:08:26 -0000 1.9 *************** *** 49,50 **** --- 49,53 ---- /// Toplevel <T,U> (T,U) foo(T x, U y) = (x,y); + + /// PASS + (?int,?int) tup = (null, 3); |
From: Daniel B. <bo...@us...> - 2004-06-21 11:48:34
|
Update of /cvsroot/nice/Nice/src/nice/tools/code In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30391/src/nice/tools/code Modified Files: Gen.java Log Message: Optimize trivial ifs, so that no code is generated at all. Index: Gen.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/code/Gen.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Gen.java 13 Dec 2003 17:52:01 -0000 1.18 --- Gen.java 21 Jun 2004 11:48:24 -0000 1.19 *************** *** 69,72 **** --- 69,77 ---- public static Expression shortCircuitAnd(Expression value1, Expression value2) { + if (value1 == QuoteExp.trueExp) + return value2; + if (value2 == QuoteExp.trueExp) + return value1; + return Inline.inline(nice.lang.inline.ShortCircuitOp.create("&&"), value1, value2); |
From: Daniel B. <bo...@us...> - 2004-06-21 11:48:34
|
Update of /cvsroot/nice/Nice/src/gnu/expr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30391/src/gnu/expr Modified Files: SimpleIfExp.java Log Message: Optimize trivial ifs, so that no code is generated at all. Index: SimpleIfExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/SimpleIfExp.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SimpleIfExp.java 29 Mar 2003 00:30:30 -0000 1.1 --- SimpleIfExp.java 21 Jun 2004 11:48:25 -0000 1.2 *************** *** 17,20 **** --- 17,25 ---- public static Expression make(Expression i, Expression t, Expression e) { + if (i == QuoteExp.trueExp) + return t; + if (i == QuoteExp.falseExp) + return e; + return new SimpleIfExp(i, t, e); } |
From: Daniel B. <bo...@us...> - 2004-06-21 11:48:34
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30391 Modified Files: NEWS Log Message: Optimize trivial ifs, so that no code is generated at all. Index: NEWS =================================================================== RCS file: /cvsroot/nice/Nice/NEWS,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** NEWS 18 Jun 2004 13:16:30 -0000 1.35 --- NEWS 21 Jun 2004 11:48:25 -0000 1.36 *************** *** 18,21 **** --- 18,22 ---- java.io.ObjectOutputStream.flush() * Reduced compilation time and memory consumption. + * Smaller generated bytecode. * Fixed native compilation using gcj. It used to block when gcj produced too much output. |
From: Daniel B. <bo...@us...> - 2004-06-18 13:16:41
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31650 Modified Files: NEWS Log Message: Fixed native compilation using gcj. It used to block when gcj produced too much output. Index: NEWS =================================================================== RCS file: /cvsroot/nice/Nice/NEWS,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** NEWS 17 Jun 2004 10:41:14 -0000 1.34 --- NEWS 18 Jun 2004 13:16:30 -0000 1.35 *************** *** 18,21 **** --- 18,23 ---- java.io.ObjectOutputStream.flush() * Reduced compilation time and memory consumption. + * Fixed native compilation using gcj. It used to block when gcj produced + too much output. -- |
From: Daniel B. <bo...@us...> - 2004-06-18 13:16:41
|
Update of /cvsroot/nice/Nice/src/nice/tools/compiler In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31650/src/nice/tools/compiler Modified Files: native.nice Log Message: Fixed native compilation using gcj. It used to block when gcj produced too much output. Index: native.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/compiler/native.nice,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** native.nice 23 Jan 2004 13:00:23 -0000 1.6 --- native.nice 18 Jun 2004 13:16:30 -0000 1.7 *************** *** 43,53 **** "--main=" + pkg + ".fun", "-o", output, jar ]); ! p.waitFor(); ! if (p.exitValue() != 0) { fail(); ! // Print the content of stderr. ! let in = new BufferedReader(new InputStreamReader(p.getErrorStream())); try { for (?String line = in.readLine(); line != null; --- 43,54 ---- "--main=" + pkg + ".fun", "-o", output, jar ]); ! let CharArrayWriter output = new CharArrayWriter(); ! let exitValue = waitFor(p, output); ! if (exitValue != 0) { fail(); ! // Print the output of the process ! let in = new BufferedReader(new CharArrayReader(output.toCharArray)); try { for (?String line = in.readLine(); line != null; *************** *** 74,75 **** --- 75,104 ---- java.lang.System.out.println(); } + + int waitFor(Process p, Writer w) + { + let out = new BufferedReader(new InputStreamReader(p.getInputStream())); + let err = new BufferedReader(new InputStreamReader(p.getErrorStream())); + + let printer = new PrintWriter(w); + + while (true) + { + if (out.ready) + for (?String line = out.readLine(); line != null; + line = out.readLine()) + printer.println(line); + + if (err.ready) + for (?String line = err.readLine(); line != null; + line = err.readLine()) + printer.println(line); + + try { + return p.exitValue(); + } + catch(IllegalThreadStateException e) { + // The process is not finished yet. + } + } + } |
From: Daniel B. <bo...@us...> - 2004-06-17 12:15:59
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12952/src/bossa/syntax Modified Files: Node.java Log Message: Use less memory. Index: Node.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Node.java,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** Node.java 9 Dec 2003 15:21:05 -0000 1.59 --- Node.java 17 Jun 2004 12:15:50 -0000 1.60 *************** *** 35,39 **** this.propagate = propagate; } ! Node(List /* of Node */ children, int propagate) --- 35,39 ---- this.propagate = propagate; } ! Node(List /* of Node */ children, int propagate) *************** *** 53,65 **** } - void addFirstChild(Node n) - { - if (n==null) - Internal.error("null child in Node.addChild for node "+this); - - if (children == null) children=new ArrayList(); - children.add(0, n); - } - final Node child(Node n) { --- 53,56 ---- *************** *** 86,92 **** List addChildren(List c) { ! // OPTIM: do not allocate each time, but beware sharing an empty list ! // as some client might modify it. ! if(c==null) return new LinkedList(); for(Iterator i = c.iterator(); i.hasNext();) addChild((Node) i.next()); --- 77,83 ---- List addChildren(List c) { ! if (c == null) ! return Collections.EMPTY_LIST; ! for(Iterator i = c.iterator(); i.hasNext();) addChild((Node) i.next()); *************** *** 174,177 **** --- 165,171 ---- { case none: + this.scope = outer; + this.typeScope = typeOuter; + break; case down: this.scope = new VarScope(outer,varSymbols); |
From: Daniel B. <bo...@us...> - 2004-06-17 11:48:27
|
Update of /cvsroot/nice/Nice/src/gnu/expr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20740/src/gnu/expr Modified Files: ClassExp.java Log Message: Minor: removed debugging statement. Index: ClassExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/ClassExp.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ClassExp.java 11 Jun 2004 15:53:35 -0000 1.19 --- ClassExp.java 17 Jun 2004 11:48:17 -0000 1.20 *************** *** 264,268 **** else { - System.out.println(getName()); instanceType = type = new ClassType(getName()); type.setSuper(superType); --- 264,267 ---- |
From: Daniel B. <bo...@us...> - 2004-06-17 10:41:23
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26637/src/bossa/syntax Modified Files: NiceMethod.java Log Message: Explicitly mark which methods are overrides in compiled packages, and use that information to speed up the loading of compiled packages. Index: NiceMethod.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/NiceMethod.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** NiceMethod.java 16 Jun 2004 14:56:14 -0000 1.39 --- NiceMethod.java 17 Jun 2004 10:41:13 -0000 1.40 *************** *** 160,168 **** super.resolve(); ! homonyms = Node.getGlobalScope().lookup(getName()); ! if (homonyms.size() == 1) ! homonyms = null; ! else ! homonyms.remove(getSymbol()); } --- 160,174 ---- super.resolve(); ! // In interface files, we can assume that if the method overrides ! // any other known method, there is an explicit override keyword. ! // So we can avoid looking for specializations when there isn't one. ! if (isOverride || ! module.interfaceFile()) ! { ! homonyms = Node.getGlobalScope().lookup(getName()); ! if (homonyms.size() == 1) ! homonyms = null; ! else ! homonyms.remove(getSymbol()); ! } } *************** *** 234,237 **** --- 240,250 ---- continue; + // In a compiled package, we don't need checking. + if (module.interfaceFile()) + { + addSpecializedMethod(d); + continue; + } + if (! Types.covariantSpecialization(getType(), s.getType())) { *************** *** 258,266 **** } ! if (specializedMethods == null) ! specializedMethods = new ArrayList ! // Heuristic: the maximum number that might be needed ! (homonyms.size() - i.previousIndex()); ! specializedMethods.add(d); } --- 271,275 ---- } ! addSpecializedMethod(d); } *************** *** 268,271 **** --- 277,288 ---- } + private void addSpecializedMethod(MethodDeclaration method) + { + if (specializedMethods == null) + specializedMethods = new ArrayList(5); + + specializedMethods.add(method); + } + /**************************************************************** * Code generation *************** *** 298,301 **** --- 315,320 ---- public void printInterface(java.io.PrintWriter s) { + if (specializedMethods != null) + s.print("override "); s.print(super.toString() + ";\n"); } |
From: Daniel B. <bo...@us...> - 2004-06-17 10:41:22
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26637 Modified Files: NEWS Log Message: Explicitly mark which methods are overrides in compiled packages, and use that information to speed up the loading of compiled packages. Index: NEWS =================================================================== RCS file: /cvsroot/nice/Nice/NEWS,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** NEWS 16 Jun 2004 10:00:51 -0000 1.33 --- NEWS 17 Jun 2004 10:41:14 -0000 1.34 *************** *** 17,20 **** --- 17,21 ---- several Java interfaces declaring that same method, like java.io.ObjectOutputStream.flush() + * Reduced compilation time and memory consumption. -- |
From: Daniel B. <bo...@us...> - 2004-06-17 10:41:21
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26637/testsuite/compiler/methods Modified Files: overriding.testsuite Log Message: Explicitly mark which methods are overrides in compiled packages, and use that information to speed up the loading of compiled packages. Index: overriding.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/methods/overriding.testsuite,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** overriding.testsuite 17 Mar 2004 00:36:45 -0000 1.6 --- overriding.testsuite 17 Jun 2004 10:41:13 -0000 1.7 *************** *** 72,75 **** --- 72,112 ---- override boolean foo(B); foo(B x) = true; + /// PASS bug + // Should we allow a more general method to be declared in a later package + // and still discover overriding? + /// package a + /// Toplevel + class A {} + class B extends A {} + + boolean foo(B,B); foo(B x, B y) = true; + /// package b import a + B b = new B(); + assert foo(b,b); + + A a = b; + assert foo(a,a); + /// TOPLEVEL + boolean foo(A,A) = false; + + /// PASS + /// package a + /// Toplevel + class A {} + class B extends A {} + + boolean foo(A,A) = false; + boolean foo(B,B); foo(B x, B y) = true; + /// package b import a + C c = new C(); + B b = c; + A a = c; + assert !foo(a,a); + assert !foo(b,b); + assert !foo(c,c); + /// TOPLEVEL + class C extends B {} + foo(C x, C y) = false; + /// PASS A a = new C(); |
From: Daniel B. <bo...@us...> - 2004-06-16 21:03:58
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13165/src/bossa/syntax Modified Files: MethodDeclaration.java Log Message: Optimization: do not typecheck method parameters of compiled packages. Index: MethodDeclaration.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodDeclaration.java,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** MethodDeclaration.java 26 Mar 2004 00:36:38 -0000 1.58 --- MethodDeclaration.java 16 Jun 2004 21:03:49 -0000 1.59 *************** *** 140,143 **** --- 140,146 ---- void typedResolve() { + if (module.interfaceFile()) + return; + Polytype type = getType(); |