nice-commit Mailing List for The Nice Programming Language (Page 77)
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: <bo...@us...> - 2003-11-11 14:46:13
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1:/tmp/cvs-serv13412/debian Modified Files: control Log Message: Build-depend on ant to make sure that the ant plugin is built. Moved to contrib, since it build-depends on javacc and ant which are contrib at the moment. Index: control =================================================================== RCS file: /cvsroot/nice/Nice/debian/control,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** control 6 Nov 2003 20:49:41 -0000 1.15 --- control 11 Nov 2003 14:46:09 -0000 1.16 *************** *** 1,7 **** Source: nice ! Section: devel Priority: optional Maintainer: Daniel Bonniot <bo...@us...> ! Build-Depends-Indep: debhelper (>> 3.0.0), jikes-classpath (>= 1:1.18) | java-compiler, kaffe (>= 1:1.1.1), javacc, groff Standards-Version: 3.6.1 --- 1,7 ---- Source: nice ! Section: contrib/devel Priority: optional Maintainer: Daniel Bonniot <bo...@us...> ! Build-Depends-Indep: debhelper (>> 3.0.0), jikes-classpath (>= 1:1.18) | java-compiler, kaffe (>= 1:1.1.1), javacc, groff, ant Standards-Version: 3.6.1 |
From: <bo...@us...> - 2003-11-08 20:31:56
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv8848/src/bossa/syntax Modified Files: OverloadedSymbolExp.java Log Message: Correctly report ambiguity errors when there is an expected type, and we are not dealing with fields. Index: OverloadedSymbolExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/OverloadedSymbolExp.java,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** OverloadedSymbolExp.java 8 Nov 2003 15:20:51 -0000 1.60 --- OverloadedSymbolExp.java 8 Nov 2003 20:31:53 -0000 1.61 *************** *** 203,206 **** --- 203,210 ---- ") for " + this); + // remembers removed symbols, + // to list possibilities if none matches + LinkedList removed = new LinkedList(); + // Useful in case of failure. List fieldAccesses = filterFieldAccesses(); *************** *** 217,220 **** --- 221,225 ---- } catch(TypingEx e){ + removed.add(s); i.remove(); s.releaseClonedType(); *************** *** 234,240 **** try { ! return givePriorityToFields(fieldAccesses, ! "No symbol named " + ident + ! " has expected type " + expectedType); } finally { --- 239,247 ---- try { ! Expression res = givePriorityToFields(fieldAccesses); ! if (res != null) ! return res; ! ! throw User.error(this, noMatchError(removed, expectedType)); } finally { *************** *** 260,270 **** return uniqueExpression(); ! return givePriorityToFields ! (filterFieldAccesses(), ! "No variable or field in this class has name " + ident); } ! private Expression givePriorityToFields ! (List fieldAccesses, String errorMessage) { if (fieldAccesses.size() != 0) --- 267,283 ---- return uniqueExpression(); ! Expression res = givePriorityToFields(filterFieldAccesses()); ! ! if (res != null) ! return res; ! ! throw User.error(this, ! "No variable or field in this class has name " + ident); } ! /** ! @return null if there is no solution. ! */ ! private Expression givePriorityToFields (List fieldAccesses) { if (fieldAccesses.size() != 0) *************** *** 284,295 **** symbols.removeAll(filterFieldAccesses()); - if (symbols.size() == 0) - User.error(this, errorMessage); - if (symbols.size() == 1) return uniqueExpression(); } ! throw new AmbiguityError(); } --- 297,309 ---- symbols.removeAll(filterFieldAccesses()); if (symbols.size() == 1) return uniqueExpression(); } ! if (symbols.size() != 0) ! throw new AmbiguityError(); ! ! // There is no solution. ! return null; } *************** *** 522,525 **** --- 536,560 ---- } } + + /** No symbol in removed had the expected type. */ + private String noMatchError(List removed, Polytype expectedType) + { + switch (removed.size()) + { + case 0: + return "No symbol has name " + ident; + + case 1: + VarSymbol sym = (VarSymbol) removed.get(0); + return ident + " has type " + sym.getType(); + + default: + return "No symbol with name " + ident + + " has type " + expectedType + ":\n" + + Util.map("", "\n", "", removed); + } + } + + class AmbiguityError extends UserError |
From: <bo...@us...> - 2003-11-08 15:36:56
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv21405/src/bossa/syntax Modified Files: RetypedJavaMethod.java Log Message: Do not export ignored retypings. Index: RetypedJavaMethod.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/RetypedJavaMethod.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** RetypedJavaMethod.java 7 Nov 2003 23:34:19 -0000 1.9 --- RetypedJavaMethod.java 8 Nov 2003 15:36:52 -0000 1.10 *************** *** 245,248 **** --- 245,251 ---- public void printInterface(java.io.PrintWriter s) { + if (ignoredRetyping) + return; + s.print(super.toString() + " = native " + (methodName.equals("<init>") |
From: <bo...@us...> - 2003-11-08 15:20:55
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv19188/src/bossa/syntax Modified Files: OverloadedSymbolExp.java Log Message: Report an error when an attempt is made to use a symbol that was ignored. Index: OverloadedSymbolExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/OverloadedSymbolExp.java,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** OverloadedSymbolExp.java 11 Sep 2003 20:50:27 -0000 1.59 --- OverloadedSymbolExp.java 8 Nov 2003 15:20:51 -0000 1.60 *************** *** 104,107 **** --- 104,114 ---- VarSymbol s = (VarSymbol) i.next(); + if (s.isIgnored()) + { + removed.add(s); + i.remove(); + continue; + } + switch (s.match(arguments)) { case 0 : // Doesn't match *************** *** 502,505 **** --- 509,518 ---- case 1: VarSymbol sym = (VarSymbol) removed.get(0); + + if (sym.isIgnored()) + return sym.getName() + + " cannot be used because it has been ignored.\n" + + "See above for the reason why it has been ignored"; + return sym.explainWhyMatchFails(arguments); |
From: <ar...@us...> - 2003-11-08 14:59:52
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing In directory sc8-pr-cvs1:/tmp/cvs-serv16205/F:/nice/testsuite/compiler/typing Modified Files: void.testsuite Log Message: Test inferred types of variables for being 'void'. Index: void.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/typing/void.testsuite,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** void.testsuite 21 May 2003 15:55:33 -0000 1.3 --- void.testsuite 8 Nov 2003 14:59:48 -0000 1.4 *************** *** 58,59 **** --- 58,69 ---- void foo() = bar(); ?String bar() = "abc"; + + /// FAIL + let x = foo(); + /// Toplevel + void foo() {} + + /// FAIL + var x = foo(); + /// Toplevel + void foo() {} |
From: <ar...@us...> - 2003-11-08 14:59:52
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv16205/F:/nice/src/bossa/syntax Modified Files: typecheck.nice Log Message: Test inferred types of variables for being 'void'. Index: typecheck.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** typecheck.nice 7 Nov 2003 16:11:57 -0000 1.82 --- typecheck.nice 8 Nov 2003 14:59:48 -0000 1.83 *************** *** 660,663 **** --- 660,667 ---- target.type == PrimitiveType.shortType) target.type = notNull(PrimitiveType.intType); + + if (nice.tools.code.Types.isVoid(target.type)) + throw error(decl, "A variable cannot have a void type"); + } else *************** *** 686,689 **** --- 690,696 ---- notNull(decl.left).type = checkMonomorphic(type, decl); + if (nice.tools.code.Types.isVoid(notNull(decl.left).type)) + throw error(decl, "A variable cannot have a void type"); + } |
From: <bo...@us...> - 2003-11-07 23:34:24
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv14619/src/bossa/syntax Modified Files: VarSymbol.java RetypedJavaMethod.java MethodDeclaration.java Log Message: Handle ignored symbols. Index: VarSymbol.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/VarSymbol.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** VarSymbol.java 31 Jul 2003 19:32:05 -0000 1.34 --- VarSymbol.java 7 Nov 2003 23:34:19 -0000 1.35 *************** *** 71,74 **** --- 71,79 ---- } + boolean isIgnored() + { + return false; + } + void checkSpecialRequirements(Expression[] arguments) { Index: RetypedJavaMethod.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/RetypedJavaMethod.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** RetypedJavaMethod.java 7 Nov 2003 20:47:08 -0000 1.8 --- RetypedJavaMethod.java 7 Nov 2003 23:34:19 -0000 1.9 *************** *** 78,81 **** --- 78,86 ---- private List /* of LocatedString */ javaTypes; + boolean isIgnored() + { + return ignoredRetyping; + } + /**************************************************************** * Code generation *************** *** 231,236 **** User.warning(loc, message); - //trick to avoid errors later in compilation - getSymbol().syntacticType = new Polytype(PrimitiveType.synVoidType); ignoredRetyping = true; } --- 236,239 ---- Index: MethodDeclaration.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodDeclaration.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** MethodDeclaration.java 7 Nov 2003 20:47:08 -0000 1.48 --- MethodDeclaration.java 7 Nov 2003 23:34:19 -0000 1.49 *************** *** 126,129 **** --- 126,134 ---- } + boolean isIgnored() + { + return false; + } + /**************************************************************** * Typechecking *************** *** 186,189 **** --- 191,197 ---- void typecheck() { + if (isIgnored()) + return; + // what we do here is equivalent to getType().checkWellFormedness(); // except we also want to find the bytecode types when *************** *** 310,313 **** --- 318,326 ---- } + boolean isIgnored() + { + return getMethodDeclaration().isIgnored(); + } + void checkSpecialRequirements(Expression[] arguments) { *************** *** 317,320 **** --- 330,336 ---- void resolve() { + if (isIgnored()) + return; + // Check that resolving has not already been done. if (syntacticType != null) |
From: <ar...@us...> - 2003-11-07 22:50:04
|
Update of /cvsroot/nice/Nice/testsuite/compiler/classes In directory sc8-pr-cvs1:/tmp/cvs-serv5945/F:/nice/testsuite/compiler/classes Modified Files: native.testsuite Log Message: Merged a few testcases. Index: native.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/classes/native.testsuite,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** native.testsuite 7 Nov 2003 20:47:08 -0000 1.6 --- native.testsuite 7 Nov 2003 22:50:00 -0000 1.7 *************** *** 50,81 **** /// Toplevel class NonExist<T> = native NonExist; - /// package b import a - ; - /// PASS - /// package a - /// Toplevel void foo(NonExist) = native void NonExist.foo(); - /// package b import a - ; - - /// PASS - /// package a - /// Toplevel void isNotAMethod(String) = native void String.isNotAMethod(); - /// package b import a - ; - - /// PASS - /// package a - /// Toplevel void isNotAMethod(String, NonExist) = native void String.isNotAMethod(NonExist); - /// package b import a - ; - - /// PASS - /// package a - /// Toplevel NonExist NonExist(long) = native new NonExist(long); /// package b import a ; - --- 50,57 ---- |
From: <bo...@us...> - 2003-11-07 21:53:05
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv27718/src/bossa/syntax Modified Files: Module.java Definition.java Log Message: Minor: removed cast. Index: Module.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Module.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Module.java 25 Oct 2003 20:34:37 -0000 1.17 --- Module.java 7 Nov 2003 21:53:00 -0000 1.18 *************** *** 24,27 **** --- 24,28 ---- String[] listImplicitPackages(); bossa.modules.Compilation compilation(); + boolean interfaceFile(); /**************************************************************** Index: Definition.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Definition.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Definition.java 7 Nov 2003 20:47:08 -0000 1.19 --- Definition.java 7 Nov 2003 21:53:00 -0000 1.20 *************** *** 81,85 **** public boolean inInterfaceFile() { ! return ((bossa.modules.Package)module).interfaceFile(); } --- 81,85 ---- public boolean inInterfaceFile() { ! return module.interfaceFile(); } |
From: <ar...@us...> - 2003-11-07 20:47:12
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv14222/F:/nice/src/bossa/syntax Modified Files: Definition.java JavaClass.java MethodDeclaration.java RetypedJavaMethod.java Log Message: Ignore retypings when the method or class don't exist and print only a warning when not reading from packaga.nicei . Index: Definition.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Definition.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Definition.java 28 May 2003 12:57:26 -0000 1.18 --- Definition.java 7 Nov 2003 20:47:08 -0000 1.19 *************** *** 79,82 **** --- 79,87 ---- public static Module currentModule; + public boolean inInterfaceFile() + { + return ((bossa.modules.Package)module).interfaceFile(); + } + bossa.modules.Compilation compilation() { Index: JavaClass.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/JavaClass.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** JavaClass.java 11 Nov 2002 20:14:50 -0000 1.27 --- JavaClass.java 7 Nov 2003 20:47:08 -0000 1.28 *************** *** 56,62 **** if (classType == null) ! User.error(javaName, javaName + " was not found in classpath"); - // Check that we don't give a wrong arity to a generic class. int nativeArity = classType.getArity(); --- 56,67 ---- if (classType == null) ! { ! if (!definition.inInterfaceFile()) ! User.warning(javaName, javaName + " was not found in classpath so this retyping is ignored"); ! ! ignoredRetyping = true; ! return; ! } // Check that we don't give a wrong arity to a generic class. int nativeArity = classType.getArity(); *************** *** 77,80 **** --- 82,88 ---- void resolveClass() { + if (ignoredRetyping) + return; + JavaClasses.fetchMethods(definition.tc, (gnu.bytecode.ClassType) definition.getJavaType()); *************** *** 88,90 **** --- 96,99 ---- /** The qualified name of the existing java type. */ private LocatedString javaName; + boolean ignoredRetyping; } Index: MethodDeclaration.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodDeclaration.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** MethodDeclaration.java 30 Aug 2003 10:57:32 -0000 1.47 --- MethodDeclaration.java 7 Nov 2003 20:47:08 -0000 1.48 *************** *** 121,124 **** --- 121,129 ---- } + public String getSyntacticReturnType() + { + return String.valueOf(getReturnType()); + } + /**************************************************************** * Typechecking *************** *** 238,242 **** (syntacticConstraint != null ? syntacticConstraint : Constraint.toString(getType().getConstraint())) ! + String.valueOf(getReturnType()) + " " + getName().toQuotedString() --- 243,247 ---- (syntacticConstraint != null ? syntacticConstraint : Constraint.toString(getType().getConstraint())) ! + getSyntacticReturnType() + " " + getName().toQuotedString() Index: RetypedJavaMethod.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/RetypedJavaMethod.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** RetypedJavaMethod.java 29 Aug 2003 16:52:42 -0000 1.7 --- RetypedJavaMethod.java 7 Nov 2003 20:47:08 -0000 1.8 *************** *** 58,61 **** --- 58,62 ---- this.methodName = methodName; this.javaTypes = javaTypes; + this.syntacticReturnType = returnType.toString(); } *************** *** 81,89 **** ****************************************************************/ ! private static gnu.bytecode.Type type(LocatedString s) { Type res = Types.type(s); ! if(res == null) ! User.error(s, "Unknown java class " + s); return res; } --- 82,91 ---- ****************************************************************/ ! private gnu.bytecode.Type type(LocatedString s) { Type res = Types.type(s); ! if(res == null && !ignoredRetyping) ! setIgnoredRetyping(s, "Ignoring retyping because java class " + s + " is not known"); ! return res; } *************** *** 105,117 **** Type holderType = TypeImport.lookup(className); if (holderType == null) ! User.error(this, ! "Class " + className + " was not found"); ! if (!(holderType instanceof ClassType)) User.error(className, className + " is a primitive type"); ClassType holder = (ClassType) holderType; ! className = new LocatedString(holder.getName(), className.location()); ! javaArgType = new Type[javaTypes.size()-1]; --- 107,125 ---- Type holderType = TypeImport.lookup(className); if (holderType == null) ! { ! setIgnoredRetyping(this, "Ignoring retyping because class " + ! className + " was not found"); ! ! javaArgType = new Type[javaTypes.size()-1]; ! return; ! } ! if (!(holderType instanceof ClassType)) User.error(className, className + " is a primitive type"); + ClassType holder = (ClassType) holderType; ! className = new LocatedString(holder.getName(), className.location()); ! javaArgType = new Type[javaTypes.size()-1]; *************** *** 121,124 **** --- 129,135 ---- javaArgType[i-1] = type(t); + + if (javaArgType[i-1] == null) + continue; // set the fully qualified name back *************** *** 129,137 **** LocatedString retTypeString = (LocatedString) javaTypes.get(0); javaRetType = type(retTypeString); // set the fully qualified name of the return type back javaTypes.set(0, new LocatedString(javaRetType.getName(), retTypeString.location())); ! reflectMethod = holder.getDeclaredMethod(methodName, javaArgType); --- 140,151 ---- LocatedString retTypeString = (LocatedString) javaTypes.get(0); javaRetType = type(retTypeString); + + if (ignoredRetyping) + return; // set the fully qualified name of the return type back javaTypes.set(0, new LocatedString(javaRetType.getName(), retTypeString.location())); ! reflectMethod = holder.getDeclaredMethod(methodName, javaArgType); *************** *** 147,155 **** { if (methodName.equals("<init>")) ! User.error(className, "class " + holder.getName() + " has no constructor with " + javaArgType.length + " arguments"); ! else ! User.error(className, "No method named " + methodName + " with " + ! javaArgType.length + " arguments was found in class " + ! holder.getName()); } --- 161,173 ---- { if (methodName.equals("<init>")) ! setIgnoredRetyping(className, "Ignored retyping because class " + ! holder.getName() + " has no constructor with " + ! javaArgType.length + " arguments"); ! else ! setIgnoredRetyping(className, "Ignored retyping because no method named " + ! methodName + " with " + javaArgType.length + ! " arguments was found in class " + holder.getName()); ! ! return; } *************** *** 199,203 **** --- 217,239 ---- ") and in Nice (" + arity + ")"); } + + void typedResolve() + { + if (ignoredRetyping) + return; + + super.typedResolve(); + } + void setIgnoredRetyping(Located loc, String message) + { + if (!inInterfaceFile()) + User.warning(loc, message); + + //trick to avoid errors later in compilation + getSymbol().syntacticType = new Polytype(PrimitiveType.synVoidType); + ignoredRetyping = true; + } + /**************************************************************** * Module interface *************** *** 206,211 **** public void printInterface(java.io.PrintWriter s) { ! s.print(super.toString() + ! " = native " + (methodName.equals("<init>") ? "new " + className --- 242,246 ---- public void printInterface(java.io.PrintWriter s) { ! s.print(super.toString() + " = native " + (methodName.equals("<init>") ? "new " + className *************** *** 213,235 **** + " " + className + "." + methodName) + ! mapGetName(javaArgTypes()) + ";\n"); } ! private static String mapGetName(gnu.bytecode.Type[] types) { ! if(types == null) return "((NULL))"; String res = "("; ! for(int n = 0; n<types.length; n++) { if(n != 0) res += ", "; ! if(types[n] == null) ! res += "[NULL]"; else ! res += types[n].getName(); } return res + ")"; } } --- 248,283 ---- + " " + className + "." + methodName) + ! mapJavaArgTypes() + ";\n"); } ! private String mapJavaArgTypes() { ! if(javaArgType == null) return "((NULL))"; String res = "("; ! for(int n = 0; n<javaArgType.length; n++) { if(n != 0) res += ", "; ! if(javaArgType[n] == null) ! res += javaTypes.get(n+1); else ! res += javaArgType[n].getName(); } return res + ")"; } + + public String getSyntacticReturnType() + { + if (ignoredRetyping) + return syntacticReturnType; + + return super.getSyntacticReturnType(); + } + + String syntacticReturnType; + + boolean ignoredRetyping; + } |
From: <ar...@us...> - 2003-11-07 20:47:12
|
Update of /cvsroot/nice/Nice/testsuite/compiler/classes In directory sc8-pr-cvs1:/tmp/cvs-serv14222/F:/nice/testsuite/compiler/classes Modified Files: native.testsuite Log Message: Ignore retypings when the method or class don't exist and print only a warning when not reading from packaga.nicei . Index: native.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/classes/native.testsuite,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** native.testsuite 15 Nov 2002 13:47:52 -0000 1.5 --- native.testsuite 7 Nov 2003 20:47:08 -0000 1.6 *************** *** 45,46 **** --- 45,81 ---- class Container<T> = native nativePkg.Container; <T> Container<T> newContainer(T) = native new nativePkg.Container(Object); + + /// PASS + /// package a + /// Toplevel + class NonExist<T> = native NonExist; + /// package b import a + ; + /// PASS + /// package a + /// Toplevel + void foo(NonExist) = native void NonExist.foo(); + /// package b import a + ; + + /// PASS + /// package a + /// Toplevel + void isNotAMethod(String) = native void String.isNotAMethod(); + /// package b import a + ; + + /// PASS + /// package a + /// Toplevel + void isNotAMethod(String, NonExist) = native void String.isNotAMethod(NonExist); + /// package b import a + ; + + /// PASS + /// package a + /// Toplevel + NonExist NonExist(long) = native new NonExist(long); + /// package b import a + ; + |
From: <bo...@us...> - 2003-11-07 16:12:00
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv24691/src/bossa/syntax Modified Files: typecheck.nice Log Message: Make sure that enterElse and exitIf are always called after enterIf, even when there was an exception (for a user error for instance). This guarantees that the conditional types stack stays clean, and therefore avoids a memory leak during multiple compilations in the same JVM, when a compilation has a user error inside an if or a loop. Index: typecheck.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** typecheck.nice 6 Oct 2003 21:28:19 -0000 1.81 --- typecheck.nice 7 Nov 2003 16:11:57 -0000 1.82 *************** *** 459,487 **** try{ ! (?List<MonoSymbol> notNullInThen, ?List<MonoSymbol> notNullInElse) = ! nullnessInfo(condition); ! if (notNullInThen != null) ! notNullInThen.foreach(MonoSymbol variable => { ! mlsub.typing.Monotype type = notNull(variable.type); ! mlsub.typing.Monotype sureType = makeSure(type); ! setVarType(variable, now: sureType, otherBranch: type); ! }); ! (?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofInThen, ! ?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofInElse) = ! instanceofInfo(condition); ! if (instanceofInThen != null) ! instanceofInThen.foreach( ((MonoSymbol variable, mlsub.typing.Monotype type)) => ! setVarType(variable, now: type, otherBranch: variable.type)); ! ! e.thenExp = thenExp = notNull(thenExp.noOverloading()); ! typecheck(thenExp); ! // since the type of the variable is destructively changed, ! // it is important to compute the branch's type and to store it now. ! thenExp.getType(); ! enterElse(); if (notNullInElse != null) --- 459,492 ---- try{ ! ?List<MonoSymbol> notNullInThen, notNullInElse; ! ?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofInThen; ! ?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofInElse; ! try { ! (notNullInThen, notNullInElse) = nullnessInfo(condition); ! if (notNullInThen != null) ! notNullInThen.foreach(MonoSymbol variable => { ! mlsub.typing.Monotype type = notNull(variable.type); ! mlsub.typing.Monotype sureType = makeSure(type); ! setVarType(variable, now: sureType, otherBranch: type); ! }); ! (instanceofInThen, instanceofInElse) = instanceofInfo(condition); ! if (instanceofInThen != null) ! instanceofInThen.foreach( ((MonoSymbol variable, mlsub.typing.Monotype type)) => ! setVarType(variable, now: type, otherBranch: variable.type)); ! ! e.thenExp = thenExp = notNull(thenExp.noOverloading()); ! typecheck(thenExp); ! // since the type of the variable is destructively changed, ! // it is important to compute the branch's type and to store it now. ! thenExp.getType(); ! } finally { ! // Calling this is important for clearning the conditional types stack, ! // which is good when calling the compiler repeatedly from the same JVM. ! enterElse(); ! } if (notNullInElse != null) *************** *** 714,742 **** enterIf(); ! if (whileExp != null) ! if (l.isTestFirst) ! { ! ?List<MonoSymbol> variables = variablesNotNullIfTestSucceeds(whileExp); ! if (variables != null) ! variables.foreach (MonoSymbol variable => ! setVarType(variable, ! now: makeSure(variable.type), ! out: variable.type)); ! ?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofIfTrue = ! first_(instanceofInfo(notNull(whileExp))); ! if (instanceofIfTrue != null) ! instanceofIfTrue.foreach( ((MonoSymbol variable, mlsub.typing.Monotype type)) => setVarType(variable, now: type, out: variable.type)); ! } ! ! typecheck(l.loopBody); ! typecheck(l.iterationStatements); ! // There is no else part in a loop, but this call is necessary to pop off ! // conditional type information (from assignments) from the stack. ! enterElse(); ! exitIf(); } --- 719,750 ---- enterIf(); ! try { ! if (whileExp != null) ! if (l.isTestFirst) ! { ! ?List<MonoSymbol> variables = variablesNotNullIfTestSucceeds(whileExp); ! if (variables != null) ! variables.foreach (MonoSymbol variable => ! setVarType(variable, ! now: makeSure(variable.type), ! out: variable.type)); ! ?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofIfTrue = ! first_(instanceofInfo(notNull(whileExp))); ! if (instanceofIfTrue != null) ! instanceofIfTrue.foreach( ((MonoSymbol variable, mlsub.typing.Monotype type)) => setVarType(variable, now: type, out: variable.type)); ! } ! typecheck(l.loopBody); ! typecheck(l.iterationStatements); ! } ! finally { ! // There is no else part in a loop, but this call is necessary to pop off ! // conditional type information (from assignments) from the stack. ! enterElse(); ! exitIf(); ! } } |
From: <bo...@us...> - 2003-11-07 12:34:41
|
Update of /cvsroot/nice/Nice/src/bossa/modules In directory sc8-pr-cvs1:/tmp/cvs-serv17038/src/bossa/modules Modified Files: Package.java Log Message: Do not mark dispatch methods as synthetic, as this prevents javac from considering them when compiling Java programs refering to Nice code. Index: Package.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/modules/Package.java,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** Package.java 3 Nov 2003 15:42:53 -0000 1.100 --- Package.java 7 Nov 2003 12:34:37 -0000 1.101 *************** *** 806,810 **** res.addBytecodeAttribute (new MiscAttr("id", def.getFullName().getBytes())); - res.addBytecodeAttribute(MiscAttr.synthetic()); return addMethod(res, false); --- 806,809 ---- |
From: <bo...@us...> - 2003-11-06 20:49:45
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1:/tmp/cvs-serv3505/debian Modified Files: control Log Message: Put kaffe as the default JVM, in particular for autobuilders. Index: control =================================================================== RCS file: /cvsroot/nice/Nice/debian/control,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** control 31 Aug 2003 14:31:24 -0000 1.14 --- control 6 Nov 2003 20:49:41 -0000 1.15 *************** *** 8,12 **** Package: nice Architecture: all ! Depends: java-virtual-machine, java1-runtime | java2-runtime Suggests: emacsen, ant Description: Extension of Java with parametric types, multi-methods, and more --- 8,12 ---- Package: nice Architecture: all ! Depends: kaffe | java-virtual-machine, kaffe | java1-runtime | java2-runtime Suggests: emacsen, ant Description: Extension of Java with parametric types, multi-methods, and more |
From: <bo...@us...> - 2003-11-06 14:50:33
|
Update of /cvsroot/nice/Nice/web In directory sc8-pr-cvs1:/tmp/cvs-serv24079/web Modified Files: irc.xml Log Message: New URL for the IRC logs. Index: irc.xml =================================================================== RCS file: /cvsroot/nice/Nice/web/irc.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** irc.xml 6 Aug 2003 22:41:26 -0000 1.2 --- irc.xml 6 Nov 2003 14:50:30 -0000 1.3 *************** *** 33,37 **** <para> ! <ulink url="http://pauillac.inria.fr/~bonniot/nice@freenode/"> Archives of the IRC discussions</ulink> are available. </para> --- 33,37 ---- <para> ! <ulink url="http://confer09.condor-edv.com/nice@freenode/"> Archives of the IRC discussions</ulink> are available. </para> |
Update of /cvsroot/nice/Nice/src/gnu/expr In directory sc8-pr-cvs1:/tmp/cvs-serv20805/src/gnu/expr Modified Files: ScopeExp.java ProcInitializer.java ObjectExp.java LambdaExp.java ClassInitializer.java ApplyExp.java Log Message: Anonymous functions that do not capture the environment are initialized only once in the parent class <clinit> method, even if they appear in a method that also has non-static anonymous functions. This speeds up class to that method and avoids a memory leak. Index: ScopeExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/ScopeExp.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ScopeExp.java 30 Oct 2001 15:16:50 -0000 1.2 --- ScopeExp.java 6 Nov 2003 14:30:24 -0000 1.3 *************** *** 86,89 **** --- 86,101 ---- } + public ClassExp currentClass () + { + ScopeExp exp = this; + for (;; exp = exp.outer) + { + if (exp == null) + return null; + if (exp instanceof ClassExp) + return (ClassExp) exp; + } + } + public ModuleExp currentModule () { Index: ProcInitializer.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/ProcInitializer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ProcInitializer.java 30 Oct 2001 15:16:50 -0000 1.2 --- ProcInitializer.java 6 Nov 2003 14:30:25 -0000 1.3 *************** *** 10,14 **** field = lexp.allocFieldFor(comp); proc = lexp; ! LambdaExp heapLambda = LambdaExp.getHeapLambda(lexp.outer); if (heapLambda instanceof ModuleExp && comp.instanceField != null) { --- 10,14 ---- field = lexp.allocFieldFor(comp); proc = lexp; ! LambdaExp heapLambda = lexp.getHeapLambda(); if (heapLambda instanceof ModuleExp && comp.instanceField != null) { Index: ObjectExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/ObjectExp.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ObjectExp.java 30 Oct 2001 15:16:50 -0000 1.3 --- ObjectExp.java 6 Nov 2003 14:30:25 -0000 1.4 *************** *** 28,32 **** LambdaExp caller = outerLambda(); Variable closureEnv = ! ! Compilation.usingTailCalls ? getHeapLambda(caller).heapFrame : caller.heapFrame != null ? caller.heapFrame : caller.closureEnv; code.emitLoad(closureEnv); --- 28,32 ---- LambdaExp caller = outerLambda(); Variable closureEnv = ! ! Compilation.usingTailCalls ? getHeapLambda().heapFrame : caller.heapFrame != null ? caller.heapFrame : caller.closureEnv; code.emitLoad(closureEnv); Index: LambdaExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/LambdaExp.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** LambdaExp.java 3 Nov 2003 15:43:50 -0000 1.19 --- LambdaExp.java 6 Nov 2003 14:30:26 -0000 1.20 *************** *** 534,538 **** fflags = (fflags | Access.STATIC) & ~Access.FINAL; } ! ClassType frameType = getHeapLambda(outer).getHeapFrameType(); Type rtype = Compilation.getMethodProcType(frameType); Field field = frameType.addField (fname, rtype, fflags); --- 534,538 ---- fflags = (fflags | Access.STATIC) & ~Access.FINAL; } ! ClassType frameType = getHeapLambda().getHeapFrameType(); Type rtype = Compilation.getMethodProcType(frameType); Field field = frameType.addField (fname, rtype, fflags); *************** *** 562,566 **** { compileAsMethod(comp); ! getHeapLambda(outer).addApplyMethod(this); } --- 562,566 ---- { compileAsMethod(comp); ! getHeapLambda().addApplyMethod(this); } *************** *** 679,701 **** } ! public static LambdaExp getHeapLambda(ScopeExp scope) { ! ScopeExp exp = scope; ! for (;; exp = exp.outer) ! { ! if (exp == null) ! return null; ! if (exp instanceof ModuleExp ! || (exp instanceof ClassExp ! && ((ClassExp) exp).needsConstructor) ! || (exp instanceof LambdaExp ! && ((LambdaExp) exp).heapFrame != null)) ! return (LambdaExp) exp; ! } } void addMethodFor (Compilation comp, ObjectType closureEnvType) { ! LambdaExp heapLambda = getHeapLambda(outer); ClassType ctype = heapLambda.getHeapFrameType(); addMethodFor(ctype, comp, closureEnvType); --- 679,716 ---- } ! public LambdaExp getHeapLambda() { ! ScopeExp exp = outer; ! ! if (getNeedsClosureEnv()) ! for (;; exp = exp.outer) ! { ! if (exp == null) ! return null; ! if (exp instanceof ModuleExp ! || (exp instanceof ClassExp ! && ((ClassExp) exp).needsConstructor) ! || (exp instanceof LambdaExp ! && ((LambdaExp) exp).heapFrame != null)) ! return (LambdaExp) exp; ! } ! ! // No need for heap, return the englobing class ! ClassExp res = currentClass(); ! ! /* ! For user classes, needsConstructor is false, but their outer ! class (lambda) is the package class. ! */ ! if (res.needsConstructor) ! return res; ! else ! return res.outerLambda(); ! } void addMethodFor (Compilation comp, ObjectType closureEnvType) { ! LambdaExp heapLambda = getHeapLambda(); ClassType ctype = heapLambda.getHeapFrameType(); addMethodFor(ctype, comp, closureEnvType); Index: ClassInitializer.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/ClassInitializer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ClassInitializer.java 30 Oct 2001 15:16:50 -0000 1.1 --- ClassInitializer.java 6 Nov 2003 14:30:30 -0000 1.2 *************** *** 22,26 **** else { ! LambdaExp heapLambda = LambdaExp.getHeapLambda(cexp.outer); next = heapLambda.initChain; heapLambda.initChain = this; --- 22,26 ---- else { ! LambdaExp heapLambda = cexp.getHeapLambda(); next = heapLambda.initChain; heapLambda.initChain = this; Index: ApplyExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/ApplyExp.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ApplyExp.java 18 Apr 2003 14:50:19 -0000 1.9 --- ApplyExp.java 6 Nov 2003 14:30:31 -0000 1.10 *************** *** 229,233 **** code.emitLoad(func_lambda.closureEnv); // Recursive call. else ! LambdaExp.getHeapLambda(func_lambda.outerLambda()).loadHeapFrame(comp); } --- 229,233 ---- code.emitLoad(func_lambda.closureEnv); // Recursive call. else ! func_lambda.getHeapLambda().loadHeapFrame(comp); } |
From: <bo...@us...> - 2003-11-06 14:30:37
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1:/tmp/cvs-serv20805/debian Modified Files: changelog Log Message: Anonymous functions that do not capture the environment are initialized only once in the parent class <clinit> method, even if they appear in a method that also has non-static anonymous functions. This speeds up class to that method and avoids a memory leak. Index: changelog =================================================================== RCS file: /cvsroot/nice/Nice/debian/changelog,v retrieving revision 1.220 retrieving revision 1.221 diff -C2 -d -r1.220 -r1.221 *** changelog 6 Nov 2003 14:25:56 -0000 1.220 --- changelog 6 Nov 2003 14:30:32 -0000 1.221 *************** *** 6,9 **** --- 6,11 ---- return void. * Added source-level debugging information for recent debuggers (jsr 45). + * Generate more efficient code for anonymous functions that do not capture + the environment. This also avoids a memory leak. -- |
From: <bo...@us...> - 2003-11-06 14:25:59
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1:/tmp/cvs-serv20118/debian Modified Files: changelog Log Message: Added source-level debugging information for recent debuggers (jsr 45) Index: changelog =================================================================== RCS file: /cvsroot/nice/Nice/debian/changelog,v retrieving revision 1.219 retrieving revision 1.220 diff -C2 -d -r1.219 -r1.220 *** changelog 3 Nov 2003 13:35:46 -0000 1.219 --- changelog 6 Nov 2003 14:25:56 -0000 1.220 *************** *** 5,8 **** --- 5,9 ---- unused, without needing to return a dummy value when the method does not return void. + * Added source-level debugging information for recent debuggers (jsr 45). -- |
From: <bo...@us...> - 2003-11-04 17:10:23
|
Update of /cvsroot/nice/Nice/src/gnu/bytecode In directory sc8-pr-cvs1:/tmp/cvs-serv5827/src/gnu/bytecode Modified Files: SourceMap.java Log Message: Removed debug info. Index: SourceMap.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/bytecode/SourceMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SourceMap.java 3 Nov 2003 18:32:07 -0000 1.1 --- SourceMap.java 4 Nov 2003 17:10:20 -0000 1.2 *************** *** 48,52 **** try { String value = buffer.toString() + lines.toString() + trailer; - System.out.println(value); return value.getBytes("UTF-8"); } --- 48,51 ---- *************** *** 84,88 **** int translate(String file, int line) { - System.out.println(file + ":: " + line); if (! file.equals(currentFile) || line < firstLine) { --- 83,86 ---- |
Update of /cvsroot/nice/Nice/src/gnu/bytecode In directory sc8-pr-cvs1:/tmp/cvs-serv32481/src/gnu/bytecode Modified Files: Method.java LineNumbersAttr.java CodeFragment.java CodeAttr.java ClassType.java Added Files: SourceMap.java Log Message: Added source-level debugging support (jsr 45). --- NEW FILE: SourceMap.java --- /**************************************************************************/ /* N I C E */ /* A high-level object-oriented research language */ /* (c) Daniel Bonniot 2003 */ /* */ /* This program is free software; you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation; either version 2 of the License, or */ /* (at your option) any later version. */ /* */ /**************************************************************************/ package gnu.bytecode; /** A mapping from source files to the bytecode line numbers. The format is specified by the JSR 45. @author Daniel Bonniot (bo...@us...) */ class SourceMap extends Attribute { SourceMap(ClassType classfile) { super("SourceDebugExtension"); buffer = new StringBuffer("SMAP\n"); buffer.append(classfile.getName()).append('\n'); buffer.append("Default\n*S Default\n*F\n"); } private StringBuffer buffer; private StringBuffer lines = new StringBuffer("*L\n"); private static final String trailer = "*E\n"; public int getLength() { return getBytes().length; } private byte[] getBytes() { // write the last part. writeCurrent(); currentFile = null; try { String value = buffer.toString() + lines.toString() + trailer; System.out.println(value); return value.getBytes("UTF-8"); } catch (java.io.UnsupportedEncodingException e) { // Should never happen, UTF-8 is standard. throw new Error(e.toString()); } } public void write(java.io.DataOutputStream out) throws java.io.IOException { byte[] bytes = getBytes(); out.write(bytes, 0, bytes.length); } /* We work by remembering the last file used, and add a new File entry each time we change files. However, we keep the first line number, so that each source line from the same file is relative to that base. This helps keeping the output line number low. */ private String currentFile = null; private int fileNumber = 0; private int firstLine = -1; private int lastLine = -1; private int outputBase = 1; /** Return a line number which is unique in this source map, and which can be translated back into the given file and source line number. */ int translate(String file, int line) { System.out.println(file + ":: " + line); if (! file.equals(currentFile) || line < firstLine) { writeCurrent(); currentFile = file; firstLine = line; } lastLine = line; return outputBase + line - firstLine; } private void writeCurrent() { if (currentFile != null) { fileNumber++; buffer.append(fileNumber).append(' ').append(currentFile) .append('\n'); int len = lastLine - firstLine + 1; lines.append("" + firstLine + '#' + fileNumber + ',' + len + ':' + outputBase).append('\n'); outputBase += len; } } } Index: Method.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/bytecode/Method.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Method.java 23 Jun 2003 17:49:01 -0000 1.6 --- Method.java 3 Nov 2003 18:32:07 -0000 1.7 *************** *** 222,230 **** } ! public void compile_linenumber (int linenumber) { if (code == null) code = new CodeAttr(this); ! code.putLineNumber(linenumber); } --- 222,230 ---- } ! public void compile_linenumber (String file, int linenumber) { if (code == null) code = new CodeAttr(this); ! code.putLineNumber(file, linenumber); } Index: LineNumbersAttr.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/bytecode/LineNumbersAttr.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LineNumbersAttr.java 30 Oct 2001 15:16:50 -0000 1.2 --- LineNumbersAttr.java 3 Nov 2003 18:32:07 -0000 1.3 *************** *** 35,40 **** --- 35,54 ---- /** Add a new line number entry. + * @param file the source file for this entry * @param linenumber the number in the source file for this entry * @param PC the byte code location for the code for this line number. */ + void put (String file, int linenumber, int PC) + { + Method method = ((CodeAttr) container).getMethod(); + linenumber = method.classfile.getSourceMap().translate(file, linenumber); + put(linenumber, PC); + } + + /** Add a new line number entry. + * @param linenumber the number in the source file for this entry + * @param PC the byte code location for the code for this line number. + * The line number is supposed to have already been translated by a source + * map. + */ public void put (int linenumber, int PC) { Index: CodeFragment.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/bytecode/CodeFragment.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CodeFragment.java 30 Oct 2001 15:16:50 -0000 1.2 --- CodeFragment.java 3 Nov 2003 18:32:07 -0000 1.3 *************** *** 51,54 **** --- 51,55 ---- { for (int i = 0; i < linenumbers.length; i += 2) + // The line numbers are already translated by the source map. cattr.lines.put(linenumbers[i+1], linenumbers[i] + cattr.PC); } Index: CodeAttr.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/bytecode/CodeAttr.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** CodeAttr.java 8 Oct 2003 12:35:31 -0000 1.19 --- CodeAttr.java 3 Nov 2003 18:32:07 -0000 1.20 *************** *** 178,187 **** } ! public final void putLineNumber (int linenumber) { if (lines == null) lines = new LineNumbersAttr(this); readPC = PC; ! lines.put(linenumber, PC); } --- 178,187 ---- } ! public final void putLineNumber (String file, int linenumber) { if (lines == null) lines = new LineNumbersAttr(this); readPC = PC; ! lines.put(file, linenumber, PC); } Index: ClassType.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/bytecode/ClassType.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ClassType.java 30 Sep 2003 13:19:54 -0000 1.18 --- ClassType.java 3 Nov 2003 18:32:07 -0000 1.19 *************** *** 1112,1114 **** --- 1112,1126 ---- return new ParameterizedType(this, parameters); } + + private SourceMap sourceMap; + + SourceMap getSourceMap() + { + if (sourceMap == null) + { + sourceMap = new SourceMap(this); + sourceMap.addToFrontOf(this); + } + return sourceMap; + } } |
From: <bo...@us...> - 2003-11-03 18:32:10
|
Update of /cvsroot/nice/Nice/src/gnu/expr In directory sc8-pr-cvs1:/tmp/cvs-serv32481/src/gnu/expr Modified Files: Expression.java Compilation.java CheckedTarget.java Log Message: Added source-level debugging support (jsr 45). Index: Expression.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/Expression.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Expression.java 20 Mar 2003 14:58:24 -0000 1.4 --- Expression.java 3 Nov 2003 18:32:06 -0000 1.5 *************** *** 66,70 **** if (line > 0) { ! comp.method.compile_linenumber (line); compileNotePosition(comp, target); } --- 66,70 ---- if (line > 0) { ! comp.method.compile_linenumber (getFile(), line); compileNotePosition(comp, target); } Index: Compilation.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/Compilation.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Compilation.java 24 Jun 2003 20:07:38 -0000 1.19 --- Compilation.java 3 Nov 2003 18:32:07 -0000 1.20 *************** *** 1357,1361 **** int line = module.getLine(); if (line > 0) ! code.putLineNumber(line); /* --- 1357,1361 ---- int line = module.getLine(); if (line > 0) ! code.putLineNumber(module.getFile(), line); /* Index: CheckedTarget.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/CheckedTarget.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CheckedTarget.java 26 Nov 2001 11:09:49 -0000 1.3 --- CheckedTarget.java 3 Nov 2003 18:32:07 -0000 1.4 *************** *** 139,143 **** int line = comp.position >> 12; if (line > 0) ! code.putLineNumber(line); if (thisIsProc) code.emitPushThis(); --- 139,143 ---- int line = comp.position >> 12; if (line > 0) ! code.putLineNumber(comp.filename, line); if (thisIsProc) code.emitPushThis(); |
From: <bo...@us...> - 2003-11-03 15:43:53
|
Update of /cvsroot/nice/Nice/src/gnu/expr In directory sc8-pr-cvs1:/tmp/cvs-serv28029/src/gnu/expr Modified Files: LambdaExp.java Log Message: Specify in the bytecode dispatch methods and dispatch classes as "Synthetic". Index: LambdaExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/LambdaExp.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** LambdaExp.java 25 Oct 2003 20:34:37 -0000 1.18 --- LambdaExp.java 3 Nov 2003 15:43:50 -0000 1.19 *************** *** 1698,1707 **** private gnu.bytecode.Attribute attributes; ! private void addAttributes(Method m) { for (Attribute a = attributes; a != null; ) { Attribute next = a.getNext(); ! a.addToFrontOf(m); a = next; } --- 1698,1707 ---- private gnu.bytecode.Attribute attributes; ! void addAttributes(AttrContainer bytecode) { for (Attribute a = attributes; a != null; ) { Attribute next = a.getNext(); ! a.addToFrontOf(bytecode); a = next; } |
From: <bo...@us...> - 2003-11-03 15:43:22
|
Update of /cvsroot/nice/Nice/src/gnu/expr In directory sc8-pr-cvs1:/tmp/cvs-serv27977/src/gnu/expr Modified Files: ClassExp.java Log Message: Specify in the bytecode dispatch methods and dispatch classes as "Synthetic". Index: ClassExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/ClassExp.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ClassExp.java 25 Oct 2003 20:34:37 -0000 1.13 --- ClassExp.java 3 Nov 2003 15:43:19 -0000 1.14 *************** *** 339,342 **** --- 339,344 ---- child.addMethodFor(instanceType, null, type); } + + addAttributes(instanceType); } |
From: <bo...@us...> - 2003-11-03 15:42:56
|
Update of /cvsroot/nice/Nice/src/bossa/modules In directory sc8-pr-cvs1:/tmp/cvs-serv27864/src/bossa/modules Modified Files: Package.java Log Message: Specify in the bytecode dispatch methods and dispatch classes as "Synthetic". Index: Package.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/modules/Package.java,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** Package.java 25 Oct 2003 20:34:38 -0000 1.99 --- Package.java 3 Nov 2003 15:42:53 -0000 1.100 *************** *** 696,699 **** --- 696,700 ---- dispatchClass = createClassExp(name + ".dispatch"); + dispatchClass.addBytecodeAttribute(MiscAttr.synthetic()); } *************** *** 805,808 **** --- 806,810 ---- res.addBytecodeAttribute (new MiscAttr("id", def.getFullName().getBytes())); + res.addBytecodeAttribute(MiscAttr.synthetic()); return addMethod(res, false); |
From: <bo...@us...> - 2003-11-03 15:42:56
|
Update of /cvsroot/nice/Nice/src/gnu/bytecode In directory sc8-pr-cvs1:/tmp/cvs-serv27864/src/gnu/bytecode Modified Files: MiscAttr.java Log Message: Specify in the bytecode dispatch methods and dispatch classes as "Synthetic". Index: MiscAttr.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/bytecode/MiscAttr.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** MiscAttr.java 7 Sep 2000 17:55:10 -0000 1.1.1.1 --- MiscAttr.java 3 Nov 2003 15:42:53 -0000 1.2 *************** *** 28,31 **** --- 28,38 ---- } + public static Attribute synthetic() + { + return new MiscAttr("Synthetic", nobytes); + } + + private static final byte[] nobytes = new byte[0]; + public int getLength() { return length; } |