2007-09-12 Mo DeJong <mdejong@users.sourceforge.net> * known_issues.txt: Add note about test cases that fail because the build/install directory contains a space in the directory name. * tests/jacl/ioEncodeDecode.test: * tests/tcl/SocketCmd.test: Update WIKI url so that search works as expected. * tests/tcl/encoding.test: * tests/tcl/io.test: Mark each failing test that depends on the iso2022-jp encoding with the knownbug constraint. Each JDK release seems to break the iso2022-jp encoding is new ways. 2007-09-11 Mo DeJong <mdejong@users.sourceforge.net> * README.jacl: * README.tclblend: * announce: * docs/website/index.html: Add notes indicating that the 1.4 version is stable and ready for evaluation in production environments. 2007-06-07 Mo DeJong <mdejong@users.sourceforge.net> * configure: Regen. * configure.in: * src/pkgIndex.tcl: * src/jacl/tcl/lang/Interp.java: * src/tcljava/tcl/lang/BlendExtension.java: * unix/tools/vutil/current: * unix/tools/vutil/vsub.sh: * win/makefile.vc: Update to version 1.4.1. Added release tag tcljava-141-2007-06-06. 2007-06-06 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/SubstCmd.java (cmdProc): Remove else branch that skipped \r characters since this did not match the C implementation. * tests/tcl/subst.test: Add test case for \r case. 2007-01-13 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Expression.java (Atan2Function, PowFunction, AcosFunction, AsinFunction, AtanFunction FmodFunction, LogFunction, Log10Function, SqrtFunction): Add valid input bounds checks to math functions. Fix typo in log10() function that make it return incorrect results. 2006-09-16 Mo DeJong <mdejong@users.sourceforge.net> * docs/TJC/module.html: Mention that PACKAGE statement is required in a module file. * src/tjc/tjc/library/module.tcl: Update module_parse_validate so that an error will be generated when no PACKAGE declaration is found in a module file. * tests/tjc/module.test: Check for missing PACKAGE statement. 2006-09-11 Mo DeJong <mdejong@users.sourceforge.net> * docs/TclJava/ClassLoading.html: Update class loading info, mention use of context class loader and how env(TCL_CLASSPATH) should be used at runtime. * docs/TclJava/JavaSignatures.html: Update signature docs, add full signature example. * src/tcljava/tcl/lang/TclClassLoader.java (checkTclClasspath): A bug was causing changes to env(TCL_CLASSPATH) to be ignored in checkTclClasspath, fix it by using || instead of && in the test expr. * tests/tcljava/tcljavaInterp.test: Add regression test cases for path bug. [Bug 1556640] 2006-08-21 Mo DeJong <mdejong@users.sourceforge.net> * announce: Update for 1.4.0 release. * docs/Topics/WhatsNew.html: Mention setInterrupt API. * docs/website/index.html: Update for 1.4.0 release. 2006-08-21 Mo DeJong <mdejong@users.sourceforge.net> * configure: Regen. * tcljava.m4 (AC_GCC_BUGS): Replace AC_TRY_COMPILE with AC_TRY_RUN so that program is compiled and run on host system. [Bug 1528278] 2006-08-21 Mo DeJong <mdejong@users.sourceforge.net> * src/tjc/tcl/lang/TJC.java: Fixup comments. * src/tjc/tjc/library/compileproc.tcl: Remove FIXME comments. * tests/tjc/compileproc_7.test: Test lappend to scoped variable name, this usage will not init a scoped var slot. 2006-08-21 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Expression.java: Make expr pool default to 50 ExprValue objects. 2006-08-18 Mo DeJong <mdejong@users.sourceforge.net> * configure: Regen, * configure.in: Invoke new macro. * tcljava.m4 (AC_GCC_BUGS): Add new macro that attempts to detect a tricky bug known to exist in gcc 4.1.0. This optimizer bug causes failures when converting a long long back into a pointer. This logic is used to store a pointer to a C interp structure inside a jlong in the Java interp object. [Bug 1528278] 2006-08-05 Mo DeJong <mdejong@users.sourceforge.net> * src/tjc/tcl/lang/TJCCompileCmd.java (TclCompile, isClassDefined): Add logic that detects the case where a Tcl proc with the same name is compiled more than once. This logic will generate a unique name so that a ClassLoader error because of a duplicate definition is avoided. * tests/tjc/tjcthread.test: Add test case for compilation of same proc in two different interpreters. Add test case for recompilation of Tcl proc with the same name. 2006-08-05 Mo DeJong <mdejong@users.sourceforge.net> * docs/TJC/index.html: Separate docs for batch and runtime mode into two sections. * docs/TJC/module.html: Add +inline-expr info. 2006-08-04 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Remove new_features.txt. * README.jacl: * README.tclblend: Mention WhatsNew.html. * new_features.txt: Removed. * docs/Topics/WhatsNew.html: Create a New Features HTML page containing new 1.4 features and importing the old entries from new_features.txt. * docs/Topics/index.html: Add link to WhatsNew.html. 2006-08-04 Mo DeJong <mdejong@users.sourceforge.net> * src/tcljava/tcl/lang/TclClassLoader.java: Avoid throwing NullPointerException when method can just return null. * src/tjc/tcl/lang/TJCThread.java: Refactor the TJCThread class so that state variables become instance variables instead of static ones. This makes it possible to start the service again after it has been canceled without having to wait for the previous thread to die. 2006-08-03 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/EventuallyFreed.java: Add debug statements. * src/jacl/tcl/lang/Interp.java (Interp, dispose, eventuallyDispose, finalize, transferResult, invoke, setInterrupted, toString): Reimplment dispose() and eventuallyDispose() so that interp is marked as deleted in the same way as Tcl 8.4. Print an error message to stderr in finalize() if an interp that was not deleted is finalized, the previous finalize implementation did not work since it always raised an exception. Don't error out in transferResult if interp has been deleted. Return Interp description in toString() method. * src/jacl/tcl/lang/InterpAliasCmd.java (cmdProc): * src/jacl/tcl/lang/InterpSlaveCmd.java (cmdProc): Call Interp.release() in finally block so that release is invoked even if an exception is raised. This fixed a number of undeleted interp problems in the interp.test file. * src/tests/jacl/tcl/lang/JavaTestExtension.java: Add testinterpdelete. * src/tests/jacl/tcl/lang/TestInterpDeleteCmd.java: Implement testinterpdelete command which enables a series of tests in interp.test. 2006-08-03 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Interp.java (ready, invoke): Move interp ready check into ready() method. Invoke this method from invoke() like Tcl 8.4. * src/jacl/tcl/lang/Parser.java (evalObjv): Invoke Interp.ready() before code evaluation. * src/tjc/tcl/lang/TJC.java (invoke): Invoke Interp.ready() before code evaluation. 2006-07-31 Mo DeJong <mdejong@users.sourceforge.net> * README.jacl: * README.tclblend: Update README files for 1.4.0 release. * known_issues.txt: Remove old issue notes. * docs/contents.html: * docs/Topics/index.html: * docs/Topics/BuildJaclUnix.html: * docs/Topics/BuildJaclWin.html: * docs/Topics/BuildTclBlendUnix.html: * docs/Topics/BuildTclBlendWin.html: Add build instructions for 1.4.0 release. * docs/Topics/EventLoop.html: * docs/Topics/SetInterrupted.html: Replace CRLF with LF. * docs/Topics/index.html: 2006-07-28 Mo DeJong <mdejong@users.sourceforge.net> * src/native/javaInterp.c: Add deallocated Tcl_Obj check. * src/tclblend/tcl/lang/Interp.java (eval): Call preserve()/release() around the evalTclObject() invocation so that the ref count of the TclObject wrapped around the Tcl_Obj* is incremented. This avoids a crash during the eval invocation. * tests/tcljava/tcljavaInterp.test: Add test case for evalFile() bug. [Bug 1530631] 2006-07-26 Mo DeJong <mdejong@users.sourceforge.net> * src/tclblend/tcl/lang/Interp.java (shlib_load): Make shlib_load synchronized in case two threads invoked the Interp constructor at the same time. 2006-07-26 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Update 'make dist' build rules to include new files and remove old ones. Include itcl and tjc files in Jacl dist. 2006-07-26 Mo DeJong <mdejong@users.sourceforge.net> * src/native/javaIdle.c: * src/native/javaInterp.c (Java_tcl_lang_Interp_evalString, Java_tcl_lang_Interp_evalTclObject, JavaCmdProc, BTestCmd): Reimplement eval() methods and JavaCmdProc so that a Java exception is never left pending when invoked from Tcl. A Java exception can only be thrown when invoked from a Java method. Return a Tcl status from native eval methods. * src/tclblend/tcl/lang/Interp.java (eval, evalString, evalTclObject, callCommand, checkPendingException): Replace propagateException field with pendingException. Reimplement eval methods so that they make use of the pendingException field and use an int result status from the native eval methods. This new implementation will never leave a Java exception pending in the JVM when a Java method is invoked from Tcl. As the stack is unwound, a Java method can rethrow the exception. This new implementation maintains compatibility and avoids an edge case that resulted in an assert because of a pending exception. * src/tests/tcljava/tcl/lang/JtestCmd.java: Add "npe" and "tclexception" methods for use in tests. * src/tests/tcljava/tests/TestExceptionPending.java: Test methods that call eval from Java and check for Exceptions. * tests/tclblend/javaInterp.test: Add test cases for assert due to pending exception bug. Use new JNI exception pending test logic. * tests/tcljava/tcljavaInterp.test: Add exception handler test that work in both Jacl and Tcl Blend. [Bug 1525613] 2006-07-18 Mo DeJong <mdejong@users.sourceforge.net> * src/janino/org/codehaus/janino/tools/JGrep.java: Fixup import name clash that was causing compile error with JDK 1.5. 2006-07-18 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: * src/janino/README.TXT: * src/janino/org/codehaus/janino/AstGeneratorVisitor.java: * src/janino/org/codehaus/janino/ByteArrayClassLoader.java: * src/janino/org/codehaus/janino/CachingJavaSourceClassLoader.java: * src/janino/org/codehaus/janino/ClassBodyEvaluator.java: * src/janino/org/codehaus/janino/ClassFileIClass.java: * src/janino/org/codehaus/janino/ClassLoaderIClassLoader.java: * src/janino/org/codehaus/janino/CompileException.java: * src/janino/org/codehaus/janino/Compiler.java: * src/janino/org/codehaus/janino/Cookable.java: * src/janino/org/codehaus/janino/Descriptor.java: * src/janino/org/codehaus/janino/EvaluatorBase.java: * src/janino/org/codehaus/janino/ExpressionEvaluator.java: * src/janino/org/codehaus/janino/FilterWarningHandler.java: * src/janino/org/codehaus/janino/IClass.java: * src/janino/org/codehaus/janino/IClassLoader.java: * src/janino/org/codehaus/janino/Java.java: * src/janino/org/codehaus/janino/JavaSourceClassLoader.java: * src/janino/org/codehaus/janino/JavaSourceIClassLoader.java: * src/janino/org/codehaus/janino/MethodDescriptor.java: * src/janino/org/codehaus/janino/Mod.java: * src/janino/org/codehaus/janino/Parser.java: * src/janino/org/codehaus/janino/ReflectionIClass.java: * src/janino/org/codehaus/janino/ResourceFinderIClassLoader.java: * src/janino/org/codehaus/janino/Scanner.java: * src/janino/org/codehaus/janino/ScriptEvaluator.java: * src/janino/org/codehaus/janino/SimpleCompiler.java: * src/janino/org/codehaus/janino/UnitCompiler.java: * src/janino/org/codehaus/janino/UnparseVisitor.java: * src/janino/org/codehaus/janino/Visitor.java: * src/janino/org/codehaus/janino/samples/ClassBodyDemo.java: * src/janino/org/codehaus/janino/samples/DeclarationCounter.java: * src/janino/org/codehaus/janino/samples/ExpressionDemo.java: * src/janino/org/codehaus/janino/tools/Disassembler.java: * src/janino/org/codehaus/janino/tools/JGrep.java: * src/janino/org/codehaus/janino/util/CausedException.java: * src/janino/org/codehaus/janino/util/ClassFile.java: * src/janino/org/codehaus/janino/util/Producer.java: * src/janino/org/codehaus/janino/util/ResourceFinderClassLoader.java: * src/janino/org/codehaus/janino/util/StringPattern.java: * src/janino/org/codehaus/janino/util/Traverser.java: * src/janino/org/codehaus/janino/util/TunnelException.java: * src/janino/org/codehaus/janino/util/enumerator/Enumerator.java: * src/janino/org/codehaus/janino/util/enumerator/EnumeratorSet.java: * src/janino/org/codehaus/janino/util/iterator/DirectoryIterator.java: * src/janino/org/codehaus/janino/util/iterator/IteratorCollection.java: * src/janino/org/codehaus/janino/util/iterator/MultiDimensionalIterator.java: * src/janino/org/codehaus/janino/util/iterator/ProducerIterator.java: * src/janino/org/codehaus/janino/util/iterator/ScopeIterator.java: * src/janino/org/codehaus/janino/util/iterator/TraversingIterator.java: * src/janino/org/codehaus/janino/util/resource/JarDirectoriesResourceFinder.java: * src/janino/org/codehaus/janino/util/resource/LazyMultiResourceFinder.java: * src/janino/org/codehaus/janino/util/resource/MapResourceCreator.java: * src/janino/org/codehaus/janino/util/resource/MapResourceFinder.java: * src/janino/org/codehaus/janino/util/resource/MultiResourceFinder.java: * src/janino/org/codehaus/janino/util/resource/PathResourceFinder.java: * src/janino/org/codehaus/janino/util/resource/Resource.java: * src/janino/org/codehaus/janino/util/resource/ResourceCreator.java: * src/janino/org/codehaus/janino/util/resource/ResourceFinder.java: Update to Janino 2.4.5 with local mods. * src/tjc/tjc/library/tjcthread.tcl: Update Tcl scritps so that specific SimpleCompiler API is invoked. 2006-07-11 Mo DeJong <mdejong@users.sourceforge.net> * tests/inprogress/Unicode.test: Remove comment output. * tests/tjc/tjcthread.test: Add log match output for race condition test. 2006-07-11 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/TclInputStream.java (decodedNumBytes, getsObj, filterBytes, doReadChars, readChars, externalToUnicode): Reimplement input decoding so that bytes are decoded to chars in one pass. The previous implementation assumed that a decode operation could be done twice, but that is not possible in Java since the nio decoders provide no way to save decoder state. This new implementation will decode bytes into chars one char at a time while saving a map that is used later to determine how many bytes were decoded for a given range of characters. These chages fixes up support for stateful encodings like shiftjis. * tests/jacl/ioEncodeDecode.test: Add additional test cases for input decoding issues. 2006-07-11 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/FileChannel.java (open): Truncate file after opening using new Java nio channels package. * src/jacl/tcl/lang/OpenCmd.java: Pass TclIO.TRUNC instead of attempting to delete the file. A file delete does not work when another file descriptor to the same file is open. * tests/tcl/io.test: Add file truncate test. 2006-07-08 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/TclInputStream.java (getsObj, filterBytes, peekAhead): Add debug output to gets method. Avoid looking at the next buffer when EOF char has been found. Cleanup code by removing C porting comments. Double check that the copiedTotal return value from getsObj matches the length of the TclObject. * tests/jacl/ioEncodeDecode.test: Mark some tests as knownbug since the tests don't pass. Add some tests that comparing conversion of shiftjis with utf-8. * tests/tcl/encoding.test: Add knownbug constraint to test that does not pass. * tests/tcl/io.test: Fixup whispace. 2006-07-07 Mo DeJong <mdejong@users.sourceforge.net> Reimplement IO and encoding commands using the new java.nio.charset package. The previous implementation made use of sun.* APIs which were not officially supported. * src/jacl/tcl/lang/Channel.java: Use braces in if statement. * src/jacl/tcl/lang/ChannelBuffer.java (toString): Add toString() method for debug printout. * src/jacl/tcl/lang/EncodingCmd.java: Reimplement encoding command using java.nio APIs. The default system encoding is now set by reading the "file.encoding" property. This logic will default to iso8859-1. The encoding names command now returns only those encodings that are supported at runtime. * src/jacl/tcl/lang/FconfigureCmd.java: Raise an error if -encoding argument to fconfigure is not supported at runtime. * src/jacl/tcl/lang/TclInputStream.java: * src/jacl/tcl/lang/TclOutputStream.java: Reimplement input/output decode/encode operations using java.nio.charset package. Some escape based encodings are still broken, but most IO tests now pass. * tests/jacl/ioEncodeDecode.test: Add Jacl specific encoding tests. Not all tests pass. * tests/tcl/encoding.test: Port encoding tests from Tcl CVS. * tests/tcl/io.test: Fixup tests, a syntax error was causing many tests to not run. 2006-06-29 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/ExecCmd.java: Remove scary runtime exec logic and replace with exec introduced in JDK 1.3. The old code is no longer needed since we require JDK 1.4 now. 2006-06-29 Mo DeJong <mdejong@users.sourceforge.net> * tests/tcljava/tcljavaInterp.test: Update memory size test so that it passes in both Jacl and Tcl Blend. 2006-06-29 Mo DeJong <mdejong@users.sourceforge.net> Fixup build/tests with JDK 1.5. The DupTest class does not even compile with JDK 1.5, so just remove this strange edge case. * Makefile.in: * src/tcljava/tcl/lang/reflect/PkgInvoker.java (getPkgInvoker): Check for null before invoking loadClass, this makes the common fail case faster when null is returned for the class loader. * src/tests/tcljava/tests/DupTest.java: * src/tests/tcljava/tests/InnerTest/DupName.java: * src/tests/tcljava/tests/InnerTest/DupTest.java: * src/xputils/xputils.tcl: Update error message for JDK 1.4 or newer. * tests/tcljava/FuncSig.test: Test JDK version at runtime and match object signature so that test passes in JDK 1.5. * tests/tcljava/JavaNewCmd.test: Remove DupName test since it does not compiled with JDK 1.5. 2006-06-29 Mo DeJong <mdejong@users.sourceforge.net> Require JDK 1.4 or newer to build Jacl or Tcl Blend. * bsjavac.sh: Remove old shell script that worked around buggy JDK 1.0/1.1 javac. * configure: Regen. * configure.in: Fixup default --prefix option, it will now correctly default to /usr/local. Remove AC_JAVA_WITH_KAFFE and AC_JAVA_WITH_JIKES. Remove old tests that checked for -native option to java, it existed only for old JDK 1.0/1.1. * tcljava.m4 (AC_JAVA_WITH_KAFFE, AC_JAVA_WITH_JIKES, AC_PROG_JAVAC, AC_JAVA_DETECT_JVM, AC_JAVA_CLASSPATH, AC_JAVA_TOOLS, AC_JAVA_JNI_LIBS): Remove ancient kaffe and jikes support. Detect JDK version as 1.4 or 1.5. Remove old code to detect CLASSPATH, this was only needed to work around CLASSPATH related bugs in JDK 1.0/1.1 tools. Remove old JNI lib search code, now depends on JDK 1.4 or 1.5 style install paths. 2006-06-28 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/QSort.java (doDictionary): Reimplement dictionary compare based on Tcl 8.4 source. 2006-06-27 Mo DeJong <mdejong@users.sourceforge.net> * src/tjc/tcl/lang/TJCBench.java: Add not operator tests and invoke object tests. * src/tjc/tjc/library/compileproc.tcl: In compileproc_expr_evaluate_boolean_emit, emit optimized boolean result logic when the type of the ExprValue is known at compile time. * tests/tclbench/expr.bench: Add bench tests for if statement that evaluates an expression to a boolean value. * tests/tclbench/internal.bench: * tests/tjc/compileproc_9.test: Add output tests for new boolean result logic. 2006-06-27 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/ExprValue.java (optIntUnaryNot, optIntUnaryNotNstr): Make inlined unary not methods public so that they can be invoked from TJC code. * src/tjc/tcl/lang/TJC.java (exprUnaryNotOperator, exprUnaryNotOperatorKnownInt, exprUnaryNotOperatorKnownIntAsBoolean): Add methods to support compiled unary logical not operator. These methods are invoked when +inline-expr is enabled. The compiler will use compile time type info and optimized runtime logic to handle TclObject and ExprValue cases. This approach executes about twice as fast as invoking TJC.exprUnaryOperator(). * src/tjc/tjc/library/compileproc.tcl: Add compileproc_expr_evaluate_emit_inlined_unary_not_operator and invoke it from compileproc_expr_evaluate_emit_unary_operator, this method implements inlined logic for the unary not operator. This operator will generate literals with a null string rep and emit optimized code that does not null the string rep in the ExprValue. * tests/tjc/compileproc_9.test: Add a host of test cases for inlined unary not. 2006-06-26 Mo DeJong <mdejong@users.sourceforge.net> * src/tjc/tjc/library/compileproc.tcl: Update compileproc_expr_evaluate_result_emit so that it will use new compile time type info to invoke a specific interp.setResult() method based on the ExprValue result type. Each operator and math function now returns info to indicate the result type if it is known at compile time. This change makes most expr commands execute more quickly since it removes a call to a method that branches based on type. * tests/tjc/compileproc.test: * tests/tjc/compileproc_9.test: Add test cases for setting of result based on compile time result info. 2006-06-23 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Interp.java (setResult, checkCommonInteger, checkCommonDouble): Optimize recycled int and double implementations by creating specifc TclObject methods that null the string rep without checking for a disposed or shared object. This logic is only invoked when the refCount is known to be 1 or 2, so it will not modify an actual shared object. This optimization leads to runtime performance gains of 2x to 3x. Make arguments to setResult() final and inline the branch found in checkCommonBoolean to make inlining setResult easier in the boolean case. * src/jacl/tcl/lang/TclObject.java (setRecycledIntValue, setRecycledDoubleValue): Add optimized set methods for int and double cases. These methods avoid calling invalidateStringRep(), they just null the string rep. * src/tcljava/tcl/lang/TclDouble.java (setRecycledInternalRep): Add access method needed only when the recycled object's internal rep was changed. This is not the common case. * src/tjc/tcl/lang/TJCBench.java: * tests/tclbench/internal.bench: Add additional operator plus implementations. 2006-06-23 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Interp.java (Interp, checkCommonInteger, checkCommonDouble, checkCommonBoolean): Implement a "recycled" object for int and double values. This is a TclObject that gets set to a primitive value and it then set to the result or a variable. This implementation avoids thousands of TclObject allocations for the most common result set operations. * src/tests/jacl/tcl/lang/TestRecycled.java: Test recycled result object refCount. * tests/jacl/refCount.test: Invoke TestRecycled tests. 2006-06-22 Mo DeJong <mdejong@users.sourceforge.net> * src/tjc/tcl/lang/TJCBench.java: Add a seires of new bench test for int operator plus and logical or operations. Also add specific tests that set the interp result to int, double, and String values. * tests/tclbench/expr.bench: Add test cases for setting an interp result to int, double, and String values that are not shared constants. * tests/tclbench/internal.bench: Invoke new bench tests. 2006-06-21 Mo DeJong <mdejong@users.sourceforge.net> * src/tjc/tcl/lang/TJCBench.java: Add possible implementations for unary not operator. * src/tjc/tjc/library/compileproc.tcl: Rewrite compileproc_expr_evaluate_emit_binary_operator and add so that expr logic and equals operators are generated in util methods named compileproc_expr_evaluate_emit_binary_equals_operator and compileproc_expr_evaluate_emit_binary_logic_operator. This makes no changes to emitted code. * tests/tclbench/internal.bench: Invoke new bench tests. 2006-06-20 Mo DeJong <mdejong@users.sourceforge.net> * src/tjc/tjc/library/compileproc.tcl: Implement stack based expr values by adding or updating compileproc_init, compileproc_compile, compileproc_variable_cache_names_array, compileproc_expr_value_stack_is_used, compileproc_expr_value_stack_get, compileproc_expr_value_stack_release, compileproc_expr_value_stack_alias, compileproc_expr_value_stack_lookup_alias, compileproc_expr_value_stack_generate, compileproc_expr_value_stack_release_generate, compileproc_expr_evaluate_emit_ternary_operator, compileproc_emit_exprvalue_get, and compileproc_emit_exprvalue_release. This change will store an ExprValue ref on the stack and then use these refs in every expr expression evaluation in the command. Update the ternary operator since the values need to be released back onto the stack as they are processed. * src/tjc/tjc/library/emitter.tcl: Add a finally buffer argument to the emitter_callframe_pop command. * src/tjc/tjc/library/module.tcl: Add support for -inline-expr-value-stack and +inline-expr-value-stack-null options. * tests/tjc/compileproc_9.test: Add test cases for expr stack values logic. 2006-06-19 Mo DeJong <mdejong@users.sourceforge.net> * jaclsh.bat.in: Include existing JAVA_FLAGS env var value when setting JAVA_FLAGS. * src/jacl/tcl/lang/Expression.java (releaseExprValue): Improve check for duplicate value in the ExprValue cache. * src/jacl/tcl/lang/Interp.java: Add final boolean value that will disable shared constant checking. This code path is execution time critical and the extra shared ref checking is not needed by default. Remove extra null ref check in setResult. * src/tcljava/tcl/lang/TclObjectBase.java: Make the DEALLOCATED field final since it will not be changed at runtime. * src/tjc/tcl/lang/TJCBench.java: * tests/tclbench/internal.bench: Add TclObject preserve() and release() timing tests. Rename result tests so that they get sorted together. 2006-06-18 Mo DeJong <mdejong@users.sourceforge.net> * src/tests/tcljava/tests/JavaTest.java: Pass null to Interp.setResult(TclObject). * src/tjc/tcl/lang/TJCBench.java: Add a series of result set, reset result, and unary int not tests to establish base times for ExprValue related optimizations. Tests now take special care to always set a static result after a loop so that optimizer does not omit code in loop body. * tests/tclbench/internal.bench: Invoke new tests. * tests/tclbench/libbench.tcl: Add more debug code to test run method. * tests/tcljava/JavaCallCmd.test: Add NPE test for when Interp.setResult(TclObject) is invoked with a null argument. 2006-06-17 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/ExprValue.java (setValue): Add method to support copying the value inside an ExprValue into a second ExprValue. * src/jacl/tcl/lang/Expression.java (evalMathFunction): Reimplement all math functions so that a value is returned in the first argument instead of grabbing another ExprValue. Invoke rand() with special case since it takes no arguments. * src/tcljava/tcl/lang/TclObjectBase.java (isIntType, isDoubleType): Make these methods public so that they can be used in TJC compiled code. * src/tests/jacl/tcl/lang/JavaTestExtension.java: Update math function tests. * src/tests/tjc/TestTJC.java: Update tests so that ExprValues are explicitly released. * src/tjc/tcl/lang/TJC.java (exprInitValue, exprGetValue, exprMathFunction, exprEqualsEmptyString, exprIntMathFunction): Reimplement math function invocation so that ExprValue objects must be explicitly freed. Pass ExprValue to the empty string test. Don't grab/release ExprValues inside TJC methods, assume the caller will take care of this. * src/tjc/tjc/library/compileproc.tcl: Init +inline-expr cars in compileproc_init. Invoke compileproc_expr_evaluate_boolean_emit to explicitly release ExprValue object when done with them. The TJC layer no longer implicitly releases objects inside TJC mehtods. Rewrite compileproc_expr_evaluate_emit_unary_operator and compileproc_expr_evaluate_emit_binary_operator so that they make use of new compileproc_expr_peek_operand API. The compileproc_expr_peek_operand makes it easy for an operator to examine an operand without having to generate code twice for special cases. Rewrite compileproc_expr_evaluate_emit_math_function so that it is possible to pass an ExprValue object to a math function. * tests/tclbench/expr.bench: Add math function test. * tests/tjc/compileproc.test: Test expr parser logic and new compileproc_expr_peek_operand method. * tests/tjc/compileproc_2.test: * tests/tjc/compileproc_9.test: Update tests that regenerated eval buffers and caused tmp local ids to be skipped. * tests/tjc/testtjc.test: Add tests. 2006-06-13 Mo DeJong <mdejong@users.sourceforge.net> * src/tcljava/tcl/lang/TclObjectBase.java (duplicate, takeExclusive): Explicitly ref TclInteger.dummy in the int case so that the code is more clear. Also, don't copy the string ref if it is null. * src/tcljava/tcl/lang/library/java/javalock.tcl (java::unlock): Pass -exact flag to lsearch. 2006-06-12 Mo DeJong <mdejong@users.sourceforge.net> Rename TclObject.isIntegerType() to isIntType() so that it matches ExprValue. Update callers. This patch makes no functional changes. * src/jacl/tcl/lang/AfterCmd.java: * src/jacl/tcl/lang/ExprValue.java (getIntValue, getDoubleValue, optIntUnaryNot, optIntUnaryNotNstr): Add validate boolean that can be used to enable extra debug checking in getIntValue and getDoubleValue. Add inline method impls for use in Expression class. * src/jacl/tcl/lang/Expression.java (evalUnaryOperator): Invoke optIntUnaryNot(). * src/jacl/tcl/lang/StringCmd.java: * src/jacl/tcl/lang/Util.java: * src/tcljava/tcl/lang/JavaInvoke.java: * src/tcljava/tcl/lang/TclBoolean.java: * src/tcljava/tcl/lang/TclInteger.java: * src/tcljava/tcl/lang/TclObjectBase.java (isIntegerType): Use isIntType() instead of inlined compare to TclInteger.dummy, there is no performance advantage. * src/tests/tjc/tcl/lang/TestTcl.java: * src/tjc/tcl/lang/TJC.java: * src/tjc/tcl/lang/TJCBench.java: * tests/tclbench/expr.bench: Add logical not operator tests. * tests/tjc/testtjc.test: 2006-06-12 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Expression.java (ExprParseObject): Inline TclDouble.get() operation since this change makes a double get about 4x faster and this method is performance critical. * src/tcljava/tcl/lang/TclDouble.java: Make the value field package protected so that it can be accessed in expr functions. * src/tjc/tcl/lang/TJC.java (getBoolean, exprGetKnownInt, exprGetKnownDouble): Inline TclDouble.get() inside getBoolean, this makes getting a boolean value just as fast as an integer value. Add access methods for the int or double value inside a TclObject. * src/tjc/tcl/lang/TJCBench.java: * tests/tclbench/internal.bench: Add test cases for int/double access methods. 2006-06-11 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/AfterCmd.java: * src/jacl/tcl/lang/IdleHandler.java: Implement toString() methods that describe the after or idle event to make debugging easier. 2006-06-09 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/TclList.java (toString): * src/jacl/tcl/lang/Util.java (appendElement, convertElement): Reimplement convertElement so that it uses a StringBuffer argument passed into the method. * src/jacl/tcl/lang/Var.java: Update convertElement caller. * tests/tclbench/list.bench: Add TclList.toString() test case. 2006-06-09 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Add test source info to debug target output. * src/empty/empty.jar: Regen. * src/empty/tcl/lang/TclObject.java (TclObject): * src/jacl/tcl/lang/TclObject.java (TclObject): Add TclObject ctor that accepts an int. * src/tclblend/tcl/lang/TclObject.java (TclObject, setInternalRep): Add TclObject ctor that accepts an int. Set ivalue to zero in setInternalRep. * src/tcljava/tcl/lang/TclInteger.java (newInstance): Just invoke new TclObject ctor. * src/tcljava/tcl/lang/TclObjectBase.java (TclObject, setInternalRep, duplicate): Add TclObject ctor that accepts an int. Set ivalue to zero in setInternalRep. Comment out var set operations that set the default value. This improves execution speed slightly. * src/tests/tjc/tcl/lang/TestTcl.java: * tests/tjc/testtjc.test: Add regression test for TclObject type util methods. 2006-06-07 Mo DeJong <mdejong@users.sourceforge.net> Create type test methods in TclObject class. Replace use of instanceof with calls to type test methods. * src/jacl/tcl/lang/AfterCmd.java: * src/jacl/tcl/lang/FconfigureCmd.java: * src/jacl/tcl/lang/Interp.java: * src/jacl/tcl/lang/LindexCmd.java: * src/jacl/tcl/lang/StringCmd.java: * src/jacl/tcl/lang/TclList.java: * src/jacl/tcl/lang/Util.java: * src/tclblend/tcl/lang/TclList.java (setListFromAny): Update setListFromAny so that it matches set methods in other common classes. * src/tcljava/tcl/lang/JavaInvoke.java: * src/tcljava/tcl/lang/TclBoolean.java: * src/tcljava/tcl/lang/TclDouble.java: * src/tcljava/tcl/lang/TclInteger.java (setIntegerFromAny): Set ivalue after invoking setInternalRep() since this method will reset the ivalue. * src/tcljava/tcl/lang/TclObjectBase.java (isStringType, isListType, TclObjectBase, TclObjectBase, setInternalRep): Set ivalue to default value and add accessor methods. * src/tcljava/tcl/lang/TclString.java (setStringFromAny): Update setStringFromAny so that it matches set methods in other common classes. * src/tjc/tcl/lang/TJC.java (setVarScalar): Change method to void return type since it always returns the argument. Make it non-public since this method is not used anywhere. * src/tjc/tcl/lang/TJCBench.java: * tests/tclbench/internal.bench: Add bench tests. * tests/tcljava/tcljavaInterp.test: Fixup TclObject size output changed by last checkin. 2006-06-07 Mo DeJong <mdejong@users.sourceforge.net> Rewrite TclObject and TclInteger classes so that an object that contains an integer value stores the int inside the TclObject instance. This change allows direct access for int read, write, and incr operations. Each TclObject is now 4 bytes larger, but this is more than made up for by the fact that each TclObject that contains an int value no longer needs to allocate a 16 byte TclInteger internal rep. This implementation shows a significant improvement across the whole TclBench suite and shaves 8 seconds off the TJC recompile time. * src/jacl/tcl/lang/Expression.java (ExprParseObject, ExprParseString): Make arguments to method final. Check for int/double type using new TclObject methods and read int value directly. * src/tcljava/tcl/lang/TclBoolean.java (get): Read int value directly when getting a boolean result from an integer value. * src/tcljava/tcl/lang/TclInteger.java: Use the same TclInteger dummy value as the internal rep for every TclObject that contains an integer. This makes it possible to determine if a TclObject contains an integer by doing a pointer compare instead of an instanceof operation. This also makes it possible to access or change an int value without having to upcast from an internal rep. * src/tcljava/tcl/lang/TclObjectBase.java (TclObjectBase, duplicate, takeExclusive): Implement special case logic for a TclObject that contains an int value. * src/tjc/tcl/lang/TJC.java (getBoolean, lindexNonconst, stringIndex, stringRange, stringLast): Reimplement getBoolean logic so that it works like ExprParseObject. Access integer value directly in lindex and string methods that accept a TclObject that could contain an integer. 2006-06-06 Mo DeJong <mdejong@users.sourceforge.net> * src/tests/jacl/tcl/lang/JavaTestExtension.java: * src/tests/tclblend/tcl/lang/NativeTestExtension.java: * src/tests/tcljava/tcl/lang/TclObjectMemory.java: Add testtclobjectmemory command. * src/tjc/tcl/lang/TJCBench.java: * tests/tclbench/internal.bench: Remove split tests since they take far too long to execute. Add TclObject internal tests. * tests/tcljava/tcljavaInterp.test: Add test case that checks TclObject and related object memory sizes. * tests/tjc/testtjc.test: Update unknown class message as a result of recent changes to the TJC::compile and TJC::command commands. 2006-06-05 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/SplitCmd.java (appendElement): Fix bug that resulted in common char and empty string not being used when splitting a string. * src/tjc/tcl/lang/TJCBench.java: * tests/tclbench/internal.bench: Add string split runtime tests. 2006-06-04 Mo DeJong <mdejong@users.sourceforge.net> * src/tjc/tcl/lang/TJCBench.java: Add TclList basic operation tests. * tests/tclbench/compare.tcl: Calc time delta. * tests/tclbench/internal.bench: * tests/tclbench/loops.bench: Add tests for split command. 2006-06-03 Mo DeJong <mdejong@users.sourceforge.net> * src/tjc/tcl/lang/TJCBench.java: Add Tcl Bench tests for internal APIs. * src/tjc/tcl/lang/TJCCommandCmd.java: * src/tjc/tcl/lang/TJCPackageCmd.java: Update class loading logic so that getClassByName() is used to load a Java class by name. This fixes support for inner class names. * tests/tclbench/internal.bench: Add internal benchmark tests for TJC and Expression modules. 2006-06-01 Mo DeJong <mdejong@users.sourceforge.net> * tests/tclbench/invoke.bench: Run invoke_1_to_10_loop the default number of iterations. Running only 100 iterations produced very confusing results that did not match from one run to the next. * tests/tclbench/jacl1+tjc.out: Removed. * tests/tclbench/jacl1.out: Removed. * tests/tclbench/jacl132.out: Removed. * tests/tclbench/libbench.tcl: Require that test result converge twice before stopping. Also, generate average of last 3 times as the result time instead of picking the smallest time. This gives a better average results for multiple runs. * tests/tclbench/tclsh8411.out: Removed. 2006-05-31 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Interp.java (eval, evalResource): Check for exception and raise proper error message in case Jacl is run in an applet. 2006-05-30 Mo DeJong <mdejong@users.sourceforge.net> * src/tcljava/tcl/lang/TclString.java: Reimplement TclString so that a dummy ref is set inside the TclObject. This dummy value is used for each TclObject that contains a TclString unless the TclString is appended to. This change avoids having to allocate thousands of unused TclString instances. 2006-05-29 Mo DeJong <mdejong@users.sourceforge.net> Comment out debug statements. This generates less code in a compiled tjc.jar. * src/tjc/tjc/library/compileproc.tcl: * src/tjc/tjc/library/descend.tcl: * src/tjc/tjc/library/parse.tcl: 2006-05-29 Mo DeJong <mdejong@users.sourceforge.net> * tests/tclbench/compare.tcl: Add script that is used to process the output of tclbench and convert it to a CSV file that can easily be imported into a spreadsheet. 2006-05-27 Mo DeJong <mdejong@users.sourceforge.net> * src/tjc/tjc/library/compileproc.tcl: Add support for +inline-expr flag. Implement inlined logic in compileproc_expr_evaluate_emit_binary_operator for the eq and ne expr operators. * src/tjc/tjc/library/module.tcl: Add support for +inline-expr flag. * tests/tclbench/expr.bench: Add tests for specific inlined operations. * tests/tjc/compileproc_2.test: * tests/tjc/compileproc_9.test: Add test cases for inlined unary and binary operators. * tests/tjc/module.test: Add +inline-expr tests. 2006-05-26 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/ExprValue.java: Add a series of inlined math operations. These methods will be inlined in the Expression.evalBinaryOperator() method. * src/jacl/tcl/lang/Expression.java (evalBinaryOperator): Add implementation of math operators that makes use of inlined methods in the ExprValue. This implementation executes slightly faster than the previous implementation. Also move STREQ and STRNEQ operators into first switch since no operand validation is needed for these operators. * src/tjc/tcl/lang/TJC.java (exprBinaryOperator, exprUnaryOperator): Make arguments final. 2006-05-25 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Expression.java (ExprParseObject, ExprParseString): Optimize expr int and double parse routines by removing logic that dealt with TclBoolean object type. The TclBoolean class is seldom used, so dealing with only int and double types makes things more simple and it removed an instanceof op. * src/jacl/tcl/lang/Interp.java: Use shared int constants for the boolean true and false constants. The TclBoolean class can make use of these objects as boolean values and this change makes it much less likely that the expr module will ever encounter an object of type TclBoolean. * src/tcljava/tcl/lang/TclBoolean.java (setBooleanFromAny): Remove unused instanceof operation and update comments. * src/tcljava/tcl/lang/TclInteger.java (setIntegerFromAny): Remove special logic that dealt with TclBoolean values. An integer is now reparsed from the string rep in all cases. * src/tjc/tcl/lang/TJC.java (getBoolean): Remove logic to deal with TclBoolean object type and invoke ExprParseString() instead of ExprParseObject() to avoid pointless instanceof operations. * tests/tcl/expr.test: Add string rep tests for boolean constant value. * tests/tjc/compiledLocals.test: Update tests to account for change in shared boolean constant which is now an object of type TclInteger. 2006-05-25 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Expression.java (evalBinaryOperator): Optimize evalBinaryOperator method by doing a query of the left and right operand type at the start of the binary operator method. Each type check in the method will then use the local instead of an inlined ExprValue method. 2006-05-24 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/ExprValue.java (nullStringValue): Add method for use in expr unary plus operator. * src/jacl/tcl/lang/Expression.java (evalUnaryOperator): Set string rep of expr value to null in unary +. * src/tjc/tjc/library/compileproc.tcl (compileproc_expr_evaluate, compileproc_expr_evaluate_emit_unary_operator, compileproc_expr_evaluate_emit_exprvalue): Fixup detection of constant boolean expr. The string "+1" was incorrectly detected as a constant boolean value. Implement +, -, and ~ operators as compile time constants when applied to literal numeric values. * tests/tjc/compileproc_2.test: Add test cases for constant boolean bug and constant literal unary operators. * tests/tjc/parse.test: Add tests for unary plus and minus operators. These tests did not reveal a bug in the parser layer. 2006-05-22 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/ArrayCmd.java: Update Var field names. * src/jacl/tcl/lang/Var.java (Var, lookupVar, lookupArrayElement, getVarPtr, setVarPtr, initVarCompiledLocalScalar, unsetVar, makeUpvar, deleteVar, deleteArray, resolveScalar, resolveArray): Reimplement Var class using three typed references instead of a generic Object reference. This approach uses more memory for each instance in an already bloated class, but it avoids a slow up cast operation in the critical execution path in compiled code. * src/tests/jacl/tcl/lang/TestVarFrameCmd.java: Update Var field names. * src/tjc/tcl/lang/TJC.java (getVarScalar, incrVarScalar, lappendVarScalar, appendVarScalar, setVarScalar): Rewrite inline methods so that costly upcast is avoided. 2006-05-22 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/SplitCmd.java (cmdProc): Reimplement split command so that it will make use of a shared empty string and single character objects. This change speeds up the case of splitting on every char by 3x. * tests/tcl/split.test: Add additional split tests. * tests/tclbench/loops.bench: Add string split test and rename existing test. 2006-05-22 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Expression.java (ExprParseString, looksLikeInt): Update strtod() caller and break out of space scanning loop as soon as non-space is found. Optimize looksLikeInt, invoke charAt() only when needed and use inlined char range. * src/jacl/tcl/lang/ParseExpr.java: * src/jacl/tcl/lang/ScanCmd.java: * src/jacl/tcl/lang/StringCmd.java: Update strtod() caller. * src/jacl/tcl/lang/Util.java (strtoul, strtod, CharAt): Optimize int and double parsing functions, call charAt() only when needed and avoid invoking functions when char literal can be tested. * tests/tcl/expr.test: Add literal tests. * tests/tclbench/expr.bench: Add runtime test for case where non-numeric string is compared to itself over an over. * tests/tclbench/runbench.tcl: 2006-05-19 Mo DeJong <mdejong@users.sourceforge.net> * docs/TJC/future.html: Remove compiled local info since this feature is implemented. * docs/TJC/module.html: Add +omit-results info. * src/tjc/tjc/library/compileproc.tcl: Rework compileproc_scan_keys so that a "result" flag is kept for each compiled key. This boolean flag is set to false when the command's result is not accessed in the proc. Inlined commands like set can take advantage of this flag to avoid setting the interp result when it will not be used. Update the catch, for, foreach, if, switch, and while container commands so that they don't reset the interp result unless the result of the container command is used. Update inlined append, incr, lappend, set, and global commands so that interp result is not set when unused. * src/tjc/tjc/library/emitter.tcl: Update for util method so that it will skip the interp.resetResult() call when unused. * src/tjc/tjc/library/module.tcl: Add support for +omit-results flag. * tests/tjc/compileproc.test: Add test cases for result used logic. * tests/tjc/compileproc_8.test: Add output tests for +omit-results flag. * tests/tjc/emitter.test: * tests/tjc/module.test: Add module tests related to +omit-results flag. 2006-05-18 Mo DeJong <mdejong@users.sourceforge.net> * src/tcljava/tcl/lang/JavaInvoke.java (newInstance): Fixup support for both "Boolean" and "java.lang.Boolean" in overloaded construtor signatures. * tests/tcljava/JavaNewCmd.test: Add test case for fully qualified primitive wrapper constructor. 2006-05-17 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/QSort.java (doDictionary): Fix lsort -dictionary bug where strings of differing lengths were not sorting correctly. The sort order logic now works like C Tcl 8.4. * tests/tcl/lsort.test: Add Tcl test cases for lsort -dictionary from Tcl 8.4. 2006-05-16 Mo DeJong <mdejong@users.sourceforge.net> * src/tests/jacl/tcl/lang/JaclSetInterrupted.java: * src/tjc/tcl/lang/TJC.java (invoke): Add missing checkInterrupted() call so that compiled code can be interrupted. * tests/jacl/SetInterrupted.tcl: * tests/jacl/SetInterrupted.test: Add test case for interruption of TJC compiled code. 2006-05-15 Mo DeJong <mdejong@users.sourceforge.net> * src/tjc/tjc/library/module.tcl (module_parse): Fixup backslash processing bug where lines that appear after the first do not have the backslash removed and result in a parse error. * tests/tjc/module.test: Add test case for backslash processing bug. 2006-05-15 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/ExprValue.java: Comment fixup. * src/jacl/tcl/lang/TclList.java (toString): Don't allocate a StringBuffer for an empty list. * src/tcljava/tcl/lang/FuncSig.java (getAccessibleConstructors): Fix minor bug where no accessible constructors could lead to a NPE. * src/tcljava/tcl/lang/TclObjectBase.java (toString, duplicate): Minor disposed object optimizations. * src/tests/tjc/TestTJC.java: Comment fixups. * tests/tcljava/FuncSig.test: Add test case for getAccessibleConstructors NPE. 2006-05-15 Mo DeJong <mdejong@users.sourceforge.net> Regenerate files that include version numbers because vsub.sh incorrectly wrote files with CRLF translation. * configure.in: * src/pkgIndex.tcl: * src/jacl/tcl/lang/Interp.java: * src/tcljava/tcl/lang/BlendExtension.java: * unix/tools/vutil/current: * unix/tools/vutil/fsub.tcl: Fixup file output logic so that lf translation is always used. * unix/tools/vutil/vsub.sh: Test for empty version argument. * win/makefile.vc: 2006-05-14 Mo DeJong <mdejong@users.sourceforge.net> * src/empty/empty.jar: Regen. * src/empty/tcl/lang/Util.java: Add fake method impl. * src/jacl/tcl/lang/Expression.java (ExprParseObject): Remove ugly logic that dealt with TclObject passed into expr module. The previous code needed to check every TclDouble to see if it looked like an int that was converted to a double. The TclDouble class will no longer convert a TclObject to a TclDouble if the string could be parsed as an integer. * src/jacl/tcl/lang/Util.java (isJacl, looksLikeInt): Add util methods for use in TclDouble class. * src/tclblend/tcl/lang/Util.java: Add method impl that do nothing under Tcl Blend. * src/tcljava/tcl/lang/TclDouble.java (get): When running in Jacl, check for a string that can be parsed as both a double and an int. Change the internal rep to TclInteger in a case like this. * src/tcljava/tcl/lang/TclInteger.java: Comment fixup. * src/tests/tjc/tcl/lang/TestTcl.java: Add tests for TclDouble conversion special cases. * tests/tcl/obj.test: Update test since internal rep is no longer changed to TclDouble. * tests/tclbench/expr.bench: Add double tests. * tests/tjc/compiledLocals.test: Add tests to check the internal rep of object when dealing with TclDouble conversions. * tests/tjc/testtjc.test: Add tests. 2006-05-14 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Expression.java: Check in a number of little util fixes. * src/jacl/tcl/lang/FormatCmd.java: Comment fixup. * src/jacl/tcl/lang/TclList.java: Return empty string constant for a list with 0 elems. * src/jacl/tcl/lang/Util.java: Avoid raising an exception for the empty string. * tests/tclbench/expr.bench: Add a couple of square root generation tests. * tests/tclbench/libbench.tcl: Use integer times. * tests/tclbench/switch.bench: Add a bunch of switch runtime tests. 2006-05-13 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Expression.java (ExprParseObject): * src/tcljava/tcl/lang/TclDouble.java (setDoubleFromAny): * src/tcljava/tcl/lang/TclInteger.java (setIntegerFromAny): Fixup logic to deal with tricky octal string case. This is a string the looks like an integer but can be parsed as a double. Both the Expression and TclDouble modules now reparse from the string rep. * tests/tcl/expr.test: Add test cases for octal string that looks like an int but can be parsed as a double. 2006-05-12 Mo DeJong <mdejong@users.sourceforge.net> * src/janino/org/codehaus/janino/UnitCompiler.java: Implement temporary workaround for verifier errors in foreach and return tjcruntime modules by upping the try/catch register used. This is not the correct long term solution, but it makes janino pass all the tests cases in the tjcruntime suite. 2006-05-12 Mo DeJong <mdejong@users.sourceforge.net> * src/janino/org/codehaus/janino/Java.java: * src/janino/org/codehaus/janino/UnitCompiler.java: Fixup support for break and continue statements inside of loops. A while, do, or for loop can contain a break or continue statement that does not does not complete normally, but the loop can still complete normally. This patch also fixes up unconditional if logic so that it will correctly propagate the dead code flag up the stack. 2006-05-01 Mo DeJong <mdejong@users.sourceforge.net> * src/tjc/tjc/library/compileproc.tcl: Fix problem in compileproc_scan_keys where a container command with a nested expr block that contained more than 1 nested command would result in a compiler error. Add compileproc_scan_keys_in_container and compileproc_scan_keys_in_container_sublist so that container keys are scanned in a type specific way. Recurse on a keys sublist to fix the multiple nested commands bug. * tests/tjc/compileproc_2.test: Add test case for multiple nested commands bug. 2006-04-29 Mo DeJong <mdejong@users.sourceforge.net> * configure: Regen. * configure.in: * src/pkgIndex.tcl: * src/jacl/tcl/lang/Interp.java: * src/tcljava/tcl/lang/BlendExtension.java: * unix/tools/vutil/current: * win/makefile.vc: Update version to 1.4.0. 2006-04-26 Mo DeJong <mdejong@users.sourceforge.net> * docs/contents.html: Add new Jacl and Tcl Blend topics directory. * docs/TclJava/JavaTryCmd.html: Mention that java::try can't be used to catch a TclInterruptedException. * docs/Topics/EventLoop.html: Document Tcl event loop basics. * docs/Topics/SetInterrupted.html: Document new interp.setInterrupted() API. * docs/Topics/el1.gif: * docs/Topics/el2.gif: * docs/Topics/el3.gif: * docs/Topics/el4.gif: * docs/Topics/index.html: * docs/Topics/si1.gif: * src/jacl/tcl/lang/Interp.java (setInterrupted, checkInterrupted, disposeInterrupted): Add new public interp.setInterrupted() API. This is used to interrupt execution of an interpreter and unwind the stack from another thread. See SetInterrupted.html for details. * src/jacl/tcl/lang/Notifier.java (hasActiveInterps, processTclEvents): Add method so that user code can determine if there are any active interpreters. Add util method to process events in a loop including TclInterruptedException support. * src/jacl/tcl/lang/Shell.java: Invoke new Notifier.processTclEvents() method. * src/jacl/tcl/lang/TclInterruptedException.java: New TclInterruptedException and event that will interrupt a waiting event loop. * src/jacl/tcl/lang/TimerHandler.java: * src/tcljava/tcl/lang/JavaTryCmd.java: Docs fixup. * src/tests/jacl/tcl/lang/JaclSetInterrupted.java: Don't allow catch of TclInterruptedException in Tcl code, but do run the finally block when interrupted. * tests/jacl/SetInterrupted.tcl: * tests/jacl/SetInterrupted.test: Regression tests for interp.setInterrupted() API. 2006-04-24 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Notifier.java (processEvent): When an after event blocks in a vwait, any remaining after events should be processed via another TclEvent. The Notifier class contained a bug that would cause after events to not be processed. Fix the problem by setting the timerPending flag to false before invoking a callback that might invoke vwait. Add some null pointer and disposed notifier checks. * tests/tcl/timer.test: Add test case for an after command that blocks in a vwait. 2006-04-13 Mo DeJong <mdejong@users.sourceforge.net> * new_features.txt: Mention recent changes. * docs/TclJava/JavaForCmd.html: Document java::for. * docs/TclJava/contents.html: * src/tcljava/tcl/lang/BlendExtension.java: * src/tcljava/tcl/lang/JavaForCmd.java: Add new java::for loop command. This provides an easy way to loop over Collection and array objects. * tests/tcljava/JavaForCmd.test: Test new command. 2006-04-12 Mo DeJong <mdejong@users.sourceforge.net> Implement support for inner classes without having to use $ in the class name. Inner classes can now be indicated using either and imported or fully qualified class name. The [java::info class $c] will now return inner class names with no $ in the name. * Makefile.in: * src/jacl/tcl/lang/Interp.java: * src/tclblend/tcl/lang/Interp.java: * src/tcljava/tcl/lang/Extension.java: * src/tcljava/tcl/lang/FieldSig.java: * src/tcljava/tcl/lang/FuncSig.java: * src/tcljava/tcl/lang/JavaCastCmd.java: * src/tcljava/tcl/lang/JavaImportCmd.java: * src/tcljava/tcl/lang/JavaInfoCmd.java: * src/tcljava/tcl/lang/JavaInstanceofCmd.java: * src/tcljava/tcl/lang/JavaInvoke.java: Implement inner class loading by searching for containing class in the given class name. * src/tcljava/tcl/lang/JavaLoadCmd.java: * src/tcljava/tcl/lang/JavaNewCmd.java: * src/tcljava/tcl/lang/PackageNameException.java: * src/tcljava/tcl/lang/ReflectObject.java: * src/tcljava/tcl/lang/TclClassLoader.java: Rework TclClassLoader so that a PackageNameException is raised when a class in the java. or tcl. package is loaded but can't be found. The previous implementation would raise a SecurityException but this was confusing because there are situations where SecurityException could be raised and it is not useful to treat these like a class not found error. * src/tcljava/tcl/lang/reflect/PkgInvoker.java: * src/tests/tcljava/tests/DupTest.java: * src/tests/tcljava/tests/ImportTest.java: * src/tests/tcljava/tests/InnerImport.java: * src/tests/tcljava/tests/InnerTest.java: * src/tests/tcljava/tests/TestInterpThreadContextClassCmd.java: * src/tests/tcljava/tests/InnerTest/DupName.java: * src/tests/tcljava/tests/InnerTest/DupTest.java: * src/tjc/tcl/lang/TJCCommandCmd.java: * src/tjc/tcl/lang/TJCPackageCmd.java: * tests/tcljava/AutomaticSignature.test: * tests/tcljava/JavaImportCmd.test: Add test cases for inner class names where the containing class is imported. * tests/tcljava/JavaLoadCmd.test: * tests/tcljava/JavaNewCmd.test: Add allocation of inner static inner class tests. 2006-04-11 Mo DeJong <mdejong@users.sourceforge.net> * src/tjc/tjc/library/compileproc.tcl (compileproc_emit_container_if): Reset the interp result when emitting an inlined if command with an empty block. Also reset the interp result when there is no else block. It is very unlikely that this would be a problem in real code, but it is needed to for complete compatibility. * tests/tjc/compileproc.test: * tests/tjc/compileproc_2.test: * tests/tjc/compileproc_3.test: Update test cases. 2006-04-10 Mo DeJong <mdejong@users.sourceforge.net> * src/empty/empty.jar: Regen. * src/empty/tcl/lang/Interp.java (evalResource): * src/jacl/tcl/lang/Interp.java (evalResource): * src/tclblend/tcl/lang/Interp.java (evalResource): Make Interp.evalResource() API public so that it can be used outside the tcl.lang.* package. Tcl Blend provides no way to access this API, so it is now public so that anyone can call it. * tests/tcljava/tcljavaInterp.test: Test eval of Tcl script inside a jar both loaded by the system loader from the CLASSPATH and by the TclClassLoader from env(TCL_CLASSPATH). These tests were failing under Tcl Blend. 2006-04-10 Mo DeJong <mdejong@users.sourceforge.net> * src/tclblend/tcl/lang/Interp.java (getClassLoader): If no context class loader is defined, then use the class loader that loaded Interp.class. If that fails use the system class loader. This is needed to avoid crashing when Tcl Blend is loaded dynamically, as a JVM created in a native thread does not define a context class loader. 2006-04-10 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/FormatCmd.java: Fix typos. * src/jacl/tcl/lang/Util.java (strtod): Support both Inf and Infinity so that both Tcl and Java strings can be used for a TclDouble. This also makes it possible to pass these strings to Java methods as a double or float. * src/native/javaUtil.c (getDoubleNative): Rename native impl from getDouble to getDoubleNative. * src/tclblend/tcl/lang/Util.java (getDouble, getDoubleNative): Create wrapper around native getDouble call so that the strings Inf, Infinity, and NaN can be checked for before sending the string to the native double code. This makes TclBlend's impl of Util.getDouble() work like the Jacl impl. * src/tcljava/tcl/lang/JavaInvoke.java (newInstance, convertTclObject, parseJavaInt, parseJavaLong): When invoking a primitive wrapper constructor, choose the version that accepts a primitive Java type. This is needed so that the method layer will not incorrectly choose the version that accepts a String since that would bypass all the primitive conversion logic. Implement new int and long parsing routines that correctly handle min and max values for Java int and long types. Tcl does not use signed 32 bit numbers when parsing so it is not able to detect overflow and underflow. Address this by parsing from the string rep of each integer or long before passing to Java. This change also fixes passing of long literals which were being incorrectly cropped to integer values before being passed to Java. * src/tcljava/tcl/lang/TclDouble.java: Argument name. * tests/tcljava/JavaInvoke.test: Test correct min/max integer and long values and error messages when a number is out of range. * tests/tcljava/JavaNewCmd.test: Test for typed constructor invocations as well as a host of floating point bound and integer bound issues. 2006-04-07 Mo DeJong <mdejong@users.sourceforge.net> Update Jacl's expr module to behave like Tcl when dealing with TclObject arguments to expr commands. The expr module will now change the internal rep of a TclString into either a TclInteger or TclDouble when a number can be parsed from the string rep. This makes future calls to expr with this same object much faster since the string need not be parsed into a number again. * src/jacl/tcl/lang/Expression.java (ExprParseObject, ExprParseString): Don't check for TclList internal rep when attempting to parse a number. If a TclDouble is found but the number looks like a TclInteger, then convert the number back to a TclInteger. Pass a TclObject argument to ExprParseString and let it change the internal rep when a number is parsed from the string. * src/tcljava/tcl/lang/TclDouble.java (exprSetInternalRep): * src/tcljava/tcl/lang/TclInteger.java (exprSetInternalRep): Implement util methods to allow the expr module to change the internal rep of an object to an already parsed number. * src/tests/tjc/tcl/lang/TestTcl.java: Add test methods. * src/tjc/tcl/lang/TJC.java (getBoolean): Reimplement string parsing logic so that any type of expr string can be passed to getBoolean. The previous logic incorrectly assumed that passed in TclString objects would contain a string that could be parsed as a boolean. This bug would only show up in compiled code that passed a TclString object to an expr like [if {$obj} {...}]. * tests/tclbench/expr.bench: Add expr bench tests. * tests/tjc/compiledLocals.test: Add tests to check the internal rep of TclObject values passed to expr commands. * tests/tjc/testtjc.test: Test new expr semantics. 2006-04-05 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Interp.java (Interp): Intern common String objects of length 1. This optimization makes String.equals(String) return true for the ref compare to a compiled String of length 1 that holds an ASCII character. 2006-04-05 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Interp.java (evalResource): Implement cache for Tcl scripts loaded from jacl.jar and tcljava.jar. The init.tcl script is loaded when a new Interp() is created, and this cache makes that operation a bit faster. This change would make script loading operations a lot faster in the worst case of a class loader that did not cache loaded resources. 2006-04-05 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/ExecCmd.java (cmdProc): Reimplement JDK 1.3 and newer exec so that two threads are created. One reads stdout of the subprocess while the other reads stderr. This is needed to avoid deadlocking in waitFor() when a process writes a lot of stdout and stderr. * src/tests/tcljava/tests/exec/ExecLotsOutput.java: * tests/inprogress/ExecCmd.test: Add test case for the waitFor() exec deadlocking bug. 2006-03-30 Mo DeJong <mdejong@users.sourceforge.net> * tests/tjc/tjcthread.test: Adjust TIMEOUT values based on how long the first compile takes. This keeps the tests from timing out too quickly on a heavily loaded system. 2006-03-27 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Var.java: Create new Var flag TRACE_EXISTS and set it instead of NO_CACHE when traces are defined. Also, fix a bug in untraceVar() where deleting a trace should have nulled out the traces field. Mark resolver vars as NO_CACHE to match the C implementation. Check for this new TRACE_EXISTS flag in the resolveScalar and resolveArray methods. Remove questionable setting of Var.hashKey to null when nulling out a compiled local slot post unset. * src/tests/jacl/tcl/lang/TestVarFrameCmd.java: Reimplement resolve var printing so that the state flags are printed. This shows why a var can't be resolved if in fact it can't be. * tests/tjc/compiledLocals.test: Update test cases to show why resolve fails. 2006-03-27 Mo DeJong <mdejong@users.sourceforge.net> * src/tclblend/tcl/lang/Interp.java (evalFile): Add TclBlend implementation of Interp.evalFile(). * tests/tcljava/javaInterp.test: Removed. * tests/tcljava/tcljavaInterp.test: Add test case for Interp.evalFile() API. 2006-03-27 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Running `make tjc2` will now copy the generated tjc.jar and tjcsrc.jar into the build dir so that they will be installed by `make install`. The tjc two stage build is now stable enough to be used all the time. * jaclsh.in: Add JAVA_FLAGS env var that can be set in the user env. * src/jacl/tcl/lang/ExprValue.java: Add ExprValue constructor with boolean argument. * src/jacl/tcl/lang/Parser.java: Make objv cache larger for small sizes like 1 and 2 and add a cache for size 10. * src/jacl/tcl/lang/TclParse.java: Add boolean flag that can be used to disable TclToken cache for testing. Release tokens to cache in reverse order to keep the objects in the cache fresh. * src/tjc/tcl/lang/TJC.java: Add flag to disable objv and expr value cache. These caches should be used since disabling them leads to a serious performance hit. * src/tjc/tcl/lang/TJCCompileCmd.java: Add debug output. * tests/tclbench/libbench.tcl: Cleanup code that runs the test method once and checks for errors. 2006-03-26 Mo DeJong <mdejong@users.sourceforge.net> Reimplement compiled locals array as a plain array of Var objects. The previous implementation used a Var.CompiledLocal class that just held 2 var refs and a state flag. This new implementation avoids a pointless object allocation for each variable and is much simpler since we don't need to keep track of a second resolved Var ref. * src/jacl/tcl/lang/CallFrame.java: Change compiledLocals decl from Var.CompiledLocal[] to Var[]. * src/jacl/tcl/lang/InfoCmd.java (AppendLocals): Move AppendLocals into Var class. * src/jacl/tcl/lang/Var.java (isVarNonLocal, setVarNonLocal, lookupVar, initVarCompiledLocalScalar, setVarCompiledLocalScalarInvalid, getVarCompiledLocalScalarInvalid, initVarCompiledLocalArray, setVarCompiledLocalArrayInvalid, getVarCompiledLocalArrayInvalid, getVarCompiledLocalArray, setVarCompiledLocalArray, unsetVar, makeUpvar, deleteVars, deleteVar, resolveScalar, resolveArray, setUndefinedToNull, AppendLocals): Reimplement compiled local array as simple array of Var. Remove all the resolved ref management code since a link var is now resolved on each invocation. Remove the CompiledLocal class and update callers. Add NON_LOCAL state flag to Var class to replace CompiledLocal.isLocal flag. Add logic so that we are sure a Var object always refs either a scalar or an array but never another Var. Simplify compiled local methods by only passing needed arguments. * src/jacl/tcl/lang/VariableCmd.java: Use Var.isVarNamespace() and Var.setVarNamespace() instead of bit flags. * src/tests/jacl/tcl/lang/TestVarFrameCmd.java: Update compiled local array introspection. * src/tjc/tcl/lang/TJC.java (initCompiledLocals, initVarScoped, getVarScalar, getVarArray, setVarScalar, setVarArray, incrVarScalar, incrVarArray, lappendVarScalar, lappendVarArray, appendVarScalar): Update compiled local method callers. A link var is now resolved on each invocation by a call to either resolveScalar() or resolveArray(). * src/tjc/tjc/library/emitter.tcl: Emit compiled local array as type Var[]. * tests/tjc/compiledLocals.test: * tests/tjc/compileproc_6.test: * tests/tjc/compileproc_7.test: Update test output. 2006-03-24 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/CallFrame.java (CallFrame, dispose): Add compiledLocalsNames field to CallFrame, this array of type String stores the names for each compiled local variable. * src/jacl/tcl/lang/Var.java (toString, lookupVar, initVarCompiledLocalScalar, setVarCompiledLocalScalarInvalid, getVarCompiledLocalScalarInvalid, initVarCompiledLocalArray, setVarCompiledLocalArrayInvalid, getVarCompiledLocalArrayInvalid, getVarCompiledLocalArray, setVarCompiledLocalArray, makeUpvar): Print state flags in toString(). Search the compiled local names array to determine if a variable being looked up should live in the compiled local array. If a variable is being created at runtime, check to see if it should be created in the compiled local array. This is much more simple than the previous implementation which could end up checking the local table on each var init. Split the var set when ref invalid and var init cases out into two methods for both the scalar and array types. * src/tests/jacl/tcl/lang/TestVarFrameCmd.java: Print UNDEFINED-> when the linked to var has the UNDEFINED state set. * src/tjc/tcl/lang/TJC.java (initCompiledLocals, initVarScoped, getVarScalar, getVarArray, setVarScalar, setVarArray) Don't pass Interp to initCompiledLocals since it is not used and init CallFrame.compiledLocalsNames. Create initVarScoped method that will be called to setup non-local scoped link vars. Invoke compiled local var init methods when the compiled local slot is null and invalid methods when the resolved ref is not valid. * src/tjc/tjc/library/compileproc.tcl: Rework variable get and set code so that a result tmpsymbol is passed into methods. This makes it possible to emit more than 1 statement in a get or set operation. * src/tjc/tjc/library/emitter.tcl: Pass tmpsymbol to var get and set methods. * tests/tcl/upvar.test: Add scoped upvar test. * tests/tclbench/list.bench: Fixup typo. * tests/tjc/compiledLocals.test: * tests/tjc/compileproc.test: * tests/tjc/compileproc_6.test: * tests/tjc/compileproc_7.test: * tests/tjc/emitter.test: Update tests to account for compiled local changes. 2006-03-21 Mo DeJong <mdejong@users.sourceforge.net> Create inlined versions of the incr, lappend, and append commands that work with compiled local array variables. * docs/TJC/optcode.html: Mention inlined array access for incr, lappend, and append. Show examples where array access is slower that using scalar vars. * src/jacl/tcl/lang/Var.java ( getVarCompiledLocalArray): Add boolean flag to indicate when an error should be raised vs null returned. This is needs to optimize lappend for a non-existent array element. * src/tjc/tcl/lang/TJC.java (getVarArray, incrVarScalar, incrVarArray, lappendVarArray, appendVarArray, incrVar, lappendVar, appendVar): Implement runtime support for inlined incr, lappend, and append commands that work with compiled local array variables. * src/tjc/tjc/library/compileproc.tcl: Update compileproc_emit_invoke_call, compileproc_emit_objv_assignment, compileproc_can_inline_command_append, compileproc_emit_inline_command_append, compileproc_emit_append_call_impl, compileproc_can_inline_command_incr, compileproc_emit_inline_command_incr, compileproc_can_inline_command_lappend, compileproc_emit_inline_command_lappend, compileproc_emit_lappend_call_impl, compileproc_get_set_nonconstant_array_variable, and compileproc_setup_nonconstant_array_variable, to support inlined versions of incr, lappend, and append that work with compiled local array variables. These methods now all accept a static array var name with a non-static key. * tests/tclbench/append.bench: Add append tests. * tests/tclbench/incr.bench: Add incr tests. * tests/tjc/compiledLocals.test: Add inline command tests. * tests/tjc/compileproc_7.test: Output tests for inlined incr, lappend, and append commands. 2006-03-19 Mo DeJong <mdejong@users.sourceforge.net> Implement compiled local array variables. Array variables are now kept in the compiled local array just like scalars. This change makes array variable access a bit faster as it avoids a hashtable lookup for each array var access. This implementation mimics the C Tcl implementation of compiled local vars. * docs/TJC/optcode.html: Mention how foreach can't handle non-static variable names. * src/jacl/tcl/lang/Procedure.java (Procedure): Make proc command generate an error if an argument is an array name or a namespace qualified variable. * src/jacl/tcl/lang/Var.java (lookupVar, lookupArrayElement, getVarPtr, setVarCompiledLocalArray, getVarCompiledLocalArray, setResolvedScalarToNull): Implement compiled local array variables. These are stored in the compiled local array just like scalars. * src/tjc/tcl/lang/TJC.java (getVarScalar, getVarArray, setVarScalar, setVarArray, incrVarScalar, lappendVarScalar, appendVarScalar): Add array variable methods and update scalar methods to detect the case of accessing a scalar as an array or vice versa. * src/tjc/tjc/library/compileproc.tcl (compileproc_emit_variable, compileproc_emit_scalar_variable_get, compileproc_emit_scalar_variable_set, compileproc_emit_word, compileproc_emit_array_variable_set, compileproc_emit_container_catch, compileproc_container_catch_handler, compileproc_set_variable, compileproc_get_variable, compileproc_can_inline_command_set, compileproc_emit_inline_command_set, compileproc_can_inline_variable_access, compileproc_get_set_nonconstant_array_variable): Reimplement variable get/set code to support compiled local array variables. The catch command can now set non-static variable name and arrays with non-static word keys. The set command was also reimplemented to support static array names with non-static word keys. Rework the compileproc_emit_word method so that it is possible to pass in a String symbol and assign a String value to it instead of creating a tmp TclString wrapper. Split the var set and no var set logic from the catch command into two methods to make things easier to deal with. * src/tjc/tjc/library/descend.tcl (descend_container_catch_validate, descend_container_catch_variable, descend_container_is_valid): Rework catch command parser so that a catch command with a non-static variable name is considered valid. * src/tjc/tjc/library/emitter.tcl ( emitter_get_compiled_local_scalar_var, emitter_get_compiled_local_array_var, emitter_set_compiled_local_scalar_var, emitter_set_compiled_local_array_var): Add methods to invoke TJC methods for compiled local array variables. * tests/tcl/proc.test: * tests/tclbench/invoke.bench: * tests/tclbench/libbench.tcl: When a test case runs in less than 50 ms, up the number of loops to 5000 and run it again. This give a much more accurate average for quick tests. * tests/tclbench/list.bench: * tests/tclbench/set.bench: Add a bunch of new bench tests for scalars and arrays and empty method invocations. * tests/tjc/compiledLocals.test: Add compiled local array tests. * tests/tjc/compileproc.test: Add static array name with non-static array key tests. Add output tests for compiled local arrays. * tests/tjc/compileproc_2.test: Test catch command output with non-static var names. * tests/tjc/compileproc_6.test: Test catch with cache variables enabled. * tests/tjc/compileproc_7.test: Test inlined set command outpuut for array variable names. * tests/tjc/descend.test: Update catch tests. * tests/tjc/emitter.test: Remove catch output tests since this is all tested elsewhere. 2006-03-15 Mo DeJong <mdejong@users.sourceforge.net> Move file to correct directory. * src/tests/jacl/compiledLocals.test: Removed. * tests/tjc/compiledLocals.test: Added. 2006-03-15 Mo DeJong <mdejong@users.sourceforge.net> Implement compiled locals for Jacl that mimic the C Tcl implementation. A compiled proc stores local and imported vars in an array instead of a hashtable. Variables can then be looked up using an index into the compiled local array instead of a hashtable search. Currently, only scalar variables are supported. The previous scalar variable cache logic in TJC has been removed. * src/jacl/tcl/lang/CallFrame.java (CallFrame, dispose): Add compiledLocals ref to call frame class. * src/jacl/tcl/lang/GlobalCmd.java: Update makeUpvar(). * src/jacl/tcl/lang/InfoCmd.java: Add support for compiled locals in [info locals] and [info vars]. * src/jacl/tcl/lang/UpvarCmd.java: Update makeUpvar(). * src/jacl/tcl/lang/Var.java (makeUpvar, setVar, setVarPtr, setVarCompiledLocalScalar, getVarCompiledLocalScalar, traceVar, deleteVars, deleteVar, Var.CompiledLocal): Implement compiled local scalar variables in Jacl. The Var class now handles resolving variables and caching the results. * src/jacl/tcl/lang/VariableCmd.java: Update makeUpvar(). * src/tests/jacl/compiledLocals.test: Test cases for compiled local vars. * src/tests/jacl/tcl/lang/JavaTestExtension.java: Add testvarframe command. * src/tests/jacl/tcl/lang/TestVarFrameCmd.java: New test command used to inspect compiled locals. * src/tests/tjc/tcl/lang/TestTcl.java: Remove old test code, cases moved to compiledLocals.test. * src/tjc/tcl/lang/TJC.java (initCompiledLocals, updateVarCache, getVarScalar, setVarScalar, incrVarScalar, lappendVarScalar, appendVarScalar, resolveVarScalar, makeGlobalLinkVar): Reimplement scalar variable access so that the compiledLocals array is used instead of the previous TJC variable cache implementation. * src/tjc/tcl/lang/TJCCompileCmd.java: Fix case of fully qualified proc name. * src/tjc/tjc/library/compileproc.tcl: * src/tjc/tjc/library/emitter.tcl: Reimplement cache variable code in compileproc and emitter modules. * tests/tjc/compileproc.test: * tests/tjc/compileproc_6.test: * tests/tjc/compileproc_7.test: Update test cases that make use of compiled locals. * tests/tjc/testtjc.test: Remove old tests. 2006-03-11 Mo DeJong <mdejong@users.sourceforge.net> * src/tests/jacl/tcl/lang/TestEvalExCmd.java: * src/tests/jacl/tcl/lang/TestExprParserCmd.java: Convert CRLF to LF. 2006-03-09 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/TclObject.java (preserve, release): Optimize preserve and release for speed and code size to make inlinling of these methods easier. * src/tcljava/tcl/lang/TclObjectBase.java (disposeObject, disposedError): Check for a disposed object at the start of disposeObject() so that a call to release() after the object is disposed will raise the proper exception. Set the refCount to -1 when disposeObject() is called so that the preserve() method can check for a disposed object by looking only at the refCount. 2006-03-09 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Parser.java (grabObjv, releaseObjv): Make arguments final. * src/tests/tjc/TestTJC.java: Update TJC.releaseObjv() callers. * src/tjc/tcl/lang/TJC.java (grabObjv, releaseObjv, releaseObjvElems): Rename releaseObjv() that invokes TclObject.release() for each object to releaseObjvElems(). The releaseObjv() method will now just release the array back to the pool. * src/tjc/tjc/library/compileproc.tcl: Add logic to compileproc_emit_objv_assignment that will unroll the array element release() loop in releaseObjvElems() and apply it only to those arguments that are non-constants. This executes more quickly than releaseObjvElems(). Update callers of emitter_invoke_command_start and emitter_invoke_command_end. * src/tjc/tjc/library/emitter.tcl: Don't emit the try block in emitter_invoke_command_start since a tmp local may be declared before the try block in some cases. In emitter_invoke_command_end, invoke either TJC.releaseObjv() or TJC.releaseObjvElems(). * tests/tjc/compileproc.test: * tests/tjc/compileproc_1.test: * tests/tjc/compileproc_2.test: * tests/tjc/compileproc_3.test: * tests/tjc/compileproc_4.test: * tests/tjc/compileproc_5.test: * tests/tjc/compileproc_6.test: * tests/tjc/compileproc_7.test: * tests/tjc/emitter.test: Update test cases output since just about every call to TJC.releaseObjv() was changed to TJC.releaseObjvElems(). 2006-03-08 Mo DeJong <mdejong@users.sourceforge.net> * src/tjc/tjc/library/jdk.tcl: Reimplement jdk_tool_javac so that the javac invocation is done with batches of files instead of one invocation. The previous implementation passed a file pattern when more than 100 files were being compiled, but that only worked on Win32. This implementation will work on Unix and Windows and it avoids problems where javac runs out of memory when compiling a lot of files. 2006-03-08 Mo DeJong <mdejong@users.sourceforge.net> * docs/TJC/future.html: Describe optimizations. * src/jacl/tcl/lang/Expression.java (ExprLex): Fix a boolean literal parsing bug where a function name was parsed as a boolean literal. This was causing an error when expr {floor(1.0)} was parsed because it was parses a the boolean literal "f" and the function loor(1.0). Fix the problem by not parsing as a boolean when it is clear that the code is a function. * src/tjc/tcl/lang/TJC.java: Fixup comments. * src/tjc/tjc/library/compileproc.tcl: Fixup compileproc_expr_evaluate_emit_math_function so that a null values array is passed when there are no arguments to a math function like rand(). * src/tjc/tjc/library/parse.tcl: Make _parse_expr_iterate_descend treat a math function with no arguments like any other operator. * tests/tcl/expr.test: Test fix for boolean literal parsing bug. * tests/tjc/compileproc_2.test: Emit code for rand() math expression. * tests/tjc/parse.test: Add test cases for no arg emit bug fix. The rand() math function is the only supported math function that accepts no arguments. 2006-03-04 Mo DeJong <mdejong@users.sourceforge.net> * docs/contents.html: * docs/TJC/example1.html: * docs/TJC/example2.html: * docs/TJC/future.html: * docs/TJC/index.html: * docs/TJC/jdkcfg.html: * docs/TJC/tjcpkg.html: Update docs, replace CRLF with LF. * src/tjc/tcl/lang/TJC.java: Fixup comment. * src/tjc/tjc/library/main.tcl: Unset vars. * tests/tclbench/append.bench: * tests/tclbench/expr.bench: * tests/tclbench/libbench.tcl: * tests/tclbench/runbench.tcl: * tests/tclbench/switch.bench: Add a few more tclbench tests and update impl to detect when something goes wrong with the compile step. * tests/tjc/compileproc_7.test: Add test. * tests/tjc/jdkutils.tcl: Change CRLF to LF. 2006-03-03 Mo DeJong <mdejong@users.sourceforge.net> * src/tjc/tjc/library/compileproc.tcl: * src/tjc/tjc/library/emitter.tcl: When passing multiple arguments to the append command, take care to pass constant strings and variables in seperate arguments. This will append directly to the StringBuffer inside the TclString class instead of creating a temp StringBuffer and then wrapping it in a TclString. This change will result in the TJC compiler implementation creating far fewer tmp StringBuffer objects. 2006-03-03 Mo DeJong <mdejong@users.sourceforge.net> * src/tjc/tjc/library/compileproc.tcl: Optimize compileproc_command_cache_lookup, compileproc_argument_printable, and compileproc_emit_invoke. * src/tjc/tjc/library/emitter.tcl: Optimize emitter methods that invoked emitter_statement, it is better to call emitter_indent and append the constant strings in the method. 2006-02-28 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/TclObject.java (toString): Remove workaround for Janino bug since this problem is now fixed. * src/janino/README.TXT: Import Janino 2.3.18. This is really ugly since all files were changed because all CRLF were changed to LF. * src/janino/org/codehaus/janino/*.java: * src/tcljava/tcl/lang/TclObjectBase.java (toString): Make toString() final. 2006-02-28 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Interp.java (eval): Make maxNestingDepth a constant int. Update caller of Parser.grabObjv() and Parser.releaseObjv(). * src/jacl/tcl/lang/InterpSlaveCmd.java: Don't set maxNestingDepth since it is constant. * src/jacl/tcl/lang/Parser.java (evalObjv, eval2, init, grabObjv, releaseObjv): Reimplement TclObject[] grab and release logic so that the array is always set to null values when returned to the pool. * src/tjc/tcl/lang/TJC.java (grabObjv, releaseObjv, invoke): Update caller of grabObjv() and releaseObjv() since we no longer need to set the array elements to null before using and releasing the array. * src/tjc/tjc/library/main.tcl: When the -nocompile flag is passed, don't write out generated Java files. This avoids a huge amount of slow IO calls. 2006-02-28 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Expression.java (ExprParseObject, ExprParseString, evalUnaryOperator, evalBinaryOperator, ExprLex): Make ExprParseObject and ExprParseString static methods. Pass ExprValue into the ExprParseObject and ExprParseString methods and update callers. Use String.equals() instead of String.compareTo() since equals will directly compare object refrences which should be faster when dealing with the same String. Check for the more common TclInteger before TclBoolean and TclList in the ExprParseObject method. Make evalUnaryOperator and evalBinaryOperator methods static. Use ExprValue.setIntValue(boolean) method when a boolean result is being set. * src/tests/tjc/TestTJC.java: Update caller of exprEqualsEmptyString(). * src/tjc/tcl/lang/TJC.java (getBoolean, exprEqualsEmptyString, exprGetValue): Check for TclInteger before TclBoolean and TclList. Update ExprParseObject(), evalUnaryOperator(), and evalBinaryOperator() calls. Do pointer compare for empty string "" in exprEqualsEmptyString and pass in negate flag instead of negating in caller code. Add a exprGetValue() helper that accepts a boolean value. * src/tjc/tjc/library/compileproc.tcl: Rework compileproc_expr_evaluate_emit_binary_operator so that calls to TJC.exprEqualsEmptyString() accept a boolean negate flag. Use String.equals() instead of String.compareTo() when comparing a TclObject to a constant string value. * tests/tjc/compileproc_2.test: Update tests. 2006-02-24 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: * jtclsh.in: * tcljava.m4: * src/aolserver/src/nsjava.c: * src/jacl/tcl/lang/TclObject.java: * src/tclblend/tcl/lang/TclObject.java: * src/tcljava/tcl/lang/TclObjectBase.java: * src/tjc/tcl/lang/TJCThread.java: * src/tjc/tjc/library/reload.tcl: * tests/tjc/compileproc_0.test: * tests/tjc/compileproc_1.test: Fixup poor spelling. 2006-02-23 Mo DeJong <mdejong@users.sourceforge.net> Add new tests and update existing tests so that they have unique names. Rework the tclbench module so that it runs tests until times converge. This is needed so that the hotspot compiler will fully compile code before tests results are used. Add support for runtime compilation using the TJC::compile command. * tests/tclbench/data.bench: * tests/tclbench/expr.bench: * tests/tclbench/invoke.bench: * tests/tclbench/jacl1+tjc.out: * tests/tclbench/jacl1.out: * tests/tclbench/jacl132.out: * tests/tclbench/lappend.bench: moved tests to list.bench. * tests/tclbench/libbench.tcl: * tests/tclbench/list.bench: Add list tests. * tests/tclbench/loops.bench: * tests/tclbench/runbench.tcl: * tests/tclbench/set.bench: * tests/tclbench/string.bench: * tests/tclbench/jworld/scripting.bench: Add rather useless tests from Javaworld scripting article. These tests suck up 128M of ram and take forever to run. 2006-02-16 Mo DeJong <mdejong@users.sourceforge.net> * tests/tclbench/jacl132.out: * tests/tclbench/lappend.bench: * tests/tclbench/libbench.tcl: * tests/tclbench/list.test: * tests/tclbench/string.bench: * tests/tclbench/tclsh8411.out: * tests/tcljava/javaInterp.test: Add test and bench files. 2006-02-15 Mo DeJong <mdejong@users.sourceforge.net> * jaclsh.bat.in: * jaclsh.in: Add janino.jar and janinosrc.jar to debug classpath when debug is enabled. Make sure Mingw test is only run under Win32. * jtclsh.in: Make sure Mingw test is only run under Win32. * src/jacl/tcl/lang/Interp.java (Interp): Use StringBuffer instead of Character.toString() since it exists only in JDK 1.4. * src/jacl/tcl/lang/Procedure.java: Typo. * src/tjc/tjc/library/jdk.tcl: Use ':' as path separator unless running under Win32. * src/tjc/tjc/library/tjcthread.tcl: Look for janino.jar based on location of tcljava.jar on the CLASSPATH. * tests/tjc/jdk.test: Make tests work under Unix and Win32. 2006-02-15 Mo DeJong <mdejong@users.sourceforge.net> Check in SimpleCompiler modifications to support compilation of code contained in a Java String. * src/janino/org/codehaus/janino/Compiler.java (createJavacLikePathIClassLoader): Make method accessible in rest of package so it can be used in SimpleCompiler. * src/janino/org/codehaus/janino/SimpleCompiler.java (SimpleCompiler, compile): Add constructor and compile method to support compilation from a String object. * src/janino/org/codehaus/janino/util/resource/MultiResourceFinder.java: * src/janino/org/codehaus/janino/util/resource/PathResourceFinder.java: Add debug statements. 2006-02-15 Mo DeJong <mdejong@users.sourceforge.net> Revert local changes to janino so that tree state can be tagged before local mods. Tagged as: janino-2317-import 2006-02-13 Mo DeJong <mdejong@users.sourceforge.net> Add TJC::compile command to support runtime compilation of Tcl procs. Compilation is implemented using the TJC compiler and an embedded Java compiler called Janino. * Makefile.in: Add build support for Janino compiler. The compiler is BSD licensed and is included directly in the Jacl source tree so that it is installed along with Jacl. * docs/TJC/tjcpkg.html: Add TJC::compile documentation. * src/jacl/tcl/lang/TclObject.java (toString): Work around a pizza and janino compiler bug having to do with a superclass that can't be accessed outside the package. * src/janino/README.TXT: Add text file that describes the Janino compiler source. * src/janino/org/codehaus/janino/Access.java: * src/janino/org/codehaus/janino/AstCompilationUnitGenerator.java: * src/janino/org/codehaus/janino/AstGeneratorVisitor.java: * src/janino/org/codehaus/janino/ByteArrayClassLoader.java: * src/janino/org/codehaus/janino/CachingJavaSourceClassLoader.java: * src/janino/org/codehaus/janino/ClassBodyEvaluator.java: * src/janino/org/codehaus/janino/ClassFileIClass.java: * src/janino/org/codehaus/janino/ClassLoaderIClassLoader.java: * src/janino/org/codehaus/janino/CodeContext.java: * src/janino/org/codehaus/janino/CompileException.java: * src/janino/org/codehaus/janino/Compiler.java: * src/janino/org/codehaus/janino/DebuggingInformation.java: * src/janino/org/codehaus/janino/Descriptor.java: * src/janino/org/codehaus/janino/EvaluatorBase.java: * src/janino/org/codehaus/janino/ExpressionEvaluator.java: * src/janino/org/codehaus/janino/FilterWarningHandler.java: * src/janino/org/codehaus/janino/IClass.java: * src/janino/org/codehaus/janino/IClassLoader.java: * src/janino/org/codehaus/janino/Java.java: * src/janino/org/codehaus/janino/JavaSourceClassLoader.java: * src/janino/org/codehaus/janino/JavaSourceIClassLoader.java: * src/janino/org/codehaus/janino/Location.java: * src/janino/org/codehaus/janino/MethodDescriptor.java: * src/janino/org/codehaus/janino/Mod.java: * src/janino/org/codehaus/janino/Opcode.java: * src/janino/org/codehaus/janino/Parser.java: * src/janino/org/codehaus/janino/ReflectionIClass.java: * src/janino/org/codehaus/janino/ResourceFinderIClassLoader.java: * src/janino/org/codehaus/janino/Scanner.java: * src/janino/org/codehaus/janino/ScriptEvaluator.java: * src/janino/org/codehaus/janino/SimpleCompiler.java: * src/janino/org/codehaus/janino/UnicodeUnescapeException.java: * src/janino/org/codehaus/janino/UnicodeUnescapeReader.java: * src/janino/org/codehaus/janino/UnitCompiler.java: * src/janino/org/codehaus/janino/UnparseVisitor.java: * src/janino/org/codehaus/janino/Visitor.java: * src/janino/org/codehaus/janino/WarningHandler.java: * src/janino/org/codehaus/janino/doc-files/new_bsd_license.txt: * src/janino/org/codehaus/janino/samples/ClassBodyDemo.java: * src/janino/org/codehaus/janino/samples/DeclarationCounter.java: * src/janino/org/codehaus/janino/samples/DemoBase.java: * src/janino/org/codehaus/janino/samples/ExpressionDemo.java: * src/janino/org/codehaus/janino/samples/ScriptDemo.java: * src/janino/org/codehaus/janino/samples/ShippingCost.java: * src/janino/org/codehaus/janino/tools/Disassembler.java: * src/janino/org/codehaus/janino/tools/HprofScrubber.java: * src/janino/org/codehaus/janino/util/AutoIndentWriter.java: * src/janino/org/codehaus/janino/util/Benchmark.java: * src/janino/org/codehaus/janino/util/ClassFile.java: * src/janino/org/codehaus/janino/util/MultiIterator.java: * src/janino/org/codehaus/janino/util/PrimitiveWrapper.java: * src/janino/org/codehaus/janino/util/ResourceFinderClassLoader.java: * src/janino/org/codehaus/janino/util/StringPattern.java: * src/janino/org/codehaus/janino/util/TeeReader.java: * src/janino/org/codehaus/janino/util/Traverser.java: * src/janino/org/codehaus/janino/util/TunnelException.java: * src/janino/org/codehaus/janino/util/enumerator/Enumerator.java: * src/janino/org/codehaus/janino/util/enumerator/EnumeratorFormatException.java: * src/janino/org/codehaus/janino/util/enumerator/EnumeratorSet.java: * src/janino/org/codehaus/janino/util/enumerator/EnumeratorSetTypeException.java: * src/janino/org/codehaus/janino/util/iterator/EnumerationIterator.java: * src/janino/org/codehaus/janino/util/iterator/FilterIterator.java: * src/janino/org/codehaus/janino/util/iterator/FilterListIterator.java: * src/janino/org/codehaus/janino/util/iterator/IteratorCollection.java: * src/janino/org/codehaus/janino/util/iterator/MultiDimensionalIterator.java: * src/janino/org/codehaus/janino/util/iterator/ReverseListIterator.java: * src/janino/org/codehaus/janino/util/iterator/TransformingIterator.java: * src/janino/org/codehaus/janino/util/iterator/TraversingIterator.java: * src/janino/org/codehaus/janino/util/iterator/UniterableElementException.java: * src/janino/org/codehaus/janino/util/resource/DirectoryResourceCreator.java: * src/janino/org/codehaus/janino/util/resource/DirectoryResourceFinder.java: * src/janino/org/codehaus/janino/util/resource/FileResource.java: * src/janino/org/codehaus/janino/util/resource/FileResourceCreator.java: * src/janino/org/codehaus/janino/util/resource/FileResourceFinder.java: * src/janino/org/codehaus/janino/util/resource/JarDirectoriesResourceFinder.java: * src/janino/org/codehaus/janino/util/resource/LazyMultiResourceFinder.java: * src/janino/org/codehaus/janino/util/resource/MultiResourceFinder.java: * src/janino/org/codehaus/janino/util/resource/PathResourceFinder.java: * src/janino/org/codehaus/janino/util/resource/Resource.java: * src/janino/org/codehaus/janino/util/resource/ResourceCreator.java: * src/janino/org/codehaus/janino/util/resource/ResourceFinder.java: * src/janino/org/codehaus/janino/util/resource/ZipFileResourceFinder.java: * src/tcljava/tcl/lang/TclClassLoader.java: Remove debug statements. * src/tcljava/tcl/lang/TclObjectBase.java: Work around toString() bug. * src/tjc/tcl/lang/JaclLoadTJCCmd.java: Load TJC::compile command when TJC package is loaded. Load each command at runtime when first used. * src/tjc/tcl/lang/TJCCommandCmd.java: Fixup error message. * src/tjc/tcl/lang/TJCCompileCmd.java: Add TJC::compile implementation. * src/tjc/tcl/lang/TJCReadyVar.java: Add test class. * src/tjc/tcl/lang/TJCThread.java: Add implementation of second compiler thread that converts Tcl procs to Java class files. * src/tjc/tjc/library/compileproc.tcl: Docs fixup. * src/tjc/tjc/library/jdk.tcl: Check that all jars are in the same directory. Add support for running tjc with pizza and janino compilers. * src/tjc/tjc/library/main.tcl: Add -pizza and -janino command line options for tjc. * src/tjc/tjc/library/reload.tcl: Add support for running TJC in an "embedded" mode that loads only the minimum set of commands needed to compile Tcl commands with TJC. * src/tjc/tjc/library/tjc.tcl: Define _tjc(jardir). * src/tjc/tjc/library/tjcthread.tcl: Add Tcl source code used in second compiler thread. This code will use the Janino compiler to convert Tcl commands to Java class data. Currently, both the Janino and Pizza compilers are supported but the Janino compiler is the default. * tests/tjc/testtjc.test: Test TJC::compile command. * tests/tjc/tjcthread.test: Regression test TJCThread, the second compiler thread that is used to compile Tcl procs. 2006-02-11 Mo DeJong <mdejong@users.sourceforge.net> * docs/TJC/future.html: Note string inline functions that have been implemented. * src/jacl/tcl/lang/Interp.java (checkCommonCharacter): Implement common cache of TclString objects that represent a single ASCII character. * src/jacl/tcl/lang/StringCmd.java (cmdProc): * src/tjc/tcl/lang/TJC.java (stringIndex): Use common char cache for results of string index. 2006-02-09 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Remove previously created originals dir so that rebuild is done with the correct source code. * src/jacl/tcl/lang/ExprValue.java: Make class and all methods final so that methods can be more easily inlined. * src/jacl/tcl/lang/Expression.java: Simplify a couple of if statements so that only one method invocation is used. Simplify operator check so that lots of compares are skipped in the common case. * src/jacl/tcl/lang/Var.java: Check the last character in a variable name string that might be an array var before searching from the front. * src/tjc/tjc/library/parseproc.tcl: Typo. 2006-02-09 Mo DeJong <mdejong@users.sourceforge.net> Revert var pool changes, this change actually caused regressions in TJC compiled code because the variables in the pool were still being used in compiled code. * src/jacl/tcl/lang/Interp.java: * src/jacl/tcl/lang/Var.java: 2006-02-08 Mo DeJong <mdejong@users.sourceforge.net> Reimplement TclClassLoader using the class loader delagation model from JDK 1.2. The interp class now supports a public method called getClassLoader() that returns the ClassLoader instance used by the interp. The interp class loader will now delagate to the thread context loader, this should fix class loading problems when Jacl is used in environments that depend on the context class loader for classes and resources. * Makefile.in: Add new test build rules. * README.jacl: * README.tclblend: JDK 1.2 now minimium version, add link to build instructions on wiki. * diffs.txt: Add built-in Tcl commands that were not mentioned. * new_features.txt: Mention new compiler and classloader features. * src/empty/README.txt: Mention empty.sh. * src/empty/empty.jar: Regen. * src/empty/empty.sh: New empty.jar regen script. * src/empty/tcl/lang/Interp.java (getClassLoader): Add public method. * src/jacl/tcl/lang/GlobCmd.java: * src/jacl/tcl/lang/Interp.java: * src/tclblend/tcl/lang/Interp.java: * src/tcljava/tcl/lang/AdaptorClassLoader.java: * src/tcljava/tcl/lang/Extension.java: Use TclClassLoader so that classes can be loaded from env(TCL_CLASSPATH). * src/tcljava/tcl/lang/JavaDefineClassCmd.java: * src/tcljava/tcl/lang/JavaImportCmd.java: Use TclClassLoader so that importing multiple classes from the env(TCL_CLASSPATH) does not cause errors. * src/tcljava/tcl/lang/JavaInvoke.java: * src/tcljava/tcl/lang/JavaLoadCmd.java: Use interp class loader or create a new one that delagates to the interp class loader. * src/tcljava/tcl/lang/TclClassLoader.java: Reimplement TclClassLoader, there is now on class loader instance per interp. The same calss loader is used for all loading, so the strange loading problems caused by multiple loader instances should be a thing of the past. Add ability to load resources from the env(TCL_CLASSPATH). * src/tcljava/tcl/lang/reflect/PkgInvoker.java: * src/tests/tcljava/javaload/Test5Cmd.java: * src/tests/tcljava/testext/Cmd.java: * src/tests/tcljava/testext/Dummy.java: * src/tests/tcljava/testext/cmd.tcl: * src/tests/tcljava/tests/TestInterpThreadClassLoader.java: * src/tests/tcljava/tests/TestInterpThreadContextClassCmd.java: * src/tjc/tcl/lang/TJCCommandCmd.java: * src/tjc/tcl/lang/TJCPackageCmd.java: Use TclClassLoader when loading classes. * tests/jacl/Interp.test: Removed. * tests/tclblend/javaInterp.test: Deleted some tests. * tests/tcljava/JavaDefineClassCmd.test: Add multiple class loading tests. * tests/tcljava/tcljavaInterp.test: Define interp tests that work in both Jacl and Tcl Blend. 2006-02-07 Mo DeJong <mdejong@users.sourceforge.net> Condense multiple append and lappend commands into one invocation with multiple arguments. This takes advantage of inlined command optimizations when compiled with TJC. Comment out debug code in methods that take up a lot of time or are invoked often. Optimize methods that are invoked often as seen with a method profiler. * src/tjc/tjc/library/compileproc.tcl: * src/tjc/tjc/library/descend.tcl: * src/tjc/tjc/library/emitter.tcl: * src/tjc/tjc/library/parse.tcl: * tests/tjc/compileproc.test: * tests/tjc/compileproc_3.test: 2006-02-06 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/StringCmd.java: Optimize "string first" and "string last" subcommands for case where the string is a single character. * src/tjc/tcl/lang/TJC.java (stringIndex, stringRange, stringFirst, stringLast): Add inlined string command code. * src/tjc/tjc/library/compileproc.tcl: Add inlined string command. The following subcommands are inlined. string compare string equal string first string last string index string length string range * tests/tjc/compileproc_7.test: Add compiler output tests for inlined string commands. 2006-01-30 Mo DeJong <mdejong@users.sourceforge.net> * docs/TclJava/JavaDefineClassCmd.html: * src/tcljava/tcl/lang/JavaDefineClassCmd.java: * src/tcljava/tcl/lang/TclClassLoader.java: * src/tests/tcljava/javaload/Test3Cmd.java: * src/tests/tcljava/javaload/Test4Cmd.java: * tests/tcljava/JavaDefineClassCmd.test: Add ability to directly pass byte[] object to the java::defineclass command. 2006-01-27 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Expression.java (grabExprValue, releaseExprValue): Reimplement expr value cache so that only a single array access is needed to get or release a cached value. * src/jacl/tcl/lang/Interp.java: Init var pool. * src/jacl/tcl/lang/LappendCmd.java: Use optimized TclList.append(). * src/jacl/tcl/lang/TclList.java (append): Add optimized TclList.append() method that accepts multiple TclObjects in an array. This will speed up lappend operations that have multiple arguments since the type checks are only done once. * src/jacl/tcl/lang/Var.java: Set the NO_CACHE flag when a trace is added to a variable. This makes the cache valid check faster since only the isVarCacheInvalid needs to be invoked. Add Var object cache with 50 entries. * src/tcljava/tcl/lang/TclString.java (append): Add optimized TclString.append() that accepts multiple TclObject arguments in an array. This is used with the TJC compiled lappend for scalar variables. * src/tests/tjc/TestTJC.java: * src/tests/tjc/tcl/lang/TestTcl.java: Move test code into TestTcl since the old TJC access methods are no gone. * src/tjc/tcl/lang/TJC.java: Use var.isVarCacheInvalid() instead of TJC.isVarScalarValid(var). Use optimized TclList.append() and TclString.append() operations with compiled scalar commands. Remove unused TJC.isVarScalarValid() and TJC.getVarScalar() methods. * tests/tjc/testtjc.test: Update tests since class they are defined in has changed. 2006-01-26 Mo DeJong <mdejong@users.sourceforge.net> Replace use of synchronized Vector and Hashtable classes with unsynchronized ArrayList and HashMap classes delivered with JDK 1.2.X. Use of Enumeration replaced with Iterator. Fix a couple of destroy time iteration bugs in Itcl to make it match the C impl. * Makefile.in: Add missing ItclAccess.java file to itclsrc.jar. * src/empty/empty.jar: Regen. * src/empty/tcl/lang/Interp.java: * src/itcl/itcl/lang/BiCmds.java: * src/itcl/itcl/lang/Class.java: * src/itcl/itcl/lang/Cmds.java: * src/itcl/itcl/lang/Ensemble.java: * src/itcl/itcl/lang/ItclInt.java: * src/itcl/itcl/lang/Methods.java: * src/itcl/itcl/lang/Objects.java: * src/itcl/tcl/lang/ItclAccess.java: * src/jacl/tcl/lang/AfterCmd.java: * src/jacl/tcl/lang/ArrayCmd.java: * src/jacl/tcl/lang/BgErrorMgr.java: * src/jacl/tcl/lang/CallFrame.java: * src/jacl/tcl/lang/ClockCmd.java: * src/jacl/tcl/lang/Expression.java: * src/jacl/tcl/lang/IdleHandler.java: * src/jacl/tcl/lang/InfoCmd.java: * src/jacl/tcl/lang/Interp.java: * src/jacl/tcl/lang/InterpAliasCmd.java: * src/jacl/tcl/lang/InterpCmd.java: * src/jacl/tcl/lang/InterpSlaveCmd.java: * src/jacl/tcl/lang/Namespace.java: * src/jacl/tcl/lang/NamespaceCmd.java: * src/jacl/tcl/lang/Notifier.java: * src/jacl/tcl/lang/PackageCmd.java: * src/jacl/tcl/lang/ParseResultVector.java: Removed unused file. * src/jacl/tcl/lang/SearchId.java: * src/jacl/tcl/lang/TclIO.java: * src/jacl/tcl/lang/TclList.java: * src/jacl/tcl/lang/TimerHandler.java: * src/jacl/tcl/lang/TraceCmd.java: * src/jacl/tcl/lang/Var.java: * src/jacl/tcl/lang/WrappedCommand.java: * src/tclblend/tcl/lang/CObject.java: * src/tclblend/tcl/lang/Interp.java: * src/tclblend/tcl/lang/Notifier.java: * src/tcljava/tcl/lang/FieldSig.java: * src/tcljava/tcl/lang/FuncSig.java: * src/tcljava/tcl/lang/JavaImportCmd.java: * src/tcljava/tcl/lang/ReflectObject.java: * src/tests/jacl/tcl/lang/TestChannelCmd.java: * src/tjc/tcl/lang/TJC.java: * tests/inprogress/TimerHandler.test: * tests/jacl/IdleHandler.test: * tests/tjc/main.test: Rework test that depends on hash order. 2006-01-24 Mo DeJong <mdejong@users.sourceforge.net> * src/itcl/itcl/lang/Class.java: * src/jacl/tcl/lang/CallFrame.java: Don't invoke Hashtable.dispose() since Var.deleteVars() does that already. * src/jacl/tcl/lang/TclObject.java: Fixup whitespace issues. * src/tclblend/tcl/lang/TclObject.java: Replace disposedCheck with inlined impl. Fixup whitespace issues. * src/tcljava/tcl/lang/TclObjectBase.java: Remove disposedCheck() calls, replace with inlined versions in methods. Remove the check from getInternalRep(), toString(), and isShared() unless a special flag is set so that commands can be easily inlined. * src/tcljava/tcl/lang/TclString.java: Remove FIXME and fixup whitespace. 2006-01-24 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Add "tjc2" make target that will recompile the Tcl code in tjc.jar into Java code. * src/tjc/tcl/lang/TJCShell.java: Require TJC package so that a compiled tjc.jar will work like an uncompiled one. * tests/all.tcl: Set TJC_LIBRARY to a resource path inside tjc.jar. Define test_tjc_init command that should be invoked at the top of a TJC test script. * tests/tjc/compileproc.test: * tests/tjc/compileproc_1.test: * tests/tjc/compileproc_2.test: * tests/tjc/compileproc_3.test: * tests/tjc/compileproc_4.test: * tests/tjc/compileproc_5.test: * tests/tjc/compileproc_6.test: * tests/tjc/compileproc_7.test: * tests/tjc/descend.test: * tests/tjc/emitter.test: Invoke test_tjc_init at the start of the test script. * tests/tjc/tjc.test: Don't try to run "file normalize" in Jacl since it is not implemented. 2006-01-23 Mo DeJong <mdejong@users.sourceforge.net> Reimplement variable cache so that the cache is flushed on method entry and exit. This is needed so that recursive methods don't write over each other's cache variables. * src/tjc/tjc/library/compileproc.tcl: Invoke emitter_callframe_push and emitter_callframe_try instead of the now renamed emitter_callframe_start. Invoke emitter_callframe_pop instead of renamed emitter_callframe_end. This change was needed so that the whole command body could be processed before checking to see if the varcache needed to be flushed on command entry. * src/tjc/tjc/library/emitter.tcl: Rename emitter_callframe_start to emitter_callframe_push and move try block into emitter_callframe_try. Rename emitter_callframe_end to emitter_callframe_pop and move cache flush up in decl. * tests/tjc/compileproc_6.test: * tests/tjc/compileproc_7.test: * tests/tjc/emitter.test: Check cache var flush calls. 2006-01-19 Mo DeJong <mdejong@users.sourceforge.net> Refactor TclObject class so that Jacl and TclBlend specific code appears in different classes. A common base class named TclObjectBase now exists, it contains common TclObject code. TclBlend depends on a specific preserve() and release() implementation and make use of the CObject class. The Jacl implementation of TclObject avoids this logic in preserve() and release(), so these methods will execute more quickly and be easier to inline. * src/empty/README.txt: Updated. * src/empty/empty.jar: Regen. * src/empty/tcl/lang/TclObject.java: Added. * src/jacl/tcl/lang/TclObject.java: Added. * src/tclblend/tcl/lang/TclObject.java: Added. * src/tcljava/tcl/lang/TclObject.java: Removed. * src/tcljava/tcl/lang/TclObjectBase.java: Added. 2006-01-19 Mo DeJong <mdejong@users.sourceforge.net> * docs/TJC/future.html: * docs/TJC/module.html: * docs/TJC/optcode.html: Document compiled lappend and append commands. * src/jacl/tcl/lang/LappendCmd.java (lappendVar): Move lappend logic into static method so that it can be invoked via TJC.lappendVar(). * src/jacl/tcl/lang/Var.java (isArrayVarname): Add helper method to examine static variable name. * src/tjc/tcl/lang/TJC.java (lappendVarScalar, appendVarScalar, lappendVar, appendVar): Add runtime implementations for append and lappend as well as optimized versions that work with cached variables. * src/tjc/tjc/library/compileproc.tcl: Refactor object argument array assignment into compileproc_emit_objv_assignment, this is now used for regular method invocations as well as append and lappend methods. Add inlined append and lappend generators. Also add interp.resetResult() call to incr code. * tests/tjc/compileproc_7.test: Test incr, lappend, and append output. 2006-01-18 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Subst WIN32_HOST and use it to subst Win32 paths into autogenerated files like jdk.cfg. * configure: Regen. * configure.in: Make sure WIN32_HOST gets set for Jacl under Mingw. * src/tjc/tjc/library/compileproc.tcl: Add debug flag setting logic for whole module. Rewrite entrypoint function so that one proc is compiled at a time. * src/tjc/tjc/library/main.tcl: Rewrite proc processing so that code is generated one proc at a time. This fixes the out of memory errors that were showing up because all memory was being consumed to store the generated Java code. Each generated proc is now saved to disk before the next one is processed. * tests/tjc/compileproc.test: Rewrite test that invokes entrypoint. * tests/tjc/tjc.test: Add info about why test currently fails. 2006-01-16 Mo DeJong <mdejong@users.sourceforge.net> * docs/TJC/example1.html: Add documentation and examples of TJC compiler use. * docs/TJC/example2.html: * docs/TJC/future.html: * docs/TJC/index.html: * docs/TJC/jdkcfg.html: * docs/TJC/module.html: * docs/TJC/optcode.html: * docs/TJC/tjcpkg.html: * src/jacl/tcl/lang/LindexCmd.java (TclLindexList, TclLindexFlat): Make methods static so they can be used in TJC method. * src/tjc/tcl/lang/TJC.java (lindexNonconst): Implement inlined lindex method implementation optimized for common uses. * src/tjc/tjc/library/compileproc.tcl: Add inlined lindex support. * src/tjc/tjc/library/module.tcl (module_options_parse): Create helper method to parse OPTIONS and PROC_OPTIONS. Add support for +O psudo option that enables all optimizations. * tests/tjc/compileproc_7.test: Add inlined lindex output tests. * tests/tjc/module.test: Test +O option. 2006-01-13 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Var.java (incrVar): Reimplement incrVar() so that it makes use of TclInteger.incr() instead of getting and then setting the value. * src/tcljava/tcl/lang/TclInteger.java (incr): Add optimized incr() method for use by the incr command. This executes more quickly than getting then setting the value. * src/tests/tjc/TestTJC.java: Update calls to resolveVarScalar() since it can no longer raise a TclException. * src/tjc/tcl/lang/TJC.java (updateVarCache, getVarScalar, setVarScalar, incrVarScalar, incrVar, resolveVarScalar): Inline simple var logic instead of calling TJC.getVarScalar(). Update updateVarCache signature since it no longer throws a TclException. Add inlined incr command methods. Don't set flags in TJC.setVarScalar() since the code is never needed. * src/tjc/tjc/library/compileproc.tcl: Don't declare updateVarCache() with throws of TclException. Don't null out a varcache before resolve step since resolve will always return VAR_NO_CACHE on fail. Implement inlined incr command logic, each use case is optimized. * src/tjc/tjc/library/emitter.tcl: Add helper method to double quote and backslash Tcl string. * tests/tjc/compileproc_6.test: Fixup updateVarCache(). * tests/tjc/compileproc_7.test: Fixup updateVarCache(). Add output tests for inlined incr command. 2006-01-12 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/GlobalCmd.java: Cleanup. * src/jacl/tcl/lang/ListCmd.java: Rework preserve() and release() so that only a release() is needed in case of a TclException. * src/jacl/tcl/lang/TclList.java (append, getLength): Optimize append and getLength so that setListFromAny is only called when not already a TclList irep. * src/tjc/tcl/lang/TJC.java (CompiledCommand, makeGlobalLinkVar): Set a inlineCmds flag when a command is compiled with inlined command. Check for these command names in addition to the container command names. Add makeGlobalLinkVar() method to inline global command. * src/tjc/tjc/library/compileproc.tcl: Add support for inline of Tcl commands. Currently, the global, list, llength, and set commands are inlined. Add method to query a scalar variable value. * tests/tjc/compileproc_7.test: Add output tests for inlined commands. * src/tjc/tjc/library/emitter.tcl: Set flag to indicate that CompiledComamnd has inlined methods. Add method to emit interp result statement. Add method to emit inlined global command. * src/tjc/tjc/library/module.tcl: Add new +inline-commands option. * tests/tjc/module.test: Test new +inline-commands option. 2006-01-11 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: add tjcsrc and tjc test build dir to test CLASSPATH to fixup debugger support. * src/jacl/tcl/lang/IncrCmd.java (cmdProc): Update call to Var.incrVar() since it accepts Strings. * src/jacl/tcl/lang/Var.java (isVarCacheInvalid, setVarNoCache, getVar, incrVar, makeUpvar): Whitespace fixup. Add NO_CACHE flag to signal when a variable can't be cached. Set NO_CACHE flag on link to variable when a link from variable is redirected from one variable to another via upvar. * src/tests/tjc/TestTJC.java: Add variable lookup tests. * src/tjc/tcl/lang/TJC.java (CompiledComamnd.updateVarCache, CompiledComamnd.getVarScalar, CompiledComamnd.setVarScalar, resolveVarScalar, isVarScalarValid, getVarScalar, setVarScalar): Implement runtime support for cached scalar variables. * src/tjc/tjc/library/compileproc.tcl: Add code to check for constant use while declaring args. Move args processing methods into compileproc since they need to invoke compileproc methods for variable access. Add variable cache logic and methods to emit variable cache code. Read +cache-variable flag from module to enable variable cache. Enable scalar variable set in catch and foreach commands. * src/tjc/tjc/library/emitter.tcl: Move args processing methods that emit a variable into compileproc module. * src/tjc/tjc/library/module.tcl: Add support for +cache-variables OPTIONS flag. * tests/all.tcl: Run compileproc after all other tests. * tests/tjc/compileproc.test: Test scalar set and get. * tests/tjc/compileproc_6.test: Test var cache output. * tests/tjc/descend.test: Load TJC commands since this is the first file loaded. * tests/tjc/emitter.test: Invoke compileproc_init to clear out any var state since this test file invokes some compileproc functions. * tests/tjc/module.test: Test +cache-variables. * tests/tjc/testtjc.test: Test cache variable impl. 2005-12-29 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/GlobalCmd.java: Invoke NamespaceCmd.tail() instead of using inlined logic. * src/jacl/tcl/lang/NamespaceCmd.java (tailCmd, tail): Add NamespaceCmd.tail() that will return the tail portion of a namespace String. * src/jacl/tcl/lang/VariableCmd.java: Invoke NamespaceCmd.tail() instead of using inlined logic. 2005-12-28 Mo DeJong <mdejong@users.sourceforge.net> Add -constant-increment OPTIONS flag that will skip calling preserve() and release() for const object arguments when a Tcl command is being invoked. This is safe since a constant will always have a ref count of at least 2. Make it easier for the Java runtime compiler to optimize calls to TJC.releaseObjv() by passing the array size as a compile time argument. Also, add a special case used when all the arguments to a command are constant values. * src/tests/tjc/TestTJC.java: * src/tjc/tcl/lang/TJC.java (grabObjv, releaseObjv): * src/tjc/tjc/library/compileproc.tcl: * src/tjc/tjc/library/emitter.tcl: * src/tjc/tjc/library/module.tcl: * tests/tjc/compileproc.test: Add skip constant increment flag and check it when emitting code that passes constant values to a Tcl command. * tests/tjc/compileproc_1.test: * tests/tjc/compileproc_2.test: * tests/tjc/compileproc_3.test: * tests/tjc/compileproc_4.test: Update test cases to account for new size argument to TJC.releaseObjv(). * tests/tjc/compileproc_5.test: Add test cases for new -constant-increment OPTIONS flag. * tests/tjc/emitter.test: * tests/tjc/module.test: Add -constant-increment OPTIONS flag. 2005-12-27 Mo DeJong <mdejong@users.sourceforge.net> * license.amd: * src/tjc/tjc/library/util.tcl: Change CRLF to LF. 2005-12-20 Mo DeJong <mdejong@users.sourceforge.net> Import TJC Tcl to Java compiler. TJC will convert Tcl source code to Java source code and then compile it into class files. * Makefile.in: Build tjc.jar along with test files. * configure: Regen. * configure.in: Create tjc and tjc.bat scripts at configure time. * jaclsh.bat.in: * jaclsh.in: Add tjc.jar to CLASSPATH. * license.amd: AMD license text. * tjc.bat.in: * tjc.in: Launcher scripts for TJC. * src/jacl/tcl/lang/Interp.java: Support "package require TJC" in Jacl. * src/tests/tjc/TestTJC.java: * src/tests/tjc/TestTJCCompiledCommand.java: * src/tests/tjc/tcl/lang/TestTcl.java: * src/tests/tjc/test/tjc/TJCExtension.java: * src/tests/tjc/test/tjcext/TJCExtension.java: * src/tests/tjc/test/tjcext/library/f1.tcl: * src/tests/tjc/test/tjcext/library/f2.tcl: * src/tests/tjc/test/tjcext/library/f3.tcl: Source code for TJC tests. * src/tjc/tcl/lang/JaclLoadTJCCmd.java: Package loading command for TJC. * src/tjc/tcl/lang/TJC.java: TJC runtime support for compiled commands. * src/tjc/tcl/lang/TJCCommandCmd.java: Implement TJC::command Tcl command. * src/tjc/tcl/lang/TJCPackageCmd.java: Implement TJC::package Tcl command. * src/tjc/tcl/lang/TJCShell.java: Implement TJC main(). * src/tjc/tjc/library/compileproc.tcl: * src/tjc/tjc/library/descend.tcl: * src/tjc/tjc/library/emitter.tcl: * src/tjc/tjc/library/jdk.tcl: * src/tjc/tjc/library/main.tcl: * src/tjc/tjc/library/module.tcl: * src/tjc/tjc/library/nameproc.tcl: * src/tjc/tjc/library/parse.tcl: * src/tjc/tjc/library/parseproc.tcl: * src/tjc/tjc/library/reload.tcl: * src/tjc/tjc/library/tjc.tcl: * src/tjc/tjc/library/util.tcl: Tcl source code that implements TJC compiler. * tests/all.tcl: * tests/tjc/compileproc.test: * tests/tjc/compileproc_0.test: * tests/tjc/compileproc_1.test: * tests/tjc/compileproc_2.test: * tests/tjc/compileproc_3.test: * tests/tjc/compileproc_4.test: * tests/tjc/descend.test: * tests/tjc/emitter.test: * tests/tjc/jdk.test: * tests/tjc/jdkutils.tcl: * tests/tjc/main.test: * tests/tjc/module.test: * tests/tjc/nameproc.test: * tests/tjc/parse.test: * tests/tjc/parseproc.test: * tests/tjc/testtjc.test: * tests/tjc/tjc.test: Regression test cases for TJC implementation. 2005-11-23 Mo DeJong <mdejong@users.sourceforge.net> * configure: * configure.in: Increase max heap from 22 to 32 megs to avoid out of memory errors. * src/jacl/tcl/lang/Var.java (lookupVar): Minor optimization in var lookup logic. * src/tcljava/tcl/lang/TclString.java (newInstance): Make the newInstance() method that accepts a StringBuffer public. This API provides a handy way to reuse a StringBuffer. 2005-11-22 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Interp.java: Space fixup. * src/jacl/tcl/lang/NamespaceCmd.java (inscopeCmd): Pass a TclObject to eval, preserve() and release() argument objects. * src/jacl/tcl/lang/Parser.java (evalObjv, eval2): Use grabObjv() and releaseObjv() to get a TclObject[] object in the "unknown" command case. Fixup space issues in a number of places. 2005-11-22 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/FindElemResult.java (update): Create an update() method so that an existing FindElemResult can be populated with new values instead of allocating a new object each time. * src/jacl/tcl/lang/TclList.java (splitList): When splitting a String into a TclList, reuse a FindElemResult object to avoid lots of allocations. * src/jacl/tcl/lang/TclParser.java (ParseList): Update findElement() caller. * src/jacl/tcl/lang/Util.java (findElement): Update findElement API so that it accepts a FindElemResult ref and populates it with the results of the invocation. Also, rewrite the element logic so that a tmp StringBuffer is only created when backslash subst are needed. Otherwise, invoke substr() on the original String to get the element String. This is faster and avoids object allocations. * tests/tclparser/parseCmd.test: Add list parse tests. 2005-11-21 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Interp.java: Create a Var[] of length 2 for so the Var.lookupVar() API need not allocate a new array each time it is invoked. * src/jacl/tcl/lang/Var.java (lookupVar): Use interp.lookupVarResult instead of allocating a new array for each call. 2005-11-21 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/StringCmd.java (Utf8Count): Create Utf8Count method that accepts a single char argument. * src/jacl/tcl/lang/TclParser.java (cmdProc, UTF8CharPointer): Define UTF8CharPointer as an internal rep so that a parsed byte representaiton can be cached. Optimize the getByteInfo method so that no allocation of byte mapping info is done unless needed. Add optimized return values from helper functions in the case of a 1 to 1 mapping. These improvements significantly improve performance of the parse command. 2005-11-21 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Parser.java (grabObjv, releaseObjv, infiniteLoopException): Fixup last patch which was only half applied. Make grabObjv and releaseObjv package scoped so that they can be used in the Interp class. Create infiniteLoopException helper method to raise loop error with specific message. 2005-11-21 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Interp.java (eval): When passing a pure Tcl list to eval, skip the parsing step and just invoke evalObjv() directly. This provides a significant performance improvement and works like the C version of Tcl. * src/jacl/tcl/lang/Namespace.java (resetShadowedCmdRefs): Optimize the common case of a command in the global namespace by avoiding object allocation unless needed. * src/jacl/tcl/lang/Parser.java (savedVarFrame): Save var frame before try block and restore it in a finally block so that restoring works in the TclException case. This is needed for the new Interp.eval() implementation. * src/jacl/tcl/lang/TclList.java (index): Optimize the TclList.index() method so that it does not call setListFromAny() unless needed. * tests/tcl/eval.test: Test new eval implementation. 2005-11-20 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Interp.java (createCommand, deleteCommandFromToken, renameCommand, hideCommand): Increment WrappedCommand epoch when a command is renamed or redefined. Also invoke new resetShadowedCmdRefs() method to check for a rename that shadows another command. * src/jacl/tcl/lang/Namespace.java (resetShadowedCmdRefs): Port of shadowed command ref logic from Tcl 8.4. * src/jacl/tcl/lang/WrappedCommand.java: Add a cmdEpoch field that is used to see if a ref to a WrappedCommand is still valid. When changes to a command are made, the command epoch is updated to indicate that a held ref is no longer valid. * src/tests/jacl/tcl/lang/TestEpoch.java: * tests/jacl/refCount.test: Test WrappedCommand.cmdEpoch field on command rename and delete. 2005-11-20 Mo DeJong <mdejong@users.sourceforge.net> Update Namespace.getNamespaceForQualName() so that a result object stored on a per interp basis is populated with namespace info. Profiling indicates that this API generates lots of heap allocations that could be avoided. * src/jacl/tcl/lang/InfoCmd.java: * src/jacl/tcl/lang/Interp.java: * src/jacl/tcl/lang/Namespace.java: * src/jacl/tcl/lang/NamespaceCmd.java: * src/jacl/tcl/lang/ProcCmd.java: * src/jacl/tcl/lang/Var.java: 2005-11-20 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Namespace.java: Reformat CRLF to LF to avoid patching issues. 2005-11-18 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/AfterCmd.java (getAfterEvent): Update strtoul() caller. * src/jacl/tcl/lang/Expression.java (ExprParseString): Update strtoul() and strtod() callers. * src/jacl/tcl/lang/FormatCmd.java (strtoul): Update callers of FormatCmd.strtoul() and fixup a number of formatting and StringBuffer issues. * src/jacl/tcl/lang/ScanCmd.java (cmdProc): Update strtoul() and strtod() callers and fixup formatting issues. * src/jacl/tcl/lang/StringCmd.java (cmdProc): Update strtoul() and strtod() callers. * src/jacl/tcl/lang/StrtodResult.java: Fixup comment. * src/jacl/tcl/lang/Util.java (strtoul, getInt, strtod, getDouble): Update strtoul() and strtod() to support parsing a sign indicator from the front of the string. The previous implementation was buggy as it saw strings like "- 100" as integers. Also support a "nan" as a double string. * tests/tcl/parseExpr.test: Enable test. * tests/tcl/string.test: Add number parsing test. 2005-11-18 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Parser.java (parseCommand): Update parseCommand to use ParseWhitespace util method in command end logic. This fixes a bug where backslash newline + newline was not being seen as the end of a command. Rename numBytes to numChars in all Parser methods. * tests/tcl/parse.test: Add test case for backslash newline + newline bug in Jacl. 2005-11-17 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/ParseExpr.java (ParseInfo, ParsePrimaryExpr): Add support for parsing boolean literal tokens. * tests/tcl/parseExpr.test: Test boolean literal parsing. Remove constraints for tests that pass. 2005-11-17 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/ExprValue.java (getStringValue, toString): Use Util.printDouble() to create a string rep from a double. * tests/tcl/expr.test: Check for string rep of a double expr value. 2005-11-16 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/ForCmd.java (cmdProc): Remove extra CONTINUE branch and add default switch block. * tests/tcl/for.test: Test for Tcl 8.4 results and remove knownBug contstraints. * tests/tcl/interp.test: Use knownbug not knownBug as constraint name. * tests/tcl/switch.test: Update to switch tests from Tcl 8.4. 2005-11-16 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/EvalCmd.java (cmdProc): Invoke eval(TclObject) instead of eval(String). * src/jacl/tcl/lang/Interp.java (setResult, eval, checkCommonInteger, checkCommonDouble, checkCommonBoolean, checkCommonString): Increment new result TclObject ref count before decremeting the old result ref count in the setResult(TclObject) method. This matches the Tcl 8.4 impl. Double check that common objects are shared to catch possible ref count errors in user code. Increment and decrement the passed in TclObject ref count in eval(TclObject) to match the Tcl 8.4 impl of Tcl_EvalObjEx. * src/jacl/tcl/lang/NamespaceCmd.java (evalCmd): Invoke eval(TclObject) instead of eval(String). * src/jacl/tcl/lang/UplevelCmd.java (cmdProc): Don't preserve and release TclObject passed to eval(TclObject) since eval now does that. * src/jacl/tcl/lang/Var.java (setVar): Pass String instead of TclObject since a String would get passed in the helper method anyway. * src/tcljava/tcl/lang/BeanEvent.java (BeanEvent): Save a String and invoke eval(String) later on instead of saving a ref to a TclObject without incrementing the ref count. * src/tcljava/tcl/lang/TclObject.java: Comment fixup. 2005-11-16 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/FormatCmd.java (cvtDblToStr): Set StringBuffer length instead of allocating a new StringBuffer. Format a double that has an exponent with a leading zero in the exponent so that Jacl matches Tcl 8.4. * tests/tcl/expr.test: Test for double formatting with an exponent that has a leading zero. 2005-11-07 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/ForeachCmd.java (cmdProc): Remove unused var lookup code. * src/jacl/tcl/lang/IfCmd.java (cmdProc): Check for extra words after the else block and generate an error if found. * tests/tcl/foreach.test: * tests/tcl/if.test: * tests/tcl/while-old.test: * tests/tcl/while.test: Update test to those found in Tcl 8.4. 2005-11-06 Mo DeJong <mdejong@users.sourceforge.net> * src/itcl/itcl/lang/Cmds.java: Don't pass -url to source of a resource. * src/jacl/tcl/lang/FileCmd.java: Add debug statement. * src/jacl/tcl/lang/FileUtil.java: Fixup broken use of StringBuffer, keep file path from being munged with more than one character appears before a colon. * src/jacl/tcl/lang/FormatCmd.java: Fixup broken StringBuffer usage. * src/jacl/tcl/lang/Interp.java (createCommands, evalResource): Remove -url arguent to source of a resource. Set the script name returned by info script when sourcing a resource. * src/jacl/tcl/lang/SourceCmd.java: If a filename starts with "resource:" then always treat it as a resource. The previous code would only treat it as a resource if the -url flag was also passed. * src/jacl/tcl/lang/library/init.tcl: Remove -url arguent to source of a resource. * tests/jacl/FileCmd.test: Test for filename bug that was keeping resource: prefixed names from being dealt properly with the file commands. * tests/jacl/Interp.test: Remove -url arguent to source of a resource. 2005-11-04 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Copy files into library directory without extra files and CVS dirs. Don't cd to tests directory in source tree before running tests. * jaclsh.bat.in: * jaclsh.in: Check for JACL_MAIN env var when starting shell, if it exists then use it as the name of the Java main program. Default to tcl.lang.Shell. * src/jacl/tcl/lang/Expression.java: Comment out unused String allocation. * src/jacl/tcl/lang/ParseExpr.java (GetLexeme, ParseMaxDoubleLength): Update GetLexeme to match Tcl 8.4 implementation so that expr parsing that depends on the eq or ne operator works as expected. * src/jacl/tcl/lang/ProcCmd.java (cmdProc, FindCommandNamespace): Create util method to lookup command given a name and use it in the proc command. * src/jacl/tcl/lang/SwitchCmd.java (cmdProc, getBodyOffset): Update implementation of the switch command so that it matches Tcl 8.4. Move switch body logic into util method. * src/tcljava/tcl/lang/Extension.java (load): Move loading logic into util method. * tests/all.tcl (testsDirectory): Update test harness implementation so that tests are run with the build directory as the current directory. This keeps tmp files from being created in the source tree and it matches how Tcl 8.4 works. * tests/tcl/SwitchCmd.test: Remove duplicate of switch.test. * tests/tcl/switch.test: Update error message for switch command so that it matches Tcl 8.4. * tests/tclparser/parseCmd.test: Add expr parse test cases for eq and ne operators. 2005-10-28 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Add tcljava and jacl test source directories to the CLASSPATH for debug targets. * src/jacl/tcl/lang/ParseExpr.java (parseExpr, ParsePrimaryExpr, GetLexeme, LogSyntaxError): Fix bugs causing expr test failures. * src/jacl/tcl/lang/Parser.java (parseTokens, backslash, ParseBraces, ParseQuotedString, ParseWhiteSpace): Add "count" member to BackSlashResult so that caller can correctly determine the number of characters parsed. Set this count field in the backslash() method. Set the script_array member of a TclToken when setting the script_index. Add ParseWhitespaceResult util, it is not used yet. * src/jacl/tcl/lang/TclToken.java: Invoke the getTokenString() method just once in toString(); * src/tests/jacl/tcl/lang/JavaTestExtension.java: Replace testeval2 command with testevalex. Add testexprparser command. * src/tests/jacl/tcl/lang/TestEval2Cmd.java: * src/tests/jacl/tcl/lang/TestEvalExCmd.java: Rename TestEval2Cmd to TestEvalExCmd. * src/tests/jacl/tcl/lang/TestEvalObjvCmd.java: Update to match Tcl 8.4 implementation so that test cases pass. * src/tests/jacl/tcl/lang/TestExprParserCmd.java: Port Tcl 8.4 implementation of test command. * src/tests/jacl/tcl/lang/TestParserCmd.java: Update to match Tcl 8.4 implementation. * src/tests/jacl/tcl/lang/TestParsevarnameCmd.java: * tests/tcl/parse.test: Update to Tcl 8.4 tests. * tests/tcl/parseExpr.test: Update to Tcl 8.4 tests. 2005-10-27 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Expression.java (Expression, registerMathFunction, evalMathFunction, RoundFunction): Add method to support registration of math functions. Use it for built-in math functions in ctor. Fix num args to math function check so that a math function with no args is correctly handled. Pass name of math function into evalMathFunction in case it is needed for an error message. Update round() math function implementation so that Tcl 8.4 tests added to expr.test pass. * src/tests/jacl/tcl/lang/JavaTestExtension.java: Create T1(), T2(), and T3() math functions so that tests in expr.test pass. * tests/tcl/expr.test: Use constraints to limit running tests that don't work instead of commenting them out. Add round() tests from Tcl 8.4. 2005-10-26 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/BackSlashResult.java: Add a count field that saves the number of characters consumed by the backslash subst. * src/jacl/tcl/lang/FindElemResult.java: Add a size field that saves the number of characters consumed from the script. * src/jacl/tcl/lang/ParseExpr.java (ParseInfo, parseExpr): Define start, next, prevEnd, and lastChar indexes like Tcl 8.4 so that parser tests pass. * src/jacl/tcl/lang/Parser.java (backslash, ParseHex): Rewrite backslash subst impl so that it makes use of a ParseHex helper like Tcl 8.4. * src/jacl/tcl/lang/TclParser.java (ParseList, ParseCountNewline): Use new size member of FindElemResult to get the correct number of characters in a list element. Fix end index bug in ParseCountNewline so that the correct number of newlines is returned. * src/jacl/tcl/lang/TclToken.java: * src/jacl/tcl/lang/Util.java (findElement): Define size member of FindElemResult. 2005-10-25 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Expression.java: Repalce call to Character.toString() with String.valueOf() since the former only appears in JDK 1.4 and newer. 2005-10-23 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/ParseExpr.java: Add port of Tcl 8.4 expr parser donated by Bruce Johnson. * src/jacl/tcl/lang/Parser.java (ParseBraces, ParseQuotedString): Add Tcl 8.4 parse APIs needed for expr parser. * src/jacl/tcl/lang/TclParse.java (insertInTokenArray): Add field named "extra" for cases where an extra index result needs to be passed back to the caller. Init the result member. Add helper method to expand token array. * src/jacl/tcl/lang/TclParser.java: Use new expr parser to return expr tokens in parser package. * tests/tclparser/parseCmd.test: Enabled expr tests. 2005-10-21 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/LindexCmd.java (cmdProc, TclLindexList, TclLindexFlat): Implement Tcl TIP 22, multiple index arguments to lindex. This matches the Tcl 8.4 implementation. * src/jacl/tcl/lang/Util.java (getIntForIndex): Update to match Tcl 8.4 implementation. * tests/tcl/lindex.test: * tests/tcl/string.test: Update tests to those used in Tcl 8.4. 2005-10-20 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Add tcltest.tcl to jacl.jar. * src/jacl/tcl/lang/Interp.java (createCommands, transferResult): Add tcltest package. Check for deleted interp in transferResult. * src/jacl/tcl/lang/InterpAliasCmd.java (cmdProc): * src/jacl/tcl/lang/InterpSlaveCmd.java (eval, invokeHidden): * src/jacl/tcl/lang/PackageCmd.java (checkVersion): Check for version number with two . characters in a row. * src/xputils/iload.test: Load tcltest package. * src/xputils/xputils.test: Load tcltest package. * tests/all.tcl: Load tcltest package instead of directly sourcing tcltest.tcl. * tests/defs (setupJavaPackage): Do nothing if Java package was already loaded. * tests/tcl/info.test: Load tcltest package. * tests/tcl/io.test: Load tcltest package. * tests/tcl/lsort.test: Load tcltest package. * tests/tcl/pkg.test: Load tcltest package into slave interp. These tests were not being run before so some new bugs in the interp needed to be fixed before the tests would pass. 2005-10-20 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/TclParserExtension.java: Reformat to replace DOS CRLF with LF. 2005-10-19 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/CharPointer.java: * src/jacl/tcl/lang/FindElemResult.java: Add elemStart member needed for calculation of element ranges in new parser package. * src/jacl/tcl/lang/Interp.java: Load parser package via "package require parser". * src/jacl/tcl/lang/Parser.java: Set the parse.termIndex and parse.errorType fields as needed by parser package. Add defs for TCL_TOKEN_SUB_EXPR and TCL_TOKEN_OPERATOR, though these are not implemented yet. Add parse error type decls needed by parser package. * src/jacl/tcl/lang/StringCmd.java (Utf8Count): Make Utf8Count available to other Jacl classes. * src/jacl/tcl/lang/TclParse.java: Add the errorType member to match Tcl 8.4. Also set termIndex to the end of the script. * src/jacl/tcl/lang/TclParser.java: Ported tclpro's parser package from the C code in tclParser.c. The package is functional except for the expr parser. * src/jacl/tcl/lang/TclParserExtension.java: Load parser package when required in Jacl. * src/jacl/tcl/lang/TclToken.java: Add printing code for TCL_TOKEN_SUB_EXPR and TCL_TOKEN_OPERATOR types. * src/jacl/tcl/lang/Util.java (findElement): Update FindElemResult calls so that they take an index for the start of the token. * tests/all.tcl: Add tclparser tests. * tests/tclparser/parse.test: * tests/tclparser/parseCmd.test: Test cases for parser package from tclpro. The expr tests and tests that depend on embedded null handling are currently disabled. 2005-10-17 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Add "make debug" target that will invoke a JPDA debug session for Jacl. Add src jars like tcljavasrc.jar to the CLASSPATH for the JPDA debug session. 2005-10-17 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/AfterCmd.java: * src/jacl/tcl/lang/EvalCmd.java: * src/jacl/tcl/lang/NamespaceCmd.java: * src/jacl/tcl/lang/UplevelCmd.java: Update concat callers since it now returns a TclObject. * src/jacl/tcl/lang/Util.java (concat): Reimplement concat so that it behaves like Tcl_ConcatObj from Tcl 8.4. * tests/tcl/list.test: Add concat test case. Update to Tcl 8.4 version. * tests/tcl/util.test: Remove incorrect code that would fail to run tests unless testobj was defined. Update to Tcl 8.4 version. 2005-10-14 Mo DeJong <mdejong@users.sourceforge.net> * configure: Regen. * tcljava.m4 (AC_JAVA_JNI_LIBS): Remove unused directory from search path in AMD 64 case. 2005-10-14 Mo DeJong <mdejong@users.sourceforge.net> * configure: Regen. * tcljava.m4 (AC_JAVA_JNI_LIBS): Add detection code for AMD 64 bit JVM under Linux. 2005-10-14 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Fixup test syntax that was generating errors under Linux. * src/native/javaCmd.c (Tclblend_Init, JavaInitBlend): Add assert calls to double check that interp pointers are not NULL in the init path. 2005-10-13 Mo DeJong <mdejong@users.sourceforge.net> Enable Java debugger support for Jacl. When the JACL_DEBUG=1 env var is set, both jaclsh and jaclsh.bat will start the Jacl shell in a mode that supports attaching a Java source debugger. Jar files that contain the Java source code for each package are now created and installed so that a debugger can automatically display the source code. * Makefile.in: Create tcljavasrc.jar, jaclsrc.jar, itclsrc.jar, and install them. * configure: Regen. * jaclsh.bat.in: * jaclsh.in: Add itcl.jar to the CLASSPATH. Add new debug source jars to CLASSPATH if the JACL_DEBUG env var is set. * new_features.txt: Mention debug mode for Jacl. * tcljava.m4 (AC_JAVA_TOOLS): Update logic for debug flags under Win32. 2005-10-12 Mo DeJong <mdejong@users.sourceforge.net> * src/tcljava/tcl/lang/TclBoolean.java: Reimplement TclBoolean class so that only two instances of the TclBoolean internal rep will ever exist. This matches the C Tcl impl. In the get() method, check for an integer with the value 0 or 1, and return a boolean value without converting the internal rep to a boolean type. * src/tests/tcljava/tcl/lang/TestObjCmd.java: Add support for "boolean" type so that conversion tests will run as expected. * tests/tcl/obj.test: Add int->boolean conversion tests. 2005-10-11 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/StringCmd.java (cmdProc): Use Util.getBoolean() since TclBoolean.get() now converts int and double values. * src/tcljava/tcl/lang/TclBoolean.java (setBooleanFromAny): Update conversion to boolean type to match Tcl 8.4 implementation where int and double numbers are converted directly to boolean values. Get object string rep to fix a bug where conversion of a pure object would result in loss of info. * src/tcljava/tcl/lang/TclIndex.java (testUpdateIndex): Add a regression testing access methods use in TestObjCmd. * src/tcljava/tcl/lang/TclString.java: Add FIXME. * src/tests/jacl/tcl/lang/JavaTestExtension.java: Create "testobj" and related commands. * src/tests/tcljava/tcl/lang/TestObjCmd.java: Add implementation of "testobj" and related commands. * tests/tcl/listObj.test: Enable "testobj" conditional code that was commented out. * tests/tcl/obj.test: Update to Tcl 8.4 obj.test. * tests/tcl/stringObj.test: Modify some tests so that they pass even though Jacl uses slightly different buffer allocation code for strings. Jacl also has no "none" TclObject, a TclObject always has an internal rep so make tests that depend on that pass too. * tests/tcl/util.test: Tests not run currently. 2005-10-06 Mo DeJong <mdejong@users.sourceforge.net> Add optimized setVar() methods to the Interp class that accept a primitive argument type like an int, double, or boolean. Use these methods in the rest of Jacl code to take advantage of optimized primitive type assignment. * Makefile.in: Compile itcl code only with Jacl. * src/jacl/tcl/lang/ArrayCmd.java: * src/jacl/tcl/lang/CatchCmd.java: * src/jacl/tcl/lang/EofCmd.java: * src/jacl/tcl/lang/Interp.java: Create shared constant TclObject values for common primitive types. Add setVar() methods that optimize assignment of primitive values. Check for common primitives and use the shared constant values if found. * src/jacl/tcl/lang/InterpAliasCmd.java: * src/jacl/tcl/lang/InterpCmd.java: * src/jacl/tcl/lang/InterpSlaveCmd.java: * src/jacl/tcl/lang/LlengthCmd.java: * src/jacl/tcl/lang/StringCmd.java: * src/jacl/tcl/lang/TellCmd.java: * src/jacl/tcl/lang/TraceCmd.java: * src/jacl/tcl/lang/Util.java: * src/jacl/tcl/lang/Var.java: Remove useless getVar(), setVar(), unsetVar(), traceVar(), untraceVar(), and getTraces() methods that are just aliases. * src/jacl/tcl/lang/VariableCmd.java: * src/jacl/tcl/lang/VwaitCmd.java: * src/tclblend/tcl/lang/Interp.java: Add setVar() methods so that public API for TclBlend Interp class matches that of Jacl. 2005-10-06 Mo DeJong <mdejong@users.sourceforge.net> Add tclbench runtime performance testing support. The existing output can be used to compare Tcl 8.4.11 to Jacl 1.3.2. * tests/tclbench/data.bench: * tests/tclbench/expr.bench: * tests/tclbench/jacl132.out: * tests/tclbench/libbench.tcl: * tests/tclbench/list.test: * tests/tclbench/loops.bench: * tests/tclbench/runbench.tcl: * tests/tclbench/tclsh8411.out: 2005-09-29 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/AfterCmd.java (cmdProc, getAfterEvent): Update Util.strtoul() caller. * src/jacl/tcl/lang/ExprCmd.java (cmdProc): Invoke new Expression.evalSetResult() method. * src/jacl/tcl/lang/ExprValue.java: Rewrite ExprValue class so that it is a mutable value that can be passed around inside Jacl methods. * src/jacl/tcl/lang/Expression.java: Reimplement Jacl's expr module to use 32 bit integers instead of 64 bit integers in calculations. Add support for eq and ne string operators. Create per-interp cache of ExprValue objects to speed up expr processing. When parsing an expr, use the internal rep for integer, double, and boolean types instead of always reparsing from the string representation. Add shortcuts for common strings as expr values. The expr div and mod as well as other operators are now up to date WRT to CVS head of Tcl. Parsing of boolean tokens in an expr has been fixed and math functions have been reimplemented so that they accept ExprValues instead of TclObject values. * src/jacl/tcl/lang/FormatCmd.java (cmdProc): Update Util.strtoul() caller. * src/jacl/tcl/lang/Interp.java (strtoulResult, strtodResult): Add parse result object to avoid allocation for each parse operation. * src/jacl/tcl/lang/Parser.java (eval2, backslash): Set array member to null in case it helps gc faster, update caller of Util.strtoul(). * src/jacl/tcl/lang/ScanCmd.java (cmdProc): Update Util.strtoul() caller. * src/jacl/tcl/lang/StringCmd.java (cmdProc): Remove pointless TclBoolean internal rep checking. Update calls to Expression.looksLikeInt() and Util.strtod(). * src/jacl/tcl/lang/StrtodResult.java: Add support for updating the result of an already allocated object. * src/jacl/tcl/lang/StrtoulResult.java: Ditto. * src/jacl/tcl/lang/Util.java (strtoul, getInt, getIntForIndex, strtod, getDouble, findElement, getBoolean, traceProc): Optimize number parsing routines. Pass an already allocated object to strtoul and strtod so as to avoid lots of allocations. Support a null interp argument in getInt, getIntForIndex, and getDouble. * src/tcljava/tcl/lang/TclDouble.java (setDoubleFromAny): Check for double and integer objects with no string rep and create a string rep for them if needed. * src/tcljava/tcl/lang/TclInteger.java (setIntegerFromAny): Check for boolean with string rep and optimized boolean to integer cases. * src/tcljava/tcl/lang/TclObject.java (hasNoStringRep): Add access method to determine if object has no string rep. This is needed to check for edge cases when converting objects and during expr evaluations. * tests/tcl/expr.test: Add expr tests from Tcl CVS. * tests/tcl/string.test: Add missing string is tests. 2005-09-21 Mo DeJong <mdejong@users.sourceforge.net> Add a constant boolean flag to the TclObject class. If enabled, each TclObject allocation, internal rep allocation, and internal rep conversion will be counted. This will provide a handy interactive record of the way that objects behave. This code will be optimized away when the flag is set to false. * src/jacl/tcl/lang/TclList.java: * src/tclblend/tcl/lang/CObject.java: * src/tclblend/tcl/lang/TclList.java: * src/tcljava/tcl/lang/TclBoolean.java: * src/tcljava/tcl/lang/TclDouble.java: * src/tcljava/tcl/lang/TclInteger.java: * src/tcljava/tcl/lang/TclObject.java: * src/tcljava/tcl/lang/TclString.java: 2005-09-11 Mo DeJong <mdejong@users.sourceforge.net> Make NamespaceCmd.Namespace inner class a toplevel class in the tcl.lang package. The Namespace class is now part of the documented public API for Jacl. Add API docs for classes/methods that are only available with Jacl. * diffs.txt: * itcl/itcl/lang/BiCmds.java: * itcl/itcl/lang/Class.java: * itcl/itcl/lang/Cmds.java: * itcl/itcl/lang/Ensemble.java: * itcl/itcl/lang/ItclInt.java: * itcl/itcl/lang/Methods.java: * itcl/itcl/lang/Objects.java: * itcl/itcl/lang/Parse.java: * itcl/itcl/lang/Util.java: * itcl/tcl/lang/ItclAccess.java: * jacl/tcl/lang/CallFrame.java: * jacl/tcl/lang/ImportedCmdData.java: * jacl/tcl/lang/InfoCmd.java: * jacl/tcl/lang/Interp.java: * jacl/tcl/lang/InterpAliasCmd.java: * jacl/tcl/lang/InterpSlaveCmd.java: * jacl/tcl/lang/Namespace.java: * jacl/tcl/lang/NamespaceCmd.java: * jacl/tcl/lang/ProcCmd.java: * jacl/tcl/lang/Procedure.java: * jacl/tcl/lang/Resolver.java: * jacl/tcl/lang/Var.java: * jacl/tcl/lang/WrappedCommand.java: 2005-09-11 Mo DeJong <mdejong@users.sourceforge.net> Add tcljava-post-itcl-merge tag. 2005-09-11 Mo DeJong <mdejong@users.sourceforge.net> Add Itcl package for Jacl. This is a full port of the C version of Itcl 3.2.1 over to Java. A "package require Itcl" adds the itcl::class and other commands. * Makefile.in: * license.itcl: * src/itcl/itcl/lang/BiCmds.java: * src/itcl/itcl/lang/Class.java: * src/itcl/itcl/lang/Cmds.java: * src/itcl/itcl/lang/Ensemble.java: * src/itcl/itcl/lang/Itcl.java: * src/itcl/itcl/lang/ItclExtension.java: * src/itcl/itcl/lang/ItclInt.java: * src/itcl/itcl/lang/Linkage.java: * src/itcl/itcl/lang/Methods.java: * src/itcl/itcl/lang/Migrate.java: * src/itcl/itcl/lang/Objects.java: * src/itcl/itcl/lang/Parse.java: * src/itcl/itcl/lang/Util.java: * src/itcl/itcl/lang/library/itcl.tcl: * src/itcl/tcl/lang/ItclAccess.java: * src/jacl/tcl/lang/CallFrame.java: * src/jacl/tcl/lang/Interp.java: * src/jacl/tcl/lang/NamespaceCmd.java: * src/jacl/tcl/lang/ProcCmd.java: * src/jacl/tcl/lang/Procedure.java: * src/jacl/tcl/lang/Var.java: * src/jacl/tcl/lang/WrappedCommand.java: * src/tcljava/tcl/lang/TCL.java: * src/tcljava/tcl/lang/TclException.java: * tests/all.tcl: * tests/itcl/basic.test: * tests/itcl/body.test: * tests/itcl/chain.test: * tests/itcl/delete.test: * tests/itcl/ensemble.test: * tests/itcl/import.test: * tests/itcl/info.test: * tests/itcl/inherit.test: * tests/itcl/interp.test: * tests/itcl/local.test: * tests/itcl/methods.test: * tests/itcl/mkindex.test: * tests/itcl/namespace.test: * tests/itcl/protection.test: * tests/itcl/scope.test: 2005-09-11 Mo DeJong <mdejong@users.sourceforge.net> Add tcljava-pre-itcl-merge tag. 2005-08-08 Mo DeJong <mdejong@users.sourceforge.net> Add tcljava-132-branch branch and and tcljava-132-branchpoint tags. 2005-08-08 Mo DeJong <mdejong@users.sourceforge.net> Add tcljava-132-2005-08-08 tag to mark tree state for the 1.3.2 release. 2005-07-28 Mo DeJong <mdejong@users.sourceforge.net> * announce: Update. * docs/website/index.html: Update. 2005-07-27 Mo DeJong <mdejong@users.sourceforge.net> * README.jacl: Update msys description and mention jaclsh.bat script. * README.tclblend: Mention Tcl 8.4.11 and Thread 2.6.2 reqs. Add msys url and mention jtclsh.bat script. * docs/website/faq.html: Update FAQ. * docs/website/index.html: Update homepage info with new 1.3.2 release. * docs/website/mail.html: Add mail page that explains how the mailing lists work. 2005-07-23 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Channel.java (initOutput): When initializing a channel of type "file", set a flag to indicate that the channel should be sync()'ed in addition to flushing. * src/jacl/tcl/lang/FlushCmd.java: Print IO exception stack trace, this should never happen but if it did sa stack trace would be helpful. * src/jacl/tcl/lang/TclOutputStream.java (setSync, flushChannel): Add flag setting method so that an output stream can be marked so that sync() will be invoked when flushing. * tests/tcl/SocketCmd.test: Add simple socket test case that writes to and reads from a socket. 2005-07-21 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/BinaryCmd.java (FormatNumber, ScanNumber): Handle edge cases when casting from a double to a float. Rewrite scanning code so that 64 bit long value is used for shifting operation. * src/jacl/tcl/lang/InfoCmd.java: * src/jacl/tcl/lang/Shell.java: * src/jacl/tcl/lang/SubstCmd.java: Invoke static method via class name. * src/jacl/tcl/lang/Util.java (strtod): Add support for "NaN", "Inf", and "-Inf" strings as valid double values. * tests/tcl/binary.test: Enable test cases that were not being run because they had the nonPortable constraint. Java supports only big endian primitive types so the binary format and scan operations can just assume big endian layout. Test that assume little endian are not run via addition of the littleEndian constraint. Add test cases for double -> float edge cases. 2005-07-20 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Copy new files into dist. * tests/tclblend/loading.test: Rework test so that it is only run under Win32 and returns the proper result. * win/jaclsh.bat: Removed old bat script. 2005-07-19 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Remove old green threads code for "custom" target. Tcl Blend only works with a native threads JVM anyway. Add new custom2 shell which loads a JVM at runtime and then loads Tcl Blend like a JVM would. This shell make it easier to debug weird loading issues in Tcl Blend. * src/tests/tclblend/tests/JavaEval.java: Make the program exit(0) when an expected result matches the program result. Use positive exit status. * tests/tclblend/loading.test: Use the expected compare test in the JavaEval class. * unix/custom2.c: Add new custom shell impl that loads a JVM and then loads Tcl Blend into the JVM. 2005-07-18 Mo DeJong <mdejong@users.sourceforge.net> Fix crashes when loading Tcl Blend into an existing JVM by invoking Tcl_FindExecutable("java") to init Tcl subsystems. * src/native/javaCmd.c: Update comment. * src/native/javaInterp.c ( Java_tcl_lang_Interp_create, Java_tcl_lang_Interp_init, Java_tcl_lang_Interp_initName): Add TCLBLEND_DEBUG output statements. Add initName() method that will init the Tcl executable name when Tcl Blend is loaded from Java. * src/tclblend/tcl/lang/Interp.java (shlib_load, initName): Add initName() method mentioned above and invoke it after loading the Tcl Blend shared lib. * tests/tclblend/loading.test: Update tests to account for executable name check. Add test for [info nameofexecutable] in a Tcl Blend interp loaded into Java. 2005-07-17 Mo DeJong <mdejong@users.sourceforge.net> Add startup .bat files for Jacl and Tcl Blend. The bat files are auto generated by configure with the correct paths. * Makefile.in: Install and test jaclsh.bat and jtclsh.bat. Make sure the PATH variable is always set with the new directories prepended to the PATH. Rework tricky gdb invocation under Win32 since the mingw version of gdb does not know about mingw style unix paths. * autogen.sh: Remove autoconf generated cache. * configure: Regen. * configure.in: Quote directory names passed to mingw path utils to deal with spaces in paths. Subst native versions of paths so that we can generate a .bat file with win32 paths. Emit bat during configure on win32. * jaclsh.bat.in: Jacl bat template. * jaclsh.in: Print error if run under Cygwin. * jtclsh.bat.in: Tcl Blend bat template. * jtclsh.in: Don't set unix env vars under win32. * mingw_path.sh: Deal with paths that don't exist and other edge cases. * mingw_path.test: Regression tests for mingw utils. * mingw_paths.sh: Script to convert a set of path elements separated by : into win32 path elements separated by ; characters. 2005-07-16 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Place double quotes around setting of runtime path variable in shell_tclblend and test_tclblend.exec targets. This avoids an error when the PATH contains a directory name that has spaces in it under Win32. * configure: Regen. * jtclsh.in: Place double quotes around PATH value. * tcljava.m4 (AC_JAVA_JNI_LIBS): Add detection for Sun JDK 1.3 and 1.4 JVMs. Fixup IBM JDK 1.3 detection so that it does not generate a false positive when configuring with a Sun JDK 1.4 JVM. 2005-07-14 Mo DeJong <mdejong@users.sourceforge.net> Update version number to 1.3.2. Update README and associated files. * README.jacl: * README.tclblend: * announce: * configure: * configure.in: * new_features.txt: * src/pkgIndex.tcl: * src/jacl/tcl/lang/Interp.java: * src/tcljava/tcl/lang/BlendExtension.java: * unix/tools/vutil/current: * unix/tools/vutil/vsub.sh: * win/makefile.vc: 2005-07-14 Mo DeJong <mdejong@users.sourceforge.net> * configure: Regen. * configure.in: Fixup subst variable needed when configuring both tclblend and jacl. * tests/inprogress/Unicode.test: Add knownbug constraint to test that always fails due to some bug in Java unicode libs. 2005-07-13 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/StringCmd.java (cmdProc): Handle empty string case for string is CLASS subcommand. * tests/tcl/string.test: Add test case for empty string argument with string is. [Bug 1237950] 2005-07-13 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/CObject.java: Add stubbed out signatures for methods defined by the TclBlend version of CObject. These methods will never be called in Jacl. [Patch 875166] 2005-07-13 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Expression.java (ExprGetValue): Check for a subexpression that has no right hand operand and raise a syntax error if found. * tests/tcl/expr.test: Check for error condition. Thanks go to Jason Lohrey for this bug id and patch. [Bug 1071611] 2005-07-13 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Expression.java (ExprParseString): Fix ancient number parsing bug dealing with expr values. Expr should treat something that does not parse as an integer or double as a string. Expr was incorrectly raising an error for numbers that were out of range or did not look like integers. * tests/inprogress/ExprCmd.test: * tests/tcl/expr.test: Remove knownbug constraint since this number parse bug is now fixed. [Bug 879170] 2005-07-13 Mo DeJong <mdejong@users.sourceforge.net> * src/tcljava/tcl/lang/TclInteger.java (setIntegerFromAny): When converting a boolean to an integer, convert by reparsing the string rep unless the boolean has the string rep "0" or "1". It is possible that a valid integer like 10 would be converted to the boolean 1 and we would not want to convert that back to the integer 1. 2005-01-12 Mo DeJong <mdejong@users.sourceforge.net> * demos/gluepkg/JarCmd.java: * src/jacl/tcl/lang/Interp.java: * src/jacl/tcl/lang/NamespaceCmd.java: * src/jacl/tcl/lang/PackageCmd.java: * src/jacl/tcl/lang/SearchId.java: * src/jacl/tcl/lang/Var.java: * src/tcljava/tcl/lang/TclClassLoader.java: * src/tests/jacl/tcl/lang/TestChannelCmd.java: Replace use of variable identifier enum with e since enum is a reserved word in Java 1.5. 2004-11-20 Mo DeJong <mdejong@users.sourceforge.net> * docs/TclJavaLib/dispose.htm: Add note to dispose command docs to make sure people know that dispose must be called from the same thread that created the interp. * src/jacl/tcl/lang/Interp.java (dispose): * src/tclblend/tcl/lang/Interp.java (dispose): Check that the Interp.dispose() method is being invoked from the same thread that the interp was created in. Users should not be invoking dispose in another thread and it crashes Tcl Blend so this error check just makes things easier to debug. [Bug 1037295] 2004-11-17 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/ExecCmd.java (cmdProc): Add ability to exec a process in the background by passing the & flag to the exec command. [Patch 500880] 2004-11-17 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: * src/tcljava/tcl/lang/JavaLoadCmd.java: * src/tests/tcljava/javaload/Test11Extension.java: * tests/tcljava/JavaLoadCmd.test: Add check for class dependency errors while creating an instance of an Extension object via the java::load command. [Patch 1016586] 2004-11-17 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Interp.java (setWorkingDir): Fixup error message from cd command so that it matches the Tcl implementation. [Bug 896209] 2004-11-17 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/ExecCmd.java (cmdProc) Update exec for JDK 1.3 or newer so that another thread is created to read data from the subprocess while the first thread calls waitFor(). Earlier than JDK 1.3 still does both in one thread. [Bug 879167] 2004-11-17 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/ExecCmd.java (execWin): Add "windows xp" as one of the OS strings checked before execing the pre JDK 1.3 version of exec. [Bug 879167] 2004-10-01 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Copy tests/tl.jar to build dir and add it to the CLASSPATH. * src/jacl/tcl/lang/Interp.java (convertStringCRLF, readScriptFromURL): Move CRLF conversion code into helper function so that it can be regression tested. * src/tclblend/tcl/lang/Interp.java (evalResource, readScriptFromInputStream): Remove JDK compressed jar hack and replace with Reader/Writer code in the readScriptFromInputStream helper. * tests/tl.jar: Add jar for test cases. * tests/jacl/Interp.test: Add test case for evalResource() in the Interp class. * tests/tclblend/javaInterp.test: Add test case for evalResource() in the Interp class. 2004-09-30 Mo DeJong <mdejong@users.sourceforge.net> * configure: Regen. * tcljava.m4 (TCLJAVA_ENABLE_JACL_OR_TCLBLEND): When building with Jacl only, set the ac_cv_tcl_win32 var based on the results of uname -s. This fixes a native path conversion code problem that was causing a configure problem and was causing `make test` to fail. [Bug 904653] 2004-09-30 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/FileChannel.java (close): Set file member to null after closing. * src/jacl/tcl/lang/Interp.java (readScriptFromFile, readScriptFromURL, readScriptFromInputStream, evalResource): Use new Tcl IO layer to filter CRLF to LF when sourcing data from a file. Use new ReadInputStreamChannel class to read and filter data from an InputStream either from a resource or a URL. This removes any attempts to use the available method to do any sort of non-blocking IO in the Interp class. * src/jacl/tcl/lang/ReadInputStreamChannel.java: Add new class to read data from an InputStream as a Channel. * tests/all.tcl: Fixup tcltest variable setting so that it works in Jacl. * tests/jacl/Interp.test: Add test cases for CRLF to LF conversion when sourcing a file or a URL. [Bug 1000176] 2004-09-28 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/TclOutputStream.java (flushChannel): Add explicit call to flush() the OutputStream and to sync() the FileDescriptor for a FileOutputStream. This fixes a number of test regressions under Sun JDK 1.4 (Win32). 2004-09-18 Alexander James Pasadyn <ajpasadyn@users.sourceforge.net> * src/jacl/tcl/lang/InfoCmd.java (InfoHostnameCmd): Implement info hostname command for Jacl. [Patch 1017119] 2004-09-18 Alexander James Pasadyn <ajpasadyn@users.sourceforge.net> * src/jacl/tcl/lang/Shell.java (main): If the main eval() returns TCL.ERROR or some unknown error code, exit with a non-zero status. [Patch 1021427] 2004-09-18 Alexander James Pasadyn <ajpasadyn@users.sourceforge.net> * src/tcljava/tcl/lang/TCL.java: Make the TCL.NO_EVAL, TCL.EVAL_GLOBAL, and TCL.EVAL_DIRECT constants public so that they can be used outside the tcl.lang package. [bug 1000263] 2004-09-18 Alf Watt <alfwatt@users.sourceforge.net> * configure: Regen. * tcljava.m4 (AC_JAVA_CLASSPATH): Add support for building Jacl under Darwin. [Bug 1004860] 2004-09-18 Alexander James Pasadyn <ajpasadyn@users.sourceforge.net> * src/jacl/tcl/lang/library/init.tcl: Loop over path value list in env(TCLLIBPATH) instead of incorrectly assuming that it is a single value. [Bug 979897] 2003-09-30 Mo DeJong <mdejong@users.sourceforge.net> * README.jacl: * README.tclblend: Remove note claiming Jacl and Tcl Blend were not ready for use in a production system. 2003-09-09 Mo DeJong <mdejong@users.sourceforge.net> * configure: Regen. * tcljava.m4 (AC_JAVA_CLASSPATH): Avoid using an existing CLASSPATH env var under msys+mingw since the mixing of Win32 and Unix style paths was causing problems. Append an existing CLASSPATH env var value to the detected ac_java_classpath instead of skipping the detection step when a CLASSPATH is set. 2003-09-02 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Update the tclblendDist rule so that win/libjvm.dll.a is included in the tar and zip files. 2003-08-17 Mo DeJong <mdejong@users.sourceforge.net> * docs/website/faq.html: Add entry about stubs. * docs/website/index.html: Add 1.3.1 release news. 2003-08-07 Mo DeJong <mdejong@users.sourceforge.net> Add tcljava-131-2003-08-07 tag to mark the 1.3.1 release. 2003-08-07 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Create a tmp directory and run install check for tclblend in this dir. This avoids a problem under Windows where the install rule crashes when a tclblend.dll is loaded from two different localtions on the file system. * jtclsh.in: Set the PATH env var to include Java and Tcl Blend shared lib locations. 2003-07-25 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Fix install of xputils package so that it works when built outside the src dir. * configure: Regen. * tcljava.m4 (TCLJAVA_CHECK_TCLSH): Fix the TCLSH_LOC and TCLSH paths so that the install rule works under Win32 in both regular and debug mode. 2003-07-25 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Parser.java: Set the interp result directly instead of trying to append to the result object since appending is known to not work. 2003-07-25 Mo DeJong <mdejong@users.sourceforge.net> * src/pkgIndex.tcl: * src/jacl/tcl/lang/Interp.java: * src/tcljava/tcl/lang/BlendExtension.java: * unix/tools/vutil/current: * win/makefile.vc: Update version numbers in files as a result of running `make dist`. 2003-07-25 Mo DeJong <mdejong@users.sourceforge.net> * configure: Regen. * configure.in: Update version number to 1.3.1. 2003-07-25 Mo DeJong <mdejong@users.sourceforge.net> * README.jacl: * README.tclblend: Update to mention that scripts need to be installed before running and that Tcl 8.4.4 is the min 8.4 version that Tcl Blend can be used with. 2003-07-07 Mo DeJong <mdejong@users.sourceforge.net> * configure: Regen. * tcljava.m4 (AC_JAVA_JNI_LIBS): If linking with the jvm.lib from the JDK fails, link with our own import lib for jvm.dll. * win/libjvm.dll.a: Add import lib created using instructions from the following URL: http://www.inonit.com/cygwin/jni/invocationApi/archive.html 2003-05-30 Kenneth H. Cox <tclunit@attbi.com> * src/native/javaInterp.c (BTestCmd): Change C++ style comment to C style comment. 2003-04-30 Mo DeJong <mdejong@users.sourceforge.net> * README.tclblend: Update min version of the Tcl Thread package to 2.5.2. This avoids a configure bug in the 2.5.1 release that shows up when building in the srcdir. 2003-03-18 Mo DeJong <mdejong@users.sourceforge.net> * src/tcljava/tcl/lang/JavaDefineClassCmd.java (cmdProc): Convert each char to a byte instead of calling String.getBytes() which returns bytes in the platform's default encoding. 2003-03-17 Mo DeJong <mdejong@users.sourceforge.net> Add tcljava-130-2003-03-17 tag to mark the 1.3.0 release. 2003-03-17 Mo DeJong <mdejong@users.sourceforge.net> * tests/tcl/get.test: Fix syntax error and add knownbug constraint to test that fails. * tests/tcljava/FuncSig.test: Comment out test case that depends on a feature in the source that was disabled. * tests/tcljava/JavaDefineClassCmd.test: Use binary translation when reading .class files for both Jacl and Tcl Blend. This is needed to fix a failing test in Jacl, as a result of the recent IO upgrade. 2003-03-17 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Revamp the dist target, updates are needed since lots of things about file layout have changed. Copy the xputils dir out of the src subdir when installing Tcl Blend. Don't bother building a .Z file via dist. * configure: Regen. * configure.in: Rework AC_OUTPUT so that only the needed files are emitted for a Jacl or Tcl Blend configure. 2003-03-17 Mo DeJong <mdejong@users.sourceforge.net> * tests/inprogress/CallFrame.test: * tests/inprogress/ExprCmd.test: * tests/inprogress/GlobCmd.test: * tests/inprogress/Unicode.test: * tests/inprogress/Util.test: * tests/jacl/FileCmd.test: * tests/jacl/Interp.test: * tests/tcl/error.test: * tests/tcl/expr-old.test: * tests/tcl/expr.test: * tests/tcl/fileName.test: * tests/tcl/for.test: * tests/tcl/format.test: * tests/tcl/get.test: * tests/tcl/if.test: * tests/tcl/interp.test: * tests/tcl/io.test: * tests/tcl/ioCmd.test: * tests/tcl/lsearch.test: * tests/tcl/misc.test: * tests/tcl/namespace.test: * tests/tcl/parse.test: * tests/tcl/parseOld.test: * tests/tcl/platform.test: * tests/tcl/proc-old.test: * tests/tcl/proc.test: * tests/tcl/regexp.test: * tests/tcl/scan.test: * tests/tcl/security.test: * tests/tcl/set-old.test: * tests/tcl/split.test: * tests/tcl/string.test: * tests/tcl/switch.test: * tests/tcl/timer.test: * tests/tcl/upvar.test: * tests/tcl/utf.test: * tests/tcl/var.test: * tests/tcl/while-old.test: * tests/tcl/while.test: Either add a knownbug constraint or simply don't run any test that currently fail. This is needed so that folks don't see a ton of errors from known problems when running `make test` on the release. 2003-03-17 Mo DeJong <mdejong@users.sourceforge.net> * README.jacl: * README.tclblend: Add note indicating that 1.3.0 is not a production release. Fixup some old links and descriptions under the Documentation section. Note the Tcl and Thread package requirements for Tcl Blend. 2003-03-17 Mo DeJong <mdejong@users.sourceforge.net> * docs/cFunctions.html: * docs/contents.html: * docs/TclJava/contents.html: * docs/TclJavaLib/contents.htm: * docs/website/download.html: * docs/website/faq.html: * docs/website/getstart.html: * docs/website/index.html: * docs/website/links.html: * docs/website/logo100.gif: * docs/website/mail.html: * docs/website/manual.html: * docs/website/matchmadeforscripting.html: Add new web interface that will be available via tcljava.sourceforge.net. Pull in content from previous FAQ, add new getting started page along with other new content. 2003-03-13 Mo DeJong <mdejong@users.sourceforge.net> * extras/GuiShell/GuiShell.java (processCommand): Remove call to interp.updateReturnInfo() and check for TCL.OK. This is already handled by the interp.eval() method. * src/jacl/tcl/lang/Interp.java (eval): Don't create a new TclException when catching, just reset the completion code in case it was changed because TCL.RETURN was raised. This matches the implementation used elsewhere. Fixup some comments about the eval method. * src/jacl/tcl/lang/Shell.java (processEvent): Remove call to interp.updateReturnInfo() and check for TCL.OK. This is already handled by the interp.eval() method. 2003-03-10 Mo DeJong <mdejong@users.sourceforge.net> * diffs.txt: Move fblocked, fconfigure, and socket from the unsupported list to the partially supported list. * new_features.txt: Add note about new Jacl IO subsystem. 2003-03-10 Mo DeJong <mdejong@users.sourceforge.net> * src/tcljava/tcl/lang/FieldSig.java (getAccessibleFields, getAccessibleField): Don't return a private field as a result of getAccessibleFields or getAccessibleField. * src/tcljava/tcl/lang/FuncSig.java (getAccessibleConstructors, getAccessibleConstructor): Don't return a private constructor as a result of getAccessibleConstructors or getAccessibleConstructor. * src/tcljava/tcl/lang/reflect/PkgInvoker.java (isAccessible): Add isAccessible methods that accept a Constructor or a Field argument. * src/tests/tcljava/pkg1/PrivateAccess.java: Add test case of private access for fields and constructors. * tests/tcljava/PkgInvoker.test: Add accessibility checks for private methods, fields, and constructors in a class with a TclPkgInvoker. 2003-03-10 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Notifier.java (serviceEvent): * src/tclblend/tcl/lang/Notifier.java (serviceEvent): No need for extra logic that deals with the isProcessing field of the TclEvent class since the getAvailableEvent does not return a TclEvent that has isProcessing set to true. 2003-03-10 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Notifier.java (serviceEvent): Rework synchronization on a TclEvent inside serviceEvent. Now the monitor on the TclEvent object is only locked if the sync() method has been invoked on the TclEvent. This should speed things up since a monitor lock is no longer needed in the common case where the event is processed without a call to sync(). * src/tclblend/tcl/lang/Notifier.java (preserve, release, queueEvent, deleteEvents, serviceEvent, getAvailableEvent): Implement TclEvent change to serviceEvent as described above. Undo the "notifierMutex" changes made on 2000-08-23, it is not clear why a separate object used as a mutex is preferable to just synchronizing the methods. Just make sure that the serviceEvent method is not synchronized since that is what was causing the deadlocking problem. * src/tcljava/tcl/lang/TclEvent.java (sync): Don't synchronize the entire sync() method since there is no need to do that when sync() is called from the primary thread. Instead, grab the monitor before calling wait. 2003-03-10 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Notifier.java (deleteEvents, deleteEvent, serviceEvent): Have the Notifier class implement the EventDeleter interface to match the event delete implementation used in Tcl Blend. Optimize the deleteEvents call by saving the just processed event in the servicedEvent field and checking this field when the Notifier is passed to deleteEvents. This avoids the need for a call to the deleteEvent method for every event in the queue. * src/tclblend/tcl/lang/Notifier.java (deleteEvents, deleteEvent, serviceEvent): Optimize the deleteEvents call by saving the just processed event in the servicedEvent field and checking this field when the Notifier is passed to deleteEvents. This avoids the need for a call to the deleteEvent method for every event in the queue. 2003-03-09 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Notifier.java (serviceEvent, getAvailableEvent, doOneEvent): Rework synchronization approach used by Jacl's notifier class. Don't synchronize the serviceEvent and doOneEvent methods, instead synchronize only when waiting and when reading or changing the queue. This lets us queue up a new event while another is still being processed. * src/tests/tcljava/tests/EventQueueLockThread.java: Add new test case for event queue while another event is being processed. * tests/tcljava/TclEvent.test: Add test that makes use of EventQueueLockThread. 2003-03-07 Mo DeJong <mdejong@users.sourceforge.net> Initial port of Tcl IO layer from Tcl 8.4. This port implements encoding and translation features and buffers things based on Tcl's semantics. Implements correct semantics for puts, read, gets, seek, tell, eof, and close. Async IO the fileevent command, and the fcopy have not been implemented. * src/jacl/tcl/lang/Channel.java (read, write, close, flush, initInput, initOutput, eof, getInputStream, getOutputStream, setBlocking, setBuffering, getBufferedInput, getBufferedOutput, getNumBufferedInputBytes, getNumBufferedOutputBytes, isBlocked, inputSawCR, setEncoding, setInputTranslation, setOutputTranslation, getInputEofChar, setInputEofChar, getOutputEofChar, setOutputEofChar): Use the TclInputStream and TclOutputStream to manage IO details instead of using a Java Reader or Writer. Invoke methods on the input or output object from the identical method in the Channel class. The read method now returns an integer and expects a TclObject as an argument. Add abstract getInputStream and getOutputStream method that should be defined by a subclass. * src/jacl/tcl/lang/ChannelBuffer.java: Add helper class that is used by TclInputStream and TclOutputStream. * src/jacl/tcl/lang/FblockedCmd.java (cmdProc): Pass interp to Channel API for error checking. * src/jacl/tcl/lang/FconfigureCmd.java (cmdProc): Update -eofchar and -translation option handling to match Tcl impl and so test cases pass. * src/jacl/tcl/lang/FileChannel.java (read, write, flush, seek, tell, getInputStream, getOutputStream): Remove read, write, and flush methods since this is now handled in Channel. Update seek and tell implementations based on the new TclInputStream and TclOutputStream classes. Add defs for the getInputStream and getOutputStream abstract methods. * src/jacl/tcl/lang/GetsCmd.java (cmdProc): Implement calls to Channel class based on Tcl implementation. * src/jacl/tcl/lang/OpenCmd.java (cmdProc): Update error messages in open so they pass Tcl tests. * src/jacl/tcl/lang/ReadCmd.java (cmdProc): Implement calls to Channel class based on Tcl implementation. * src/jacl/tcl/lang/SeekCmd.java (cmdProc): Use TclIndex when processing seek options so that test cases pass. * src/jacl/tcl/lang/ServerSocketChannel.java (getInputStream, getOutputStream): Implement dummy methods. * src/jacl/tcl/lang/Shell.java (main): Invoke the interp.dispose() method before calling exit so that any remaining IO is flushed when Channels are closed. * src/jacl/tcl/lang/SocketChannel.java (SocketChannel, getInputStream, getOutputStream): Remove setting of reader and writer fields and implement getInputStream and getOutputStream instead. * src/jacl/tcl/lang/StdChannel.java (open, ): Don't set reader, instead implement getInputStream method. Add dummy getOutputStream implementaiton. * src/jacl/tcl/lang/TclInputStream.java: Implementaiton of input half of Tcl IO code. Supports binary input as well as reading encoded streams. * src/jacl/tcl/lang/TclOutputStream.java: Implementaiton of output half of Tcl IO code. Supports binary output as well as writing encoded streams. * src/tcljava/tcl/lang/TclString.java (append, empty): Add an append method that acepts a char[] and a new empty method that will ensure that the internal rep is an empty StringBuffer. These features are used by the Jacl IO system only. * src/tests/jacl/tcl/lang/TestChannelCmd.java (cmdProc): Update calls to Channel APIs like isBlocked, getNumBufferedInputBytes, and getNumBufferedOutputBytes. * tests/tcltest.tcl: Add the testConstraint method since it is used in io.test and ioCmd.test. * tests/inprogress/Unicode.test: Add a couple of test cases for Java encodings. The JVM's I have tested don't seem to support encodings very well, so these tests will likely fail. * tests/tcl/FileCmd.test: Invoke fconfigure correctly, this buggy code was inside a catch. * tests/tcl/io.test: * tests/tcl/ioCmd.test: Add IO test scripts from Tcl CVS as of today. Most pass, some still fail because of minor bugs. 2003-03-07 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/TclByteArray.java (setLength): Remove TclException from method throws section since the methods never throw a TclException. Call the invalidateStringRep method from setLength so that a modified array will be reflected in the string rep. 2003-03-06 Bruce Johnson <bruce_johnson@merck.com>, Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/FileChannel.java (open): Add logic to handle EXCL and TRUNC options. * src/jacl/tcl/lang/OpenCmd.java (cmdProc): Add proc essing of access flags, the RDONLY, WRONLY, RDWR, APPEND, CREAT, EXCL, and TRUNC options are now processed correctly. * src/jacl/tcl/lang/TclIO.java: Add the EXCL and TRUNC values. 2003-03-05 Tom Poindexter <tpoindex@nyx.net>, Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Interp.java (eventuallyDispose): * src/jacl/tcl/lang/StdChannel.java (close): Invoke the close() method for any remaining channel when the interp is being disposed of. The close method in the StdChannel class will invoke flush one final time for stdout in case there was output that had not yet been flushed. 2003-03-05 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/StdChannel.java (open, write): Avoid wrapping a buffered IO object around the stdio and stderr streams since this was causing problems where stdout was not being flushed. Instead, explicitly handle flushing in the write method. 2003-02-14 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Build a jar file named hello.jar for use in test that loads class file out of a jar. Also copy new directory to dist file. * src/tcljava/tcl/lang/TclClassLoader.java (getClassFromPath): Use '/' character instead of File.separatorChar as the separator when constructing a class file name to be searched for in the .jar file. A jar file always uses '/' as the separator. * src/tests/tcljava/hello/SayHello.java: Add test source code. * tests/tcljava/JavaCallCmd.test: Add test case that loads a class file out of a jar on the TCL_CLASSPATH. [Bug 225612] 2003-02-06 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/IfCmd.java (cmdProc): Add additional info to errorInfo to match Tcl 8.3 implementation. * tests/tcl/expr.test: * tests/tcl/if.test: Update test cases to match Jacl implementation. 2003-02-06 Mo DeJong <mdejong@users.sourceforge.net> * tests/tcl/incr-old.test: * tests/tcl/incr.test: Update incr test cases to match Jacl implementation. Add tests cases from Tcl 8.4 impl. 2003-02-05 Mo DeJong <mdejong@users.sourceforge.net> * tests/interp.test: Don't include load command in list of hidden commands for Jacl. * tests/set-old.test: Run test cases that depend on hash order through lsort so that the tests pass under Jacl. 2003-02-05 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Parser.java (eval2): When invoking logCommandInfo while processing a nested command, check for a close bracket terminator in addition to a normal end of command terminator. This allows a regression test that was failing to pass. 2003-02-05 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/ParseAdaptor.java (parseNestedCmd): Raise missing close-bracket exception for easy error case. * src/jacl/tcl/lang/Parser.java (parseCommand): Raise "missing close-bracket" exception when parser finds a nested command that is not terminated by a close bracket. This allows a couple of failing test cases to pass. 2003-02-03 Mo DeJong <mdejong@users.sourceforge.net> * tests/tcl/error.test: * tests/tcl/expr.test: * tests/tcl/for.test: * tests/tcl/if.test: * tests/tcl/incr.test: * tests/tcl/while.test: Change expected result of tests that examine the errorInfo variable after an error is raised. The message "while compiling" has been changed to "while executing" to match the Jacl implementation. Jacl does not have a bytecode compiler, so it can't match the errorInfo messages of Tcl 8.X. This change allows a number of test cases to pass. 2003-02-03 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Expression.java (ExprGetValue): Throw a plain syntax error when unmatched parens or a bad ?: operator is encountered. This is less descriptive but matches the Tcl 8.3 implementation. 2003-02-03 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Expression.java (ExprGetValue, mathFunction): Return null from ExprGetValue when a CLOSE_PAREN is found and check for this special case so that the proper error message is returned. 2003-02-03 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Parser.java (eval2): Check to see if the character just before the end of the returned script is a terminator and don't include it in the error message if it is. This fixes a test case in error.test. 2003-02-02 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/ClockCmd.java (GetDate): Work around bug in JDK's Calendar implementation by adding whole days instead of a days worth of seconds. This allows the two failing test cases in clock.test to pass, these tests dealt with daylight savings time issues. 2003-02-02 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/FileCmd.java (copyRenameOneFile): Check for case where a directory cannot be renamed because the target dir contains a file. Raise a EEXIST error in this case. This gets a number of test cases in tests/jacl/FileCmd.test to pass. 2003-02-01 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/FileCmd.java (cmdProc): Add unimplemented command stubs for channels, link, normalize, separator, and system subcommands. * src/jacl/tcl/lang/FileUtil.java (doTildeSubst): Search for env(HOME) in the global variable table. * tests/defs: Add testchmod implementation for UNIX. * tests/jacl/FileCmd.test: Rework tests to match Tcl 8.4 and current Jacl implementation. 2003-02-01 Mo DeJong <mdejong@users.sourceforge.net> * tests/tclblend/loading.test: Rework a couple of tests to make errors showing up under JDK 1.4 more clear. Remove core file if there is one. 2003-01-31 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/FormatCmd.java (cmdProc, cvtStrToStr): Fixup failing format test cases that had to do with padding with zeros and negative width values. 2003-01-27 Mo DeJong <mdejong@users.sourceforge.net> * tests/tclblend/loading.test: Add unimplemented constraint so that loading-2.3 is not run. 2003-01-27 Mo DeJong <mdejong@users.sourceforge.net> * README.jacl: Document shared UNIX/Windows build for Jacl. * README.tclblend: Document shared UNIX/Windows build for Tcl Blend. * new_features.txt: Added note about new Windows build system. * unix/README.jacl: Removed. * unix/README.tclblend: Removed. * win/README.jacl: Removed. * win/README.tclblend: Removed. 2003-01-27 Mo DeJong <mdejong@users.sourceforge.net> * bsjavac.sh: Add script that works around path separator issues under Win32. * configure: Regen. * tcljava.m4 (AC_PROG_JAVAC, AC_JAVA_JNI_LIBS, TCLJAVA_CHECK_TCLSH): Add support for JDK 1.1 when building under mingw. This meant adding a special workaround to deal with path separator bugs in that version of javac. Also set the TCL_LIBRARY env var when running tclsh. * src/tclblend/tcl/lang/CObject.java: Don't make objPtr final to work around bug in brain dead jdk 1.1 compiler. 2003-01-27 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Use TOP_DIR_NATIVE instead of TOP_DIR in build rules that require a Win32 style path instead of a unix style path. 2003-01-21 Mo DeJong <mdejong@users.sourceforge.net> Add initial and incomplete mingw build support. * Makefile.in: Add _NATIVE versions of paths that have to be in Win32 native format. Add TCL_DEFS to compile line to avoid compiler warnings under Mingw. Add PATH to the list of variables that gets modified when running the shell or test targets. Add jni_example.clean to cleanup after recent change. * configure: Regen. * configure.in: Subst TCL_DEFS and TCL_BIN_TCLSH into Makefile. Subst *_NATIVE variables after running them through mingw_path.sh. * mingw_path.sh: Add new helper file that converts a mingw path to a win32 path. * tcljava.m4 (AC_JAVA_JNI_LIBS, TCLJAVA_WITH_TCL, TCLJAVA_CHECK_TCLSH): Detect IBM JDK 1.3 for win32. Make sure libs appear after the source file in JVM link test. When loading tclConfig.sh, check for win32 specific defines and add any missing variables. Add mingw flags to build commands under win32. Check for win32 name for tclsh if unix style name is not found. * src/native/java.h: Add mingw build support. * unix/custom.c: Fixup define checks so that custom can be compiled with JDK 1.2 or newer. 2003-01-20 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Split creation of JNI_example shared lib into a compile an link step to match the makefile.vc impl of same. * win/makefile.vc: Add \ to output dir name, hard code dll name. This fixes a minor build problem with last checkin. 2003-01-20 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Add jni_example target, this provides a very simple test case to ensure that the JVM can load a generated shared lib. * extras/JNI_example/JNI_example.c: New file * extras/JNI_example/JNI_example.java: New file. * src/xputils/iload.test: Fixup some test case results to match the current implementation which passes a DEFAULT token. * win/makefile.vc: Fixup support for building in a build dir that is not tcljava/win. Add jni_example target. 2003-01-20 Mo DeJong <mdejong@users.sourceforge.net> * src/native/javaCmd.c (Tclblend_Init): Add additional TCLBLEND_DEBUG output. If an exception is raised during the Interp constructor, check to see if it is an UnsatisfiedLinkError return a more useful error message to Tcl. The old error message "java.lang.UnsatisfiedLinkError: init" was not very illuminating. Don't propagate a Java exception since Tclblend_Init is only every invoked by Tcl. * src/tclblend/tcl/lang/Interp.java (shlib_load): Add a new shlib_load method instead of attempting to load the Tcl Blend shared library in the static initializer for the class. This new approach provides a way for us to catch and propagate an exception during loading of the shared library back to the caller. 2003-01-11 Mo DeJong <mdejong@users.sourceforge.net> * src/tcljava/tcl/lang/TclNumArgsException.java (TclNumArgsException): Use a StringBuffer instead of allocating a string over and over again. 2003-01-10 Mo DeJong <mdejong@users.sourceforge.net> * configure: Regen. * tcljava.m4 (AC_JAVA_CLASSPATH): Look for .../jre/lib/core.jar to support IBM JDK 1.4. 2003-01-09 Mo DeJong <mdejong@users.sourceforge.net> * new_features.txt: Mention array unset addition. * src/jacl/tcl/lang/ArrayCmd.java (cmdProc): Add array unset subcommand. 2003-01-09 Mo DeJong <mdejong@users.sourceforge.net> * src/tcljava/tcl/lang/TclIndex.java (get): Don't add a comma to the error message when there are only two items. This matches the Tcl 8.3 impl. * tests/tcljava/JavaInfoCmd.test: Update error messages to account for TclIndex change. 2003-01-09 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Parser.java (parseCommand, commandComplete): The info complete subcommand now passes all the Tcl regression tests. [Bug 223973] 2003-01-08 Mo DeJong <mdejong@users.sourceforge.net> Re-implement ref counting system for Jacl to more closely match to C implementation. Deprecate TclObject.takeExclusive() method and replace it with new TclObject.duplicate() method. * diffs.txt: Remove takeExclusive, add duplicate. * new_features.txt: Mention new TclObject.duplicate() method and when it should be used. * docs/cFunctions.html: Add Tcl_DuplicateObj entry. * docs/TclJavaLib/TclObject.htm: Doc duplicate and remove docs for takeExclusive method. Add example of how to use the duplicate method. * src/jacl/tcl/lang/Expression.java (ExprLex): Invoke release() when done with a ParseResult. * src/jacl/tcl/lang/Interp.java (Interp, setResult, resetResult, appendElement): Preserve the m_nullResult twice so that it is actually shared. This bug did not show up before because objects were being copied every time instead of when shared. When setting a result, don't decrement or increment the ref count of the m_nullResult. Check for illegal decrement of m_nullResult. Replace use of takeExclusive with duplicate. * src/jacl/tcl/lang/LappendCmd.java (cmdProc): Replace use of takeExclusive with duplicate. * src/jacl/tcl/lang/LinsertCmd.java (cmdProc): Replace use of takeExclusive with duplicate. * src/jacl/tcl/lang/LreplaceCmd.java (cmdProc): Replace use of takeExclusive with duplicate. * src/jacl/tcl/lang/LsortCmd.java (cmdProc): Replace use of takeExclusive with duplicate. * src/jacl/tcl/lang/ParseAdaptor.java (parseBraces): Invoke string constructor so ref count is incremented. * src/jacl/tcl/lang/ParseResult.java (ParseResult, release): Increment ref count of value unless called with a TclObject argument. Add release method that will let go of held ref. * src/jacl/tcl/lang/Parser.java (evalTokens, parseVar): Replace use of takeExclusive with duplicate. Don't release the result of evalTokens call since the ParseResult depends on it. * src/jacl/tcl/lang/SubstCmd.java (cmdProc): Call release after we are finished with a ParseResult. Increment TclObject ref count before passing it to the ParseResult constructor. * src/jacl/tcl/lang/TclList.java (duplicate, append, replace): Don't invoke takeExclusive for objects that are being added to a list. This makes it possible to create a list that holds a ref to itself, but the C version of Tcl also has this problem. This should significantly reduce memory use in Jacl since we will not need to copy every object that is added to a TclList. * src/jacl/tcl/lang/Var.java (setVar, incrVar): Remove ugly workarounds and hacks that were needed since the takeExclusive API is so broken. Invoke isShared and duplicate methods instead, the code now matches the Tcl core implementation. * src/tcljava/tcl/lang/TclObject.java (duplicate, takeExclusive): Add new duplicate method and deprecate the takeExclusive method. * src/tests/jacl/tcl/lang/TestEmptyResultCmd.java: Add new test case implementation. * src/tests/jacl/tcl/lang/TestParsevarCmd.java: Release ParseResult when done with it. * src/tests/tclblend/tcl/lang/IntListAppendCmd.java: Replace takeExclusive call with duplicate. * src/tests/tcljava/tests/ListReplaceCmd.java: Replace takeExclusive call with duplicate. * tests/inprogress/BgErrorMgr.test: Modify test case so that it matches current implementation. This test case depending on the old behavior of a list append that appended a copy instead of the real object. * tests/jacl/refCount.test: Add a series of m_nullResult and parser ref count tests. 2003-01-07 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/CallFrame.java (dispose): Clear out the var hashtable before setting it to null. This does not change the functionality. * src/jacl/tcl/lang/Interp.java (setResult): Optimize the case where the interp result is set to the same object as the current result. * src/jacl/tcl/lang/Parser.java: Minor doc improvement, no code changes. * src/jacl/tcl/lang/TclList.java (append, insert, replace): * src/tclblend/tcl/lang/TclList.java (append, replace): Raise a specific error if a method is incorrectly called with a shared object. 2003-01-01 Mo DeJong <mdejong@users.sourceforge.net> * configure: Regen. * tcljava.m4 (AC_JAVA_CLASSPATH): Add additional message to log file to indicate that an existing CLASSPATH env var is being used. * tests/tcljava/JavaInvoke.test: Test the JavaInvoke.isAssignable method. * tests/tcljava/PkgInvoker.test: Test the usesDefaultInvoker and isAccessible methods. 2002-12-31 Mo DeJong <mdejong@users.sourceforge.net> * src/tcljava/tcl/lang/FuncSig.java (matchSignature): Move assignment checks into JavaInvoke.isAssignable(). * src/tcljava/tcl/lang/JavaInvoke.java (convertTclObject, isAssignable): Query the class of an object passed to convertTclObject and use it to ensure that a Java object is assignable. Add isAssignable method for use in this class and FuncSig. * tests/tcljava/JavaInvoke.test: Move failing test invoke-9.18 down to the convertTclObject section. Add tests to check that Java argument objects can be assigned to the argument types of the method. Also check that null cannot be assigned to a primitive argument type. 2002-12-31 Mo DeJong <mdejong@users.sourceforge.net> * new_features.txt: Add note about TclObject passing. * src/tcljava/tcl/lang/JavaInvoke.java (convertTclObject): Add support for passing a TclObject directly to a Java method. If the TclObject contains a ReflectObject that contains a TclObject, then the TclObject inside the ReflectObject is passed for backwards compatibility. * src/tests/tcljava/tests/signature/PassTclObject.java: Add helper class for test cases. * tests/tcljava/JavaInvoke.test: Test implementation of convertTclObject as it applies to passing of a TclObject. 2002-12-31 Mo DeJong <mdejong@users.sourceforge.net> * src/native/javaInterp.c ( Java_tcl_lang_Interp_evalNative, Java_tcl_lang_Interp_evalString, Java_tcl_lang_Interp_evalTclObject): Rename evalNative to evalString. Add evalTclObject method to support direct evaluation of a Tcl_Obj* wrapped in a TclObject. This significantly speeds up Java commands that call eval with a TclObject argument because the data does not need to be copied into Java and then back into Tcl. * src/tclblend/tcl/lang/Interp.java (evalNative, evalString, evalTclObject, eval): Invoke new evalTclObject method from eval call that takes a TclObject argument. 2002-12-31 Mo DeJong <mdejong@users.sourceforge.net> * src/empty/empty.jar: Regen. * src/empty/tcl/lang/CObject.java (getCObjectPtr): Add method decl. * src/native/java.h: Remove getInternalRep method and add getCObjectPtr and getCObjectInst. Remove objPtr field since we get that with getCObjectPtr. * src/native/javaCmd.c (JavaSetupJava): Init getCObjectPtr and getCObjectInst methods, remove getInternalRep and objPtr. * src/native/javaObj.c (JavaGetTclObj, JavaBreakRef): Call getCObjectPtr or getCObjectInst instead of calling getInternalRep and then calling instanceof. This implementation should be more efficient since it replaces multiple JNI calls with a single one. * src/tclblend/tcl/lang/CObject.java (getCObjectPtr): Add method to return the objPtr member. * src/tcljava/tcl/lang/TclObject.java (getCObjectPtr, getCObjectInst): Add method to return the Tcl_Obj* with a single JNI call. Add method to do instanceof checks in a Java method instead of with multiple JNI calls. * tests/tclblend/javaObj.test: Add additional JavaBreakRef test. 2002-12-30 Mo DeJong <mdejong@users.sourceforge.net> * configure: Regen. * tcljava.m4 (TCLJAVA_WITH_TCL): Add TCL_CFLAGS_DEBUG or TCL_CFLAGS_OPTIMIZE to the CFLAGS that appear in the Makefile. 2002-12-30 Mo DeJong <mdejong@users.sourceforge.net> * src/native/javaInterp.c (JavaCmdProc): Scan the Tcl_Obj array passed into JavaCmdProc, if the same Tcl_Obj is passed more than once, don't try to convert it to a TclObject again. * src/tests/tcljava/tests/SameArgumentObjectsCmd.java: * tests/tcljava/JavaCmd.test: Add test case for duplicated arguments on the command line. 2002-12-30 Mo DeJong <mdejong@users.sourceforge.net> * src/native/java.h: Add JavaObjType decl. * src/native/javaInterp.c (BTestCmd): Add btest type subcommand, used for testing. * src/native/javaObj.c (Java_tcl_lang_CObject_makeRef): When the makeRef function is called with a command internal rep that does not have a ptr2 jobject ref, just set the ref without freeing the internal rep or changing the typePtr. * src/tcljava/tcl/lang/ReflectObject.java (cmdProc): Pass argv[0] as the second argument to JavaInvoke.callMethod(). I think this was not done earlier because of bugs in the ref counting implementation. This change combined with the fix in makeRef allow for the conversion from an unknown object to a command with a jobject ref. * src/tests/tclblend/tcl/lang/IntNullConvertCmd.java: Add test case for possible bug in CObject.makeRef(). * tests/tclblend/javaInterp.test: Add llength call to free internal rep of object that was turned into a cmd+ref type. * tests/tclblend/javaObj.test: Add tests for conversion from an unknown type to a cmd+ref type via a call to ReflectObject.cmdProc(). * tests/tclblend/refCount.test: Add llength call to free internal rep of object that was turned into a cmd+ref type. 2002-12-30 Mo DeJong <mdejong@users.sourceforge.net> * src/tcljava/tcl/lang/JavaTryCmd.java (cmdProc, eval): Rewrite java::try command to take advantage of the fact that exceptions are now propagated by Tcl Blend. There is no longer any reason to query the value of errorCode, since we can catch an exception directly. Add support for catching a RuntimeException raised in a Java command proc. An Java exception raised in a method invoked via the invocation API would already be wrapped in a ReflectException object. * src/tcljava/tcl/lang/ReflectException.java (cmdProc, getThrowable): Add a new getThrowable method for use by the java::try command. This method lets us query the Throwable object passed to a ReflectException without having to deal with the errorCode variable. Raise an exception if a TclException is passed to the ReflectException constructor, since a ReflectException should only be used for wrapped Java exceptions. * src/tests/tcljava/tests/RuntimeExceptionCmd.java: Add test case that raises a RuntimeException in the body of a Java cmdProc. * tests/tcljava/JavaTryCmd.test: Add new test cases for exceptional conditions in catch and finally blocks. These tests exercise the new java::try command implementation. 2002-12-29 Mo DeJong <mdejong@users.sourceforge.net> * src/tclblend/tcl/lang/Interp.java (callCommand): Fix stupid typo from last checkin. * src/tcljava/tcl/lang/JavaInvoke.java (call): Implement a shortcut when catching a TclException raised in an invoked Java method. Instead of wrapping it in a ReflectException, just throw it after resetting the interp result. * src/tcljava/tcl/lang/JavaThrowCmd.java (cmdProc): Implement same shortcut for thrown TclException. * src/tests/tcljava/tests/JavaTest.java (throwTclException): * tests/tcljava/JavaCallCmd.test: * tests/tcljava/JavaThrowCmd.test: Test TclException vs ReflectException shortcut. 2002-12-29 Mo DeJong <mdejong@users.sourceforge.net> Overhaul exception handling and propagation in TclBlend. An exception raised during a Java command will now be propagated up to an Interp.eval() call. All other Tcl callable method should now panic if called with a pending JNI exception. * src/native/java.h: Add TclException.getCompletionCode() to method cache. * src/native/javaCmd.c (Tclblend_Init, JavaInterpDeleted, FreeJavaCache): Check for a pending Java exception when entering a method from Tcl. Check for exception after calling Interp.dispose(). Add getCompletionCode method. * src/native/javaIdle.c (JavaIdleProc): Check for a pending Java exception when entering a method from Tcl. * src/native/javaInterp.c (eval, evalNative, JavaTraceProc, JavaCmdDeleteProc, JavaCmdProc, BTestCmd): Rename eval to evalNative to match change in Java code. Check that there are no pending exceptions when entering a method from Tcl. Check for exceptions after JNI method calls. Get return value for JavaCmdProc from a thrown TclException. Add comp code test to btest. * src/native/javaNotifier.c (JavaEventProc): Check for a pending Java exception when entering a method from Tcl. Check for exception after JNI method call. * src/native/javaObj.c (DupTclObject, FreeTclObject, UpdateTclObject, JavaGetTclObj, JavaGetTclObject): Check for a pending Java exception when entering a method from Tcl. Rethrow the exception in some functions to deal with the case where a wrapped TclObject internal rep is freed while the stack is unwinding. Check for exception after JNI method call. * src/native/javaTimer.c (JavaTimerProc): Check for a pending Java exception when entering a method from Tcl. * src/tclblend/tcl/lang/Interp.java (eval, evalNative, callCommand): Use new propagateException flag in callCommand to determine if an exception should be handled or propagated up to an Interp.eval() call. This fix combined with the exception handle and re-throw changes in javaObj.c fix a long standing bug where exceptions never made it back up the stack to an eval(). * src/tests/tcljava/tcl/lang/JtestCmd.java: * tests/tclblend/javaInterp.test: Add getCompletionCode() tests for callCommand from Java and C. 2002-12-29 Mo DeJong <mdejong@users.sourceforge.net> * src/tcljava/tcl/lang/ReflectObject.java (dispose): Don't attempt to delete the command from the interpreter if the interp was already deleted. * tests/tclblend/javaObj.test: Add test case that tries to delete a ReflectObject after the interp has been deleted. Modify existing test so that it does not trigger the same error. 2002-12-29 Mo DeJong <mdejong@users.sourceforge.net> * src/tcljava/tcl/lang/ArrayObject.java (initArray): Generate TclException instead of ReflectException. * src/tcljava/tcl/lang/JavaDefineClassCmd.java (cmdProc): Remove pointless wrapping of Exception in ReflectException. * tests/tcljava/ArrayObject.test: Update error message. 2002-12-28 Mo DeJong <mdejong@users.sourceforge.net> * src/tclblend/tcl/lang/Interp.java (callCommand): If a RuntimeException is encountered during execution of a Tcl command implemented in Java, set the interp result to the stack trace and continue to propagate the exception. * src/tcljava/tcl/lang/JavaInvoke.java (call, getsetField, getProperty, setProperty): Don't blindly catch all exceptions, instead catch InvocationTargetException and wrap it in a ReflectException when executing a method via the reflection interface. 2002-12-28 Mo DeJong <mdejong@users.sourceforge.net> * src/tcljava/tcl/lang/ReflectException.java (ReflectException): Set the interp result to the exception message instead of the result of a toString() call when wrapping a TclException. * tests/inprogress/CallFrame.test: * tests/inprogress/EventAdaptor.test: * tests/tclblend/javaInterp.test: * tests/tclblend/javaUtil.test: * tests/tcljava/FuncSig.test: * tests/tcljava/JavaInvoke.test: * tests/tcljava/JavaNewCmd.test: * tests/tcljava/PkgInvoker.test: Update error messages so that they do not include "tcl.lang.TclException: " before the actual error message. 2002-12-28 Mo DeJong <mdejong@users.sourceforge.net> * src/native/java.h: * src/native/javaCmd.c (FreeJavaCache, JavaSetupJava, AddToClassCache, AddToMethodCache, AddToFieldCache): Remove unused Void and voidTYPE classes from the cache. Don't set a thread local exit handler unless the cache was initialized properly. Don't call the ToString() method since the cache was not yet initialized. 2002-12-27 Mo DeJong <mdejong@users.sourceforge.net> * src/tcljava/tcl/lang/JavaInvoke.java (getsetField): Check to see is a field is final before setting it. Add previous exception error message when creating an unexpected exception. * tests/tcljava/JavaFieldCmd.test: Test for error on attempt to set a final field. 2002-12-27 Mo DeJong <mdejong@users.sourceforge.net> * new_features.txt: Add note about accessibility checks for reflected objects. * DOS/TclJava/JavaCastCmd.html: * docs/TclJava/JavaFieldCmd.html: * docs/TclJava/JavaImportCmd.html: * docs/TclJava/JavaInfoCmd.html: * docs/TclJava/JavaInstanceOfCmd.html: * docs/TclJava/JavaNewCmd.html: * docs/TclJava/JavaPackage.html: Use the term "accessible" instead of "public" when talking about Java objects we can reflect. Add a couple of additional examples. Add note about loading into Java to Java package section. * src/tcljava/tcl/lang/FieldSig.java (get): Add accessibility check. * src/tcljava/tcl/lang/FuncSig.java (get): Add accessibility check. Add abstract class check. * src/tcljava/tcl/lang/JavaCastCmd.java (cmdProc): Add accessibility check. * src/tcljava/tcl/lang/JavaImportCmd.java (cmdProc): * src/tcljava/tcl/lang/JavaInfoCmd.java (cmdProc): Add accessibility checks to the events, fields, methods, constructors, and properties methods. * src/tcljava/tcl/lang/JavaInstanceofCmd.java (cmdProc): Add accessibility check. * src/tcljava/tcl/lang/JavaInvoke.java (callMethod, callStaticMethod, call, getsetField, getProperty, setProperty): Catch known exceptions that should not occur and raise a TclRuntimeError if they do. Add accessibility checks so that a method with a return type that cannot be reflected is not invoked. Add accessibility check so that a field with an inaccessible type will not be reflected. * src/tcljava/tcl/lang/JavaNewCmd.java (cmdProc, ArraySig, get): Rename componentType member to arrayType. Add accessibility check. Rewrite poor use of String class. * src/tcljava/tcl/lang/JavaTryCmd.java: Fix typo. * src/tcljava/tcl/lang/ReflectObject.java (makeReflectObject): Add accessibility check. * src/tcljava/tcl/lang/reflect/PkgInvoker.java (isAccessible): Add method to check accessibility of a Class. * src/tests/tcljava/tests/invoke/PublicTester.java (getNonPublicTester, getCNonPublicTester, getNonPublicTesterI, nptf): Add methods and fields to test inaccessible type errors. * src/tests/tcljava/tests/signature/MethodFailure1.java: * src/tests/tcljava/tests/signature/MethodFailure2.java: * src/tests/tcljava/tests/signature/MethodFailure3.java: * src/tests/tcljava/tests/signature/MethodFailure4.java: * src/tests/tcljava/tests/signature/MethodInvoker4.java: * src/tests/tcljava/tests/signature/MethodInvoker5.java: * src/tests/tcljava/tests/signature/MethodInvoker6.java: Mark those inner classes that will be reflected inside the interpreter as public instead of private to account for accessibility changes. * tests/tcljava/FuncSig.test: Update test FuncSig-2.5 to account for changes in PublicTester.java. Cast to interface in FuncSig-3.3, this is what the original test should have done since reflecting an inaccessible type is not really correct. Add abstract class test. * tests/tcljava/JavaNewCmd.test: Change componentType to arrayType in test case. * tests/tcljava/PkgInvoker.test: Add a series of tests for inaccessible class errors. Test that casting to an accessible protected class works as expected. 2002-12-26 Mo DeJong <mdejong@users.sourceforge.net> * docs/TclJava/JavaCallCmd.html: Use the term accessible instead of public to describe which methods can be invoked. * docs/TclJava/JavaObjCmd.html: Use the term accessible instead of public to describe which methods can be invoked. Explicitly mention that invoking static methods via an instance handle is not supported. * src/tcljava/tcl/lang/ArrayObject.java (cmdProc): Add additional static flag to FuncSig.get() call. * src/tcljava/tcl/lang/FuncSig.java (get, lookupMethod, matchSignature, getAccessibleMethods, getAccessibleInstanceMethods, getAccessibleStaticMethods, mergeMethods, mergeInstanceMethods): Create separate static and instance cache for accessible methods. Add additional static flag to get() so that search is confined to static methods. Pass this flag down to lookupMethod and matchSignature. Add the word static to the error message printed when searching for a static Method fails. Add new getAccessibleStaticMethods and getAccessibleInstanceMethods methods to implement separating out the static and instance method lookup tables. Rename mergeMethods to mergeInstanceMethods and avoid merging static or inaccessible methods. * src/tcljava/tcl/lang/JavaInfoCmd.java (getFieldInfoList, getMethodInfoList): Don't check for SecurityException, we don't do it other places and the code should be able to deal with a Java error. Use the -static flag to limit the search to static or instance methods in getMethodInfoList. * src/tcljava/tcl/lang/JavaInvoke.java (newInstance, callMethod, callStaticMethod): Pass additional static flag to FuncSig.get(). * src/tcljava/tcl/lang/UnsupportedJDetachCallCmd.java: Search for static and then instance method. * src/tcljava/tcl/lang/reflect/PkgInvoker.java (isAccessible): Add method to check accessibility of a Method. * tests/tcljava/FuncSig.test: Pass additional static flag to FuncSig.get(). * tests/tcljava/FuncSig.test: Update signature tests to account for new getAccessibleInstanceMethods and getAccessibleStaticMethods methods. * tests/tcljava/JavaCallCmd.test: Update error message for a non-static method via java::call. * tests/tcljava/JavaInfoCmd.test: Fix java::info test cases, static methods are not inherited or overloaded. * tests/tcljava/JavaInvoke.test: Fixup error message and useless quoting. 2002-12-25 Mo DeJong <mdejong@users.sourceforge.net> * tests/tcljava/JavaThrowCmd.test: Update test JavaThrowCmd-1.3 to account for new Exception constructors in JDK 1.4. 2002-12-24 Mo DeJong <mdejong@users.sourceforge.net> * src/native/javaInterp.c (Java_tcl_lang_Interp_setResult, Java_tcl_lang_Interp_setResult__Ltcl_lang_TclObject_2, Java_tcl_lang_Interp_setResult__I, Java_tcl_lang_Interp_setResult__Z): Add native implementations of the setResult(boolean) and setResult(int) methods of the Interp class. This optimization makes a setResult with an int or boolean argument about 4X faster. * src/tclblend/tcl/lang/Interp.java (setResult): Declare 2 addition native versions of setResult instead of creating a wrapper TclObject. * src/tests/tclblend/tests/SetInterpResultCmd.java: Add test case for Interp.setResult(). * src/tests/tcljava/tcl/lang/JtestCmd.java: Use setResult(boolean) directly instead of wasteful call to setResult(TclObject) with a TclBoolean object result. * tests/tclblend/javaInterp.test: Add test cases for Interp.setResult(), the only user visible change is the internal rep of an interp result. 2002-12-24 Mo DeJong <mdejong@users.sourceforge.net> * docs/TclJava/JavaFieldCmd.html: Make the doc more clear WRT shadowed fields in a superclass. 2002-12-24 Mo DeJong <mdejong@users.sourceforge.net> * README.jacl: * README.tclblend: * unix/README.tclblend: * win/README.tclblend: Rework help section, mention SourceForge mailing lists instead of focusing on comp.lang.tcl. Note that Tcl 8.3.2 or newer is needed for Tcl Blend. 2002-12-24 Mo DeJong <mdejong@users.sourceforge.net> * tests/defs: Move conditional define of testgetplatform so it works with Jacl or Tcl Blend. * tests/tcljava/JavaDefineClassCmd.test: * tests/tcljava/JavaLoadCmd.test: Fixup test directory name to account for changes on 2002-04-11. 2002-12-24 Mo DeJong <mdejong@users.sourceforge.net> * src/native/javaObj.c (FreeTclObject, SetJavaCmdFromAny): Convert both a tclObjectType and a cmdTypePtr that holds a TclObject into a command internal rep with the same method. The previous implementation incremented the ref count and created a new JNI global ref for no apparent reason. Set the TclObject pointer to NULL in FreeTclObject, this has no effect but makes the code more clear. 2002-12-24 Mo DeJong <mdejong@users.sourceforge.net> * new_features.txt: Mention tclblend_init change. * src/native/javaCmd.c (JavaInitEnv): Treat tclblend_init as a list and pass each element as a JVM option. * tests/tclblend/loading.test: Test passing of multiple JVM options via tclblend_init. 2002-12-23 Mo DeJong <mdejong@users.sourceforge.net> * new_features.txt: Add note about new accessible field, method, and constructor implementation. * src/tcljava/tcl/lang/FieldSig.java (get, getAccessibleFields, getAccessibleField): Implement new access approach for fields. Use a new error message to indicate that a field can't be access, not that is does not exist. * src/tcljava/tcl/lang/FuncSig.java (get, lookupMethod, matchSignature, getAccessibleConstructors, getAccessibleConstructor, getAllDeclaredMethods, getAccessibleMethods): Implement new access approach for methods and constructors. Use a new error message to indicate that a method or constructor can't be accessed, not the it does not exist. * src/tcljava/tcl/lang/JavaInfoCmd.java (getFieldInfoList): Invoke FieldSig.getAccessibleFields() instead of calling Class.getFields() directly so that package access fields are returned when accessible. * src/tcljava/tcl/lang/reflect/PkgInvoker.java (usesDefaultInvoker): Add new helper method that will return true when a given class does not have a custom package invoker. * src/tests/tcljava/tests/invoke/PublicTester.java: Update comments. * tests/tcljava/AutomaticSignature.test: Update err msg. * tests/tcljava/FieldSig.test: Update err msg. * tests/tcljava/FuncSig.test: Update err msg and tests that invoked getAllDeclaredMethods. * tests/tcljava/JavaFieldCmd.test: Update err msg. * tests/tcljava/JavaInvoke.test: Update err msg. Use java::field instead of Object.forName() to get a java.lang.Class object. * tests/tcljava/JavaThrowCmd.test: Update err msg. * tests/tcljava/PkgInvoker.test: Update err msg. Use java::field instead of Object.forName() to get a java.lang.Class object. Add java::info fields test for a package accessible field. * tests/tcljava/ReflectObject.test: Update err msg. 2002-12-23 Mo DeJong <mdejong@users.sourceforge.net> * tests/tcljava/JavaInfoCmd.test (Button_properties_check): Add a testing proc that checks java.awt.Button props vs a known JDK 1.1 list of props. This will avoid a bunch of error messages from later JDK versions which add additional properties. 2002-12-20 Mo DeJong <mdejong@users.sourceforge.net> * configure: Regen. * tcljava.m4 (AC_PROG_JAVAC, TCLJAVA_WITH_TCL, TCLJAVA_WITH_THREAD): Print better error message if user does not pass a --with-tcl, --with-thread, or --with-jdk options. 2002-12-20 Mo DeJong <mdejong@users.sourceforge.net> Implement new ref count system for Tcl Blend, see JavaRefCount.html for complete description. * new_features.txt: Mention new ref count impl. * docs/TclJava/JavaGC.html: Move info to the new JavaRefCount.html page and add link. * docs/TclJava/JavaRefCount.html: Add new page that describes how Jacl and Tcl Blend increment ref counting. The description of Tcl Blend's ref count approach corresponds to the new implementation. * docs/TclJava/contents.html: Add link to new JavaRefCount.html page. * src/empty/empty.jar: Regen. * src/empty/tcl/lang/CObject.java: Add decls for decrRefCount() and incrRefCount(). * src/empty/tcl/lang/Interp.java: Use RuntimeException not RuntimeError. * src/native/javaCmd.c (JavaSetupJava): Link jcache->preserve to TclObject._preserve() to avoid incrementing the Tcl_Obj count from JNI code. * src/native/javaInterp.c (JavaCmdProc): Invoke jcache->preserve and jcache->release for each TclObject argument passed to a Java method. * src/native/javaList.c (Java_tcl_lang_TclList_append, Java_tcl_lang_TclList_replace): Don't implicitly increment a newly allocated Tcl_Obj in list methods that can modify a Tcl_Obj. * src/native/javaObj.c (Java_tcl_lang_CObject_makeRef, JavaGetTclObject): Don't increment the ref count for a TclObject when converting from a CObject to a non-CObject internal rep. Increment the ref count of a new CObject or TclList when it is created. * src/tclblend/tcl/lang/CObject.java (CObject, dispose, duplicate, toString, decrRefCount, incrRefCount, makeReference, cleanupAdd, cleanupPush, cleanupPop, dump, finalize): Completely reimplement CObject so that a ref count is not implicitly held for a Tcl_Obj. This gets rid of the need to try to send an object back to the thread it came from for cleanup and means we don't have to depend on the Java garbage collector. See JavaRefCount.html for a more detailed description of how the new ref count approach works. * src/tclblend/tcl/lang/Interp.java (callCommand): Invoke CObject.cleanupPush() before calling a Java method and CObject.cleanupPop() when finished. Add new cobjCleanup member to interp. * src/tclblend/tcl/lang/TclList.java (setListFromAny, append, replace): Invoke cleanupAdd() when allocating a TclList in Java code. Check for an empty list and invoke cleanupAdd() for it as well. * src/tcljava/tcl/lang/EventAdaptor.java (setCallback, deleteCallback): Copy a CObject into a TclString to avoid a memory leak when running in Tcl Blend. An event adaptor has no dispose() method so there was no place to release the held ref count. * src/tcljava/tcl/lang/TclObject.java (preserve, _preserve, release, _release, getRefCount): Create new private methods that will be invoked from JNI code. The preserve and release methods will modify the ref count of a contained CObject or TclList while _preserve and _release will not. Make it possible to call getRefCount from the package. * src/tcljava/tcl/lang/library/java/javalock.tcl: Remove unneeded llength and fixup comments. * src/tests/tclblend/tcl/lang/ArgConvertCmd.java: * src/tests/tclblend/tcl/lang/IntListAppendCmd.java: * src/tests/tclblend/tcl/lang/IntLostListCmd.java: * src/tests/tcljava/tests/HoldRefCmd.java: * src/tests/tcljava/tests/ListReplaceCmd.java: * src/tests/tcljava/tests/LostListCmd.java: * src/tests/tcljava/tests/ReRepCmd.java: * src/tests/tcljava/tests/ReleaseNewListCmd.java: * src/tests/tcljava/tests/StringListStringCmd.java: Add test cases that are run in refCount.test. * tests/jacl/refCount.test: Add Jacl specific ref count tests. * tests/tclblend/javaInterp.test: Dispose of interp in javaInterp-5.2. Call preserve and release in javaInterp-9.8 since a reflected TclObject is not automatically preserved. * tests/tclblend/refCount.test: Add Tcl Blend specific ref count tests. * tests/tcljava/FuncSig.test: Reformat test. 2002-12-18 Mo DeJong <mdejong@users.sourceforge.net> * configure: Regen. * tcljava.m4 (AC_PROG_JAVAC, AC_JAVA_JNI_LIBS): Check for Solaris javac install in /usr/bin that is actually a link into /usr/java/bin. Use uname -m instead of uname --machine. Check for libhpi.so on sparc systems and don't link to it if it is not there. Fixup error message displayed when something goes wrong with the JNI link test. 2002-12-18 Mo DeJong <mdejong@users.sourceforge.net> * src/native/java.h: Add decl for JavaNotifierInDoOneEvent. * src/native/javaIdle.c (Java_tcl_lang_IdleHandler_doWhenIdle, Java_tcl_lang_IdleHandler_cancelIdleCall, JavaIdleProc): Reimplement IdleHandler to be more like TimerHandler. Create a single global ref and store it inside the instance. This avoids a memory leak in JDK 1.2 and newer when the even is canceled. Use JavaNotifierInDoOneEvent function to decide when to propagate a Java exception. * src/native/javaNotifier.c (Java_tcl_lang_Notifier_init, JavaNotifierInDoOneEvent): Add new JavaNotifierInDoOneEvent function that can be used to find out if an event was being processed as a result of a JNI call to the Notifier.doOneEvent method. * src/native/javaTimer.c (JavaTimerProc): Don't propagate a Java exception when invoked from Tcl, instead print an error message. * src/tclblend/tcl/lang/IdleHandler.java (IdleHandler, cancel, invoke): See javaIdle.c description. Raise error if invoke is called after cancel. * src/tclblend/tcl/lang/TimerHandler.java (cancel, invoke): Zero out token, update comments. Raise an error if invoke is called after cancel(). 2002-12-18 Mo DeJong <mdejong@users.sourceforge.net> Invoke JNI DeleteLocalRef method to cleanup exception and object pointers. This is handled by default for JNI methods but it can't hurt so cleanup after ourselves everywhere we can. Check ExceptionOccurred after JNI methods even if we can't recover from the error. * src/native/javaCmd.c (JavaInitBlend, JavaThrowTclException, JavaGetString): Panic if JavaGetString is passed a null string. * src/native/javaIdle.c (JavaIdleProc): * src/native/javaInterp.c (ThrowNullPointerException, Java_tcl_lang_Interp_create, Java_tcl_lang_Interp_eval): * src/native/javaList.c (ThrowNullPointerException, Java_tcl_lang_TclList_append, Java_tcl_lang_TclList_getElements, Java_tcl_lang_TclList_index, Java_tcl_lang_TclList_listLength, Java_tcl_lang_TclList_replace): Replace inlined exception raising code with ThrowNullPointerException function. * src/native/javaObj.c (ThrowNullPointerException, printString, UpdateTclObject, JavaGetTclObj, Java_tcl_lang_CObject_getString, Java_tcl_lang_CObject_incrRefCount, Java_tcl_lang_CObject_decrRefCount, Java_tcl_lang_CObject_makeRef, JavaBreakRef, JavaGetTclObject): Check for exception in JNI method and panic if we can't do anything to handle it. Replace inlined exception raising code with ThrowNullPointerException. Reset object to the value returned by NewGlobalRef instead of directly setting the pointer, this should not matter but is done for consistency. * src/native/javaTimer.c (JavaTimerProc): Invoke DeleteLocalRef to cleanup memory. 2002-12-17 Mo DeJong <mdejong@users.sourceforge.net> * src/native/java.h (JavaIsRef): * src/native/javaInterp.c (BTestCmd): * src/native/javaObj.c (JavaIsRef): * tests/tclblend/javaObj.test: Add new btest isjobject method and use it to check that the recently added JavaBreakRef works as expected. 2002-12-17 Mo DeJong <mdejong@users.sourceforge.net> * src/native/javaInterp.c (BTestCmd, Java_tcl_lang_Interp_createBTestCommand): Add new btest command via createBTestCommand(). * src/native/javaList.c (Java_tcl_lang_TclList_index): Check for previously disposed Tcl_Obj. * src/tclblend/tcl/lang/Interp.java (createBTestCommand): Add native method decl. * src/tclblend/tcl/lang/TclList.java: Fixup comments. * src/tcljava/tcl/lang/TclString.java: Fixup comments. * src/tests/tclblend/tcl/lang/NativeTestExtension.java: Invoke Interp.createBTestCommand(). * src/tests/tcljava/tcl/lang/JtestCmd.java (cmdProc): Modify the refcount subcommand so that it returns refCount-1 to account for the ref added for the method invocation. * tests/inprogress/AfterCmd.test: * tests/inprogress/BgErrorMgr.test: * tests/inprogress/UplevelCmd.test : Update tests that use jtest refcount to account for change made to JtestCmd.java. * tests/jacl/refCount.test: Check jtest command. * tests/tclblend/javaTimer.test: Add comment. * tests/tclblend/refCount.test: Add tests for new btest command. 2002-12-17 Mo DeJong <mdejong@users.sourceforge.net> * src/native/java.h: * src/native/javaInterp.c (JavaCmdProc): * src/native/javaObj.c (JavaBreakRef, JavaGetTclObject): * src/tests/tcljava/tests/ListLengthCmd.java: * tests/tclblend/javaObj.test: Add new JavaBreakRef and invoke it from JavaCmdProc and JavaGetTclObject. This fixes a problem where a TclObject with a CObject or a TclList internal rep is stored as a Java ref inside a Tcl_Obj on the C side. Only non-CObject or TclList types should have a reference from C pointing to the container TclObject. 2002-12-17 Mo DeJong <mdejong@users.sourceforge.net> * src/native/javaObj.c (Java_tcl_lang_CObject_makeRef, Java_tcl_lang_CObject_newCObject): Return after raising exception to avoid crash in some strange situations. Zero out 64 bit structure before assigning 32 bit value to make debugging of newCObject easier. 2002-12-17 Mo DeJong <mdejong@users.sourceforge.net> * tests/all.tcl: Run tests names through lsort -dictionary so that they always get run in the same order. 2002-12-15 Mo DeJong <mdejong@users.sourceforge.net> * src/native/javaList.c: Add checks for deallocated Tcl objects when TCL_MEM_DEBUG is defined. * src/native/javaObj.c (JavaObjInit): Use Tcl_GetObjType to lookup the tcl list type pointer. Add checks for deallocated Tcl objects when TCL_MEM_DEBUG is defined. 2002-12-10 Mo DeJong <mdejong@users.sourceforge.net> * src/native/javaInterp.c (Java_tcl_lang_Interp_setVar): * tests/tclblend/javaInterp.test: Plug a memory leak in Interp.setVar when appending to a string variable. Add test case that demonstrates the memory leak. 2002-12-10 Mo DeJong <mdejong@users.sourceforge.net> * src/native/javaCmd.c (JavaInitEnv): Comment out code that deallocated JVM options. It seems that some buggy JVMs don't copy the arguments passed into JNI_CreateJavaVM. 2002-12-09 Mo DeJong <mdejong@users.sourceforge.net> * src/native/javaCmd.c (JavaInitEnv): Free memory allocated for JVM options and classpath. 2002-12-09 Mo DeJong <mdejong@users.sourceforge.net> * src/tcljava/tcl/lang/TclObject.java (disposedCheck): Add helper method that will raise an error if a TclObject method is called after the object has been disposed of. Invoke this method at the begining of each public TclOject api. 2002-12-07 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/CallFrame.java (chain, wrongNumProcArgs): * tests/jacl/Interp.test: * tests/tcl/compile.test: * tests/tcl/proc-old.test: * tests/tcl/proc.test: Update Jacl error message when proc is called with wrong number of args to match Tcl 8.4 implementation. Update tests. 2002-12-07 Mo DeJong <mdejong@users.sourceforge.net> * src/tcljava/tcl/lang/JavaCallCmd.java (cmdProc): * src/tcljava/tcl/lang/JavaInvoke.java (callMethod, callStaticMethod): * src/tcljava/tcl/lang/ReflectObject.java (cmdProc): * tests/tclblend/javaObj.test: Don't set the interp result after invoking a void Java method. This is functionally equivalent and saves a wrapper object allocation. 2002-12-07 Mo DeJong <mdejong@users.sourceforge.net> * src/tcljava/tcl/lang/FieldSig.java (get): * src/tcljava/tcl/lang/FuncSig.java (get): * src/tcljava/tcl/lang/JavaNewCmd.java (get, looksLikeArraySig): * tests/tcljava/FuncSig.test: * tests/tcljava/JavaNewCmd.test: Optimize TclList use by getting the string representation of lists we know have a length of 1. This avoids an unneeded allocation of a native object wrapper in Tcl Blend. Comment out the pointless setting of an internal rep in FuncSig and update test cases. 2002-12-07 Mo DeJong <mdejong@users.sourceforge.net> * src/native/java.h: * src/native/javaCmd.c (FreeJavaCache, JavaSetupJava): * src/native/javaObj.c (JavaObjInit, JavaGetTclObject): * src/tclblend/tcl/lang/TclList.java (newInstance): * tests/tclblend/javaObj.test: Add newInstance method to TclList and call it when we detect that a native object is a list. The old approach was to wrap the object as a CObject and then convert it to a TclList the first time a list operation was done from Java. The new approach is more efficient. 2002-08-12 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Fix 'make test' rule by setting TCLLIBPATH correctly. * src/native/javaCmd.c (Tclblend_Init): * src/native/javaInterp.c (JavaTraceProc, Java_tcl_lang_Interp_create): * src/native/javaList.c (Java_tcl_lang_TclList_append, Java_tcl_lang_TclList_replace, Java_tcl_lang_TclList_splitList): * src/native/javaNotifier.c (Java_tcl_lang_Notifier_init, Java_tcl_lang_Notifier_alertNotifier): * src/native/javaObj.c (JavaGetTclObject): * src/native/javaTimer.c ( Java_tcl_lang_TimerHandler_createTimerHandler): Zero out jlong values before assigning a pointer value. This handles the case where pointers are 32bits and a jlong is 64 bits. Add additional CONST84 check to avoid compiler warnings when compiling with Tcl 8.4 or newer. 2002-07-23 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Write out an init file that sets env vars in for the gdb_tclblend target. * tcljava.m4 (AC_JAVA_JNI_INCLUDE, AC_JAVA_JNI_LIBS): Support newer Kaffe include/library layout. 2002-07-23 Mo DeJong <mdejong@users.sourceforge.net> * src/tclblend/tcl/lang/Interp.java (finalize): * tests/tclblend/javaInterp.test: Print an error message to stderr if the Java GC thread calls finalize for an Interp. This would only happen when the user forgets to invoke dispose() on an interp. This is at least better than core dumping if an interp was finalized which is what the code used to do. 2002-07-22 Mo DeJong <mdejong@users.sourceforge.net> * src/native/javaInterp.c (JavaTraceProc, Java_tcl_lang_Interp_pkgRequire): Fixup CONST usage to cleanup compile with Tcl 8.4. 2002-07-22 Mo DeJong <mdejong@users.sourceforge.net> * src/native/java.h (JavaWasJavaThreadInit): Add decl. * src/native/javaCmd.c (JavaWasJavaThreadInit, JavaSetupJava): Add JavaWasJavaThreadInit method. * src/native/javaNotifier.c (Java_tcl_lang_Notifier_finalizeThreadCheck): Add new native method implementaiton that checks to see if thread was created in Java and cleans up Tcl thread data when last interp is deleted. * src/tclblend/tcl/lang/Interp.java (dispose): Invoke new Notifier.finalizeThreadCheck() method. * src/tclblend/tcl/lang/Notifier.java (finalizeThreadCheck): Add native method decl. * tests/tclblend/loading.test: Remove useless comments. 2002-07-22 Mo DeJong <mdejong@users.sourceforge.net> * src/tests/tclblend/tests/JavaEval.java: * src/tests/tclblend/tests/JavaLoadTclBlend.java: * src/tests/tclblend/tests/JavaLoadTclBlend2.java: * src/tests/tclblend/tests/JavaThreadLoadTclBlend.java: Rework tests so that dispose is called from a finally block just in case something goes wrong. * tests/tclblend/loading.test: Add test that loads two Java interpreters into the same Java threads. Rename a couple of tests and fixup return values. 2002-07-19 Mo DeJong <mdejong@users.sourceforge.net> * src/empty/tcl/lang/Interp.java (Interp): Throw runtime exception if fake Interp instance is accidently created. * src/tcljava/tcl/lang/BlendExtension.java (init): Raise runtime exception if init method is invoked twice. This should never happed. 2002-07-19 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Add support for THREAD_BIN_DIR. Include pkgIndex.tcl files from the blend build dir, the src dir, and the THREAD_BIN_DIR. * configure: Regen. * configure.in: Require the Thread package at configure time via the --with-thread option. This is required so that we can test interaction with Tcl threads. * tcljava.m4 (TCLJAVA_WITH_THREAD): Define --with-thread option macro. * src/native/java.h: Add TclBlendTrace header. * src/native/javaCmd.c (Tclblend_Init, JavaInitEnv, DestroyJVM, DetachTclThread, FreeJavaCache, JavaSetupJava, TclBlendTrace): Add new TclBlendTrace method and use it in key methods to print low level loading info. * src/tests/tclblend/tests/JavaEval.java: * src/tests/tclblend/tests/JavaLoadTclBlend.java: * src/tests/tclblend/tests/JavaThreadLoadTclBlend.java: * src/tests/tclblend/tests/JavaThreadsLoadTclBlend.java: Add test helpers that deal with loading Tcl into a JVM. * tests/tclblend/loading.test: Add a host of tests for loading Tcl Blend into Tcl and into an existing JVM. 2002-05-16 Mo DeJong <mdejong@users.sourceforge.net> * configure: Regen. * tcljava.m4 (AC_JAVA_JNI_LIBS): Fallback to using the clasic JVM if a client JVM is not available for a JDK 1.3/1.4 file layout. 2002-05-16 Maurice Diamantini <diam@ensta.fr> * src/jacl/tcl/lang/Util.java (isMac): Return false for Mac OSX since it is a UNIX system. This enables exec under Mac OSX. 2002-05-06 Maurice Diamantini <diam@ensta.fr> * src/jacl/tcl/lang/BinaryCmd.java (cmdProc): Cast argument to ?: operator to avoid compiler error from Jikes. Add parens to make precedence clear. 2002-05-02 Mo DeJong <mdejong@users.sourceforge.net> * new_features.txt: Add notes about the new features added to Tcl Blend and Jacl. 2002-05-02 Mo DeJong <mdejong@users.sourceforge.net> * configure: Regen. * tcljava.m4 (AC_JAVA_JNI_LIBS): The previous checkin neglected to use the $machine variable for variable names. Fix that. 2002-04-29 Mo DeJong <mdejong@users.sourceforge.net> * configure: Regen. * tcljava.m4 (AC_JAVA_JNI_LIBS): Update the JDK detection macro to support blackdown JDK 1.3 releases for Linux on architectures other than i386. 2002-04-14 Mo DeJong <mdejong@users.sourceforge.net> * configure: Regen. * tcljava.m4 (AC_JAVA_JNI_LIBS): Update the JDK detection macro to support Sun JDK 1.3 and 1.4 under Linux. Emit an error if no known jvm configuration can be found. 2002-04-13 Shawn Boyce <shawn@qcominc.com> * src/jacl/tcl/lang/Expression.java (ExprLex): Check that a token starts with a digit before passing it to strtod. This avoids a costly runtime exception and leads to a 4x speedup in some trivial examples. 2002-04-12 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/AfterCmd.java (processTimerEvent, processIdleEvent): * src/jacl/tcl/lang/Interp.java (eval): * src/jacl/tcl/lang/PackageCmd.java (pkgRequire): * src/jacl/tcl/lang/Shell.java (run): * src/jacl/tcl/lang/SocketConnectionEvent.java (processEvent): * src/tclblend/tcl/lang/Interp.java (eval, recordAndEval): Pass TCL.EVAL_GLOBAL instead of TCL.GLOBAL_ONLY to eval() functions. Fixup docs that suggest using the wrong form. 2002-04-12 Shawn Boyce <shawn@qcominc.com> * src/jacl/tcl/lang/FileCmd.java (copyRenameOneFile): Treat data copied via 'file copy' as binary. Fix array bound bug that was causing the copy command to fail. Fixup error message when too few arguments are passed to the 'file join' command. 2002-04-12 Shawn Boyce <shawn@qcominc.com> * src/jacl/tcl/lang/FileCmd.java (cmdProc): Implement 'file volumes' command using the JDK 1.2 method File.listRoots(). Reflection is used to preserve backward compatibility with JDK 1.1 systems. Fixed number of args check so that 'file volumes' can be run. 2002-04-11 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/EncodingCmd.java: Map the Tcl "identity" encoding to "UTF8" in Java. While this does not pass all the Tcl identity encoding tests, it does pass quite a few. * tests/tcl/utf.test: Add encoding command tests from Tcl 8.3. 2002-04-11 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Build demo binaries in a directory named bdemo. Build test binaries in a directory named btest. This will keep the make clean rule from removing the source files when configure is run in the src directory. Don't set auto_path when running Jacl since it is not required. 2002-01-22 Bruce Johnson <bruce_johnson@merck.com>, Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Channel.java (getChanType, getRefCount, getBufferedInput, getBufferedOutput, isBlocked, isBgFlushScheduled, inputSawCR): Add placeholder methods for properties queried by the testchannel command. * src/jacl/tcl/lang/FblockedCmd.java (cmdProc): Call placeholder isBlocked method of Channel class. * src/jacl/tcl/lang/FileChannel.java (getChanType): Add implementation of abstract getChanType method. * src/jacl/tcl/lang/ServerSocketChannel.java (getChanType): Add implementation of abstract getChanType method. * src/jacl/tcl/lang/SocketChannel.java (getChanType): Add implementation of abstract getChanType method. * src/jacl/tcl/lang/StdChannel.java (open, getChanType): Add implementation of abstract getChanType method. Set correct default buffering mode for stdchannels so that the testchannel command return proper values. * src/tests/jacl/tcl/lang/JavaTestExtension.java (init) Load testchannel command with other Jacl test commands. * src/tests/jacl/tcl/lang/TestChannelCmd.java: Add implementation of testchannel command. 2002-01-20 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/BgErrorMgr.java (processIdleEvent): Invoke Channel write method that takes a TclObject directly instead of converting an existing TclObject to a String. * src/jacl/tcl/lang/Channel.java (read, write, flush): Modify read and write methods to accept and return TclObjects instead of Strings. This will make it easier to add support for reading and writing of binary data. * src/jacl/tcl/lang/FileChannel.java (read, write, close): Update read and write methods to match superclass signatures. Place superclass close call in a try-finally block so that file is closed if exception is raised in superclass close. * src/jacl/tcl/lang/GetsCmd.java (cmdProc): Update call to channel read method, it now returns a TclObject. * src/jacl/tcl/lang/PutsCmd.java (cmdProc): Update call to channel write method, it now accepts a TclObject. * src/jacl/tcl/lang/ReadCmd.java (cmdProc): Update call to channel read method, it now returns a TclObject. * src/jacl/tcl/lang/StdChannel.java (write): Update read and write methods to match superclass signatures. 2002-01-20 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Channel.java (write, flush): Don't mess with the eof flag while writing or flushing since it only applies to a read operation. * src/jacl/tcl/lang/TclIO.java (unregisterChannel): Improve diagnostic message printed when something goes seriously wrong with a close command on a channel. 2002-01-20 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/SocketChannel.java (SocketChannel): Raise an IOException instead of catching it and raising a TclException. * src/jacl/tcl/lang/SocketCmd.java (cmdProc): Catch an IOException and instead raise a TclException when something goes wrong in the SocketChannel constructor. 2002-01-18 Mo DeJong <mdejong@users.sourceforge.net> * new_features.txt: Add note about new socket command. * docs/TclJava/JavaImportCmd.html: Attempt to make it more clear that importing all classes from a package is not supported by the java::import command. * src/jacl/tcl/lang/ExecCmd.java: Don't include InterruptedException in throws declaration for methods that can't raise this exception. * src/jacl/tcl/lang/OpenCmd.java (cmdProc): Avoid calling unnecessary TclString constructor. * src/jacl/tcl/lang/PutsCmd.java (cmdProc): When writing out a string with a newline, invoke the write method of the channel driver twice to match Tcl's implementation. * src/tcljava/tcl/lang/TclString.java: Update comment for newInstance method to make it clear that a passed in StringBuffer should not be modified by the caller. 2002-01-15 Mo DeJong <mdejong@users.sourceforge.net> * tests/README: Update README so that it is clear the tests are for Tcl/Java commands. Describe running on make shell and make test. Remove unneeded sections. 2002-01-15 Shawn Boyce <shawn@qcominc.com> * src/jacl/tcl/lang/ExecCmd.java (cmdProc, execWin, execReflection): Use new Runtime.exec API to avoid PWD hack with JDK 1.3 or newer. The API is called via reflection so that code can continue to be compiled on a JDK 1.1 system. Update the system name check in execWin to work with Windows 2000. 2002-01-14 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/SocketChannel.java (read, write, close, flush): Don't retain a errorMsg member since it is not used anywhere and makes things more complex. 2002-01-08 Mo DeJong <mdejong@users.sourceforge.net> * Makefile.in: Add JDB_ATTACH_FLAGS to deal with version specific arguments for jdb. Rework the jdb_jacl rule so that it uses these new command line arguments. * configure: Regen. * configure.in: Subst JDB_ATTACH_FLAGS. * tcljava.m4 (AC_JAVA_TOOLS): Set JAVA_G_FLAGS and JDB_ATTACH_FLAGS based on JDK version. If a java_g executable can't be found use the java executable in its place. 2002-01-08 Mo DeJong <mdejong@users.sourceforge.net> * aclocal.m4: Removed. * configure: Regen with autoconf 2.52. * configure.in: Require autoconf 2.50 or newer. Directly include the tcljava.m4 file instead of including it via aclocal.m4. * tcljava.m4: Call m4_ifval instead of ifval to avoid errors from new version of autoconf. 2002-01-02 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/SocketCmd.java (cmdProc, getPort): Call new helper method to get port number passed in by the user and check that it is valid. Raise error if the port number is too large. 2002-01-02 Bruce Johnson <bruce_johnson@merck.com>, Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Channel.java (Channel, setEncoding): Add default constructor that will set the encoding at channel creation time. Move Tcl channel name logic into fconfigure command and call EncodingCmd.getBytesPerChar to cache the number of bytes per char for the channel. * src/jacl/tcl/lang/EncodingCmd.java: Add initial implementation of the encoding command. * src/jacl/tcl/lang/FconfigureCmd.java (cmdProc): Add logic to translate from Tcl encoding names to Java encoding names and vice versa. * src/jacl/tcl/lang/Interp.java (createCommands): Add encoding command to interp cmd table. 2001-12-25 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Channel.java (close): Check for a custom output eof character and write it to the stream before closing. * src/jacl/tcl/lang/FileChannel.java (close): Invoke super class close method before closing actual stream in case custom EOF is written. Reformat some tabs into spaces. * src/jacl/tcl/lang/ServerSocketChannel.java (close): Invoke super class close method before closing actual stream. Add FIXME note. * src/jacl/tcl/lang/SocketChannel.java (close): Invoke super class close method before closing actual stream in case custom EOF is written. 2001-12-25 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Channel.java (read, write, flush, checkRead, checkWrite): Implement and use new helper methods that check to see if reading or writing is allowed on a Channel. The old logic was incorrect in the case of a server socket which is neither readable nor writeable. * src/jacl/tcl/lang/FconfigureCmd.java (cmdProc): Handle server socket case which is neither readable not writeable the same as standard Tcl. * src/jacl/tcl/lang/FileChannel.java (write, flush): Call new checkWrite method instead of invoking super class method to check the writable property. 2001-12-24 Bruce Johnson <bruce_johnson@merck.com>, Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Channel.java (getInputEofChar, setInputEofChar, getOutputEofChar, setOutputEofChar): Add methods to query and set the input and output new eof state fields. These fields are not actually used yet. * src/jacl/tcl/lang/FconfigureCmd.java (cmdProc): Add support for getting and setting -eofchar on a channel. 2001-12-23 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/FconfigureCmd.java (cmdProc): Use new getBufferingString and getBufferingID methods from the TclIO class. * src/jacl/tcl/lang/TclIO.java (getBufferingString, getBufferingID): Add helper methods to simplify the code in the fconfigure command. 2001-12-23 Bruce Johnson <bruce_johnson@merck.com>, Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Channel.java (getInputTranslation, setInputTranslation, getOutputTranslation, setOutputTranslation): Add new input and output translations fields and accessors. These fields are not actually used yet. * src/jacl/tcl/lang/FconfigureCmd.java (cmdProc): Implement the -translation option for the fconfigure command. * src/jacl/tcl/lang/TclIO.java (getTranslationString, getTranslationID): Add new methods and fields to support the -translation option for fconfigure. 2001-12-23 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Channel.java (getMode, isReadOnly, isWriteOnly, isReadWrite): Add new methods to check mode status without having to deal with TclIO flags directly. Use these new methods throughout the class. Remove the getMode method. * src/jacl/tcl/lang/FileChannel.java: Rename input parameter mode to inmode to avoid possible confusion with inherited mode field. 2001-11-27 Bruce Johnson <bruce_johnson@merck.com>, Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Channel.java (buffering, getBuffering, setBuffering, BUF_SIZE, bufferSize, getBufferSize, setBufferSize, encoding, getEncoding, setEncoding): Add new members and get/set methods. * src/jacl/tcl/lang/FconfigureCmd.java (cmdProc): Get and set channel values for -buffering, -buffersize, and -encoding options. * src/jacl/tcl/lang/TclIO.java (BUFF_FULL, BUFF_LINE, BUFF_NONE): Add new fields for use in Channel code. 2001-11-27 Bruce Johnson <bruce_johnson@merck.com>, Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Channel.java (blocking, getBlocking, setBlocking): Add new blocking state. * src/jacl/tcl/lang/FconfigureCmd.java (cmdProc): Indent to 4 space Tcl style. Add -blocking channel option. Remove the "fconfigure command not implemented yet" error. 2001-11-21 Mo DeJong <mdejong@users.sourceforge.net> * src/tcljava/tcl/lang/TclPosixException.java (TclPosixException): Return posix errors in upper case to match Tcl implementation. 2001-11-20 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/SocketCmd.java (cmdProc): Use the Util.getInt() method to parse socket port numbers so that we are compatible with Tcl error messages. Avoid wrapping code in try blocks that catch Exception. Set the interpreter result to String directly instead of creating a TclString inline. 2001-11-20 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/StdChannel.java (open): Set channel names to stdin, stdout, and stderr instead of file0, file1, and file2. * src/jacl/tcl/lang/TclIO.java (getChannel, getNextDescriptor): Remove aliases for stdin, stdout, and stderr. When getting a descriptor prefixed with "file" but sure the first one we return is "file3". 2001-11-20 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/PutsCmd.java: * src/jacl/tcl/lang/ReadCmd.java: Reformat comments to make use Java style // instead of C style /**/. 2001-11-20 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Channel.java (write): Remove trailing "." from error message since it is not compatible with Tcl error message. * src/jacl/tcl/lang/FblockedCmd.java (cmdProc): * src/jacl/tcl/lang/GetsCmd.java (cmdProc): * src/jacl/tcl/lang/PutsCmd.java (cmdProc): * src/jacl/tcl/lang/ReadCmd.java (cmdProc): Remove mode check that belongs in Channel methods. 2001-11-20 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/ServerSocketChannel.java (errorMsg) Remove unused errorMsg member. * src/jacl/tcl/lang/SocketChannel.java (SocketChannel, close): Set channel mode to TclIO.RDWR to indicate that reading and writing are allowed on socket. Set errorMsg member if an exception was raised during close. * src/jacl/tcl/lang/SocketCmd.java (cmdProc): Create SocketChannel with TclIO.RDWR mode to indicate that reading and writing are allowed on socket. 2001-11-20 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/ServerSocketChannel.java (write, flush): Remove overridden methods that attempted to provide channel specific error messages. The write and flush methods in the super class provide error messages that are compatible with Tcl. 2001-11-20 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Channel.java (getNextDescriptor): Move the getNextDescriptor method into the TclIO class. Update documentation for Channel class. * src/jacl/tcl/lang/FileChannel.java: * src/jacl/tcl/lang/ServerSocketChannel.java: * src/jacl/tcl/lang/SocketChannel.java: Invoke TclIO.getNextDescriptor from TclIO class. * src/jacl/tcl/lang/TclIO.java (getNextDescriptor): Add getNextDescriptor method from Channel class. 2001-11-19 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Channel.java (read): Turn the read method into a concrete implementation instead of an abstract method. * src/jacl/tcl/lang/FileChannel.java (read): * src/jacl/tcl/lang/ServerSocketChannel.java (read): * src/jacl/tcl/lang/SocketChannel.java (read): * src/jacl/tcl/lang/StdChannel.java (read): Make use of super class read method instead of including read logic in each Channel subclass. 2001-11-19 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Channel.java (close): Fix silly cut and paste error that was closing the underlying channel twice. 2001-11-19 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Channel.java (tell): Turn the tell method into a concrete implementation instead of an abstract method. It currently just returns -1. * src/jacl/tcl/lang/ServerSocketChannel.java (tell): * src/jacl/tcl/lang/SocketChannel.java (tell): * src/jacl/tcl/lang/StdChannel.java (tell): Remove tell command since it is now handled in the super class. 2001-11-19 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Channel.java (seek): Properly indent some throws clauses on methods. Turn the seek method into a concrete implementation instead of an abstract method. By default seek will set the posix error code EINVAL to indicate that seeking is not supported. Pass interp argument to seek method so we can raise TclExceptions. * src/jacl/tcl/lang/FileChannel.java (seek): Update method signature to account for changes in Channel class. * src/jacl/tcl/lang/SeekCmd.java (cmdProc): Pass interp argument to channel's seek command. Don't attempt to handle seek not supported case since that will be done by the driver. * src/jacl/tcl/lang/ServerSocketChannel.java (seek): Update method signature to account for changes in Channel class. Raise a EACCES posix error code if seek is invoked on a server socket so we match Tcl. * src/jacl/tcl/lang/SocketChannel.java (seek): Remove seek method since this is taken care of in the super class. * src/jacl/tcl/lang/StdChannel.java (seek): Remove seek method since this is taken care of in the super class. 2001-11-17 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Channel.java (write): Turn the write method into a concrete implementation instead of an abstract method. * src/jacl/tcl/lang/FileChannel.java (write): Invoke Channel's write method to check for error writing to a read only channel. * src/jacl/tcl/lang/SocketChannel.java (write): Use new write method in Channel class. * src/jacl/tcl/lang/StdChannel.java (write): Use new write method in Channel class. 2001-11-17 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Shell.java (ConsoleThread, putLine, put): Make use of Tcl Channels instead of writing to System.out and System.err directly. This avoids buffering conflicts between the Shell and the Tcl interp. 2001-11-17 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Channel.java (flush): Turn the flush method into a concrete implementation instead of an abstract method. * src/jacl/tcl/lang/FileChannel.java (flush): Invoke Channel.flush() inside FileChannel's flush() method to check for error writing to a read only channel. * src/jacl/tcl/lang/ServerSocketChannel.java (flush): Avoid passing unneeded 3rd argument to TclException constructor. * src/jacl/tcl/lang/SocketChannel.java (flush): Avoid passing unneeded 3rd argument to TclException constructor. Invoke Channel.flush() inside flush method instead of dealing directly with the channel. * src/jacl/tcl/lang/StdChannel.java (flush, write): Remove flush() implementation since it is now handled in the Channel class. Add call to flush in the write method for the stderr stream to maintain the appearance of an unbuffered stream. 2001-11-16 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Channel.java (chanName, close, getNextDescriptor): Make chanName member private. Turn the close() method into a concrete implementation instead of an abstract method. Add getNextDescriptor() method to replace getNextFileNum() and getNextSocketNum() methods in subclasses. * src/jacl/tcl/lang/FileChannel.java (close, getNextFileNum): Call supercalss getNextDescriptor() instead of our own getNextFileNum(). Override close() method to handle our own shutdown needs. * src/jacl/tcl/lang/ServerSocketChannel.java (close, getNextSockNum): Call supercalss getNextDescriptor() instead of our own getNextSockNum(). Override close() method to handle our own shutdown needs. * src/jacl/tcl/lang/SocketChannel.java (close, getNextSockNum, interp): Remove unneeded interp member. Call supercalss getNextDescriptor() instead of our own getNextSockNum(). Override close() method to handle our own shutdown needs. * src/jacl/tcl/lang/StdChannel.java (close, flush, open, write): Remove close() method since that is now handled in superclass. 2001-11-16 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/Channel.java: * src/jacl/tcl/lang/FileChannel.java: * src/jacl/tcl/lang/ServerSocketChannel.java: * src/jacl/tcl/lang/SocketChannel.java: * src/jacl/tcl/lang/StdChannel.java: Refactor subclases of Channel. Move reader, writer, eofCond, BUF_SIZE, and eof() members into the superclass. 2001-11-16 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/InfoCmd.java (InfoNameOfExecutableCmd): Implement info nameofexecutable command by doing a query of the "JAVA" system property. * tests/tcl/info.test: Check that the info nameofexecutable command does not return "". 2001-11-15 Neil Madden <neil@tallniel.co.uk> * src/jacl/tcl/lang/ServerSocketChannel.java: * src/jacl/tcl/lang/SocketChannel.java: * src/jacl/tcl/lang/SocketCmd.java: * src/jacl/tcl/lang/SocketConnectionEvent.java: Add initial socket implementation for both client and server sockets. The code does not work with async sockets and its functionality is limited because of the lack of fconfigure and fileevent commands in Jacl. 2001-11-15 Mo DeJong <mdejong@users.sourceforge.net> * src/jacl/tcl/lang/ExecCmd.java (cmdProc): If an exec'ed subprocess exits with a non-zero status set the error code to a three value list like {CHILDSTATUS PID NUMBER}. * tests/inprogress/ExecCmd.test: Test error code after a call to the exec command. 2001-06-03 Mo DeJong <mdejong@redhat.com> * tests/tcl/interp.test: Add interp-32.1, it checks that the child's CWD is inherited from a parent's interp. 2001-06-03 Mo DeJong <mdejong@redhat.com> * src/jacl/tcl/lang/EventuallyFreed.java (dispose): Make the dispose() method public, it was incorrectly changed from public when the EventuallyFreed class was created. 2001-05-12 Christian Krone <christian.krone@softwareag.com> * src/jacl/tcl/lang/Util.java (findElement): Fix parsing of nested quoted braces in lists. * tests/tcl/lindex.test: Add test for parsing of nested quoted braces in list. 2001-05-12 Christian Krone <christian.krone@softwareag.com> * tests/jacl/Interp.test: Add braces around the result for the Interp-5.1 test. 2001-05-12 Christian Krone <christian.krone@softwareag.com> * src/jacl/tcl/lang/Interp.java (removeInterpResolver): Use Vector.removeElement()instead of Vector.remove() which is not supported by JDK 1.1. 2001-05-05 Mo DeJong <mdejong@redhat.com> * tests/tcljava/JavaImportCmd.test: Fix incorrectly spelled error message that was causing test failures. 2001-05-05 Christian Krone <christian.krone@softwareag.com> * src/jacl/tcl/lang/Interp.java (resolvers, Interp, eventuallyDispose, ResolverScheme, addInterpResolver, getInterpResolver, removeInterpResolver): * src/jacl/tcl/lang/NamespaceCmd.java (createNamespace, findCommand, findNamespaceVar, setNamespaceResolver, getNamespaceResolver, Namespace): * src/jacl/tcl/lang/Resolver.java: New file. * src/jacl/tcl/lang/Var.java (lookupVar): * src/jacl/tcl/lang/library/init.tcl (unknown): Add interp and namespace variable and command resolver implementation. 2001-02-07 Christian Sorensen <cs@maerskdata.dk> * src/jacl/tcl/lang/FileCmd.java (getMtime): Divide the File.lastModified() result by 1000 so that the returned result will be in seconds instead of milliseconds. 2001-01-28 Mo DeJong <mdejong@redhat.com> * src/tcljava/tcl/lang/JavaImportCmd.java: Fix up diction of error messages. 2001-01-28 Mo DeJong <mdejong@redhat.com> * src/jacl/tcl/lang/SubstCmd.java: Use a StringBuffer instead of repeatedly concatenating strings together. Remove unneeded if block. These changes should improve the execution time of the subst command. 2001-01-28 Mo DeJong <mdejong@redhat.com> * tests/tcl/join.test: * tests/tcl/lindex.test: * tests/tcl/link.test: * tests/tcl/linsert.test: * tests/tcl/list.test: * tests/tcl/listObj.test: * tests/tcl/llength.test: * tests/tcl/lrange.test: * tests/tcl/lreplace.test: * tests/tcl/lsearch.test: * tests/tcl/misc.test: * tests/tcl/namespace-old.test: * tests/tcl/namespace.test: * tests/tcl/obj.test: * tests/tcl/parse.test: * tests/tcl/parseExpr.test: * tests/tcl/parseOld.test: * tests/tcl/pkg.test: * tests/tcl/platform.test: * tests/tcl/proc-old.test: * tests/tcl/proc.test: * tests/tcl/pwd.test: * tests/tcl/regexp.test: * tests/tcl/rename.test: * tests/tcl/scan.test: * tests/tcl/security.test: * tests/tcl/set-old.test: * tests/tcl/set.test: * tests/tcl/split.test: * tests/tcl/stack.test: * tests/tcl/string.test: * tests/tcl/stringObj.test: * tests/tcl/subst.test: * tests/tcl/switch.test: * tests/tcl/timer.test: * tests/tcl/trace.test: * tests/tcl/unknown.test: * tests/tcl/uplevel.test: * tests/tcl/upvar.test: * tests/tcl/util.test: * tests/tcl/var.test: * tests/tcl/while-old.test: * tests/tcl/while.test: Add or update tests to match the ones in Tcl 8.3. 2000-12-27 Mo DeJong <mdejong@redhat.com> * tests/tcl/error.test: * tests/tcl/eval.test: * tests/tcl/execute.test: * tests/tcl/expr-old.test: * tests/tcl/expr.test: * tests/tcl/fileName.test: * tests/tcl/for-old.test: * tests/tcl/for.test: * tests/tcl/foreach.test: * tests/tcl/format.test: * tests/tcl/get.test: * tests/tcl/history.test: * tests/tcl/if-old.test: * tests/tcl/if.test: * tests/tcl/incr-old.test: * tests/tcl/incr.test: * tests/tcl/interp.test: Add or update tests to match the ones in Tcl 8.3. 2000-12-23 Mo DeJong <mdejong@redhat.com> * tests/tcl/append.test: * tests/tcl/assocd.test: * tests/tcl/binary.test: * tests/tcl/case.test: * tests/tcl/clock.test: * tests/tcl/compile.test: * tests/tcl/concat.test: Add or update tests to match the ones in Tcl 8.3. Some tests expose minor formatting issues for test arguments. 2000-12-23 Mo DeJong <mdejong@redhat.com> * tests/all.tcl: Add missing test init file. * tests/defs: Add Tcl only implementations of test commands like testsetassocdata. 2000-12-23 Mo DeJong <mdejong@redhat.com> * tests/tcl/CdCmd.test: * tests/tcl/FileCmd.test: * tests/tcl/Procedure.test: * tests/tcl/PwdCmd.test: * tests/tcl/RegexpCmd.test: * tests/tcl/ReturnCmd.test: * tests/tcl/SwitchCmd.test: * tests/tcl/UpdateCmd.test: Add tcltest package initilization and cleanup code to each of the test cases. 2000-12-22 Mo DeJong <mdejong@redhat.com> * Makefile.in: The test target will now source tests/all.tcl instead of tests/all. * tests/all: Remove. * tests/defs: Remove old tcltest implementation, keep some old helper procs. * tests/tcltest.tcl: Import tcltest from Tcl 8.3. * tests/inprogress/AfterCmd.test: * tests/inprogress/BgErrorMgr.test: * tests/inprogress/CallFrame.test: * tests/inprogress/EventAdaptor.test: * tests/inprogress/ExecCmd.test: * tests/inprogress/ExprCmd.test: * tests/inprogress/GlobCmd.test: * tests/inprogress/TimerHandler.test: * tests/inprogress/Unicode.test: * tests/inprogress/UplevelCmd.test: * tests/inprogress/Util.test: * tests/jacl/FileCmd.test: * tests/jacl/IdleHandler.test: * tests/jacl/Interp.test: * tests/jacl/Notifier.test: * tests/tclblend/javaCmd.test: * tests/tclblend/javaIdle.test: * tests/tclblend/javaInterp.test: * tests/tclblend/javaObj.test: * tests/tclblend/javaTimer.test: * tests/tclblend/javaUtil.test: * tests/tcljava/ArrayObject.test: * tests/tcljava/AutomaticSignature.test: * tests/tcljava/BeanEvent.test: * tests/tcljava/BeanEventMgr.test: * tests/tcljava/ClassRep.test: * tests/tcljava/FieldSig.test: * tests/tcljava/FuncSig.test: * tests/tcljava/JavaBindCmd.test: * tests/tcljava/JavaCallCmd.test: * tests/tcljava/JavaCastCmd.test: * tests/tcljava/JavaDefineClassCmd.test: * tests/tcljava/JavaEventCmd.test: * tests/tcljava/JavaFieldCmd.test: * tests/tcljava/JavaImportCmd.test: * tests/tcljava/JavaInfoCmd.test: * tests/tcljava/JavaInstanceofCmd.test: * tests/tcljava/JavaInvoke.test: * tests/tcljava/JavaIsNullCmd.test: * tests/tcljava/JavaLoadCmd.test: * tests/tcljava/JavaLock.test: * tests/tcljava/JavaNewCmd.test: * tests/tcljava/JavaNullCmd.test: * tests/tcljava/JavaPropCmd.test: * tests/tcljava/JavaThrowCmd.test: * tests/tcljava/JavaTryCmd.test: * tests/tcljava/PkgInvoker.test: * tests/tcljava/PropertySig.test: * tests/tcljava/ReflectException.test: * tests/tcljava/ReflectObject.test: * tests/tcljava/TclEvent.test: Add tcltest package initilization and cleanup code to each of the test cases. 2000-11-19 Christian Krone <christian.krone@softwareag.com> * src/jacl/tcl/lang/StdChannel.java: (Bug #121678:) The recently introduced method StdChannel.getChanName() was removed again, since with its existence the standard channels no longer occupy the first three slots in filename channel. * src/jacl/tcl/lang/ReadCmd.java: * src/jacl/tcl/lang/PutsCmd.java: * src/jacl/tcl/lang/GetsCmd.java: These command implementations now check themself for the needed read/write access, since the underlying channel don't know the user specified name of the channel. 2000-11-14 Mo DeJong <mdejong@redhat.com> * tcljava.m4: The AC_FD_LOG macro was renamed to AS_MESSAGE_LOG_FD in the autoconf CVS. Use the new macro. 2000-10-31 Mo DeJong <mdejong@redhat.com> * configure: Regen. * tcljava.m4: The configure script would fail if jikes was not found, fix that. 2000-10-29 Mo DeJong <mdejong@redhat.com> * configure: Regen. * tcljava.m4: Properly quote call to AC_CACHE_CHECK. * src/native/javaCmd.c: Fixup a couple of comments. * tests/tcljava/ArrayObject.test: Correct test number. 2000-10-28 Mo DeJong <mdejong@redhat.com> Finish merge from ajuba-tclblend-contract-2000-08-01-branch. 2000-10-27 Daniel Wickstrom <danw@rtp.ericsson.se> * Makefile.in: Don't build unixNotifier.o. * src/jacl/tcl/lang/Notifier.java: Minor comment fixups. * src/native/java.h (JavaAlertNotifier, JavaDisposeNotifier, JavaInitNotifier): Remove declarations for unused functions. * src/native/javaNotifier.c: Add thread local cache for Notifier info, save the Tcl thread id in the Notifier instance. * src/tclblend/tcl/lang/Notifier.java: Support Notifier on a per thread basis. * unix/README.jacl: * unix/README.tclblend: Fixup build notes. * unix/unixNotifier.c: Removed single threaded Notifier implementation for Unix. * win/makefile.vc: Don't build win/winNotifier.o. * win/tclRegexp.h: Removed old support file. * win/winNotifier.c: Removed single threaded Notifier implementation for Windows. 2000-10-27 Mo DeJong <mdejong@redhat.com> * src/jacl/tcl/lang/Notifier.java: Change comments from C style to Java style. 2000-10-25 Mo DeJong <mdejong@redhat.com> * src/native/javaObj.c: Added comment about how CObject.newInstance() is invoked. * src/tclblend/tcl/lang/CObject.java: CObject now extends TclEvent. When a dangling reference to a Tcl_Obj* is found in the CObject.finalize() method, it is freed in the creating thread instead of the JVM's GC thread. 2000-10-25 Mo DeJong <mdejong@redhat.com> * docs/TclJavaLib/InternalRep.htm: * docs/TclJavaLib/ReflectObject.htm: * docs/TclJavaLib/TclBoolean.htm: * docs/TclJavaLib/TclDouble.htm: * docs/TclJavaLib/TclIndex.htm: * docs/TclJavaLib/TclInteger.htm: * docs/TclJavaLib/TclList.htm: * docs/TclJavaLib/TclObject.htm: * docs/TclJavaLib/TclString.htm: * docs/TclJavaLib/traceVar.htm: Update to account for change to InternalRep class. * src/empty/empty.jar: Regen. * src/empty/tcl/lang/CObject.java: * src/jacl/tcl/lang/CObject.java: * src/jacl/tcl/lang/NamespaceCmd.java: * src/jacl/tcl/lang/TclByteArray.java: * src/jacl/tcl/lang/TclList.java: * src/tclblend/tcl/lang/CObject.java: * src/tcljava/tcl/lang/ClassRep.java: * src/tcljava/tcl/lang/FieldSig.java: * src/tcljava/tcl/lang/FuncSig.java: * src/tcljava/tcl/lang/InternalRep.java: * src/tcljava/tcl/lang/JavaNewCmd.java: * src/tcljava/tcl/lang/PropertySig.java: * src/tcljava/tcl/lang/ReflectObject.java: * src/tcljava/tcl/lang/TclBoolean.java: * src/tcljava/tcl/lang/TclDouble.java: * src/tcljava/tcl/lang/TclIndex.java: * src/tcljava/tcl/lang/TclInteger.java: * src/tcljava/tcl/lang/TclString.java: Change InternalRep into an interface instead of an abstract class. 2000-10-25 Mo DeJong <mdejong@redhat.com> * src/tcljava/tcl/lang/TclObject.java: * src/tcljava/tcl/lang/TclString.java: Comment fixup. 2000-10-22 Mo DeJong <mdejong@redhat.com> * src/tests/tcljava/tests/javabind/Bind.java (run): Check for a null callback so as to avoid a NullPointerException. * tests/tcljava/JavaBindCmd.test: Give test thread time to queue up the event, then process all events in queue. 2000-10-22 Mo DeJong <mdejong@redhat.com> * src/native/javaCmd.c (TclThreadCleanup, DestroyJVM, DetachTclThread, FreeJavaCache): Rename TclThreadCleanup to DetachTclThread. Add DestroyJVM callback to cleanup the thread that creates the JVM. Add FreeJavaCache, this method releases any global references in the JVM. 2000-10-21 Mo DeJong <mdejong@redhat.com> * src/native/javaObj.c (JavaObjInit): Fix JavaObjInit so that it only inits the global data once. Add cmdTypePtrLock mutex to protect the global data from multiple threads. 2000-10-09 Mo DeJong <mdejong@redhat.com> * src/xputils/xputils.tcl (appendpath, prependpath): Use list command to quote arguments set to uplevel. This fixes a bug that caused xputils to fail under Windows. 2000-08-26 Mo DeJong <mdejong@redhat.com> * src/native/javaCmd.c (JavaSetupJava, TclThreadCleanup): Move JavaInfo cache into thread local storage. Removed javaVM_init_mutex. Create thread exit handler that will detach a Tcl thread from the JVM. 2000-08-26 Mo DeJong <mdejong@redhat.com> * src/native/java.h (java, JavaGetCache): Remove global java variable, replaced it with JavaGetCache(). * src/native/javaCmd.c: * src/native/javaIdle.c: * src/native/javaInterp.c: * src/native/javaList.c: * src/native/javaNotifier.c: * src/native/javaObj.c: * src/native/javaTimer.c: Call JavaGetCache() to get the JavaInfo pointer for the current thread. 2000-08-26 Mo DeJong <mdejong@redhat.com> * src/native/java.h: Add method that corresponds to tcl.lang.Exceptions's constructor to the JavaInfo struct. * src/native/javaCmd.c (AddToClassCache, AddToMethodCache, AddToFieldCache): Remove the global arrays that were used to store class, method, and field signatures. We now init the JavaInfo struct by calling methods. 2000-08-23 Jiang Wu <jwu@cs.stanford.edu> * src/tclblend/tcl/lang/Notifier.java (preserve, release, queueEvent, deleteEvents, deleteEvent, serviceEvent, getAvailableEvent, hasEvents): Fix bugs in Notifier, use an internal monitor instead of one on the class so that an event that calls vwait does not block other events from getting added to the after queue. 2000-08-23 Mo DeJong <mdejong@redhat.com> * src/tests/tcljava/tests/AppendEventQueueThread.java: Add source for enqueue of event that does a vwait test. * tests/tcljava/TclEvent.test: Add test case for notifier queue bug. 2000-08-23 Mo DeJong <mdejong@redhat.com> * configure: Regen. * tcljava.m4: Reject Tcl build that does not include thread support. 2000-08-19 Mo DeJong <mdejong@redhat.com> * Makefile.in: Renamed TCLBLEND_CLASS_NAMES variable to TCLBLEND_JNI_HEADER_CLASS_NAMES. 2000-08-08 Mo DeJong <mdejong@redhat.com> * src/native/java.h (JavaGetEnv): * src/native/javaCmd.c (JavaGetEnv, JavaInitEnv): Rewrite Tcl Blend initilization, create new method to handle all initialization in a thread safe way. * src/native/javaIdle.c: * src/native/javaInterp.c: * src/native/javaNotifier.c: * src/native/javaObj.c: * src/native/javaTimer.c: Call JavaGetEnv without an Interp argument. 2000-08-07 Mo DeJong <mdejong@redhat.com> * src/native/javaCmd.c (JavaGetEnv): Rewrite JavaGetEnv, it was implemented as two methods that did the exact same thing for two different versions of the JDK. It is now a single method. 2000-08-06 Mo DeJong <mdejong@redhat.com> * src/native/java.h: * src/native/javaCmd.c: * src/native/javaInterp.c: * src/tclblend/tcl/lang/NativeLock.java: Remove the tcl.lang.NativeLock class, it is not needed since we removed the big global lock. 2000-07-30 Mo DeJong <mdejong@redhat.com> * src/native/java.h: * src/native/javaCmd.c: * src/native/javaIdle.c: * src/native/javaInterp.c: * src/native/javaList.c: * src/native/javaNotifier.c: * src/native/javaObj.c: * src/native/javaTimer.c: * src/native/javaUtil.c: Put the JNIEnv pointer in thread local storage. Create a per JVM init flag and a per thread init flag. Tcl interps in other threads can communicate with the JVM in the main thread using the synchronization primitives project by the JNI. Remove JAVA_LOCK, JAVA_UNLOCK, PUSH_JAVA_ENV, and POP_JAVA_ENV macros and associated Java monitor. Remove JavaSetEnv function. 2000-07-29 Jiang Wu <jwu@cs.stanford.edu> * win/makefile.vc: Fix the makefile.vc to install the new xputil package, remove some errors that stopped the build, and install the .dll and .jar in lib/tclblend rather than lib. The makefile now mostly matches what the UNIX side does for tclblend 1.3. 2000-10-28 Mo DeJong <mdejong@redhat.com> Begin merge from ajuba-tclblend-contract-2000-08-01-branch. 2000-10-04 Mo DeJong <mdejong@redhat.com> * demos/watchpkg/README: Add a better example of use of the sw* commands. 2000-08-22 Mo DeJong <mdejong@redhat.com> * src/tests/tcljava/tests/JavaTest.java: * tests/tcljava/JavaInvoke.test: Add identity test case for passing of a java.lang.String ReflectObject to a Java method. 2000-08-20 Christian Krone <krischan@sql.de> * src/jacl/tcl/lang/LreplaceCmd.java: * tests/tcl/lreplace.test: Update lreplace command to be 8.4 compliant. 2000-08-20 Christian Krone <krischan@sql.de> * src/jacl/tcl/lang/LsearchCmd.java: Update lsearch command to be 8.4 compatible. * tests/tcl/LsearchCmd.test: Remove. * tests/tcl/lsearch.test: Add 8.4 test cases. 2000-08-20 Christian Krone <krischan@sql.de> * src/jacl/tcl/lang/Expression.java (ExprGetValue): Expressions with &&, || or ?: now accept boolean string values. 2000-08-20 Christian Krone <krischan@sql.de> * src/jacl/tcl/lang/Expression.java (DoubleTooSmall, ExprLooksLikeInt): Check for ARITH UNDERFLOW, rename ExprLooksLikeInt to looksLikeInt. * src/jacl/tcl/lang/Parser.java (parseVar, backslash): No Exception, when parsing the following command: "set $a(foo". Correct handling for \x123 characters with its 8th bit set (>= \x80). * src/jacl/tcl/lang/StringCmd.java: 8.4 compatible string command. * src/jacl/tcl/lang/TclByteArray.java (toString): And a byte with 0xff to produce a char. * src/jacl/tcl/lang/Util.java (strtoul, toTitle): 0X123 will now be detected as valid hex number. 8.4 compatible error message for bad octal numbers. Add toTitle method to support string command. * tests/tcl/string.test: 8.4 compatible tests for string command. 2000-08-20 Christian Krone <krischan@sql.de> * src/jacl/tcl/lang/FileCmd.java: Don't back up over multiple dots in a file extension. This matches the behavior of newer versions of Tcl. 2000-08-20 Christian Krone <krischan@sql.de> * src/jacl/tcl/lang/ClockCmd.java: * tests/tcl/clock.test: Update Jacl's clock command to be Tcl 8.4 compliant. 2000-08-20 Christian Krone <krischan@sql.de> * configure.in: Pass -ms5m -mx22m in JAVA_FLAGS. * diffs.txt: Add note about new interp command. * jaclsh.in: Dont set JAVA_FLAGS here. * new_features.txt: Add note about new interp command. * src/jacl/tcl/lang/BgErrorMgr.java (processIdleEvent): Add calls to Interp.preserve() and Interp.release(). * src/jacl/tcl/lang/CatchCmd.java: Add call to Interp.resetResult(). * src/jacl/tcl/lang/EventuallyFreed.java: Implement a ref counting scheme like Tcl_Preserve and Tcl_Release. We can't use GC because of Tcl's semantics. * src/jacl/tcl/lang/Interp.java (dispose, eventuallyDispose, createCommands, deleteCommandFromToken, renameCommand, preventAliasLoop, resetResult, eval, processUnexpectedResult, transferResult, hideCommand, exposeCommand, hideUnsafeCommands, invokeGlobal, invoke, allowExceptions): Make Interp derive from EventuallyFreed. Add guts needed to support slave/safe interps. Add interp command. Set the returnCode to TCL.OK when resetResult() is called. Add support for propagating error info slave to master interp as well as hiding and exposing commands. * src/jacl/tcl/lang/InterpAliasCmd.java: Add command that will proxy aliases commands in an interp. * src/jacl/tcl/lang/InterpCmd.java: Add command that handles the interp Tcl command. * src/jacl/tcl/lang/InterpSlaveCmd.java: Add command that will handle commands for slave interp in the master. * src/jacl/tcl/lang/library/init.tcl: Remove stub interp command. * tests/tcl/interp.test: Add interp regression tests. 2000-08-19 Christian Krone <krischan@sql.de> * src/jacl/tcl/lang/BgErrorMgr.java: Use Java style comments instead of C style ones. 2000-07-31 Mo DeJong <mdejong@redhat.com> * src/jacl/tcl/lang/FconfigureCmd.java: Don't raise error when -buffering option is given, just silently do nothing for now. * src/jacl/tcl/lang/ReadCmd.java: Fix bug that caused channel open with r+ to not work with the read command. 2000-07-31 Christian Krone <krischan@sql.de> * src/jacl/tcl/lang/Channel.java: Add refCount. * src/jacl/tcl/lang/CloseCmd.java (cmdProc): Use TclIO.unregisterChannel. * src/jacl/tcl/lang/FileChannel.java: Fix typos. * src/jacl/tcl/lang/OpenCmd.java: Fix typos. * src/jacl/tcl/lang/StdChannel.java (getChanName): Add getChanName method to StdChannel class. * src/jacl/tcl/lang/TclIO.java: Use refCount. 2000-07-29 Mo DeJong <mdejong@redhat.com> * tests/tcljava/JavaLock.test: Use error string from Tcl 8.3 when a command is invoked with the incorrect number of arguments. Jacl does not yet generate a Tcl 8.3 compliant error in this case, so some of its regression tests will fail. 2000-07-29 Mo DeJong <mdejong@redhat.com> * src/empty/empty.jar: Regen. * src/empty/tcl/lang/Interp.java: * src/jacl/tcl/lang/Interp.java: * src/native/javaInterp.c: * src/tclblend/tcl/lang/Interp.java: * src/tcljava/tcl/lang/ReflectObject.java: 2000-07-16 Christian Krone <krischan@sql.de> * src/jacl/tcl/lang/ClockCmd.java: Upgrade Jacl's clock command to match Tcl 8.3. Even stardates are supported! * tests/tcl/clock.test: Upgrade to Tcl 8.3. 2000-07-13 Mo DeJong <mdejong@redhat.com> * tcljava.m4: Add doublequotes around test variables that might be empty. 2000-07-13 Mo DeJong <mdejong@redhat.com> * src/empty/empty.jar: Regen. * src/empty/tcl/lang/Interp.java: * src/jacl/tcl/lang/Interp.java: * src/tclblend/tcl/lang/Interp.java: Add conflict table variable. * src/tcljava/tcl/lang/ReflectObject.java: Overhaul reflect table implementation to avoid problem with object hash overlap in JDK 1.2. We now use a second conflict table to store hash conflicts. 2000-06-15 Mo DeJong <mdejong@redhat.com> * src/native/java.h: * src/native/javaCmd.c: * src/native/javaIdle.c: * src/native/javaInterp.c: * src/native/javaList.c: * src/native/javaNotifier.c: * src/native/javaObj.c: * src/native/javaTimer.c: * src/native/javaUtil.c: Rename JAVA_LOCK/JAVA_UNLOCK to PUSH_JAVA_ENV/POP_JAVA_ENV, create new JAVA_LOCK and JAVA_UNLOCK macros that just grab the monitor, use these new JAVA_LOCK/JAVA_UNLOCK macros in the rest of the code. 2000-06-03 Mo DeJong <mdejong@redhat.com> * demos/pyramidpkg/AppletConsole.java: * demos/pyramidpkg/ConsoleKeyListener.java: * demos/pyramidpkg/Pyramid.java: Overhauled the pyramid demo so that it uses the Tcl event queue in a thread safe way. 2000-06-03 Mo DeJong <mdejong@redhat.com> * new_features.txt: Added notes about new JVM support. Minor comment fixup. * src/native/java.h: Removed old code that supported Tcl 8.0. * src/jacl/tcl/lang/Interp.java (appendElement): Removed extra call to toString() on result. 2000-06-03 Mo DeJong <mdejong@redhat.com> * Makefile.in: Merged from unix/Makefile.in * aclocal.m4: * autogen.sh: Added * configure: Added * configure.in: Merged from unix/configure.in * jaclsh.in: Added * jtclsh.in: Added * tcljava.m4: Added * tcljavaConfig.sh.in: Added * unix/Makefile.in: Removed * unix/configure.in: Removed * unix/install-sh: Removed * unix/jaclsh.in: Removed * unix/jtclsh.in: Removed * unix/tcljavaConfig.sh.in: Removed Finished major overhaul of the build system. The new configure process is much more robust and will support more systems that the older one. Tcl Blend can now use the Kaffe JVM. Support for IBM Java2-13 also added. 2000-05-24 Mo DeJong <mdejong@redhat.com> * tests/inprogress/Unicode.test: Overhauled the unicode conversions/substitution tests. They now take a lot less time to run. 2000-05-24 Mo DeJong <mdejong@redhat.com> * src/jacl/tcl/lang/Interp.java (evalResource): * src/tclblend/tcl/lang/Interp.java (evalResource): Changed class that getResourceAsStream is called on so that we don't use a system class loader. 2000-05-21 Mo DeJong <mdejong@redhat.com> * src/jacl/tcl/lang/Shell.java: Removed unused bits of old code that were still lying around. Added FIXME comment about TCL.OK which is not accessible. 2000-05-21 Mo DeJong <mdejong@redhat.com> * unix/Makefile.in: Changed target name from dists to dist to conform to GNU specs. 2000-05-14 Mo DeJong <mdejong@redhat.com> * unix/configure.in: Moved minimum version number back to 8.3 instead of 8.3.1 because of a bug in Tcl's package command. 2000-05-14 Mo DeJong <mdejong@redhat.com> * unix/Makefile.in: Fixed up "make test" rules, added output that makes it easy to run the tests from "make shell". 2000-05-14 Mo DeJong <mdejong@redhat.com> * src/tclblend/tcl/lang/Interp.java: Fixed up comments about flags argument, for instance GLOBAL_ONLY was changed to TCL.GLOBAL_ONLY. 2000-05-14 Mo DeJong <mdejong@redhat.com> * src/jacl/tcl/lang/Shell.java: Added calls to preserve() and release() on cmd object being passed to recordAndEval() to avoid a null pointer exception. 2000-05-14 Mo DeJong <mdejong@redhat.com> * src/pkgIndex.tcl: * src/tcljava/tcl/lang/BlendExtension.java: Moved the exporting of commands in the java namespace from pkgIndex.tcl to BlendExtension.java so that it will work in both Jacl and Tcl Blend. 2000-05-14 Mo DeJong <mdejong@redhat.com> * docs/TclJavaLib/Eval.htm: * src/jacl/tcl/lang/BgErrorMgr.java: * src/jacl/tcl/lang/Interp.java: * src/jacl/tcl/lang/Parser.java: * src/tcljava/tcl/lang/TCL.java: * src/tests/jacl/tcl/lang/TestEval2Cmd.java: * src/tests/jacl/tcl/lang/TestEvalObjvCmd.java: Moved eval() flags like TCL_EVAL_GLOBAL from the Jacl Parser class to the tcljava TCL class. This makes it possible to write code that calls eval() with flags arguments that works in both Jacl and Tcl Blend. Also removed an unused variable from Jacl's Interp. 2000-05-14 Mo DeJong <mdejong@redhat.com> * src/jacl/tcl/lang/Interp.java: Removed unused primaryThread variable. 2000-05-14 Mo DeJong <mdejong@redhat.com> * src/jacl/tcl/lang/ConsoleEvent.java: Removed class as it is no longer needed after changes to Shell. * src/jacl/tcl/lang/Shell.java: Overhauled the way the Shell program interacts with the Interp. The old way was not thread safe. The prompt displayed when a command is not yet complete has also been changed to match recent verisons of Tcl. 2000-05-13 Mo DeJong <mdejong@redhat.com> * src/pkgIndex.tcl: Added missing namespace export of the java::import cmd. 2000-05-13 Mo DeJong <mdejong@redhat.com> * src/native/javaCmd.c: * src/native/javaObj.c: * src/native/javaUtil.c: * src/native/tclResult.c: * unix/Makefile.in: * unix/configure.in: Removed old compat code that supported building Tcl Blend with Tcl 8.0. We now require Tcl 8.3.1 as a minimum. 2000-05-13 Mo DeJong <mdejong@redhat.com> * unix/Makefile.in: Changed var named TCL_INSTALL_BIN_DIR to TCL_INSTALL_LIB_DIR. Added "make gdb" rule for Tcl Blend debugging. * unix/configure.in: Added search on PATH for gdb. Changed var named TCL_INSTALL_BIN_DIR to TCL_INSTALL_LIB_DIR. 2000-05-13 Mo DeJong <mdejong@redhat.com> * src/jacl/tcl/lang/Notifier.java: Fixed small typo in a comment. 2000-05-13 Mo DeJong <mdejong@redhat.com> * src/jacl/tcl/lang/Shell.java: Dropped use of Jacl Channel objects in favor of directly calling System.in and System.out. 2000-04-07 Mo DeJong <mdejong@redhat.com> * README.jacl: * README.tclblend: Fixed up README files for the 1.3 version. * src/pkgIndex.tcl: Major overhaul of the tclblend package loading process, we now make use of the XpUtils package. * src/jacl/tcl/lang/Interp.java: Updated Java package version to 1.3.0. * src/tclblend/tcl/lang/Interp.java: Moved name of tclblend shared lib into a variable. * src/tcljava/tcl/lang/BlendExtension.java: Updated Java package version to 1.3.0. * src/tcljava/tcl/lang/TclInteger.java: Added Tcl C function names to documentation. * src/xputils/iload.tcl: * src/xputils/iload.test: * src/xputils/pkgIndex.tcl: * src/xputils/xputils.tcl: * src/xputils/xputils.test: Added XpUtils package for Tcl Blend. * unix/Makefile.in: Added tcljavaConfig.sh support. Fixed runtime linker search path so that it checks where the tcl lib will be installed not where it was built. Fixed install so that all tcljava libraries are installed into a common Tcl/lib/tcljava${VERSION} directory. Added support for XpUtils package. * unix/configure.in: Updated Java package version to 1.3.0. Added tcljavaConfig.sh support. Set minimum supported Tcl version to 8.3. * unix/jaclsh.in: * unix/jtclsh.in: Updated to account for new lib install location. * unix/tcljavaConfig.sh.in: New file. * unix/tools/vutil/current: * win/makefile.vc: Updated Java package version to 1.3.0. 2000-04-03 Mo DeJong <mdejong@redhat.com> * src/jacl/tcl/lang/ConsoleEvent.java: * src/jacl/tcl/lang/Shell.java: * src/tcljava/tcl/lang/TclException.java: Fixed up the way an event is sent to an interp and how the error result is returned so that the Shell class is more thread safe. 2000-04-03 Mo DeJong <mdejong@redhat.com> * diffs.txt: Added note about Interp.recordAndEval * new_features.txt: Added note about the addition of the history command. * docs/cFunctions.html: Fixed Interp.recordAndEval doc and reformatted to a single list. * docs/TclJavaLib/Eval.htm: Fixed Interp.recordAndEval documentation. * src/jacl/tcl/lang/ConsoleEvent.java: Fixed up Interp.recordAndEval method invocation. * src/jacl/tcl/lang/Interp.java: Changed signature for recordAndEval method. * src/tclblend/tcl/lang/Interp.java: Added empty stub for recordAndEval method. * tests/tcl/history.test: Added regression tests for history command. 2000-04-01 Mo DeJong <mdejong@redhat.com> * src/tcljava/tcl/lang/ReflectObject.java: improved some error and debug messages. 2000-04-01 Mo DeJong <mdejong@redhat.com> * unix/Makefile.in: added "make check" rule as an alias to "make test" to conform to the GNU coding standards. 2000-04-01 Mo DeJong <mdejong@redhat.com> * unix/Makefile.in: * win/makefile.vc: Fixed bug that caused the pyramidpkg to get compiled and shipped with tclblend. This fix was also back ported to the old 1.2 version. 2000-04-01 Mo DeJong <mdejong@redhat.com> * unix/kaffe_tests: removed useless file. 2000-04-01 Mo DeJong <mdejong@redhat.com> * unix/Makefile.in: fixed up "make dists" rule. 2000-03-30 Mo DeJong <mdejong@redhat.com> * changes.txt: updated contents as a result of back porting fixes to the 1.2 branch. 2000-03-29 Mo DeJong <mdejong@redhat.com> * unix/configure.in: removed IRIX hack that was added on 2000-02-23 but in fact did not work. 2000-03-20 Mo DeJong <mdejong@redhat.com> * src/tests/tcljava/tests/javabind/ActionEvent.java: * src/tests/tcljava/tests/javabind/ActionListener.java: * src/tests/tcljava/tests/javabind/Bind.java: * tests/tcljava/JavaBindCmd.test: * unix/Makefile.in Added new multi-threaded test case for the java::bind command. 2000-03-17 Mo DeJong <mdejong@redhat.com> * tests/inprogress/Unicode.test: Added test cases for Jacl substitution and passing of strings from Java to Tcl. * src/jacl/tcl/lang/Parser.java: Fixed a horrible bug that caused \u1234 to be parsed as \u1234 + 4. The parser was off by one. 2000-03-17 Mo DeJong <mdejong@redhat.com> * docs/cFunctions.html: * docs/TclJavaLib/TclInteger.htm: * src/jacl/tcl/lang/LindexCmd.java: * src/jacl/tcl/lang/LinsertCmd.java: * src/jacl/tcl/lang/LrangeCmd.java: * src/jacl/tcl/lang/LreplaceCmd.java: * src/jacl/tcl/lang/LsortCmd.java: * src/jacl/tcl/lang/StringCmd.java: * src/jacl/tcl/lang/Util.java: * src/tcljava/tcl/lang/TclInteger.java: * tests/tcl/lindex.test: * tests/tcl/linsert.test: * tests/tcl/lrange.test: * tests/tcl/lreplace.test: * tests/tcl/string.test: Renamed and moved the TclInteger.getForIndex() method to Util.getIntForIndex(). It is a mapping for the TclGetIntForIndex function which is private, so it did not belong in TclInteger. Along with this change, I updated the implementation of getIntForIndex so that it is compatible with Tcl 8.3, which also required adding the Util.checkBadOctal() method. A number of regression test were update to account for these changes. 2000-03-14 Mo DeJong <mdejong@redhat.com> * demos/packDemo/StringSplitter.java: Removed file. * demos/packDemo/PackerLayout.java: Added split() method that was implemented in StringSplitter. Also added a method to query the current pack settings. The ability to "update" a widget was also added. 2000-03-10 Mo DeJong <mdejong@redhat.com> * src/jacl/tcl/lang/Expression.java: * src/jacl/tcl/lang/StringCmd.java: * src/jacl/tcl/lang/Util.java: Got rid of the Util.isLetterOrDigit() method. It was a workaround for a bug in the Microsoft JVM. Since we do not support the Microsoft JVM and it does not exist anymore, there is no reason to leave this bug workaround in the code. 2000-03-01 Mo DeJong <mdejong@redhat.com> * diffs.txt: * new_features.txt: * src/jacl/tcl/lang/BinaryCmd.java: * src/jacl/tcl/lang/TclByteArray.java: * tests/tcl/binary.test: * src/jacl/tcl/lang/Interp.java: Added implementation of Tcl's binary comand to Jacl. The implementation was donated by Christian Krone <krischan@sql.de>. 2000-03-01 Mo DeJong <mdejong@redhat.com> * README.jacl: * README.tclblend: Updated Team member names. 2000-02-23 Mo DeJong <mdejong@redhat.com> * src/tclblend/tcl/lang/Interp.java: Removed old code that was commented out. Fixed comments. 2000-02-23 Mo DeJong <mdejong@redhat.com> * unix/configure.in: improved the error message displayed when the directory given by --with-tcl does not exist by adding the name of the directory we are searching for to the err msg. 2000-02-23 Mo DeJong <mdejong@redhat.com> * docs/cFunctions.html: * docs/TclJavaLib/Eval.htm: * src/jacl/tcl/lang/ConsoleEvent.java: * src/jacl/tcl/lang/Interp.java: * src/jacl/tcl/lang/library/history.tcl: * src/jacl/tcl/lang/library/init.tcl: Added implementation of the history command to Jacl. The implementation was donated by Christian Krone <krischan@sql.de>. 2000-02-23 Mo DeJong <mdejong@redhat.com> * README.jacl: * diffs.txt: * new_features.txt: * unix/Makefile.in: * src/jacl/tcl/lang/RegexpCmd.java: * src/jacl/tcl/lang/RegsubCmd.java: * src/jacl/tcl/lang/Util.java: * src/jacl/sunlabs/brazil/util/regexp/Regexp.java: * src/jacl/sunlabs/brazil/util/regexp/Regsub.java: * src/jacl/tcl/lang/TclRegexp.java: Added new regular expression implementation for Jacl donated by Colin Stevens <colin.stevens@sun.com>. 2000-02-23 Mo DeJong <mdejong@redhat.com> * license.oro: * src/jacl/oro.jar: * src/jacl/tcl/regex/OroRegexMatcher.java: * src/jacl/tcl/regex/OroRegexpCmd.java: * src/jacl/tcl/regex/OroRegsubCmd.java: * src/jacl/tcl/lang/RegexMatcher.java: Removed all files that were part of the ORO regexp implementation for Jacl. 2000-02-23 Mo DeJong <mdejong@redhat.com> This ChangeLog file is new, for descriptions of older changes see changes.txt.