2012-05-24  Jamison Hope  <jrh@theptrgroup.com>

	* Compilation.java (compileConstant): Use language-specific
	conversion to primitive boolean.

2012-05-20  Per Bothner  <per@bothner.com>

	* AbstractScriptEngineFactory.java: Re-do handing of Bindings so we
	can better handling SimpleBindings and other random Bindings.
	This means creating an Environment that proxies to the Bindings.
	* KawaScriptEngine.java (createBindings): Create a new
	SimpleEnvironment for just the current new Bindings, without Builtins.

	* KawaScriptEngine.java (compile): Fix NPE calculating URL.

2012-05-14  Per Bothner  <per@bothner.com>

	* AbstractScriptEngineFactory.java (getExtensions): Two small fixes.

2012-05-05  Per Bothner  <per@bothner.com>

	Fix for Savannah bug #36039 "inlining problem".
	* Compilation.java (avoidInline): New method.
	* FindCapturedVars.java (checkInlineable): Use new method to
	express existing test.
	* InlineCalls.java (visitLambdaExp): Use avoidInline - new test.

2012-05-03  Per Bothner  <per@bothner.com>

	* ApplyExp.java (compile): Warn rather than error on unreachable
	code.  Fixes Savannah bug #35524: "Unreachable code is not an error".

	* ChainLambdas.java: Add testing for unreachable code, by checking
	if a neverReturns expression is followed by another.
	* InlineCalls.java (visitIfExp): Minor update to get correct warning.

2012-05-02  Per Bothner  <per@bothner.com>

	* BeginExp.java (compile): Check for (and warn about) unreachable code.
	This is (partial) fix for Savannah bug# 35728 "More unreachable code".

	* Compilation.java (warnUnreachable): New static field.
	(warnUnreachable): New method.
	This is preliminary changes for Savannah bug #35524
	"Unreachable code is not an error".

2012-04-23  Per Bothner  <per@bothner.com>

	* Expression.java (neverReturns): New convenience method.

2012-04-22  Per Bothner  <per@bothner.com>

	* BlockExp.java (compile): Don't need goto around exitBody
	if unreachable.
	* IfExp.java (compile): Comment out optimization for when else is
	an ExitExp, as it doesn't handle unreachability properly.

	* BlockExp.java (id, counter): New fields.
	(toString, print): Use id field.

	* ExitExp.java (print) Print block's id.

2012-04-05  Per Bothner  <per@bothner.com>

	* ReferenceExp.java (PREFER_BINDING2): Move flag from here ...
	* SetExp.java (PREFER_BINDING2): .. and here ...
	* AccessExp.java (PREFER_BINDING2): ... to common super-class here.

2012-03-21  Per Bothner  <per@bothner.com>

	* Language.java (unionType): Handle Type.neverReturnsType.

	* InlineCalls.java: Defer visiting body of delay or lazy,
	thus avoiding false warnings about initialized variables.
	(deferableInit): New method.

	* LambdaExp.java (unknownContinuation): Cast of null needed due to
	change to use varargs.
	* ApplyExp.java (<init>): Convert to using varargs.

	* InlineCalls.java (visitLetExp): Special case if decl is bound
	to a lambda (as in a letrec).

	* FindCapturedVars.java (visitSetExp): Before warning about setting
	unknown, check dynamic environment, as we do for visitReferenceExp.
	(maybeWarnNoDeclarationSeen): New helper method.

2012-03-20  Per Bothner  <per@bothner.com>

	* FindCapturedVars.java (visitSetExp): Warn if setting unknown.

2012-03-15  Per Bothner  <per@bothner.com>

	Implement data-flow from argument to function parameter.
	This includes possible inlining of functions passed as parameters.
	* InlineCalls.java (typeForCalledFunction): New helper function.
	(visitReferenceExp): Many changes.
	(visitRemainingDeclaredLambdas): Warn for unused lambdas.
	(visitFluidLetExp): New method.
	(ProcedureInCallContext): New helper class.
	* FindTailCalls.java: Don't setCanRead or setCanCall - now handled
	by InlineCalls, which uses data-flow and so is more accurate.
	(visitLambdaExp): Do remove canRead parameter.
	(visitReferenceExp): Removed - no longer needed.
	* Compilation.java (warnUnused): New field and method.
	(isSimpleApplyFunction): New method.
	* Declaration.java (isModuleLocal): New method.
	(ValueSource.getValue):  Return value if called by
	isSimpleApplyFunction.
	* LambdaExp.java (setCanAccess, outerLambdaOrCaller): New methods.
	(declareClosureEnv, loadHeapFrame, enterFunction):
	Use outerLambdaOrCaller.
	(compile): Handle inline-only case.
	* ApplyExp.java (compile): Do allocMethod if needed.
	* FindCapturedVars.java (visitLambdaExp): Move check for named
	top-level function from here ...
	(checkInlineable): ... to here.

	* LambdaExp.java (enterFunction): Skip ignorable parameter.

2012-03-20  Per Bothner  <per@bothner.com>

	* LetExp.java (compile): Now that we do data-flow analysis, use
	Declaration#mayBeAccessedUninitialized.

2012-02-09  Jamison Hope  <jrh@theptrgroup.com>

	* ClassExp.java: Generate bridge method for co-variance and generics.
	(generateBridgeMethod): New method.

2012-02-03  Per Bothner  <per@bothner.com>

	* SetExp.java (compile): Don't create BindingInitializer if field
	hasConstantValueAttr.

2012-01-31  Per Bothner  <per@bothner.com>

	* InlineCalls.java (checkType): Support SAM-conversion even when
	compiler is unavailable, by using java.lang.reflect.Proxy.

2012-01-30  Per Bothner  <per@bothner.com>

	* PrimProcedure.java (compile): An optimization - which also fixes
	a possible VerifyError.

2012-01-29  Per Bothner  <per@bothner.com>

	* ModuleExp.java: Dynamically check if compiler is available,
	so Android users can use eval more easily.
	(compilerAvailable): Deprecate old field.
	(compilerAvailable): New method.
	(alwaysCompile): Update to call new compilerAvailable method.
	* Compilation.java: Likewise.

	* LambdaExp.java (getReturnType): Don't call getType on body if it
	hasn't been VALIDATED yet - that could cause problems.

2012-01-21  Per Bothner  <per@bothner.com>

	* Declaration.java (ABSTRACT_ACCESS): New flag.
	(CLASS_ACCESS_FLAGS): Include ABSTACT_ACCESS.

	* StackTarget.java (forceLazyIfNeeded): Don't force if stack type
	is actually a subtype of target type.

2012-01-15  Per Bothner  <per@bothner.com>

	* StackTarget.java (compileFromStack): Various fixes.

2012-01-01  Per Bothner  <per@bothner.com>

	* Language.java (getLangTypeFor): Check for lazy[TYPE].
	* StackTarget.java (forceLazyIfNeeded): New static method.
	(compileFromStack0): Coerce, if needed, from non-lazy to lazy.
	(getClonedInstance, doCoerce): New protected methods.
	(compileFromStack0): Do forceLazyIfNeeded.
	(compileFromStack): Use doCoerce.
	Handle coercion from non-lazy to lazy.
	* CheckedTarget.java (emitCheckedCoerce): Do forceLazyIfNeeded.
	(getClonedInstance, doCoerce): New methods.
	(compileFromStack): Remove - use inherited version.
	* Compilation.java (compileConstant): Check for LazyType.
	(generateMatchMethods): Do forceLazyIfNeeded.

2011-12-12  Per Bothner  <per@bothner.com>

	* LambdaExp.java (compile): Don't optimize ProcInitializer handling
	if mainClass differers from moduleClass

	* InlineCalls.java (checkType): Tweak previous change to handle
	interfaces and SAM-conversion better.

2011-12-10  Per Bothner  <per@bothner.com>

	* Language.java (PARSE_INTERACTIVE_MODULE): New flag.
	(parse): If PARSE_INTERACTIVE_MODULE is set, call setInteractiveName.
	This is preferable to setting it after parsing.
	* KawaScriptEngine.java (compile): Use new flag.

2011-12-09  Per Bothner  <per@bothner.com>

	* InlineCalls.java (checkType): Refactor.  This fixes a bogus warning
	if coercing (for example) a LetExp to Expression.

2011-11-29  Per Bothner  <per@bothner.com>

	* ScopeExp.java (remove): Set next pointer of Declaration to null.
	This avoid errors if the Declaration is added to some scope later.

	* Declaration.java (next): Make private.
	* ScopeExp.java: Update to use nextDecl and setNext accessor methods.

2011-11-15  Per Bothner  <per@bothner.com>

	Allow call-convention to vary from lambda to lambda.
	* ModuleMethodWithContext.java: New class, extends ModuleMethod.
	* ModuleWithContext.java: Remove class.
	* Makefile.am: Update accordingly.
	* Compilation.java (fullTailCallsVariable): New OptionInfo field.
	(currentCallConvention): Check value of full-tailcalls options.
	(typeModuleWithContext): Removed field.
	(typeModul eMethodWithContext): New field.
	(getModuleType): Always return typeModuleBody.
	(generateApplyMethodsWithContext, generateApplyMethodsWithoutContext):
	Check each lambda for usingCallContext.
	* LambdaExp.java (usingCallContext): New method.
	(generateApplyMethods): Call both generateApplyMethodsWithContext and
	generateApplyMethodsWithoutContext - always.
	* ModuleBody.java (match1, match2, match3, match4):
	Clear 'where' field in CallContext.
	* ProcInitializer.jav (aemitLoadModuleMethod): Update to generate
	ModuleMethodWithContext or ModuleWithContext as appropriate.
	* InlineCalls.java (visitLambdaExp): Only call setCallConvention
	if not yet set.

2011-11-15  Per Bothner  <per@bothner.com>

	* InlineCalls.java (visitLambdaExp): Don't call noteValueFromApply
	for optional or rest parameters.

2011-11-11  Per Bothner  <per@bothner.com>

	* Compilation.java (currentCallConvention, usingCallContext):
	New methods.
	* LambdaExp.java (callConvention): New field.
	(getCallConvention, setCallConvention): New method.
	* InlineCalls.java (visitLambdaExp): Call setCallConvention.
	* FindCapturedVars.java: Update.
	* ObjectExp.java (compile): Likewise.

2011-11-03  Per Bothner  <per@bothner.com>

	* LambdaExp.java (enterFunction): Adjust parameter count for "$this$".

2011-10-29  Jamison Hope  <jrh@theptrgroup.com>

	* InlineCalls.java (visitQuoteExp): Allow converting integer
	literals to boxed number types like java.lang.Integer and BigInteger.
	Also allow converting integer and float to float/double/Float/Double.

2011-10-25  Per Bothner  <per@bothner.com>

	* LambdaExp.java (enterFunction): If default parameter has primitive
	type, convert default to boxed type when calling searchForKeyword.
	* QuoteExp.java (compile): If value has primitive type, but target is
	corresponding boxed type, compile value as is.  This is an optimization
	primarily for the sake of the enterFunction change above.
	* InlineCalls.java (visitDefaultArgs): New method, so we can pass
	required type when visiting default expression.

2011-10-24  Per Bothner  <per@bothner.com>

	For default expressions of optional parameters, use
	Declaration#initValue instead of LambdaExp#defaultArgs.
	* LambdaExp.java (defaultArgs): Removed field.
	(opt_args): New field.
	(enterFunction, mustCompile, evalDefaultArg, print, apply):
	Update appropriately.
	* ApplyExp.java (compile): Likewise.
	* FindTailCalls.java (visitLambdaExp): Likewise.
	* ExpVisitor.java (visitDefaultArgs): Likewise.
	* FindCapturedVars.java (visitDefaultArgs): Likewise.

2011-10-08  Charles Turner  <chturne@gmail.com>

	* ApplicationMainSupport.java (propertyFields): Added the
	out:print-circle option.

2011-10-07  Per Bothner  <per@bothner.com>

	* QuoteExp.java (calculateType): If value is a Class, return a
	ParameterizedType, as in Java.

2011-10-01  Jamison Hope  <jrh@theptrgroup.com>

	Add support for native methods.
	* Special.java (nativeSpecial): New constant.
	* QuoteExp.java (nativeExp): New constant.
	* LambdaExp.java (isNative): New method.
	(addMethodFor): Set NATIVE flag on method if isNative().
	(compileAsMethod): Do nothing if isNative().
	(getReturnType, setCoercedReturnType, setCoercedReturnValue):
	Skip if native.
	* ClassExp.java (compileMembers): Skip if native.

2011-08-27  Per Bothner  <per@bothner.com>

	* LitTable.java (emit): Specify "make" parameter types
	so we get the correct method.  This fixes Savannah bug #34005
	"ambiguous call to getDeclaredMethod("make", 1)".

2011-08-25  Per Bothner  <per@bothner.com>

	Clean up and refactor code for genarating interactive class names.
	Make the int counters non static fields of ModuleManager.
	* ModuleManager.java (interactiveCounter, evalCounter,
	interactiveClassPrefix, evalClassPrefix): New fields.
	(getNewInteractiveName, getNewEvalName): New fields.
	* Compilation.java (setModuleName, setInteractiveName,
	setEvalName): New methods.
	* Language.java (eval): Improve prior fix to use setEvalName.
	(getEvalCounter): Remove method.
	* KawaScriptEngine.java (compile): Use new setInteractiveName.
	* ModuleExp.java (interactiveCounter): Remove field.
	(evalToClass): Use ModuleManager#interactiveCounter instead.

2011-08-25  Per Bothner  <per@bothner.com>

	* Language.java (eval): Generate a unique module name, so we get
	unique class names, so usedClass will work.
	(getEvalCounter): New method.
	(env_counter): Remove unused field.

2011-08-24  Per Bothner  <per@bothner.com>

	* Declaration.java (load): Tweak a questionable optimization:
	If Declaration is ignorable, only load value if not a LambdaExp.
	This fixes Savannah bug #34004 (Nullpointer exception in compiler).

2011-08-04  Per Bothner  <per@bothner.com>

	* ApplyExp.java: Optimize tail-recursion even in module-level functions.
	Also fix some issue is tail-recusive varargs functions.
	This fixes Savannah bug #33946] "Missed oppurtunity for tail call".
	* SetExp.java (canUseInc): Treat TARGET=TARGET as equivalent to
	TARGET=TARGET+0 - even if TARGET is non-numeric.

2011-08-01  Per Bothner  <per@bothner.com>

	* Compilation.java (generateBytecode): Make code to relativize source
	path names a bit more robust - specifically for Windows.

2011-07-24  Per Bothner  <per@bothner.com>

	Support for main module that has module-extends.
	*  RunnableModule.java: New interface.
	* Makefile.am: Update accordingly.
	* ModuleBody.java (runAsMain): Add static method.
	* Compilation.java (typeRunnableModule): New static field.
	(generateBytecode): Some tweaks when generating "run" method.

	* InlineCalls.java (visitLambdaExp): Adjust for this-parameter.

2011-07-21  Per Bothner  <per@bothner.com>

	* ModuleExp.java (classFor): Fix thinko - use String.replace rather
	than String.replaceAll since argument is not a regex.

2011-07-14  Per Bothner  <per@bothner.com>

	* ClassExp.java (checkDefaultSuperConstructor): New method.
	* InlineCalls.java (visitLambdaExp): Use checkDefaultSuperConstructor.
	(visitClassExp): New method.  Call checkDefaultSuperConstructor.

2011-07-12  Per Bothner  <per@bothner.com>

	* SourceName.java: New annotation interface.
	* Makefile.am: Update accordingly.
	* Declaration.java (makeField): If name is a non-simple Symbol (i.e.
	with uri or prefix) or field name doesn't demangle to name, then
	emit a SourceName annotation so we can recover the name.
	* Language.java (declFromField): Check if field has a SourceName
	annotation; if so use that to set the Declaration's name.

2011-07-09  Per Bothner  <per@bothner.com>

	* ClassExp.java (setTypes): Handle ParameterizedType in super-type.
	* InlineCalls.java (checkType):  Handle ParameterizedType in
	required type for SAM-conversion.

2011-06-29  Per Bothner  <bothner@kuling.bothner.com>

	* Language.java (getLangTypeFor): If type is a TypeVariable,
	use getRawType result instead.
	(formatTpe): If name is null, use toString.
	* PrimProcedure.java (resolveTypeVariable): New helper method.
	(<init>): Resolve TypeVariables against ParameterizedType.
	(compile): If method's return type is TypeVariable, use raw type.

2011-06-29  Per Bothner  <bothner@kuling.bothner.com>

	* ClassExp.java (setTypes): Fix error where the same type was added
	twice if ModuleExp.USE_DEFINED_CLASS is set.

2011-06-23  Per Bothner  <bothner@kuling.bothner.com>

	* ModuleExp.java (evalModule): If evalModule1 reports an error,
	then pop any possibly new and erroneous declarations.
	This may fix Savannah bug #32209 "Class verification errors when
	reloading source files" - at least it fixes Charles Turner's
	simple test-case.

2011-06-21  Per Bothner  <bothner@kuling.bothner.com>

	* ConsumerTarget.java (compileWrite): Use stackType,
	which might be a ParameterizedType.
	* Language.java (declFromField): Use getLangTypeFor(Type) method,
	which handles parameterized types.
	* StackTarget.java (compileFromStack0): Use raw types to determine if
	casting is needed

2011-06-16  Per Bothner  <per@bothner.com>

	* Declaration.java (load): Generalize ALLOCATE_ON_STACK to handle
	targets other than StackTarget, plus stack growth by one.
	* ReferenceExp.java (compile): Disable compileWrite optimization
	if ALLOCATE_ON_STACK is set.

2011-06-15  Per Bothner  <per@bothner.com>

	Revert RETURN_ARG0 support.  Instead, use a new way of getting the
	samecode, by having Declaration#load emit a dup with the new
	ALLOCATE_ON_STACK flag is set.  This is simpler, reduces the risk
	of compile-time stack-overflow, has a simpler consistency check,
	and has the potential of recovery to a regular Let variable when the
	the assumptions of using ALLOCATE_ON_STACK aren't satisfied.
	* Declaration.java (ALLOCATE_ON_STACK): Ne flag.
	(load): Handle ALLOCATE_ON_STACK case.
	* LetExp.java (compile): Handle an ALLOCATE_ON_STACK variable.
	* ReferenceExp.java (ALLOCATE_ON_STACK_LAST): New flag.
	* ApplyExp.java: Revert RETURN_ARG0 support.
	* PrimProcedure.java: Likewise.

	* LetExp.java (compile): Re-write to store initial values eagerly in
	left-to-right order, rather than saving on stack and then popping all.
	This is simpler, plus may aid future pattern-matching.
	(compile_rest, needsInit): Removed methods.

	* ApplyExp.java (RETURN_ARG0): New flag.
	(calculateType): Handle RETURN_ARG0.
	(checkSupportedReturnArg0): New method used for consistency checking.
	* PrimProcedure.java (compile): Handle RETURN_ARG0.

2011-05-01  Per Bothner  <per@bothner.com>

	* Declaration.java (initValue): Field new,
	(getInitValue, setInitValue): New methods.
	(ValueSource.getValue): Take declaration parameter. Make non-public.
	* LetExp.java (init): Remove field.  Instead use Declaration's
	initValue field.
	(<init>): Update to not take init array.
	(evalVariable): Take declarations rather than index.
	(apply, store_rest, compile, visitInitializers, print): Update.
	* Compilation.java (letStart, letVariable, letEnter, loopStart):
	Update for new LetExp representation.
	(letEnter, letDone): Change how to detect if letEnter has been called.
	* FindTailCalls.java (visitLetExp): Update for LetExp changes.
	* FindCapturedVars.java (visitLetExp): Likewise.
	* InlineCalls.java (visitLetExp, inlineCall): Likewise.
	* CatchClause.java: Update to match super-class changes.
	* FluidLetExp.java: Likewise.
	* ScopeExp.java (countNonDynamicDecls): Remove no-longer-used method.

	* Declaration.java (<init>): Remove unused protected constructor.
	Implement others in terms of (Object,Type)-taking constructor.

2011-04-18  Per Bothner  <per@bothner.com>

	Implement a data-flow framework, similar to Single Static Assignment.
	* VarValueTracker.java: New class.  Keep track of variable "values".
	* Makefile.am: Update accordingly.
	* Declaration.java (getType): More sophistcated computations.
	If there are multiple possible values, take their union.
	However, use a special case for arithmetic assignments like
	'(set! D (+ D V))' where D is the current Declaration.  In that case
	we can use the type of V, instead of the unknown type of (+ D V),
	to inductively determine the type of D.
	(MAYBE_UNINITIALIZED_ACCESS): New flag.
	(mayBeAccessedUninitialized): New method.
	(numReferences): New field.
	(getLambdaValue): New convenience method.
	* LambdaExp.java (siblingReferences): New field.
	* PushApply.java (visitReferenceExp): Build siblingReferences chain.
	* SetExp.java (valueIndex): New field.
	* Declaration.java (noteValueFromSet): Set valueIndex field.
	* LetExp.java (compile, store_rest): Check if declaration
	mayBeAccessedUninitialized, in which case we need to initialize
	it to undefined_exp.
	* ReferenceExp.java (siblingReferencesNext): New field.
	(calculateType): No longer need to look at type of declaration's value,
	since that is now handled by Declaration#getType.
	* InlineCalls.java (valueTracker): New VarValueTracker field.
	(visitReferenceExp): Check and warn if variable might be uninitialized.
	(visitIfExp): Handle data-flow fork-join.
	(visitModuleExp, visitLambdaExp): Set currentLambda.
	(visitRemainingDeclaredLambdas): New method.
	(visitLetExp, visitSetExp): Note variable setting for data-flow.
	Defer visiting a define LambdaExp.
	(visitLambdaExp): Do some preliminary data-flow from call-sites.
	(inlineCall): Update value source.

2011-04-18  Per Bothner  <per@bothner.com>

	* Declaration.java (addCaller, clearClassList): New methods.
	* ScopeExp.java (clearCallList): New method.
	* FindTailCalls.java (visitApplyExp): Use addCaller method.
	(visitLetExp, visitLambdaExp): Call clearCallList.
	* PushApply.java (visitApplyExp): Use addCaller method.

	* Declarations.java (needsInit) Moved method ...
	* LetExp.java (needsInit): ... to here.
	(compile, store_rest): Update accordingly.

2011-04-17  Per Bothner  <per@bothner.com>

	* Language.java (languages): Add "r5rs", "r6rs", and "r5rs".

	* Declaration.java (<init>): Don't setType if given type is null.
	(printInfo): Get raw type field rather than calling getType.
	(hasUnknownValue): New function.

	* Declaration.java (getValue): Only get value from field if class
	exists already.

	* Declaration.java (getValue): Remove special case to coerce constant
	value to specified type - it doesn't seem to do anything.

	* Declaration.java (noteValue, noteValueConstant, noteValueFromSet,
	noteValueFromLet): Do nothing if value is unknownValueValues.

	* Declaration (class ValueSource):  New kind constant APPLY_KIND.
	(ValueSource.getValue): Handle APPLY_KIND.

2011-04-15  Per Bothner  <per@bothner.com>

	* Compilation.java (letVariable): Use setValue rather than noteValue.

	* FindCapturedVars.java (allocUnboundDecl): Note that the new
	declaration's value is unknown.

	* PushApply.java (visitClassExp): New method.
	See kawa/ChangeLog entry for standard/object.java.

	* AccessExp.java (getName): Check for null symbol field.

2011-04-10  Per Bothner  <per@bothner.com>

	* InlineCalls.java: Update java.dyn to java.lang.invoke to
	match recent JSR-292 changes.

2011-04-03  Per Bothner  <per@bothner.com>

	* ApplyExp.java (setFunction, setFuncArgs, <init>): New convenience
	methods to make it easier to modify an ApplyExp in-place.

	* Compilation.java (walkModule): Do PushApply before InlineCalls.
	(isApplyFunction): New method.
	* PushApply.java (visitApplyExp): Because PushApply is now done before
	ApplyToArgs is optimized away, we have to check for it here.

	* Compilation.java (loopStart): Use more-precise noteValueFromLet.

2011-04-02  Per Bothner  <per@bothner.com>

	* Expression.java (type): New field - cache for getType.
	(getType): Make final - use cache and calculateType.
	(calculateType): New method.
	* BeginExp.java (getType): Replace by calculateType.
	* ClassExp.java: Likewise.
	* ExitExp.java: Likewise.
	* IfExp.java: Likewise.
	* LambdaExp.java: Likewise.
	* LetExp.java: Likewise.
	* ObjectExp.java: Likewise.
	* ReferenceExp.java: Likewise.
	* SetExp.java: Likewise.
	* ThisExp.java: Likewise.
	* TryExp.java: Likewise.
	* LambdaExp.java (type): Field renamed to ...
	(compiledType): new field name.
	* ApplyExp.java (type): Use inherited field instead.
	* QuoteExp.java: Likewise.
	* PushApply.java (visitApplyExp): Reset type field in re-used objects.

2011-03-23  Per Bothner  <per@bothner.com>

	* LetExp.java (body): Make field be package-private.
	* Compilation.java (letVariable): Don't noteValue if the
	value if the special QuoteExp.undefined_exp.
	(letEnter): Handle the case above.
	* Compilation.java (letDone): Call letEnter if not yet done.

2011-03-16  Per Bothner  <per@bothner.com>

	* Compilation.java (letVariable(Declaratiom,Expression)):
	New method overload.

	* Expression.java (makeWhile): Rewrite to make use of the Compilation
	loopStart..loopRepeat methods.
	* Compilation.java (loopStart): Initialize exprStack here
	rather than in loopVariable.

	* FindCapturedVars.java (visitFluidLetExp): Don't warnUndefinedVariable
	if IS_DYNAMIC flag is set.

	* SetExp.java (checkReachable): More informative warning text.

2011-03-07  Per Bothner  <per@bothner.com>

	* SetExp.java (checkReachable): New method.
	(compile): Use it.
	* StackTarget.java (compileFromStack0): Do nothing if not
	reachableHere.
	Fixes Savannah bug#32678 "set! and endless loop".

2011-03-04  Per Bothner  <per@bothner.com>

	* InlineCalls.java (maybeInline): Don't used obsolete
	Methodhandle.invokeExact syntax.

2011-02-20  Per Bothner  <per@bothner.com>

	* InlineCalls.java (visitSetExp): Inline super.visitSetExp and
	visitSetExpValue.
	(visitSetExpValue): Remove no-longer-needed method.
	* ExpVisitor.java (visitSetExp): Inline visitSetExpValue.
	(visitSetExpValue): Remove no-longer-needed method.

2011-01-27  Per Bothner  <per@bothner.com>

	* Declaration.java: Re-write handling of the 'value' Expression.
	There is now an array of ValueSource objects, so there can be multiple
	possible setters remembered, with some useful indirection.
	Preliminary work for supporting Single-Static-Assignment analysis.
	(value): Removed field.
	(nvalues, values): New fields.
	(getValue, NoteValue, setValue): Re-written.
	(class ValueSource): New static member class.
	(getValueraw, noteValueConstant, noteValueUnknown,
	noteValueFromSet, noteValueFromLet, checkNameDecl): New methods.
	* ApplyExp.java: Update to use new methods.
	* ModuleInfo.java: Likewise.
	* ModuleExp.java: Likewise.
	* FindCapturedVars.java: Likewise.
	* ReferenceExp.java: Likewise.
	* SetExp.java (setNewValue): New method.
	* ExpVisitor.java (visitSetExp): Simplify - don't need to update
	declaration's value because new indirection does it automatically.
	* LetExp.java (visitInitializers): Likewise.
	* InlineCalls.java (visitLetExp): Likewise.
	* Compilation.java (letEnter): Update to use ValueSource.

2011-01-25  Per Bothner  <per@bothner.com>

	* Compilation.java (addMainClass): Don't call getConstructor, which
	can caus problems if USE_DEFINED_CLASS with an explicit constructor.
	(generateBytecode): Don't make $instance field be final, since the
	field might be in moduleClass, but initialized in mainClass.

2011-01-24  Per Bothner  <per@bothner.com>

	* LambdaExp.java (getBodyFirstExpression, checkForInitCall):
	New methods, based on logic from ClassExp.
	* InlineCalls.java (visitLambdaExp): Check for some errors in *init*
	methods here, rather than in ClassExp#compile.
	* ClassExp.java (compileMembers, invokeDefaultSuperConstructor):
	Simplify/update accordingly.

	* Compilation.java (makeQuoteExp): New convenience method.

2011-01-19  Per Bothner  <per@bothner.com>

	More changes to separate compile-time from run-time code.
	* Language.java (emitPushBoolean, emitCoerceToBoolean): Move from here
	* Compilation.java (emitPushBoolean, emitCoerceToBoolean): ... to here.
	* Compilation.java (mangleNameIfNeeded, isValidJavaName, mangleName):
	Move from here ...
	* Language.java (mangleNameIfNeeded, isValidJavaName, mangleName):
	... to here.
	* ClassExp.java (slotToMethodName): Update accordingly.
	* ModuleExp.java (makeDeclInModule2): Move from here ...
	* ModuleInfo.java (makeDeclInModule2): ... to here.

2011-01-17  Per Bothner  <per@bothner.com>

	* Language.java (getCompilationClass): New method.
	(getCompilation): Use reflection and getCompilationClass to allocate
	appropriate Compilation-subclass instance.
	Also remove unused Lexer parameter.

2011-01-03  Per Bothner  <per@bothner.com>

	* Compilation.java (typeList, typeConstVector): New fields.

2011-01-01  Per Bothner  <per@bothner.com>

	* ClassExp.java (<init>): Replace by single 2-argument constructor.
	* ObjectExp.java (<init>): Allocation ClassTypes here.

	Add support for combining explicit class (e.g. define-simple-class)
	and module class, if they have eh same name.
	* ClassExp.java (setClassType): New method.
	(<init>): Don't set type or instanceType yet.
	(getClassName): New method.
	* ModuleInfo.java (className): Change to protected.
	* ModuleExp.java (USE_DEFINED_CLASS): New constant.
	(classFor): Improvements to name-setting logic.
	* Compilation.java (generateBytecode): Don't generate constructor
	if module does USE_DEFINED_CLASS.

2010-12-30  Per Bothner  <per@bothner.com>

	* FindCapturedVars.java (getTypeRaw, setType): New method.
	* ExpVisitor.java (visitDeclarationType): Change to protected.
	* Declaration.java (visitDeclarationType):  New method.

2010-12-28  Per Bothner  <per@bothner.com>

	* Compilation.java (typeFieldLocation, typeStaticFieldLocation):
	New static Classtype fields.
	* Declaration.java (load): Use them.
	* ReferenceExp.java (getType): Return more specific Location types.
	* ModuleInfo.java (setupModuleExp): Avoid some needless getInstance
	calls - which caused references to say *print-miser-width* to fail.

2010-12-26  Per Bothner  <per@bothner.com>

	* Declaration.java (compileAnnotations): New method, partially
	based on code from ClassExp#compileMembers, but using new
	RuntimeAnnotationsAttr#maybeAddAnnotation.
	* ClassExp.java (compileMembers): Use Declaration#compileAnnotations.
	Also call compileAnnotations on nameDecl of methods and class itself.
	* InlineCalls.java (visitReferenceExp):  If processingAnnotations()
	treat a reference to a ClassExp as a constant.
	(visitAnnotations): Check if annotation use matches @Target.

2010-12-25  Per Bothner  <per@bothner.com>

	* Declaration.java (isClassMethod, isClassField): New methods.
	* InlineCalls.java: Use isClassMethod.

	* InlineCalls.java (visitQuoteExp): Warning if integer literal
	is out of range.

2010-12-24  Per Bothner  <per@bothner.com>

	* Declaration.java (annotations): New field.
	(numAnnotations, getAnnotation, setAnnotation, addAnnotation):
	New methods.
	(printInfo): Also print out annotations.
	* ClassExp.java (compileMembers): Emit annotations.
	(print): Some tweaks.
	* QuoteExp.java (validateApply): Add error check for if
	MakeAnnotation.makeMethodProc didn't get get inlined.
	* InlineCalls.java (processingAnnotations): New field.
	(processingAnnotations, visitAnnotations): New methods.
	(visitScopeExp): Call visitAnnotations.
	(checkType): If incompatible types, and we're
	processingAnnotations force an error rather than a warning.

	* ExpVisitor.java (getLanguage): New convenience method.

	* ApplyExp.java (inlineIfConstant): Copy line number to result.

2010-12-23  Per Bothner  <per@bothner.com>

	* InlineCalls.java (visitQuoteExp): Generalize handling of conversion
	of integer literals to primitives to also support byte and short.
	Likewise for converting gnu.text.Char constants to char.

2010-11-27  Per Bothner  <per@bothner.com>

	* ModuleBody.java (runAsMain): Only runCleanups at end if
	registerShutdownHook failed.

2010-11-26  Per Bothner  <per@bothner.com>

	* Keyword.java: Update since Symbol constructor args swapped.

2010-11-18  Per Bothner  <per@bothner.com>

	* ClassExp.java (IS_PACKAGE_MEMBER): New flag.
	(setTypes): Set IS_PACKAGE_MEMBER as appropriate.
	(compileMembers): Use IS_PACKAGE_MEMBER to help determine if class
	is a member class, rather than unreliably scanning for '$'.

2010-11-05  Per Bothner  <per@bothner.com>

	* ClassExp.java (setTypes): Tweak logic for setting modifiers.

2010-11-04  Per Bothner  <per@bothner.com>

	* Compilation.java (warnUndefinedVariable, warnUnknownMember,
	warnInvokeUnknownMethod, warnAsError): New static OptionInfo fields.
	Change warnInvokeUnknownMethod to default to warnUnknownMember.
	(warnUndefinedVariable, warnUnknownMember,
	warnInvokeUnknownMethod, warnAsError): New methods.
	* ExpVisitor.java (error): Update to use Compilation#warnAsError.
	* FindCapturedVars.java: Similar, but with warnUndefinedVariable.

	* ClassExp.java (slotToMethodName): Handle an empty sname.

	* FindCapturedVars.java (visitReferenceExp): Fix thinko.

2010-10-28  Per Bothner  <per@bothner.com>

	* Declaration.java (ENUM_ACCESS, FINAL_ACCESS): New flags.
	(VOLATILE_ACCESS): Make sure constant is long.
	(CLASS_ACCESS_FLAGS, FIELD_ACCESS_FLAGS, METHOD_ACCESS_FLAGS):
	New masks.
	(getAccessFlags): Check ENUM_ACCESS and FINAL_ACCESS.

	* QuoteExp.java (print): Print type.

2010-10-24  Per Bothner  <per@bothner.com>

	* Language.java (getTypeFor): Do setCanRead on ClassExp.

2010-10-23  Per Bothner  <per@bothner.com>

	* Language.java (getLangTypeFor): Can simplify now.
	(getTypeFor): Handle ReferenceExp that dereferences to a ClassExp.
	* PrimProcedure.java (<init>): Can simplify.

2010-10-21  Per Bothner  <per@bothner.com>

	* Compilation.java (generateApplyMethodsWithoutContext): Move copying
	of incoming argument to vararms/#!rest array to separate ...
	(varArgsToArray): ... new method.  Generalize so it also works
	for the WithContext case.
	(generateApplyMethodsWithContext): Use varArgsToArray.

2010-10-17  Per Bothner  <per@bothner.com>

	* IfExp.java (getTest, getThenClause, getElseClause): New accessors.

2010-10-15  Per Bothner  <per@bothner.com>

	* QuoteExp.java (validateApply): Pass MethodProc's expected parameter
	type as required type to InlineCalls#visit.

	* Compilation.java (generateApplyMethodsWithoutContext):  When
	allocating a varargs array, make sure to use the implementation type.

	* LambdaExp.java (addMethodFor): Make use of Java5 varargs array
	parameter for any array type, not just Object[].

2010-10-14  Per Bothner  <per@bothner.com>

	* LambdaExp.java (enterFunction): Don't set stackType to object
	just because the parameter is non-simple.

2010-10-11  Per Bothner  <per@bothner.com>

	* ReferenceExp.java (getType): Fix to not return toStringType.
	* InlineCalls.java (visitQuoteExp): Likewise for setting type.
	(checkType): Similarly fix argument to Type#compare.

	* PrimProcedure.java (toString): Check for null retType.

	* BeginExp.java (visitChildren): Move pushOptions/popOptions from
	here ...
	(visit): ... to here, since (for example) InlineCalls#visitBeginExp
	doesn't call BeginExp's visitChildren.

2010-10-09  Per Bothner  <per@bothner.com>

	* Compilation.java (pushPendingImport): Take extra parameter.

	* Compilation.java (mustCompile): Initialize to ModuleExp.alwaysCompile.
	This does the right thing for for Eval for pre-parsed Scheme forms.

	* Language.java (parse): No longer need to check for alwaysCompile.

	* Compilation.java (setSharedModuleDefs): New method.

2010-10-06  Per Bothner  <per@bothner.com>

	Fix Savannah bug# 31251 "defvar", reported by Helmut Eller.
	* QuoteExp.java (SHARED_CONSTANT): New flag.
	(isSharedConstant): New method.
	(makeShared): Two new factory methods - which set SHARED_CONSTANT.
	(undefined_exp, abstractExp, voidExp, trueExp, falseExp, nullExp,
	classObjectExp): Change to allocate using makeShared.
	* InlineCalls.java (visitQuoteExp): Don't patch expression type
	if isSharedConstant is true.
	* ReferenceExp.java (getType): Check for undefined_exp.

	* Inlineable.java (getReturnType): Remove method.  Instead we have a
	default (deprecated) implementation in Procedure.
	* ApplyExp.java (getType): Update accordingly.

2010-10-05  Per Bothner  <per@bothner.com>

	* TypeValue.java (getConstructor): New abstract method.
	* InlineCalls.java (checkType): Make use type nwe convert value method.
	* InlineCalls.java (visitLetExp): Use declaration type, if specified,
	when visiting initializing expresssion.

	* Compilation.java (inlineOk): Tweak 2010-10-01 fix (to Savannah
	bug #31180) to check the nameDecl's isPublic() rather than ignorable().
	This fixes the case when the lambda is only called but not read.
	Fixes Savannah bug #31256 "Verify error".

2010-10-04  Per Bothner  <per@bothner.com>

	* QuoteExp.java (EXPLICITLY_TYPED): New flag.
	(isExplicitlyTyped, setType): New methods.
	* InlineCalls.java (checkIntValue, checkLongValue, fixIntValue,
	fixLongValue): New methods.  Based on code that was in CompileArith.
	(visitQuoteExp): New method.

2010-10-01  Per Bothner  <per@bothner.com>

	Fix Savannah bug #31180 "exception in inline-compiler".
	* Declaration.java (load): Don't try to expand in-place the LambdaExp
	of a module-level functions since that is not inlined.
	See FindCaturedvars#visitLambdaExp.
	* Compilation.java (inlineOk): However, we do want to "inline" call to
	a private module-level procedure as a method call, even when immediate.

2010-09-30  Per Bothner  <per@bothner.com>

	* Compilation.java (langOptions): New field.
	(generateApplet, generateServlet): Remove fields. Instead use
	bits in langOptions.
	(generatingApplet, generatingServlet, sharedModuleDefs): New methods.
	* Language.java (parse): Set langOptions from options parameter.

2010-09-28  Per Bothner  <per@bothner.com>

	* TypeValue.java (emitTestIf): Fix error in javadoc.

	* LambdaExp.java (enterFunction):  If parameter is indirect-binding,
	change Variable's type to Location.

	* FindCapturedVars.java (checkInlineable): Remove unused local.

2010-09-20  Per Bothner  <per@bothner.com>

	* InlineCalls.java (checkType): New method, extracted from visit.
	Do SAM conversion: If the required type has a Single Abstract Method,
	you can use a lambda expression.

	* Language.java (parse): Set mustCompile here as appropriate.
	* ModuleExp.java (evalModule1): Don't need to set it here.

	* InlineCalls.java (visitSetExpValue): Use the raw type of decl,
	rather than using getType, which may force it to Object.

	* ClassExp.java (AbstractMethodFilter): Helper class moved to
	gnu.bytecode.ClassType.
	(compileMembers): Use new gnu.bytecode.ClassType#getAbstractMethods.

	* ClassExp.java (print) Some pretty-printing tweaks.

	* ClassExp.java (addMethod): New convenience method.

2010-09-17  Per Bothner  <per@bothner.com>

	* QuoteExp.java (getInstance): New factory method taking SourceLocator.

	* InlineCalls.java (visit): Pass SourceLocator eror error.

2010-09-16  Per Bothner  <per@bothner.com>

	* ApplyExp.java (visitArgs): Remove version that takes argsInlined.
	* InlineCalls.java (maybeInline): The validateApply methods no
	longer take a boolean argsInlined parameter.

	* Expression.java (VALIDATED): New flag.
	(NEXT_AVAIL_FLAG): Update accordingly.
	(validateApply): Remove no-longer-used argsInlined parameter.
	* ApplyExp.java (visitArgs): New method without argsInlined parameter.
	* LambdaExp.java (INLINE_ONLY): Renumber so it doesn't conflict
	with VALIDATED.
	(validateApply): Update to not use argsInlined.
	* QuoteExp.java: Likewise.
	* ReferenceExp.java: Likewise.
	* InlineCalls.java (visit): Check and set VALIDATED flag.
	Short-circuit if VALIDATED was set.
	(maybeInline):  Remove no-longer-used argsInlined parameter.

2010-09-15  Per Bothner  <per@bothner.com>

	* ModuleExp.java (evalModule1, evalModule2): Use Environment's
	setSaveCurrent/restoreCurrent methods.

2010-09-04  Per Bothner  <per@bothner.com>

	* Compilation.java (inlineOk): In interactive mode don't inline
	non-self calls to top-level functions.
	* LambdaExp.java (visit): Set and restore Compilation's curLambda.
	* ProcInitializer.java (emitLoadModuleMethod): Allow rebinding
	only if there is a Declaration.  (Probably redundant change.)
	* ScopeExp.java (topLevel): New method.

2010-09-02  Per Bothner  <per@bothner.com>

	In interactive mode allow re-binding existing procedures.
	* ProcInitializer.java (emitLoadModuleMethod): If interactive, check
	if there is an existing ModuleMethod binding, and if so re-use it.
	* ModuleMethod.java (init): New method.

2010-09-01  Per Bothner  <per@bothner.com>

	* LambdaExp.java (allocParameters): Remove some obsolate code - we
	no longer use an argsArray solely because we have have > 4 parameters
	in the function method, only apply methods.

2010-08-31  Per Bothner  <per@bothner.com>

	* Compilation.java (fewerClass): Remove unused flag.
	Update accordingly.
	* LambdaExp.java: Likewise.

2010-08-28  Per Bothner  <per@bothner.com>

	* Compilation.java (defaultClassFileVersion):  If JAVA7 is PreProcessed,
	select ClassType.JDK_1_7_VERSION.
	* InlineCalls.java (maybeInline): If use:java.dyn is PreProcess-enabled,
	use a MethodHandle instead of reflection.  Note is compile-time-only.

	Fix verification problem (backward jump between new and constructor).
	* ApplyExp.java (MAY_CONTAIN_BACK_JUMP): New flag.
	* FindCapturedVars.java: Set MAY_CONTAIN_BACK_JUMP if indicated.
	* PrimProcedure.java: Rewrite constructor if it MAY_CONTAIN_BACK_JUMP.

2010-08-27  Per Bothner  <per@bothner.com>

	* InlineCalls.java: Remove check for no-longer used CanInline.
	* CanInline.java: Remove interface.
	* Makefile.am: Update accordingly.

	* InlineCalls.java (maybeInline): Remove support for old inliner API
	found using Procedure.inlineCallsKey.
	(getInlinerMethodArgTypes): Simplify appropriately.

2010-08-26  Per Bothner  <per@bothner.com>

	* InlineCalls.java (maybeInline): Support new inliner methods with
	key Procedure.valiateApplyKey.
	These need an extra required-Type argument.

	Replace ExpWalker expression-visitor API by new ExpVisitor.
	* ExpWalker.java: Removed - replaced by ...
	* ExpVisitor.java:  New generic abstract class.
	* ExpExpVisitor.java: New convenience class extends ExpVisitor.
	* PushApply.java: Change to extend ExpExpVisitor.
	* ResolveNames.java: Likewise.
	* FindCapturedVars.java: Likewise.
	* ChainLambda.java: Extend ExpVisitor, and change to pass
	current scope as parameter rather than field.
	* FindTailCalls.java: Likewise pass in returnContinuation.
	* InlineCalls.java: Likewise, passing in "expected type".
	The beginnings of a general type-checking framework.
	* Expression.java (walk(ExpWalker,D)): Replace by ...
	(visit(ExpVisitor,D)): new method.
	(walkChildren(ExpWalker)): Replace by ...
	(visitChildren(ExpVisitor,D): New method.
	(inline): Replace by ...
	(validateApply): New method.
	* ApplyExp.java, BeginExp.java, BlockExp.java, CatchClause, ClassExp.java, ExitExp.java, FluidLetExp.java, IfExp.java, LambdaExp.java, LangExp.java, ModulExp.java, ObjectExp.java, ReferenceExp.java, ScopeExp.java, ThisExp.java, TryExp.java, SetExp.java, SynchronizedExp.java: Update accordingly.

2010-08-26  Per Bothner  <per@bothner.com>

	* LambdaExp.java (getClassType): new method.
	* ClassExp.java (getClassType, getType): New overriddes.
	* ObjectExp.java (getType): New override.
	* Language.java (getTypeFor): Use getClassType for ClassExp.

	* Language.java (formatType): Return getName rather than toString.

2010-08-20  Per Bothner  <per@bothner.com>

	* BindingInitializer.java (emit): Update for renamed method.

	* FluidLetExp.java (doInits, compile): Update since
	setWithSave/setRestore no longer take CallContext argument.

2010-08-19  Per Bothner  <per@bothner.com>

	* CompiledModule.java: Update to use new Environment-setting methods.
	* SetExp.java: Likewise.
	* Expression.java: Likewise.
	* KawaScriptEngine.java: Likewise.
	* ReferenceExp.java: Likewise.
	* Declaration.java (load): If this is a fluid variable declaration,
	then load the base Declaration instead.
	* FindCapturedVars.java (maybeWarnNoDeclarationSeen): New method.
	(walkFluidLetExp, walkReferenceExp): Call it.
	(walkReferenceExp): Remove recent code to handle fluids.
	(capture): If this is a fluid, capture base instead.
	* BindingInitializer.java (emit): If declaration is fluid,
	create anonymous ThreadLocation instead.

2010-08-17  Per Bothner  <per@bothner.com>

	* FindCapturedVars.java (walkReferenceExp): If the declaration is
	a fluid in a different function, treat as dynamic.

2010-08-07  Per Bothner  <per@bothner.com>

	* ModuleContext.java (table): Change from using WeakHashMap to
	ClassToInstanceMap, a new sub-class of AbstractWeakHashTable.
	This fixes a memory leak reported by Daniele Benegiamo.
	(ClassToInstanceMap): New member class, extends AbstractWeakHashTable.

	* ModuleInfo.java (class ClassToInfoMap): Change to member class.
	Remove default constructor.
	(ClassToInfoMap.matches): Fix - parameter should be key type,
	not value type.

2010-08-06  Per Bothner  <per@bothner.com>

	* LambdaExp.java (throwsSpecification): Change to Expression array.
	(addMethodFor): Better error checking of throws specification.
	Allow a constant class in a throws specification - the name of
	a constant class would now resolve to a QuoteExpr of a Class.
	Fixes bug reported by John Whittaker <john.whittaker@sbcglobal.net>.

	* LambdaExp.java (walkChildrenOnly): Also walk throwsSpecification.

	* ExpWalker.java (walkExps): Allow a null argument.
	(walkDefaultArgs): No longer need null check here.

	* ClassExp.java (declareParts): Add null check, in case of error.

2010-08-02  Per Bothner  <per@bothner.com>

	* ModuleInfo.java: Add synchronized qualifiers.

	* ModuleContext.java: Add synchronized qualifiers as needed.
	* ModuleManager.java: Likewise.

	* InlineCalls.java (maybeInline): Do the property-lookup
	stuff inside a synchronized block, since we cache the method.

2010-08-01  Per Bothner  <per@bothner.com>

	* FindCapturedVars.java (allocUnboundDecl): Set IS_SINGLE_VALUE.

	* LetExp.java (compile): Only allocateVariable if isSimple.

	* Compilation.java: Fix calls to deprecated 2-argument
	version of ClassType.make.

	* Compilation.java (pendingImports, exprStack, callInitMethods):
	Add generic type parameters to avoid "unchecked" warning.

	* Language.java (setDefaultLanguage): Rename to setCurrentLanguage.
	(setSaveCurrent, restoreCurrent): New convenience methods.
	(setDefault, eval): Update accordingly.
	* CompiledModule.java (evalModule): Likewise.
	* KawaScriptEngine.java (compile): Likewise.

	* Compilation.java (setSaveCurrent, restoreCurrent):
	New convenience methods.
	(process): Use it.
	* ResolveNames.java (resolveModule): Likewise.
	* ModuleExp.java (evalModule1): Likewise.

	Fixes race condition reported by Daniele Benegiamo.
	* Compilation.java (current): Change from ThreadLocation to
	InheritableThreadLocal.  Using ThreadLocation would be ok, but
	only if we used the proper fluid protocol for thread-local setting.
	The problem is that ThreadLocation by default shares with parent.
	There doesn't seem to be much use for that.
	* Language.java (current): Likewise.
	(global): New static, to provide a default for getDefaultLanguage.

2010-07-31  Per Bothner  <per@bothner.com>

	* Language.java (declFromField): Set IS_DYNAMIC if field
	type is ThreadLocation.

2010-07-05  Per Bothner  <per@bothner.com>

	* LitTable.java (emit): For backward compatibility for we prefer
	Symbol's 'make' method over 'valueOf' - they differ in argument order.

2010-06-29  Per Bothner  <per@bothner.com>

	* ModuleInfo.java (checkCurrent): Make sure to set lastModifiedTime
	even if there is no class yet.

2010-05-19  Per Bothner  <per@bothner.com>

	* Keyword.java (keywordNamespace): Namespace constructors are
	now protected; use factory method instead.

2010-05-07  Per Bothner  <per@bothner.com>

	Avoid writing imported "source" class if current.  I.e. if required
	using a source file name, we parse it to check for dependencies.
	* Compilation.java (explicit): New boolean.
	(process): Don't compile and write class if class is current.
	* Language.java (PARSE_EXPLICIT): New flag.
	(parse): Set Compilation#explicit if PARSE_EXPLICIT set.
	* ModuleInfo.java (checkCurrent): Don't quickly return true if comp is
	non-null (callers should check comp instead to guard against cycles).
	However, do quickly return false if classname is null.

2010-05-06  Per Bothner  <per@bothner.com>

	Fix issue where required modules inherit --aplet and --servlet options.
	* Compilation.java (generateAppletDefault, generateServletDefault):
	Remove static fields.
	* Language.java (PARSE_FOR_APPLET, PARSE_FOR_SERVLET): New flags.
	(parse): Use these to set Compilation.generateApplet
	and generateServlet.

2010-04-18  Per Bothner  <per@bothner.com>

	* ModuleContext.java (flag): New field.
	(IN_HTTP_SERVER, IN_SERVLET): New flags.
	(getFlags, setFlags, addFlags): New methods.
	* ModuleInfo.java (cleanupAfterCompilation): New convenience methods.

2010-04-05  Per Bothner  <per@bothner.com>

	* ModuleExp.java (evalModule1): Call module resolve and walk using
	Compilation 'process' mechanism.  This makes things both simpler
	and more robust in different scenarios, such as servlets.
	* Compilation.java (addMainClass): Don't set mustCompile - we shouldn't
	be calling addMainClass otherwise.

2010-04-02  Per Bothner  <per@bothner.com>

	* TryExp.java (apply): Add support for interpreting catch-clauses.
	(mustCompile): Now always return false.
	* CatchClause.java: Noew extends LetExpr.
	(evalVariable): New hook to get exception passed from TryExpr.apply.
	* LetExp.java (evalVariable): New hook.

2010-03-01  Per Bothner  <per@bothner.com>

	* KawaScriptEngine.java: Fix typo.

2010-02-23  Per Bothner  <per@bothner.com>

	* CompiledModule.java (evalModule(Environment,OutPort)): New method.
	Partly moved from removed kawa.standard.load#loadSource.

2010-02-21  Per Bothner  <per@bothner.com>

	* ModuleInfo.java (className): Make private.
	(getClassName): New method, uses same logic as getClassType.
	(setClassType): New method.
	* ModuleManager.java: Update accordingly.
	(searchWithClassName): Use getClassName(), which works better than
	searching with just the className field, and is the purpose of
	this particular exercise.
	* ModuleContext.java: Update accordingly.
	* Compilation.java: Update accordingly.
	* ModuleExp.java (evalModule2): Avoid code duplication by using
	ModuleContext's findInstance method.
	Do ClassMemberLocation.defineAll if we're loading a class file.

	* CompiledModule.java: New class, encapsulates a compiled module.
	* Makefile.am:  Update accordingly.
	* KawaScriptEngine.java (class KawaCompiledScript): Use CompiledModule
	class to replace two old fields.
	(eval): Re-write to use CompiledModule.

	* ModuleExp.java (evalModule2): Remove unused parameter.

	* ModuleContext.java (clear): New method.

2010-02-16  Per Bothner  <per@bothner.com>

	* ModuleExp.java (evalModule2): Invoke run() for all Runnables, not
	just ModuleBody.  However, do check the runDone field.
	Note there is no need to check staticInitRun - in that case
	the ModuleBody does not implement Runnable.

2010-01-18  Per Bothner  <per@bothner.com>

	* Language.java (loadClass): Only catch ClassNotFoundException
	during Class.forName - not for possibly-inferior class loading.

2009-12-13  Per Bothner  <per@bothner.com>

	* Declaration.java (makeField): Don't set STATIC on a field initialized
	in the run method, even if it is constant.
	* SetExp.java (compile): Re-arranges cases, since shouldEarlyInit()
	is now also true for ClassExp-valued Declaration.

2009-12-06  Per Bothner  <per@bothner.com>

	* GenericProc.java (addAtEnd): New method.
	(add): Re-implement by calling addAtEnd and then adjusting.
	(setProperty): New method.
	(makeWithoutSorting): New factory method.

2009-12-02  Per Bothner  <per@bothner.com>

	* LetExp.java (apply): Restore old value of evalFrames[level].
	This is normally null, but not always when we deal with TemplateScope
	and other weird scope.
	Fixes bug reported by Jamison Hope <jrh@theptrgroup.com>.

2009-12-01  Per Bothner  <per@bothner.com>

	* FindTailCalls.java (walkClassExp): Don't setCanRead.
	* ModuleExp.java (allocFields): Remove special case for ClassExp.
	* FindCapturedVars.java (walkLambdaExp): Don't inline a named
	module-level function, even if we can.
	(capture): Needs lexical link even if can-call, not just can-read.
	* ClassExp.java (HAS_SUBCLASS): New flag.
	(<init>): Don't setCanRead.  Don't create PairClassType - yet.
	(setTypes): Don't need to create PairClassType the class is private
	and has no sub-classes.

2009-11-04  Per Bothner  <per@bothner.com>

	* ModuleExp.java (compilerAvailable): New static flag.
	(alwaysCompile): Initialize to compilerAvailable.
	* Compilation.java (mustCompileHere): Emit error message
	if compilerAvailable is false.
	(pushScope): Don't force compilation for LambdaExp if
	compiler is not available.

	* InlineCalls.java (walkTryExp): New method - optimize trivial case.

2009-11-01  Per Bothner  <per@bothner.com>

	* Declaration.java (flags): Chaneg from int to long.
	(getFlag, setFlag, printInfo): Update accordingly.
	* LambdaExp.java (compileAsMethod): Update accordingly.
	(VOLATILE_ACCESS, TRANSIENT_ACCESS): New flags.
	(getAccessFlags): Re-write to support new flags.

	* FindCapturedVars.java (capture): More informative warning about
	needing static link - and don't warn for ObjectExp.
	(walkClassExp): Remove now-redundant warning.

2009-10-31  Per Bothner  <per@bothner.com>

	* ModuleExp.java (isStatic):  Make static modules be the default.
	(evalModule2): Don't execute run if staticInitRun().
	(allocFields): Change/simplify logic to use shouldEarlyInit.
	* Declaration.java (shouldEarlyInit): New method.
	(setSyntax): Also set EARLY_INIT flag.
	(makeField): Only assign field to literal if field is static.
	Use shouldEarlyInit instead of testing EARLY_INIT.
	* SetExp.java (compile): Some re-orginization using shouldEarlyInit.
	* ModuleBody.java (runAsMain): Remove questionable and apparently
	no-longer-needed call to ClassMemberLocation.defineAll.

	* Declaration.java (isCompiletimeConstant): New method.
	(isStatic): Use it.

	* Compilation.java (generateBytecode): Generate call to run method
	if --module-static-run, even if immediate.

	* Compilation.java (pushNewModule): Set SUPERTYPE_SPECIFIED
	for if generateServlet.

	* Compilation.java (MODULE_NONSTATIC, MODULE_STATIC_DEFAULT,
	MODULE_STATIC, MODULE_STATIC_RUN): New constants.
	* ModuleExp.java (isStatic, staticInitRun): Use new constants.

2009-10-28  Per Bothner  <per@bothner.com>

	* PrimProcedure.java (compile): Handle passing a static link from a
	constructor when it calls another (this) constructor.
	in a class that takes a static link.
	Fixes bug reported 10/26 by Yaroslav Kavenchuk.

	* ApplyExp.java (compile): Return if inlineCompile throws an
	exception.  This avoids errors due to compiling twice.

2009-10-17  Per Bothner  <per@bothner.com>

	* InlineCalls.java (walkLambdaExp):  Don't compare getType of
	this-paramater with null - since getType is never null.
	This caused the type of this to incorrectly be objectType.

2009-10-12  Per Bothner  <per@bothner.com>

	* Language.java (unionType): New method.
	* IfExp.java (getType): Use unionType.

2009-10-11  Per Bothner  <per@bothner.com>

	* Declaration.java (type, typeExp): This are now initially null,
	unless the type is specifier.  The get set by type inference or
	the first getType access.  This allows better type inference.
	(<init>(Object)): Set name but not type as null.
	(getValue): Coerce/override type of value.
	* InlineCalls.java (walkScopeExp): New method.
	* ModuleExp.java (evalModule2): Simplify the Declaration->Location
	import.
	* ApplyExp.java (inlineIfConstant): Set type of resulting QuoteExp.
	* ExpWalk.java (walkDeclarationType): Get "raw" typeExp.

2009-10-09  Per Bothner  <per@bothner.com>

	* Declaration.java (setTypeExp): Simplify/generalize by using
	Language.getTypeFor.

	* Declaration.java (isStatic):  Tweak previous change.

2009-10-08  Per Bothner  <per@bothner.com>

	* Declaration.java (isStatic):  Also static if a compiler-time constant.
	This reduces errors from FindCapturedVars.capture.
	(makeField): Simplify accordingly.

2009-09-30  Per Bothner  <per@bothner.com>

	* Declaration.java (load): Create FieldLocation if this is indirect
	and DONT_DEREFERENCE, rather than using CREATE_FIELD_REFERENCE.
	(maybeIndirectBinding): New method.
	(makeField): Only setIndirectBinding if immediate.  (It may have
	been set previously if maybeIndirectBinding was called.)
	Also, never set field type to gnu.kawa.reflect.FieldLocation.
	* ModuleInfo.java (setupModuleExp): ..
	* Language.java (declFromField): Only set name from value if final.
	* ModuleInfo.java (makeDeclInModule2); Don't set CREATE_FIELD_REFERENCE.
	* ReferenceExp.java (CREATE_FIELD_REFERENCE): Remove - no longer used.

2009-09-29  Per Bothner  <per@bothner.com>

	* GenericProc.java (getMethod, getMethodCount): New methods.
	* PrimProcedure.java (disassemble): Add support for GenericProc.
	Recover more cleanly from anonymous functions.

	* PrimProcedure.java (disassemble, disassemble$X): New static methods
	to help with debugging.

2009-09-26  Per Bothner  <per@bothner.com>

	* QuoteExp.java (getRawType): New method.

2009-09-15  Per Bothner  <per@bothner.com>

	* StackTarget.java (compileFromStack0): Use new
	Type.emitConvertFromPrimitive this allows use to change the default
	mapping int->java.lang.Integer but optimize when we need IntNum.

	* InlineCalls.java (maybeInline): Check for InvocationTargetException.

	* Language.java (coerceToObject(int)): Rmeove method.

	* ApplicationMainSupport.java: New class.
	Contains code moved from ModuleBody and repl.
	* Makefile.am: Update accordingly.
	* ModuleBody.java (commandLineArgArray, commandLineArguments,
	processArgs, setArgs): Move to ApplicationMainSupport.
	* Compilation.java (generateBytecode): Update accordingly.

2009-09-14  Per Bothner  <per@bothner.com>

	* CheckedTarget.java (getInstance(Declaration)): New factory method.
	* Expression.java (compile): Use new method.
	* LetExp.java (compile): Use new method for better errors.

2009-08-27  Per Bothner  <per@bothner.com>

	* ModuleBody.java (exitIncrement, exitDecrement, exitCounter):
	Moved to here from kawa.repl, since needed for kawart.jar.

	* ModuleBody.java (setArgs, commandLineArgArray, commandLineArguments):
	Moved to here from kawa.repl, since these are needed for kawart.jar,
	but kawa.repl doesn't belong in kawa.repl.

	* InlineCalls.java (maybeInline): On exception, setCause on re-trow.
	* ApplyExp.java (compile): Likewise.

	Avoid creating and setting unused fields, primarily for LambdaExp
	and ClassExp.  Don't compile function if ignoring it.  One goal
	is to not generate code for module-local macros.
	* SetExp.java (compile): Check ignorable(), and don't special-case
	for ClassExp.
	* LambdaExp.java(compile): Also immeditely return if IgnoreTarget.
	(allocMethod): New method, pulled from allocChildMethods.
	(allocChildMethods): Only allocMethod if nameDecl != null; do so
	lazily for anonymous lambda.
	(compile, compileSetField): May need to allocMethod at this time.
	* BindingInitializer.java (create): If we don't have a field (which
	is now more likely) use different logic to decide <init? vs <clinit>.
	(emit): If decl is ignorable, compile value with Ignore target.
	* Declaration.java (load): If this is ignorable, compile value instead.
	(makeField): Don't create field if ignorable().

	* LambdaExp.java (side_effects): New method.

	* PrimProcedure.java (sideEffectFree): New field.
	(isSideEffectFree, setSideEffectFree): New methods.
	* ApplyExp.java (side_effects): New method.
	(compile): If target is Ignore and we're calling a side-effect-free
	known Procedure, just compile arguments with an Ignore target.

2009-08-23  Per Bothner  <per@bothner.com>

	* InlineCalls.java (maybeInline): Also check Procedure.inlineCallsKey.

	* LambdaExp.java (setCoercedReturnValue): Moved from Convert.
	* Compilation.java (makeCoercion*2): Moved from Convert.
	* InlineCalls.java: Update accordingly.

	* ApplyExp.java (asInlineable, inlineCompile): New static methods.
	(compile): Support use of LazyPropertyKey Procedure.compilerKey.
	* QuoteExp.java (inline): Generalized to use ApplyExp.asInlineable.

2009-08-19  Per Bothner  <per@bothner.com>

	* ModuleInfo.java (checkCurrent): We're always current if we're
	currently compiling this module - i.e. comp!=null.

2009-08-12  Per Bothner  <per@bothner.com>

	* InlineCalls.java (maybeInline): See if Procedure implements
	CanInline *or* it has an "inliner" property, and if so apply it.
	* QuoteExp.java (inline): Call maybeInline.

	* StackTarget.java (compileFromStack0): When checking if cast is
	needed, use implementation types.

	* ClassExp.java (declareParts): Check for duplicate field names.

2009-08-08  Per Bothner  <per@bothner.com>

	* FindTailCalls.java (walkApplyExp): Comment out bogus optmization.

2009-07-14  Per Bothner  <per@bothner.com>

	Fix for Savannah bug #27014 "AND vs. VOID".
	* IfExp.java (select): New method.
	* InlineCalls.java (walkIfExp): Use select.
	Handle (with warning) the case when the condition has void type.

	* LitTable.java (emit): For Values instances, we want to use the
	constructor, rather than "make" as the latter's return type is Object.
	Also, don't call readResolve for Values instances.

2009-07-08  Per Bothner  <per@bothner.com>

	* ModuleInfo.java (checkCurrent): Fix thinko for case when
	moduleClass is null and className is non-null - before we used a
	stale value of hasClass.

2009-07-07  Per Bothner  <per@bothner.com>

	Fix for Savannah bug #24249 "Local define miscompiled".
	* LambdaExp.java (compileEnd): No longer do generateApplyMethods
	in compileEnd, because of generateBytecode change.
	(compileAsMethod): Update to explicitly call generateApplyMethods.
	* ApplyExp.java (compile): Likewise.
	* ClassExp.java (compileMembers): Likewise.
	* Compilation.java (generateBytecode): Call compileEnd right after
	compileBody, so that to child function bodies are compiled before
	we do dumpInitializers.  However, generateApplyMethods has to be done
	later, which is why it was moved out of compileEnd.

	* LambdaExp.java (compileEnd): Call single-argument version of
	generateConstructor.

2009-07-05  Per Bothner  <per@bothner.com>

	Fix Savannah bug #26940 "Compiler stuck in endless loop".
	* FindTailCalls.java (walkApplyExp):  Don't set inlineHome
	from tailCallers.
	* FindCapturedVars.java (checkInlineable): Instead set it here.
	* ScopeExp.java (nestedIn): New method.

2009-06-28  Per Bothner  <per@bothner.com>
	    Helmut Eller  <eller.helmut@gmail.com>

	Compile to tail-calls and do inlining more widely.
	* LambdaExp.java (tailCallers): New field.
	(returnContinuation): Generalize - need not be an ApplyExp.
	* FindTailCalls.java (returnContinuation): New state variable.
	(inTailContext): Replace field by method using returnContinuation.
	(walkApplyExp): We now allow inlining a function with multiple calls
	and multiple mutually recusive functions if they have the same (static)
	continuation.
	(walkBlockExp): New method.
	(walkLetDecls): New method factored out from walkLetExp.
	(walkDecls): Rename to postWalkDecls.
	(walkLambdaExp): Actual determination of inlinability deferred
	to FindCapturedVars.walkLambdaExp.
	* FindCapturedVars.java (checkInlineable): New method - does actual
	determination of inlineability.
	(walkLambdaExp): Set inlineability based on checkInlineable.
	* ApplyExp.java (compile): If we've already compiled/inlined this
	method, then just push arguments and jump to start of body.

	* Compilation.java (mangleNameIfNeeded): Allow null.

2009-06-08  Per Bothner  <per@bothner.com>

	* ModuleExp.java (evalModule1): Remove unused CallContext parameter.
	(evalModule): Update accordingly,
	* KawaScriptEngine.java (compile): Likewise.

2009-05-30  Per Bothner  <per@bothner.com>

	* LitTable.java (writeObject, emit): Add support for Pattern literals.

2009-05-17  Per Bothner  <per@bothner.com>

	Add support for JSR-223 scrpting (javax.script).
	* AbstractScriptEngineFactory.java: New class.
	* KawaScriptBindings.java: New class.
	* KawaScriptEngine.java: New class
	* Makefile.am: Update accordingly.
	* ModuleExp.java (evalModule1, evalModule2): Create/find instance
	in evalModule2, rather than evalModule1.

2009-05-15  Per Bothner  <per@bothner.com>

	Fix bug reported by Alex Mitchell <alexm@nus.edu.sg>.
	* Language.java (PARSE_CURRENT_NAMES): New flag, to split the old
	functionality of PARSE_IMMEDIATE into two parts.
	(PARSE_FOR_EVAL): Old combined functionality.
	(parse(Inport,SourceMEssages,int,ModuleInfo)): New method.
	(parse): Check PARSE_CURRENT_NAMES.
	(eval): Use PARSE_FOR_EVAL rather than PARSE_IMMEDIATE.
	* Compilation.java (process): If immediate create ClassLoader here.
	(usedClass): Above change allows simplification here.
	* ModuleExp.java (evalToClass): Don't create ArrayClassLoader here.

2009-04-21  Per Bothner  <per@bothner.com>

	* Compilation.java (makeRunnable): New method.
	(addMainClass): Use makeRunnable.
	(generateBytecode): If staticInitRun, we don't implement Runnable,
	so find run method in ModuleBody rather than Runnable.
	* ModuleInfo.java (getCompilation): New method.

	* Compilation.java (generateBytecode): The $instance field should have
	type moduleClass, not mainClass.  (Not that it matters, since there
	are other problems combining module-extends with static modules.)

	* BindingInitializer.java (emit): Revert 2009-04-18 - no longer needed.
	* Compilation.java (compileConstant): If compiling a ClassType with
	Class as the expected type, do loadClassRef to get the Class.

2009-04-18  Per Bothner  <per@bothner.com>

	* BindingInitializer.java (emit): If the value is a ModuleExp,
	use loadClassRef to load the Class instead.
	* ModuleExp.java (allocFields): Don't allocFieldFor a ModuleExp.

	* Compilation.java (loadClassRef): Prefer Java5 class literal.

2009-04-16  Per Bothner  <per@bothner.com>

	* InlineCalls.java (walkSetExp): Error if unknown type specified.

2009-03-15  Per Bothner  <per@bothner.com>

	* ClassExp.java (classNameSpecifier): New field.
	(setTypes): If classNameSpecifier is set use it to generate class name.

	* ClassExp.java (getJavaName): Remove unused method.

	* ModuleExp.java (getJavaName): Remove unused method.

2009-03-14  Per Bothner  <per@bothner.com>

	* ModuleExp.java (evalModule): Remove duplicate comp.addMainClass call.

2009-03-13  Per Bothner  <per@bothner.com>

	* ReferenceExp.java (valueIfConstant): Check for binding.getValue()
	being null.

2009-02-27  Per Bothner  <per@bothner.com>

	* NameLookup.java (getInstance, setInstance): New methods.
	(getLanguage, setLanguage): New methods.
	* Language.java (getCompilation): Change to also pass NameLookup.
	(parse): Get "session" NameLookup instance in immediate mode.
	* ModuleExp.java (evalModule): Run compiled body before trying to
	set values in Environment.
	* Compilation.java: Remove 3 unused constructors.
	* LambdaExp.java (allocFieldFor): In imediate mode, field
	may need to be public.
	* Declaration.java (makeField): Likewise.
	* ScopeExp.java (countNonDynamicDecls): New method.

	* NameLookup.java (removedSubsumed): Remove hidden declarations.
	(subsumedBy): New method used by removedSubsumed.

2009-02-25  Per Bothner  <per@bothner.com>

	* ModuleInfo.java (class ClassToInfoMap): New class.
	(mapClassToInfo): Use ClassToInfoMap instead of WeakHashMap.
	* ModuleManager.java: Update accordingly.
	* NameLookup.java: Update GeneralHashTable with generics.
	Make sure to use AbstractHashTable.hashToIndex where needed.

2009-01-14  Per Bothner  <per@bothner.com>

	* BuiltinEnvironment.java: Minor javadoc fix.
	(<init>): Make constructor private, since this is a singleton class.

	* LambdaExp.java (Closure.apply): Check for null body, which can
	happen if a syntax-case macro calls a function in the same module.

2008-12-29  Per Bothner  <per@bothner.com>

	* TryExp.java (getFinallyClause): New accessor method.
	* ExpWalker.java (exitValue): Make protected.
	(getExitValue): New accessor method.

2008-12-27  Per Bothner  <per@bothner.com>

	* TryExp.java (compile): Various tweaks to handle StackMapTable.
	* BlockExp.java: Re-write to use ExitableBlock.
	* ExitExp.java: Likewise.
	* FluidLetExp.java: Minor tweak to enable an optimization.
	* LambdaExp.java (enterFunction): Use new noteStartFunction method.
	* IfExp.java (compile): Update for ExitExp changes.
	* Compilation.java (defaultClassFileVersion): Change to
	ClassType.JDK_1_6_VERSION if JAVA6 is selected.
	(generateMatchMethods): Need to explicitly note type-state for loop.
	* Declaration.java (load): Update for exception handling changes.
	* CheckedTarget.java (emitCheckedCoerce): Likewise.

	* LambdaExp.java (enterFunction): Use new emitArrayLoad variant.

	* LambdaExp.java (compile): Commment out bit-rotted and never-finished
	usingCPStyle support.

2008-12-23  Per Bothner  <per@bothner.com>

	* Compilation.java (generateApplyMethodsWithContext,
	generateApplyMethodsWithoutContext): Skip a 'this' parameter.

2008-11-18  Per Bothner  <per@bothner.com>

	* PrimProcedure.java (isAppicable): For Java5-style VARARGS
	allow last argument as an array *or* an argument list.
	(compileArgs): Likewise improved VARARGS handling.

	* LitTable.java (emit): Handle array Class objects.

2008-11-16  Per Bothner  <per@bothner.com>

	* ModuleExp.java (evalToClass): Use ObjectType.getContextClassLoader.

2008-11-13  Per Bothner  <per@bothner.com>

	* SetExp.java (canUseInc): New static method, to check if we
	can use the iinc instruction.
	(BAD_SHORT): New constant.
	(compile): Use canUseInc; if OK, do emitInc.
	* ApplyExp.java (compile):  If tail-recursing increments a parameter
	variable, try to use the 'iinc' instruction.  This requires ...
	(pushArgs, popParams): hanges, so we can maybe emit iinc.
	* ReferenceExp.java (valueIfConstant): New method.

2008-10-26  Per Bothner  <per@bothner.com>

	* Expression.java (isSingleValue): New method.
	* ReferenceExp.java (isSingleValue): New method.

2008-10-24  Per Bothner  <per@bothner.com>

	Implement framework for inline-by-copying Expressions.
	(It was intended for optimizing call/cc, but there may be a better
	way of doing that, so we probably won't use it for now.)
	* Expression.java (deepCopy): New method.
	* ApplyExp.java (deepCopy): New method.
	* ExitExp.java (deepCopy): New method.
	* QuoteExp.java (deepCopy): New method.
	* ReferenceExp.java (deepCopy): New method.
	* LambdaExp.java (ATTEMPT_INLINE): New flag.
	(inline): If ATTEMPT_INLINE is set, try to inline by deep-copying.
	(compileAsMethod):  If we inlined, then primMethods may be null.
	* InlineCalls.java (inlineCalls): New static method, based on inlining
	logic from walkApplyExp, but generalized to use deepCopy when needed.

	* BlockExp.java (setLabel): New method.
	(print): Print space before label.

2008-09-08  Per Bothner  <per@bothner.com>

	* LambdaExp.java (addMethodFor): Don't call declareThis here, since
	that creates a Scope and Variable before we even create the
	corresponding CodeAttr, which if nothing else is ugly and confusing.
	(allocChildClasses): Instead call declareThis here.

2008-09-06  Per Bothner  <per@bothner.com>

	* ApplyExp.java: Update to use maybe-correct SwitchState code in
	unfinished usingCPStyle() code.
	* Compilation.java (generateBytecode): Likewise.
	(generateApplyMethodsWithContext, generateApplyMethodsWithoutContext,
	generateMatchMethods):  Use new startSwitch method.

2008-09-05  Per Bothner  <per@bothner.com>

	* SeriesTarget.java: Removed class.  The optimization requires
	jsr/ret, which isn't compatible with Java6 StackMapTable.
	Re-writing to use an integer and a switch to return to the caller
	may be possible, but seems difficult.  Probably not worthwhile.
	* Makefile.am: Update accordingly.
	* Declaration.java (load): Remove special handling for SeriesTarget.
	* Compilation.java (compileConstant): Likewise.

2008-07-25  Per Bothner  <per@bothner.com>

	* ReferenceExp.java (TYPE_NAME): New flag.

2008-06-20  Per Bothner  <per@bothner.com>

	* ClassExp.java (declareParts): Semi-redundantly set the outer link
	of a method.  This fixes another part of Savannah bug #23606.

2008-06-19  Per Bothner  <per@bothner.com>

	* LambdaExp.java (primBodyMethods): New field, so we don't step
	on primMethods for methods in pair classes.  This fixes a part
	of Savannah bug #23606.

	* ClassExp.java (declareParts): Check for static method.

2008-06-11  Per Bothner  <per@bothner.com>

	* InlineCalls.java (walkSetExp): New method.  Check that we don't
	try to assign to a method.
	(walkReferenceExp): Check that we don't try to access a method as a
	variable - which isn't supported yet.
	This fixes Savannah bug #23534: '"uninitialized register 10"
	(VerifyError) when accessing globals from method within
	define-simple-class'.

2008-06-01  Per Bothner  <per@bothner.com>

	* Compilation.java (javaIntegerType, scmPairType, scmNamedType):
	Remove no-longer used fields.

	* PrimProcedure.java (matchN, compileArgs): Also check for new
	LangObjType.listType.

	* Compilation.java (loadClassRef): Fix classname used when emitting
	code to load a Class not using Java5 class literals.

	* Compilation.java (defaultClassFileVersion): Fix PreProcess typo.

2008-05-31  Per Bothner  <per@bothner.com>

	* Language.java (getTypeFor): If we have a quoted Type/Class use that
	as is, rather than passing it though getTypeFor(Object,boolean).
	E.g. if someone explicitly writes a class like java.lang.String use
	the plain ClassType rather than try to map it to toStringType or
	generally a LangObjType.

2008-05-18  Per Bothner  <per@bothner.com>

	* PrimProcedure.java (takesVarArgs): Also true if VARARGS flag set.
	* LambdaExp.java (addMethodFor): If #!rest type is Object[] and we're
	generate a JDK_1_5 or newer classfile, set VARARGS flag instead of
	appending "$V" to method name.

	* Compilation.java (defaultClassFileVersion): New constant.
	(addClass): Use defaultClassFileVersion.

2008-05-11  Per Bothner  <per@bothner.com>

	* ModuleInfo.java (checkCurrent): Return true if no source path.

	* ModuleInfo.java (checkCurrent):  Fix/rewrite for indirectly
	imported modules, when we may checkCurrent multiple times.
	* Compilation.java (cleanupAfterCompilation): Clear module's body,
	but not minfo.exp itself, so we have the actual list of Declarations,
	if a module is re-required.

2008-05-10  Per Bothner  <per@bothner.com>

	* Compilation.java (useClass): Call new addClass(ClassType) method,
	regardless of whether class isExisting(), because the class might be in
	a not-yet-loadable ClassType in a separate immediate-compiled module.
	* Declaration.java (load): Also note usedClass on a field's type, not
	just its declaring class.

2008-05-03  Per Bothner  <per@bothner.com>

	* ClassExp.java (compileMembers): Set encloding and inner members.
	* LambdaExp.java (enterFunction): Set enclosing member of frame.

2008-04-30  Per Bothner  <per@bothner.com>

	* LambdaExp.java (addMethodFor): If a class method has an unspecified
	parameter or return type, look to see if we can "inherit" the type
	from a super-class.

	* LambdaExp.java (setCoercedReturnType): New method.

	* FindCapturedVars.java (walkClassExp): Don't complain about static
	link for simple class if this is an anonymous inner class, as in
	the Scheme (object ...) macro.

2008-04-26  Per Bothner  <per@bothner.com>

	* ModuleMethod.java (resolveParameterTypes): Don't NPE if name is null.

	* Compilation.java (loadClassRef(String)): Remove method.
	(loadClassRef(ObjectType)): Generalize from ClassType.

	* LitTable.java (emit): Handle a Class that isPrimitive.

	* Compilation.java (compileToArchive): Do compress .zip files.

2008-03-02  Per Bothner  <per@bothner.com>

	* ClassExp.java (compile): Rename to compileMembers.
	(compile): Update accordingly.
	* ObjectExp.java: Likewise.
	* ClassInitializer.java: Likewise.

2008-02-27  Per Bothner  <per@bothner.com>

	* ConsumerTarget.java (compileFromStack): Fix lookup of Consumer
	method, specifically when the operand is a char.
	Fixes bug reported by Yaroslav Kavenchuk <kavenchuk@gmail.com>.

2008-01-16  Per Bothner  <per@bothner.com>

	* CanInline.java (inline): Take extra argsInlined parameter.
	* ApplyExp.java (walkArgs): Take extra argsInlined parameter.
	* QuoteExp.java (inline): Pass argsInlined to CanInline.inline call.

2008-01-06  Per Bothner  <per@bothner.com>

	* QuoteExp.java (classObjectExp): New constant.
	(getInstance): Map Type.pointer_type to classObjectExp.
	* InlineCalls.java (walkLetExp): Must convert if decl type specified.

2007-12-30  Per Bothner  <per@bothner.com>

	* Compilation.java (cleanupAfterCompilation): New method.
	(outputClass): Call cleanupAfterCompilation.
	* ModuleExp.java (evalToClass): Likewise.
	This fixes a bad memory leak (noticable in RunXQTS).
	* ModuleInfo.java (getCompilation): Remove unused method.

2007-12-09  Per Bothner  <per@bothner.com>

	* LambdaExp.java (allocFieldFor): If we don't need a closure (and
	there is no explicit nameDecl.field), then allocate field in mainClass.
	Field no longer needs to be final.
	(addApplyMethods): Pass field in - if field is static, add apply
	methods in module instead of local frame.
	(compileSetField): Call allocFieldFor first, so we can pass it to
	addApplyMethod.
	* ProcInitializer.java (<init>): Pass in field from caller.
	If field is static then allocate field and apply methods in module.
	(emitLoadModuleMethod): Likewise.

2007-11-04  Per Bothner  <per@bothner.com>

	* ModuleExp.java (alwaysCompile): Set to true rather than false.
	This allows better consistency and stack traces.
	(evalModule): If an important bindings is constant (and not indirect
	or a procedure) now make it a StaticFieldLocation.  This makes it
	trivial to handle define-constant.

	* Declaration.java (hasConstantValue): New method.
	* FindCapturedVars.java (capture): Return immediately if
	hasConstantValue.

	* Compilation.java (compileConstant): Recover from dis-allowed null.

	* SetExp.java (compile): If we compile a field reference,
	then we need to note it's a usedClass.

	* LambdaExp.java (evalDefaultArg): New convenience method.
	(Closure.matchN): Add handling for keyword parameters.

2007-10-21  Per Bothner  <per@bothner.com>

	* FindCapturedVars.java (walkApplyExp): Add an optimization which also
	seems to fix Savavvan bug #21363: "ArrayIndexOutOfBoundsException when
	compiling define-simple-class."

2007-09-02  Per Bothner  <per@bothner.com>

	* ModuleContext.java (searchInstance): New method.

	* Declaration.java (setTypeExp): Recognize a quoted Class.

	* Declaration.java (printInto): Add some commented-out debug printing.

2007-06-10  Per Bothner  <per@bothner.com>

	* TypeValue.java: Fix thinko for JAVA5 case.

2007-04-27  Per Bothner  <per@bothner.com>

	* Language.java (loadClass): Invoke ClassMemberLocation.defineAll
	rather than this.defineAll.
	(defineAll, defineFromFieldValue): Removed methods.
	* ModuleBody.java (runAsMain): Update invocation of 
	ClassMemberLocation.defineAll by padding default Language..

2007-04-26  Per Bothner  <per@bothner.com>

	* ModuleExp.java (evalToClass): If internal exception is thrown,
	re-throw as a SyntaxException.

	* ApplyExp.java (compile, compileToArray, pushArgs): Use
	compileWithPosition rather than compile, for arguments.
	* LetExp.java (compile): Likewise, for init expression.

2007-04-25  Per Bothner  <per@bothner.com>

	* ModuleInfo.java (mapClassToInfo): New static WeakHashMap.
	(moduleClass): Make private.
	(getModuleClassRaw, setModuleClass): New methods.
	(find): Change parameter to ClassType.
	If isExisting, first try ModuleManager.findWithClass.
	* ModuleManager.java (findWithClass): Make static.  Search
	in ModuleInfo.mapClassToInfo.
	(findWithClassType): Remove function.
	(findWithClassName):  Re-implement - first try searchWithClassName,
	but if no match load Class and try findWithClass.
	(find): Partially "inline" findWithClassType and
	setWithCompilation, so we don't try to search for Class yet.
	* ModuleExp.java (evalToClass): Use setModuleClass.

	* ModuleInf.java (getModuleClass): Use ClassType's
	getContextClassUse method rather than Class.forName.

2007-04-23  Per Bothner  <per@bothner.com>

	* ModuleManager.java (modules): Change from linked list to array.
	(numModules): New field.
	(add):  Update appropriately and make private.
	(getModule(int)): New method.
	(firstModule): Remove method.
	(find): xxxx
	(searchWithClassName, searchWithAbsSourcePath):
	Update to search in modules array.
	(clear): Update to free modules array.
	(findWithClass(Class), findWithClassType): New methods.
	(find): Use findWithClassType.
	* ModuleContext.java (findFromInstance):  Use findWithClass.
	* ModuleInfo.java (next): Remove field.
	(nextModule): Remove method.
	(find(String)): Remove - no longer used.
	(register):   Don't bother looking for ModuleInfo - just setInstance.
	* Compilation.java (generateBytecode): Iterate over modules array.

	* ModuleContext.java (table): Change to use WeakHashMap if JAVA2.
	Change to map Class to instance rather than class name to instance.
	(findInstance(Class)): New overloaded method.
	(fineInstance(ModuleInfo)): Use findInstance(Class).
	(checkInstance, makeInstance): Remove unused methods.
	(setInstance): Change to single parameter.
	(findFromInstance): Update accordingly.
	* ModuleInfo.java (register): Likewise.

2007-04-20  Per Bothner  <per@bothner.com>

	* BuiltinEnvironment.java (enumerateAllLocations): Fix thinko.
	Fixes Savannah bug #19476: "BuiltinEnvironment.enumerateAllLocations
	doesn't return inherited bindings".

2007-04-19  Per Bothner  <per@bothner.com>

	* ClassExp.java (getImplMethods): Don't lose in the case we didn't
	create a "xxx$class" for a pair type - i.e. if it is abstract.

2007-03-31  Per Bothner  <per@bothner.com>

	* Language.java (declFromField): Set IS_NAMESPACE_PREFIX if
	constant field's type is Namespace.

2007-03-20  Per Bothner  <per@bothner.com>

	* ClassExp.java (declareParts): Checking INTERFACE_SPECIFIED must be
	done earlier, in setTypes, before addClass is done.
	* ClassExp.java (compile): Don't generateConstructor if interface.
	(declareParts): Don't getConstructor if interface.
	* FindCapturedVars.java (walkClassExp): Likewise.

2007-03-19  Per Bothner  <per@bothner.com>

	Fix for Savannah bug #18846: Cannot inherit from non-static class
	* ClassExp.java (superClassIndex): New field.
	(setTypes): Set superClassIndex.
	(walkChildren): Walk supers array.
	(loadSuperStaticLink, invokeDefaultSuperConstructor): New methods.
	(compile): Call invokeDefaultSuperConstructor.
	* Compilation.java (generateConstructor): Likewise.
 	* PrimProcedure.java (compile): Use new ClassExp.loadSuperStaticLink.
	* LambdaExp.java (allocChildMethods): Neeed static link
	if getNeedsClosureEnv.

	* ClassExp.java (print): Print supers array.

	* ClassExp.java (setClassName): Inline into setTypes and remove.
	(setTypes): Allow define-simple-class to define interface and
	define-class to define class.
	(CLASS_SPECIFIED): New flag.
	(isMakingClassPair): No longer same as !simple.
	* Compilation.java (callInitMethods): Don't create separate instance
	class just because class is a PairClassType.

2007-03-13  Per Bothner  <per@bothner.com>

	* ModuleExp.java (evalModule): Don't fail if msg is null.

	* ClassExp.java (INTERFACE_SPECIFIED): New flag bit.
	(declareParts): Set interface if INTERFACE_SPECIFIED.
	Set class-level access flag (PUBLIC or package access).

	* Compilation.java (registerClass): Use new addModifiers method.

2007-03-13  Per Bothner  <per@bothner.com>

	* LambdaExp.java (inlineIn): Fix logic.
`<
2007-03-06  Per Bothner  <per@bothner.com>

	* Special.java (abstractSpecial): New constant.
	* QuoteExp.java (abstractExp): New static field.
	* LambdaExp.java (isAbstract): New method.
	(addMethodFor): Set ABSTRACT modifier is isAbstract().
	(compileAsMethod): Ignore is isAbstract().
	(getReturnType): Don't use body's type is isAbstract().
	* ClassExp.java (IS_ABSTRACT): New flag.
	(isAbstract): New method.
	(declareParts): Set abstract flag if method is abstract.
	Error if *init* method is abstract.
	(compile): Skip abstract methods.

2007-03-01  Per Bothner  <per@bothner.com>
	    Chris Wegrzyn <chris.wegrzyn@gmail.com>

	* LambdaExp.java (compileEnd): Merge in compileChildMethods, calling
	before it before it used to be called.
	This fixes Savannah bug #18909 "Recursive call to function in closure
	causes NullPointerException".
	(compileChildMethods): Remove method.
	* ApplyExp.java (compile): Remove compileChildMethods call.
	* ClassExp.java (compile): Likewise.
	* Compilation.java (generateBytecode): Likewise.

2007-02-28  Per Bothner  <per@bothner.com>

	* FindTailCalls.java (walkReferenceExp): Check for void type using
	isVoid rather than identify with Type.void_type.
	Fixes Savannah bug#18736, "intenal compile error -- svn rev 5816".

	* LitTable.java (staticTable): Change type to Table2D.
	(findLiteral): Avoid clash in use of staticTable.

	* InlineCalls.java (walkApplyOnly): Make final.

2007-02-27  Per Bothner  <per@bothner.com>

	* FindTailCalls.java (walkSetExp, walkFluidLetExp): Don't setCanWrite
	on Declaration here - which should be done before InlineCalls.
	* ResolveNames.java (walkSetExp): Invoke Declaration.setCanWrite.
	* FindCapturedVars.java (allocUnboundDecl): Do setCanWrite.
	* InlineCalls.java (walkReferenceExp): Add optimization to use
	variable used toinitialize variable.
	(walkApplyExp): Don't param.setValue if getCanWrite.

2007-02-26  Per Bothner  <per@bothner.com>

	* CanInline.java (inline): Change so that arguments need to be walked.
	Change 2nd paramter type ExpWalker->InlineCalls.
	* QuoteExp.java (inline): Don't walkArgs before calling CanInline's
	inline method - do it wafter if we don't.
	* LambdaExp.java (inline): Move (apply (lambda ...) ...) optimization
	to InlineCalls since it needs to be done before func is walked.
	* InlineCalls.java (walkApplyExp): Do (apply (lambda ...) ...)
	optimization here.

	* ApplyExp.java (walkArgs): New method.
	* Expression.java (inline): Take extra boolean argsWalked parameter.
	* LambdaExp.java (inline): Take argsInlined parameter.
	Also inline lambda directly in function-call position.
	* QuoteExp.java (inline): Take argsInlined parameter.
	* ReferenceExp.java (inline): Take argsInlined parameter.
	* InlineCalls.java (walkApplyExp): Delegate/defer walking args to
	Expression.inline method.

2007-02-25  Per Bothner  <per@bothner.com>

	* BindingInitializer.java (emit): Don't create private ThreadLocation -
	it seems like expensive overkill.

	* BindingInitializer.java (emit): Save/set/restore source location.

2007-02-23  Per Bothner  <per@bothner.com>

	* Language.java (getTypeFor): Don't use asType, which can throw.

	* Compilation.java (generateApplyMethodsWithContext,
	generateApplyMethodsWithContext): Save/set/restore source location.

2007-02-22  Per Bothner  <per@bothner.com>

	* QuoteExp.java (print): Don't modify value field.

2007-02-19  Per Bothner  <per@bothner.com>

	* ClassExp.java (compilePushClass): If simple, return Class object.
	(setTypes): Ok to have superType (class) even if non-simple.
	* FindCapturedVars.java (walkClassExp): Warning if simple and
	needs a closure env.
	* InlineCalls.java (walkReferenceExp): Don't convert unknown to type;
	this is handeled by Scheme.checkDefaultBinding.

2007-02-18  Per Bothner  <per@bothner.com>

	* Language.java (declFromField): Convert String to Symbol.
	* GenericProc.java (setProperties): Map Keyword to Symbol.
	* ModuleExp.java (getNamespaceUri): New method.
	* ProcInitializer.java (emitLoadModuleMethod): Update name handling.
	* Symbols.java (gentemp): Change return type to SimpleSymbol.

2007-02-18  Per Bothner  <per@bothner.com>

	* Language.java (getTypeFor): Handle Ref bound to constant.

2007-02-08  Per Bothner  <per@bothner.com>

	* FindCapturedVars.java (walkClassExp): If class needs static link,
	then init methods do so as well.

	* Compilation.java (generateConstructor): Allow lexp to be null.
	(generateBytecode): Call generateConstructor on moduleClss with null
	lexp.  This prevents emitting initializers in wrong class.

	* InlineCalls.java  (walkReferenceExp): Map name->class using getTypeFor
	here, rather than later, in FindCapturedVars.
	* FindCapturedVars.java (walkReferenceExp): Don't do getTypeFor here.

	* Language.java (getTypeFor): Remove redundant assignment.

	* TypeValue.java: Extend java.lang.reflect.Type if JAVA5.

2007-02-01  Per Bothner  <per@bothner.com>

	* PrimProcedure.java (compile): Alwaus set thisType to null
	if constructor.
	* ClassExp.java (compile): If there is a staticLinkField,
	have to set it in *init*.
	Defer enterFunction until after super init call.
	* LambdaExp.java (declareClosureEnv): If *init* needs closureEnv,
	we need to pass it as an extra parameter, not through 'this'.

2007-01-19  Per Bothner  <per@bothner.com>

	* ModuleInfo.java (checkCurrent): Use ClassType.getContextClass.

2007-01-16  Per Bothner  <per@bothner.com>

	* Language.java (formatType): New method.

2007-01-14  Per Bothner  <per@bothner.com>

	* ModuleInfo.java (find): Set moduleClass field.

	* ModuleInfo.java (checkCurrent): Use context-ClassLoaxder rather than
	ModuleManager's defaultClassLoader.  Recover from SecurityException.
	* ModuleManager.java (defaultClassLoader): Remove no-longer-used field.
	* ModuleExp.java (evalToClass): Pass context ClassLoader as parent
	of new ArrayClassLoader.  Catch SecurityException.
	(evalToClass): Use one-argument version of loadClass, since
	2-argument version is now protected if JAVA2 is enabled.
	* Compilation.java (setupLiterals): Likewise.

2007-01-13  Per Bothner  <per@bothner.com>

	* ModuleManager.java (findWithSourcePath(Path,String)): New method.
	(findWithURL): Pass actual URL by using new method.
	* ModuleExp.java (classFor): Update to use Paths and more robust
	handling of URL-to-classname mapping.

	* ModuleExp.java (classFor): Update "<stdin>" to "/dev/stdin".

2007-01-03  Per Bothner  <per@bothner.com>

	* ModuleInfo.java (sourceAbsPath): Change to Path and non-public.
	(sourceAbsPathname): New field.
	(getSourceAbsPath, setSourceAbsPath, getSourceAbsPathname): New methods.
	(absPath): Radically simplify to use Path's getCanonical.
	(setCompilation, checkCurrent): Update accordingly.
	* ModuleManager.java (searchWithAbsSourcePath, findWithSourcePath):
	Update accordingly.
	(register): Update to use Path functions.
	* Compilation.java (generateBytecode): Likewise.

	* ModuleExp.java (evalToClass): If no url given, use Path.currentPath.

	* LambdaExp.java (allocChildMethods): For non-static ClassExp do
	setOuterLink here, so we can call constructor before class is compiled.
	* ClassExp.java (compile): Don't setOuterLink here any more.

2007-01-02  Per Bothner  <per@bothner.com>

	* PrimProcedure.java (apply): Special handling for "clone" of array.

	* LitTable.java (emit): Also look for 'valueOf' for factor method.

2006-12-30  Per Bothner  <per@bothner.com>

	* PrimProcedure.java (getMethod): New method.

2006-12-18  Per Bothner  <per@bothner.com>

	* ModuleBody.java (runAsMain): Remove long-deprecated method.

2006-12-15  Per Bothner  <per@bothner.com>

	* Compilation.java (setLine): Moved from Translator.

2006-12-12  Per Bothner  <per@bothner.com>

	* ModuleExp.java (evalModule): If ExceptionInInitializerError is
	thrown, re-throw its cause.

2006-12-11  Per Bothner  <per@bothner.com>

	* InlineCalls.java (walkLetExp): Check for null (unknown) declaration.

	* Keyword.java (writeExternal, readExternal, readResolve): New methods,
	since serialization inherited from Symbol doesn't match 'make'.

2006-12-05  Per Bothner  <per@bothner.com>

	* Compilation.java (registerClass): Don't set Access.SUPER if interface.

2006-12-04  Per Bothner  <per@bothner.com>

	* Language.java (parse): New final method that takes option ModuleInfo.
	Have other final parse methods use it.
	* ModuleInfo.java (sourceURL): Relace/rename field by ...
	(sourcePath, sourceAbsPath): New methods.
	(absPath): New static method.
	(setCompilation): Set both sourcePath and sourceAbsPath.
	* Compilation.java (generateBytecode): Adjust relative source path.
	* ModuleManager.java (searchWithSourcePath): Rename to
	searchWithAbsSourcePath since it assumes argument is absolute.
	(register): Resolve relative sourceUrl.

	* ModuleManager.java (defaultClassLoader): New field, replaces
	static field in kawa.repl.
	(setCompilationDirectory, getCompilationDirectory): New methods.

	* Compilation.java (process): Use getCompilationDirectory.

2006-11-27  Per Bothner  <per@bothner.com>

	* Language.java (hasNamespace): New method.
	* NameLookup.java (lookup): Use hasNamespace,
	* ScopeExp.java (lookup): Compare symbols using equals.
	(lookup): Check namespace using hasNamespace.
	(duplicateDeclarationError): New static method.
	(getDefine): Use duplicateDeclarationError.
	* LambdaExp.java (OVERLOADABLE_FIELD): New constant,
	(allocFieldFor): If OVERLOADABLE_FIELD add unique suffix.

2006-11-25  Per Bothner  <per@bothner.com>

	* GenericProc.java (matchN): Make a pre-pass to prefer those methods
	that are applicable.

	* PrimProcedure.java (matchN): Trivial re-arranging - move tr/catch
	inwards so it is only "executed" when we need to do a coercion.

2006-11-22  Per Bothner  <per@bothner.com>

	* FindTailCalls.java (walkReferenceExp): If the variable has void
	type replace it by the void constant.

	* Keyword.java: Rename Consumer methods append->write.
	* Special.java: Likewise.
	* Symbols.java: Likewise.

2006-11-20  Per Bothner  <per@bothner.com>

	* Compilation.java (loadCallContext): Don't use existing callContextVar
	if it is dead().  Otherwise, do re-use existing callContextVar.

	* Keyword.java (print): Update since parameter is now a Consumer.
	* Special.java: Likewise.
	* Symbols.java (print): Change parameter to take a Consumer.
	* Expression.java (print): Handle general Consumer.

2006-11-19  Per Bothner  <per@bothner.com>

	* Special.java (undefined): New static field.
	(optional, rest, key, dfault, eof): Make final.
	* Undefined.java: Removed class.
	* Makefile.am: Update accordingly.
	* Copilation.java (scmUndefinedType): Remove unused field.
	* QuoteExp.java: Update Undefined.getInstance() -> Special.undefined.

2006-11-18  Per Bothner  <per@bothner.com>

	* Compilation.java (generateBytecode): Save/restore callContextVar
	within clinit.
	(clinitMethod, callContextVarForInit): New fields.
	(generateBytecode): Save $ctx for "run" method in callContextVar.
	(loadCallContext): For now don't try to reuse/cache variable
	expect within clinit.

2006-11-17  Per Bothner  <per@bothner.com>

	* ConsumerTarget.java: Update writeChar -> append.

2006-11-16  Per Bothner  <per@bothner.com>

	* ConsumerTarget.java (compileFromStack): New overload.
	(compileWrite): New method, to optimize awa a swap.
	* ReferenceExp.java (compile): Use compileWrite.

2006-11-15  Per Bothner  <per@bothner.com>

	* QuoteExp.java (compile): Use compileConstant directly in more cases.
	(getType): Don't cache result - it changes the behavior of compile.
	(voidExp, nullExp): Set type explicitly.

2006-11-13  Per Bothner  <per@bothner.com>

	* Expression.java: Implement SourceLocator.
	(setLocation): New method.
	(getFile, getLine, getColumn): Rename to getFileName, getLineNumnber,
	getColumnNumber.
	* ExpWalker.java: Implement SourceLocator.
	* Declaration.java: Implement SourceLocator.
	(getFile, getLine, getColumn): Rename to getFileName, getLineNumnber,
	getColumnNumber.
	* Compilation: Implement SourceLocator.
	(error): Generalize.
	* ClassExp.java: Update.
	* LambdaExp.java: Update.
	* ModuleInfo.java: Update.
	* ErrorExp.java: Update.
	* BindingInitializer.java: Update.
	* ModuleExp.java: Update.
	* ProcInitializer.java: Update.
	* CheckedTarget.java: Update.
	* ReferenceExp.java: Use new UnboundLocationException constructor.

2006-11-09  Per Bothner  <per@bothner.com>

	* Language.java (print): Remove unused methods.

2006-11-07  Per Bothner  <per@bothner.com>

	* LetExp.java (compile): Don't allocateVarianble unless Declaration
	needsInit().

	* SeriesTarget.java (done): Can now be null.
	(compileFromStackSimple): Do goto 'done' if needed.
	(compileFromStack): Handle the case when 'done==null'.
	Bemore specific about "function" parameter type - it is a singleton.
	(toString): New method.
	* Compilation.java (compileConstant): Fix handling when literal is
	Values and target is a SeriesTarget.

	* ScopeExp.java (replaceFollowing): Also set context of newDecl.

2006-11-03  Per Bothner  <per@bothner.com>

	Minor optimization to avoid storing unused parameters of
	inline-only functions.  Happens most for XQuery implied paramaters,
	such as position() when it is unused.
	* ApplyExp.java (pushArgs): New helper method.  Don't push
	ignorable parameters.
	(compile): Use it, for both inline-only and tail-calls.
	(popParams): Also pass along Declaration, so we can check ignorable().
	* LambdaExp (allocChildClasses):   Don't allocate Variable if
	parameter is ignorabled() and function is inline-only.

2006-11-01  Per Bothner  <per@bothner.com>

	* SeriesTarget.java (isSingletonType): Removed, replaced by
	new and enhanced OccurrenceType.itemCountIsOne.
	(compileFromStack): Update accordingly.
	* ConsumerTarget.java (compileFromStack): Likewise.

	* ApplyExp.java (inlineIfConstant): Trivial improvement.

2006-10-31  Per Bothner  <per@bothner.com>

	* ConsumerTarget.java (compileFromStack): Resolve to
	implementationType.

	* QuoteExp.java (compile): Handle the case when we have an
	explicit type for the constant, whih may require special conversion.

	* InlineCalls.java (walkIfExp): Must walk then/else
	after constant folding.

	* ApplyExp.java (getArg, setArg): New method.

	* ApplyExp (print): Also print type if interesting.

	* ApplyExp (getTypeRaw, setType): New methods.
	* QuoteExp.java (type): New field.
	(getType): Update to use/set type field.
	* IfExp.java (getType): New method.

	* Expression.java (valueIfConstant): New method.
	* QuoteExp.java	 (valueIfConstant): New method.
	(<init>): New constructor which also takes explicit type.

	* ModuleInfo.java (setupModuleExp): If moduleClass is non-null,
	use that as the Class.  This fixes Savannah bug #15881 "classnotfound
	exception compiling application of define-syntax macro".

2006-10-30  Per Bothner  <per@bothner.com>

	* QuoteExp.java (inline): Minor optimization - reuse ApplyExp.

2006-10-29  Per Bothner  <per@bothner.com>

	* ExpWalker.java (walkDeclarationType, walkDeclarationTypes): New.
	(walkScopeExp): Use walkDeclarationTypes.
	* ResolveNames.java (walkScopeExp): Likewise.

	* Expression.java (toString): New method
	* ApplyExp.java (toString): New method

2006-10-26  Per Bothner  <per@bothner.com>

	* ExpWalker.java (currentLambda): Make protected, for XQResolveNames.

2006-10-25  Chris Wegrzyn <chris.wegrzyn@gmail.com>
	    Per Bothner  <per@bothner.com>

	* LetExp.java (apply): Patch for using wrong length to arraycopy.
	This fixes Savannah bug #18106 "ArrayIndexOutOfBoundsException in
	deep LetExp nesting".  In addition, made a micro-optimization.

2006-10-25  Per Bothner  <per@bothner.com>

	* NameLookup.java: Change to extends GeneralHashTable.
	(map): Remove Hashtable field - use this/super instead.
	(push): Just push to front of hash bucket chain.  Don't use a Vector.
	(pop): Just remove from chain HashNode with matching Declaration.
	(lookup): Just loop though HashNode chain.

2006-10-16  Per Bothner  <per@bothner.com>

	* ModuleExp.java (evalModule): If Declaration is an alias for
	one that needsContext(), then create a StaticFieldLocation.
	Set the latter's Declaration.

	* Declaration.java (getDeclarationValueFromStatic): New static method.

2006-10-15  Per Bothner  <per@bothner.com>

	* Compilation.java (error): New overloaded method.

	* Compilation.java (pedantic): New flag field.
	(isPedantic): New method.
	* Language.java (requirePedantic): New static field.
	(parse): Set Compilation's pedantic flag from requirePedantic.

2006-10-12  Per Bothner  <per@bothner.com>

	* ExpWalker.java (getMessages): New convenience method.

2006-10-11  Per Bothner  <per@bothner.com>

	* LetExp.java (walkInitializers): New method.
	(walkChildren): Use walkInitializers.
	* ResolveNames.java (walkLetExp): New method. Uses walkInitializers
	to walk initializers *before* pushing declarations.

	* PrimProcedure.java (<init>): New convenience constructor.

	* PrimProcedure.java (compileInvoke): Fix handling of IgnoreTarget
	for a method that takesContext().

2006-09-28  Per Bothner  <per@bothner.com>

	* ModuleExp.java (evalToClass): Don't write exception to err output.

2006-09-12  Per Bothner  <per@bothner.com>

	* ModuleExp.java (evalToClass): Use URI_utils.toURL.

	* ReferenceExp.java (apply): Get value from field even if non-static by
	using the contextDecl.  Prefer value from field over Declaration's
	value since latter may not have correct context if a LambdaExp.
	* Compilation.java (generateConstructor): We may need to register a
	module even in immediate mode, as long as the module is named.

2006-09-08  Per Bothner  <per@bothner.com>

	* ModuleExp.java (toString): New method.

2006-09-06  Per Bothner  <per@bothner.com>

	* ReferenceExp.java (apply): For now revert 2006-08-07.  It causes Ant
	builds to fails, because they compile kawa/lib in alphabethical order.

2006-08-23  Per Bothner  <per@bothner.com>

	* ModuleSet.java: New abstract class.
	* Makefile.am: Update accordingly.
	* ModuleManager.java (defaultClassLoader): New field.
	(modules, firstModule): Chain of modules.
	(register, loadPackageInfo): New method.
	* ModuleInfo.java (nextModule, next}: Used to chain modules.
	(uri, getNamespaceUri, setNamespaceUri): New field and methods.
	(setCompilation): Set sourceURL if module is non-null.
	(checkCurrent): If moduleClass is null, but className is known,
	try to load the class, and find the class file.
	* Compilation.java (registerClass): New method.
	(addClass): Move code from here to registerClass, and call it.
	(generateBytecode): If ModuleInfo has a non-null namespace URI, then
	generate a ModuleSet class for this package.  Needed for XQuery.

	* Compilation.java (pendingImports): Make public, for XQuery.

2006-08-22  Per Bothner  <per@bothner.com>

	* Language.java (getCompilation): New method.
	(parse(Lexer,int)): Make final instead of abstract.
	(parse(Compilation,int)): Make abstract.

2006-08-18  Per Bothner  <per@bothner.com>

	* BeginExp.java  (getExpressionCount): New method.

2006-08-16  Per Bothner  <per@bothner.com>

	Change the way an immediate-compiled <clinit> can find its
	Compilation in order to import literals.  This is more robust.
	* ModuleExp.java (evalModule): No longer need to set context's value1.
	(setupLiterals): Move to Compilation.java.
	* Compilation.java (setupLiterals):: Moved.  Also take integer 'key'
	parameter and pass it to findForImmediateLiterals.
	(generateBytecode): Update accordingly.
	(keyUninitialized, chainUninitialized, nextUninitialized): New fields.
	(registerForImmediateLiterals, findForImmediateLiterals): New methods.

	* ModuleExp.java (evalToClass): Don't call extra loadClass to get main
	class.  This may use inconsistent name mangling, and is redundant.

	* ModuleExp.java (lastZipCounter): New static field.
	(evalToClass):  For zip dump file name use max of lastZipCounter
	and interactiveCounter, to avoid overwriting an old file in more
	complex multi-module situations.

	* BindingInitializer.java (emit): Emit line number if available.

	* Compilation.java (addMainClass): Remove special-casing for immediate.

2006-08-08  Per Bothner  <per@bothner.com>

	* ModuleInfo.java (find(Type)): New static method.
	(clearClass, checkCurrent): New methods.
	* ModuleExp.java (evalToClass): Recursively evalToClass of dependent
	modules.

	* ModuleInfo.java (setCompilation): New method.
	(getModuleExp): If we have Compilation, use its mainLambda.
	* Compilation.java (pushNewModule): Set setCompilation on ModuleInfo.
	* ModuleManager.java (LAST_MODIFIED_CACHE_TIME): New constant.
	Moved from gnu/kawa/servlet/KawaPageServlet.java.
	(lastModifiedCacheTime): New field.
	(find): Use new setCompilation method.
	* ModuleContext.java (findInstance): Don't re-use instance
	if it isn't of the needed class.

	* ModuleInfo.java (loadEager):  Don't set to lower state, except to
	clear "busy" bit.
	* ModuleExp.java (evalToClass): Use loadByStages rather than process
	to properly handle dependencies and cycles.
	(evalModule): Init state to WALKED here rather than in evalToClass.
	* Compilation.java (process): Set state after BODY_PARSED.

	* Declaration.java (load): When CREATE_FIELD_REFERENCE in immediate
	mode use new FieldLocationa dn StaticFieldLocation factory methods.

	* ModuleExp.java (evalToClass): Don't value value1 to Compilation here.
	(evalModule): Set it here instead.  For future recursive evalToClass. 

	* Compilation.java (generateBytecode): Remove no-longer-executed calls
	to generateClassName, addClass, and setSourceFile.
	(addClass(ModuleExp,ClassType)): Inline in remaining singler caller
	addMainClass.

2006-08-07  Per Bothner  <per@bothner.com>

	* LetExp.java (apply): Only skip declarations whose init value is
	undefined_exp, which matches compile logic, rather than checking
	CAN_READ, which may not have been set if we're in a let-syntax.
	* ReferenceExp.java (apply): Remove questionable optimization.

	* ModuleInfo.java (loadByStages):  Call recursively to handle
	complex dependencies.

2006-06-28  Per Bothner  <per@bothner.com>

	* Keyword.java:  Various updates to use getName() rather than name,
	in case JAXP-QName is enabled.

	* Symbols.java (generate): Remove unused method.

	* Declaration.java (printInfo): Also print non-constant typeExp.

2006-06-27  Per Bothner  <per@bothner.com>

	* TypeValue.java (getConstructor): New method.

2006-06-21  Per Bothner  <per@bothner.com>

	* BindingInitializer.java (makeSymbolMethod): Remove unused field.

2006-06-16  Per Bothner  <per@bothner.com>

	* Language.java (getTypeFor): Handle ClassNamespace.

2006-06-12  Per Bothner  <per@bothner.com>

	* Language.java (getTypeFor(Object,boolean)): New method, with new
	'lenient' parameter.
	(getTypeFor(Expression, boolean)): Likewise.
	(asType): Update accordingly.

2006-06-09  Per Bothner  <per@bothner.com>

	* LambdaExp.java (setProperty): Update name to new PropertySet.
	* ProcInitializer.java (emitLoadModuleMethod): The setProperty method
	is now in the new class PropertySet, rather than in Procedure.

2006-05-31  Per Bothner  <per@bothner.com>

	Fix so warnings get printed before evaluation.
	* ModuleExp.java (evalModule): Take extra err parameter.
	If non-null, use it to display warnings and errors.  Return boolean.
	* Language.java (eval): Update ModuleExp.evalModule call.

2006-05-30  Per Bothner  <per@bothner.com>

	* Compilation.java (addClass): If JAVA5, set appropriate classfile
	version number.
	(loadClassRef): If classfile version number is suitable, use ldc on
	class "literal".
	* LitTable.java (writeObject, emit): Handle java.lang.Class objects.

2006-05-22  Per Bothner  <per@bothner.com>

	Handle module dependencies and cycles.
	* Compilation.java (state, getState, setState): New field and accessors.
	(PROLOG_PARSING, PROLOG_PARSED, BODY_PARSED, RESOLVED, WALKED,
	COMPILE_SETUP, COMPILED, CLASS_WRITTEN, ERROR_SEEN): New constants.
	(minfo, lexer, pendingImports): New fields.
	(pushPendingImport): New method.
	(compileModule, compileToFiles): Remove method.  Replaced by ...
	(process): New method.
	(outputClass): Add some cleanups.
	(compileToArchive): Replace call to compileModule by call to process.
	(compileWalkedModule): Rename to generateBytecode.
	(pushNewModule): Add overload.
	* ModuleExp.java (allocChildClasses): New method.
	* LambdaExp.java (allocChildClasses): Simply because of above method.
	(allocChildMethods): New method.
	(setCallersNeedStaticLink): Stop on ModuleExp.
	* Language.java (PARSE_PROLOG): New flag.
	(parse): New method.
	* ModuleExp.java (evalToClass): Use new Compilation.process.
	* ModuleInfo.java (comp, dependencies, numDependencies): New fields.
	(addDependency, getClassType): New methods.
	(loadByStages, loadEager): New methods.
	* ModuleManager.java (find): New method.
	* ReferenceExp.java (apply): Chase aliases.
	Also, if value is a LambdaExp, evaluate value rather than de-reference.

2006-05-25  Per Bothner  <per@bothner.com>

	* Compilation.java (toString): New method

	* Language.java (declFromField): Set EXTERNAL_ACCESS if appropriate.

	* ModuleManager.java (add): New method.
	(findWithClassName, findWithSourcePath): Use it.

	* ApplyExp.java (compile): Exit early if code is not reachable.

2006-05-21  Per Bothner  <per@bothner.com>

	* Compilation.java (error): New convenience overloading.
	* FindCapturedVars.java (walkReferenceExp): Use it.

	* FindCapturedVars.java (walkApplyExp): If module-level decl is
	public we don't need to get closure - that's handled anyway.

	* LetExp.java (apply): Always skip if we can neither read or call.
	Needed to avoid problems when evaluating let-syntax.

	* LambdaExp.java: Remove unused local variables.
	* ClassExp.java: Likewise.
	* Compilation.jav: Likewise.
	* FindCapturedVars.java: Likewise.
	* FIndTailCalls.java: Likewise.
	* GenericProc.java: Likewise.
	* LambdaExp.java: Likewise.
	* LitTable.java: Likewise.
	* ModuleExp.java: Likewise.
	* ObjectExp.java: Likewise.
	* SetExp.java: Likewise.
	* TryExp.java: Likewise.
	* InlineCalls.java: Remove unused import.
	* ModuleInfo.java: Likewise.
	* ClassExp.java: Access static method using class-name syntax.

2006-05-20  Per Bothner  <per@bothner.com>

	* ApplyExp.java (compile): Handle LambdaExp from imported modules,
	as when compiling multiple modules at once.

2006-05-19  Per Bothner  <per@bothner.com>

	* ErrorExp.java (compile): Throw Error if called.

	* ModuleExp.java (allocFields): Don't emit field for unreferenced
	unknown declaration.
	* ModuleExp.java (allocFields): Do emit field in IS_CONSTANT case.

2006-05-02  Per Bothner  <per@bothner.com>

	* Declaration.java (load): Change 1st param to AccessExp, so we can get
	at ReferenceExp's source location.  Wrap Location.get call by handler
	that uses those to call UnboundLocationException.setLine.
	* gnu/expr/SetExp.java (compile): Update accordingly.
	* gnu/expr/ReferenceExp.java (compile): Likewise.
	(apply): Pass file/line/column to new UnboundLocationException.

2006-04-26  Per Bothner  <per@bothner.com>

	* Compilation.java (pushScope): Set mustCompile if we see a function
	definition.  Fixes Savannah bug #16388 "performance regression".
	* Declaration.java (load): Do follow alias even if DONT_DEREFERENCE
	if base is indirect.
	If compiling constant, use passed-in Target.

2006-04-23  Per Bothner  <per@bothner.com>

	* InlineCalls.java (walkIfExp): Fold if test is reference to known
	value.
	(walkLetExp): Fold if let result expression matches let variable.

2006-04-14  Per Bothner  <per@bothner.com>

	* LetExp.java (print): Guard against null body.

	* Compilation.java (current): New ThreadLocation static field.
	(getCurrent, setCurrent): Change to use new field.

2006-04-10  Per Bothner  <per@bothner.com>

	* LambdaExp.java (addMethodFor): If a top-level function is defined
	using define-private, that doesn't mean its method should be private,
	since it may need to be accessed from a generated class.

2006-04-06  Per Bothner  <per@bothner.com>

	* ExpWalker.java (walkScopeExp): Also walk the type expressions
	of the Declarations, in case they're non-constant.

	* Declaration.java (setTypeExp): Check if typeExp is TypeValue.

2006-03-27  Per Bothner  <per@bothner.com>

	* SetExp.java (compile): Do emit value even if it is literal,
	unless the declaration IS_CONSTANT.

2006-03-25  Per Bothner  <per@bothner.com>

	* ModuleExp.java (evalModule): Check if seenErrors.

2006-03-23  Per Bothner  <per@bothner.com>

	* ErrorExp.java (<init>): New convenience constructors.

2006-03-20  Per Bothner  <per@bothner.com>

	* PrimProcedure.java (matchN): Don't add extraCount to fixArgs.

	* PrimProcedure.java (matchN): Simplify check for correct number
	of args, getting rid of mlen variable and code redundancy.

2006-03-17  Per Bothner  <per@bothner.com>

	* Declaration.java: Add hooks for type expression that are evaluted
	at run-time.
	(typeExp): New Expression field.
	(getTypeExp, setTypeExp): New method.
	(setType): Modify to also set typeExp.

2006-03-15  Per Bothner  <per@bothner.com>

	* ExpWalker.java (messages): Make protected, for XQResolveNames.

	* LitTable.java (writeObject): Add support for BigInteger and
	BigDecimal - the latter is used by XQuery for the xs:decimal type.

2006-03-14  Per Bothner  <per@bothner.com>

	* Compilation.java (compileModule): Save/set/restore current
	Compilation.

2006-03-12  Per Bothner  <per@bothner.com>

	* InlineCalls.java (<init>): New constructor.
	(inlineClass): Use new constructor.
	* ClassExp.java (setTypes): Do InlineCalls on supertypes.

2006-03-07  Per Bothner  <per@bothner.com>

	* CheckedTarget.java (emitCheckedCoerce): Get startPC at same position
	as startTry, so test for empty exception region is correct.

	* ModuleExp.java (evalModule): Save/set/restore current Compilation.

2006-03-03  Per Bothner  <per@bothner.com>

	* FindTailCalls.java (walkApplyExp): Don't chain calls to
	static functions.

2006-03-01  Per Bothner  <per@bothner.com>

	* ModuleExp.java (evalToClass): Call cleanupAfterCompilation.

	* SetExp.java (<init>): Move constructors next to each other.
	* SetExp.java (makeDefinition): New convenience factory method.

2006-02-19  Per Bothner  <per@bothner.com>

	* Compilation.java (compileToArchive): Do't set module name to
	LambdaExp.fileFunctionName.  Instead, load picks the first class.
	* LambdaExp.java (fileFunctionName): Remove no-longer-used field.

	* Compilation.java (addClass): Ensure that mainClass is the "first"
	class, so it is written first when writing an archive.

	* PrimProcedure.java: Handle a mode where a 'target' is passed when
	for static method calls.
	(mode): New field, subsumes removed is_special field.
	(isSpecial, isConstructor): Update accordingly.
	(takesTarget): New method.
	(numArgs, matchN, getParameterType): Update appropriately.
	(<init>)(Method,char,Language)): New constructor.
	(<init>)(Method,boolean,Language)): Removed constructor.
	(<init>)(ClassType,Type[])): Removed unused constructor.
	(init): Set mode to 'V' if needed.
	(compile): If static and takesTarget(), skip first argument.

2006-02-16  Per Bothner  <per@bothner.com>

	* Expression.java (side_effects): New method.
	* QuoteExp.java (side_effects): New method.
	* ReferenceExp.java (side_effects): New method.

	* Compilation.java (walkModule): Better to PushApply after InlineCalls.

2006-02-13  Per Bothner  <per@bothner.com>

	* AccessExp.java (getSimpleName): New method.

	* Compilation.java (addMainClass): Make public, since it is used
	by KawaPageServlet.

2006-02-10  Per Bothner  <per@bothner.com>

	* LetExp.java (apply): Skip Declation if !needsInit().
	* FindTailsCalls.java (walkApplyExp): Da setCanRead on Declaration
	if we might be interpreting.

	* LambdaExp.java (apply): Call setIndex, in case we're called
	directly from a macro expanded.
	* LetExp.java (apply): Likewise.

2006-02-10  Per Bothner  <per@bothner.com>

	* LambdaExp.java (Closure:getProperty): New method.
	* ProcInitializer.java (emit): Move emitting of properties to
	emitLoadModuleMethod method.
	* ModuleMethod (<init>): Don't setSymbol if it is null.
	(getName): Remove method - use from super class.

2006-02-09  Per Bothner  <per@bothner.com>

	* Declaration.java (evalIndex):  New field.
	(makeIndirectLocationFor): New method.
	* ChainLambdas.java (walkScopeExp, walkLambdaExp): Check if
	expression mustCompile.
	(walkScopeExp): Do setIndexes of Declaration, for interpretation.
	* Expression.java (mustCompile): New abstract method.
	(eval(Expression), eval(CallContext)): Make both final.
	(apply): This is not the method that needs to be overridden.
	* ScopeExp.java (frameSize): New field.
	(setIndexes): New method.
	(mustCompile): Remove no-longer-needed temporay stub method.
	* ApplyExp.java (eval): Remove method.
	* BeginExp.java (eval): Likewise,
	* ErrorExp.java (eval): Likewise,
	* ???Exp.java (mustCompile): New methods.
	* BlockExp.java (appply): New method for interpreter.
	(BlockExitException): New non-public class.
	* ExitExp.java (apply): New method.
	* IfExp.java (apply): Don't use match0 for tail-expressions,
	since that breaks try-[catch-]finally.
	* LambdaExp.java (apply): New method,
	(Closure): New non-public class, extends MethodProc.
	* LetExp.java (apply): New method.
	* QuoteExp.java (eval): Replace method with new apply method.
	* SynchronizedExp.java: Likewise.
	* ThisExp.java: Likewise.
	* TryExp.java: Likewise.
	* ReferenceExp.java (eval):  Replace by new apply method, and
	rewrite to handle lexical bindings.
	* SetExp.java: Likewise.

	* Compilation.java (walkModule, addMainClass): New methods.
	(compile, addClass(ModuleExp)):  Remove and move things around to ...
	(compileModule, compileWalkedModule): ... create these new methods.
	(push(ScopeExp)): Possible mustCompileFile() here call moved ..
	(pushScope): ... this more-commponly-called method instead.
	* ModuleExp.java (evalToClass):Call compileWalkedModule instead 
	of remove compile method.  Add general catch of Throwable.
	(evalModule): Do InliningCalls etc even if we're not sure we need to
	compile.  Check mustCompile after we have done so.
	* ScopeExp.java (mustCompile): New temporary stub method.

	* Compilation.java (source_filename) Removed field.
	(addClass): Adjust accordingly.
	(pushNewModule): New method.
	(push(ScopeExp)): Simplify ModuleExp handling - now in pushNewModule

	* PrimProcedure.java (matchN): Fix a bug in the takesContext() case.
	(apply): Likewise.
	(matcN): Fix bugs in handling of #!rest arg with a LList type.

2006-02-06  Per Bothner  <per@bothner.com>

	* InlineCalls.java (walkApplyOnly): New method.
	(walkApplyExp): Call walkApplyOnly.
	Don't call ClassMethodProc.rewrite - now handled using the inline
	method of ApplyExp sub-classes.
	* Language.java (NAMESPACE_PREFIX): Removed - no longer used.

2006-02-06  Per Bothner  <per@bothner.com>

	* ModuleExp.java (evalModule): Declaration name need not be a String.
	(allocFields): Apply deMorgan's law, to match form in SetExp.compile.

2006-02-06  Per Bothner  <per@bothner.com>

	* Language.java (getTypeFor(Object)): New final convenince method.
	(asType(Object)): Now just a wrapper for getTypeFor.
	(getTypeFor(Expression)): No longer need to catch exception.

	* Declaration.java (isLexical): New helper method.
	(isUnknown): New static helper method.
	* ReferenceExp.java (isUnknown): New method.

	* Declaration.java (getDeclaration): New though commented-out hook
	for mapping procedure name to static field.

2006-02-05  Per Bothner  <per@bothner.com>

	* ReferenceExp.java (getType): Get type from a bound Declaration.

 2006-02-04  Per Bothner  <per@bothner.com>

	* Expression.java (inline): New method.
	* LambdaExp.java (inline): New method, containing the part of
	InlineCall's walkApplyExp that handled LambdaExp functions.
	* ReferenceExp.java (inline): New method, likewise containing the
	ReferenceExp-handling parts of InlineCall's walkApplyExp.
	* QuoteExp.java (inline): New method, likewise containing the
	QuoteExp-handling parts of InlineCall's walkApplyExp.
	* InlineCalls.java (walkApplyExp): Replace most of the old code by
	a call of the new virtual 'inline' method.

2006-02-03  Per Bothner  <per@bothner.com>

	* BindingInitializer.java (emit): If name is a Symbol then emit a
	call to the new ThreadLocation.makePrivate(Symbol) method.

2006-01-20  Per Bothner  <per@bothner.com>

	* PrimProcedure.java (matchN): Do't cast the extraArg for a constructor.
	It might be a Class or String rather than a ClassType.
	We check in Invoke.typeFrom anyway.

2006-01-10  Per Bothner  <per@bothner.com>

	* ModuleContext.java (findInstance): Split out allocation into ...
	(makeInstance): New method.
	(findInstance): Don't require class of instance of match that of
	ModuleInstance.  This allow replacing of "proxy" instances.

	* ModuleExp.java (evalModule): Set ContextClassLoader for thread.

	* ModuleExp.java (allocFields): Don't make field for declaration
	whose value is a ModuleExp - as created by a module-name form.

	* Compilation.java (loadClassRef): moduleInstanceMainField
	may not have been set yet.

	* ModuleExp.java (debugPrintExpr): Move static field from here ...
	* Compilation.java: ... to here.
	* Compilation.java (compile): When debugging print expressions to
	standard error, rather than standard output.
	* ModuleExp.java (evalModule): Likewise.

2006-01-07  Per Bothner  <per@bothner.com>

	* ModuleExp.java (evalToClass): If url isn't specified,
	use default from CallContext's baseUri.

2006-01-05  Per Bothner  <per@bothner.com>

	* Compilation.java (loadClassRef): New overload takes ClassType.
	Partly for convenience, plus an optimization.
	* ClassExp.java: New new loadClasRef variant.
	* LitTable.java: Likewise.

2005-12-22  Per Bothner  <per@bothner.com>

	* ModuleExp.java (allocField): Alloc fields even if decl.ignorable().
	It's non-trivial to get this right, and it probably isn't worth it.
	Example: a define-syntax that binds to a lambda with syntax-case.
	The problem is that without the field we don't generate the method
	code - but we still addMethodFor the lambda.

2005-12-11  Per Bothner  <per@bothner.com>

	* ModuleExp.java (evalToClass, evalModule): Extra URL parameter.
	(evalToClass): If url passed-in, set class-loader's resource context.
	* Language.java (eval): Update call to evalModule.

	* Declaration.java (makeField): Only make fields final for ModuleExp
	and ClassExp - not for captured local variables and parameters.

2005-12-08  Per Bothner  <per@bothner.com>

	* LambdaExp.java (allocChildClasses): Don't special-case $finit$.
	(addApplyMethod): Don't select a ClassExp for apply methods.

	* Expression.java (compile(Compilation, Declaration)): New method.
	* SetExp.java (compile): Use new method for more informative eceptions.

	* ClassExp.java (print): Use Declaration's printInfo in header listing
	declarations, like we do for other ScopeExps.

	* CheckedTarget.java (initWrongType, emitCheckedCoerce):
	Use (new) WrongType constructors directly instead of calling 'make'
	static 	methods.  This generates slightly bigger bytecode, but it makes
	for nicer stack traces which don't include the WrongType.make call.

2005-12-05  Per Bothner  <per@bothner.com>

	* LambdaExp.java (addApplyMethods): "Swap" operands, replacing
	lexp parameter by this.  Fold getOwningLambda() call from callers.
	If the frameType doesn't extend ModuleBody, then we need to use
	the Compilation's moduleClass, so add it to the ModuleExp instead.
	This matches the logic in generateApplyMethodsWithoutContext.
	Otherwise, we might get different sets of methods for distinct
	owning LambdaExp's that end up in the same class's apply method,
	which will mess things up.

2005-12-04  Per Bothner  <per@bothner.com>

	* Keyword.java (as Symbol): New method.

2005-11-30  Per Bothner  <per@bothner.com>

	* InlineCalls.java (walkLambdaExp): New method.  Set type of
	'this' declaration.

	* Compilation.java (compile): Move addClass earlier, so super-class
	gets set before InlineCalls.

	* ChainLambdas.java (walkLambdaExp): Clear firstChild field.

2005-11-28  Per Bothner  <per@bothner.com>

	* Language.java (getLangTypeFor): New convenience method.
	* PrimProcedure.java (<init>): Use new getLangTypeFor method.

	* ClassExp.java (setClassName): If class is anonymous, then
	generate a name of the form 'mainClass$N' rather than 'objectN',
	* Compilation.java (mangleName): Support intermediate mangling
	scheme - reversible, except that '$' is left as is.
	(compile): Class name is no longer a parameter but set previously.
	(compileToFiles, compileToArchive): Likewise.
	* ModuleExp.java (evalToClass): Likewise.
	(getJavaName): Fix to use correct mangling.
	(classFor): New method.

	* ModuleExp.java (evalToClass): Use WrappedException.

2005-11-24  Per Bothner  <per@bothner.com>

	* ModuleExp.java (IMMEDIATE): New constant.
	(isStatic): If IMMEDIATE is set, default to static.  However, an
	explicit NONSTATIC_SPECIFIED or SUPERTYPE_SPECIFIED overrides.  The
	latter is used for KawaPageServlets in Echo2 mode.
	* Compilation.java (push): If immediate, set module's IMMEDIATE flag,
	rather then force static using STATIC_SPECIFIED.

2005-11-23  Per Bothner  <per@bothner.com>

	* ClassExp.java (setTypes): Set line numeber before error output.

	* Declaration.java (allocateVariable): If !isSimple return existing var.

	* Language.java (getTypeFor): Get class of ModuleExp.

	* Compilation.java (compile): Only set mainClass if it hasn't been
	set yet.  Also call getConstructor, in case needed by InlineCalls.
	
	At the Invoke.make and PrimProcedure level all construstor now
	take the ClassType as an extra parameter.  This is mostly hidden
	from user code, and the generate bytecode only passes a static link
	when needed.  The advantage is that we can generate better code.
	* Compilation.java (getConstructor): Check first if there is an
	existing constructor, since that papers over the hasOuterLink issue.

	* PairClassType.java (extractStaticLink): New static method.
	* PrimProcedure.java (isConstructor): New helper method.
	(numArgs, matchN, apply, compileArg, compile, getParameterType):
	Update for extra staticLink arg.
	(<init>): Re-arrange to fix some problems.
	(init): Set op_code to 182 if is_special.
	Leave off from argTypes array any actual static Link parameter.
	(getStaticFlag): True also if isConstructor().
	(compileArgs): Make private.  Take extra startAr 
	* ClassExp.java (declareParts): It is now safe to getConstructor
	here regardless of whether we will need a static link.
	(compile): Call ClassType's new setOuterLink method.

2005-11-22  Per Bothner  <per@bothner.com>

	* Compilation.java: For various static Field fields, initialize using
	getDeclaredField rather than addField.

	* PrimProcedure.java (compile/6): Rename to compileInvoke.
	 (compile/4): Make non-public.  Update to call compileInvoke.

2005-11-21  Per Bothner  <per@bothner.com>

	* Declaration.java (setSimple): If Variable is a parameter,
	don't make it simple.
	* LambdaExp.java (allocChildClasses): If decl has a Variable, use it.

	* LambdaExp.java (compileEnd): Split out tail part into ...
	(generateApplyMethods): ... new method.

	* LambdaExp.java (loadHeapFrame): Skip unneeded static link fields.
	Kind-of-kludgy, but fixes new test cases.

	* ClassExp.java (compilePushClass):  Generate better code.

	* ClassExp.java (compilePushClass):  Using getOwningLambda
	seems more correct/robust - though not sure.

	* ClassExp.java (compile): Call generateApplyMethods after methods
	have been compiled, in case initializers are emitted.
	Emit error if explicitInit and initializers are emitted.
	(generateApplyMethods): Add needed call.

	* Initializer.java (reportError): New method.
	* ProcInitializer.java	(reportError): New method.

	* ProcInitializer.java	(emitLoadModuleMethod): Handle the case of a
	ClassExp with a passed-in static link.

	* ClassExp.java (print): Also print flags.

2005-11-18  Per Bothner  <per@bothner.com>

	* Compilation.java (generateConstructor): Setup staticLinkField
	before calling super constructor, in case latter calls a method
	that needs static link.

2005-11-16  Per Bothner  <per@bothner.com>

	* ClassExp.java (makeClassPair): Remove field.
	(setMakingClassPair): Remove method.
	(isMakingClassPair): Is now just the inverse of isSimple().
	(<init>): New constructor, alocates and sets ClassType objects.
	(setClassName): New method, extracted from old setParts.
	Also call Compilation's addClass.
	(setParts): Remove no-longer-needed method.
	(setTypes): Simplify - always called with non-null Compilation.
	Types are now pre-allocated.
	(getType): Remove - just used inherited method.
	(walk): No need to call setParts.
	* ObjectExp.java (<init>): Call new super-constructor.
	* InlineCalls.java (walkClassExp): Remove, since non-inherited
	functionality is already done when the ClassExp was created.

	* Compilation.java (classPrefixDefault): New static field.
	(classPrefix): Initialize from classPrefixDefault.
	(compile): Remove prefix parameter.  Don't set classPrefix here.
	(compileToFiles): Remove prefix parameter.
	(compileToArchive): Update call to compile method.
	* ModuleExp.java (evalToClass): Likewise.

2005-11-14  thomas kirk  <tk@research.att.com>

	* Expression.java (print): Close OutPort.

2005-11-14  Per Bothner  <per@bothner.com>

	* PrimProcedure.java (matchN): Fix off-by-one-error.

2005-11-08  Per Bothner  <per@bothner.com>

	* ModuleContext.java (findInstance): Only re-use an instance if its
	class matches that in the ModuleInfo.

2005-10-31  Per Bothner  <per@bothner.com>

	* ModuleContext.java (getManager): New method.
	* ModuleInfo.java (classname, moduleClass): Make fields public.
	(sourceURL, lastCheckedTime, lastModifiedTime): New fields.
	* ModuleManager.java (searchWithSourcePath, findWithSourcePath,
	findWithURL): New methods.

2005-10-29  Per Bothner  <per@bothner.com>

	* ModuleContext.java: New class.
	* Makefile.am: Update accordingly.
	* ModuleInfo.java (moduleClass): Nwe field.
	(getModuleClass): New method.
	(instance): Remove field - now managed by ModuleContext.
	(getModuleExp): Simplify.
	(findFromInstance, register, getInstance): use ModuleContext methods.

2005-10-27  Per Bothner  <per@bothner.com>

	* Language.java (resolve): New method.
	* ModuleExp.java (evalModule): Call resolve.

	* ModuleManager.java: New class.
	* Makefile.am: Update accordingly.
	* ModuleInfo.java (next): New field, for chaining by ModuleManager.
	(find): Just call ModuleManager's findWithClassName.

	* Language.java (detect): New methods.

2005-10-19  Per Bothner  <per@bothner.com>

	* Declaration.java (makeField): Handle an unnamed declaration.
	This fixes a bug where an inner syntax-case needed to initialize
	its matchArray using a matchArray from an outer lambda.

2005-10-16  Per Bothner  <per@bothner.com>

	* PrimProcedure.java (<init>): Don't try to getReflectClass for a
	non-existing ClassType - i.e. one defined in this compilation.

	* PrimProcedure.java (<init>): Kludge - never set tostring_type
	for return type.

	* StackTarget.java (compileFromStack0): Use CodeAttr's new castNeeded
	method to suppress redundant casts also for ArrayTypes.

2005-10-14  Per Bothner  <per@bothner.com>

	* ClassExp.java (compile): Fix thinko - don't call default super
	constructor if we call super *or* this constructor.

	* ClassExp.java (explicitInit): New field.
	(declareParts): Set explicitInit if method name is "*init*.
	Don't declare default constructor if explicitInit.
	(compile): Don't emit default constructor if explicitInit.
	(compile): Special handling for explicit ("*init*") constructors.
	* Compilation.java (mangleName): Mangle '*init*" to "<init>".
	(callInitMethods): Make non-private since needed by ClassExp.
	* Expression.java (compileButFirst): New static method.
	* FindCapturedVars.java (walkClassExp): Don't getConstructor for
	default constructor if ClassExp has explicitInit.

	* Compilation.java (setLine(Expression)): New method.
	* Expression.java (compileNotePosition): Use new method.
	* ClassExp.java (compile): Set/restore current line number from method.
	* LambdaExp.java (allocParameters): Do putLineNumber.

2005-10-13  Per Bothner  <per@bothner.com>

	* PrimProcedure.java (<init>): Rearrange constructor code so we can
	set the return type to void if is_special.
	(isSpecial): New method.

	* Compilation.java (addClass): Move module.compileChildMethods
	invocation before we dump initializers, since compiling methods
	may require more initialization.
	Fixes bug reported 10-07 by Dominique Boucher.

2005-10-06  Per Bothner  <per@bothner.com>

	* InlineCalls.java (walkApplyExp): Add missing setLine call.
	* BindingInitializer.java (emit): Emit line number information.

2005-09-26  Per Bothner  <per@bothner.com>

	* Compilation.java (callContextVar): New field.
	(loadCallContext): Use and maybe set callContextVar.
	(generateConstructor): Temporarily clear callContextVar in new method.
	* LambdaExp.java (enterFunction):  Set callContextVar from parameter.
	(compileAsMethod): Likewise.
	(compileBody): Likewise.
	* IfExp.java (compile): Clear/restore callContextVar.

2005-09-25  Per Bothner  <per@bothner.com>

	* PrimProcedure.java (compile): New static method.
	(compile): Use new method.

	* ModuleExp.java (evalToClass): Load classes eagerly so we can do
	setReflectClass for all the generated classes.

2005-08-23  Per Bothner  <per@bothner.com>

	* LetExp.java (walkChildren): Update declaration's value.

2005-08-18  Per Bothner  <per@bothner.com>

	* FindCapturedVars.java (walkReferenceExp): Don't replace by value
	if getDontDereference().
	* ExpWalker.java (walkSetExp):  Update declaration's value.
	* InlineCalls.java (walkSetExp): Remove - use inherited method.

2005-08-07  Per Bothner  <per@bothner.com>

	* Compilation.java (pushChain): Partly inline call to push(ScopeExp),
	but avoid needless calls to mustCompileHere() because of TemplateScope.

2005-08-05  Per Bothner  <per@bothner.com>

	* Declaration.java (makeField): Instead of isPrivate() method use
	isPublic() method which also requires that the context be a ModulExp.
	Fixes Savannah bug #14037 (leaking lexical bindings).

2005-08-04  Per Bothner  <per@bothner.com>

	* ClassExp.java (declareParts): Declare constructor, if class static.

2005-08-03  Per Bothner  <per@bothner.com>

	* InlineCalls.java (walkApplyExp): No longer call rewriteToInvocation.
	Instead call ClassMethodProc's rewrite method.
	(rewriteToInvocation): Remove no-longer used method.

	* Declaration.java (getValue): Load (lazily) from final static field.
	(getConstantValue): Use getValue.

	* Declaration.java (getDeclarationFromStatic): New static method.

2005-07-28  Per Bothner  <per@bothner.com>

	* Symbols.java (generateInt): New static synchronized method.
	(generate, gentemp): Use generateInt, thereby adding missing
	synchronization.

2005-07-27  Per Bothner  <per@bothner.com>

	* ModuleBody.java (runAsMain(String[])): Sprit into two methods,
	one static and one non-static.  Deprecate old method.
	(processArgs, runAsMain()): New methods.
	* Compilation.java (generateConstructor):  Call new methods.

2005-07-23  Per Bothner  <per@bothner.com>

	* Language.java (setDefaults):  Set global/default environment to
	that of the initial (main) thread.

	* BuiltinEnvironment.java (getLocation): Update parameter list.

	* FluidLetExp.java (compile):  setWithSave andf setRestore now take
	an extra CallContext parameter.

2005-07-21  Per Bothner  <per@bothner.com>

	* ModuleBody.java (runAsMain): Use other defineAll overload.

	* Declaration.java (load): Note that field's declaraing class is used.

	* Language.java (userEnv, encOunter): New fields.
	(getEnvironment): New method.
	(getNewEnvironment): Restore previously-removed method, but now
	using the userEnv field.
	(getTypeFor, getPrompter, eval): Use new getEnvironment method.

	* ModuleBody.java (runAsMain): Call kawa.repl.processArgs.

2005-07-20  Per Bothner  <per@bothner.com>

	* Language.java (defAliasStFld): New method.

	* Compilation.java (addClass): Call dumpInitializers inside a loop, in
	case emiting an initialier creates more - just like we do in
	generateConstructor.  Fixes Savannah bug #13821.
	(generateConstructor): Use dumpInitializers.
	This removes need for invoking Initializer.reverse.

	* ProcInitializer.java (emitLoadModuleMethod): If there are keyword
	arguments, set resulting maxArgs() to -1.
	Fixes Savannah bug #13854.

2005-07-05  Per Bothner  <per@bothner.com>

	* Declaration.java (needsExternalAccess): Returns true if a
	namespace declaration.
	* ModuleExp.java (allocFields): Alloc field if a namespace declaration.
	Fix (work-around) for Savannah bug #13601.

2005-06-27  Per Bothner  <per@bothner.com>

	* ReferenceExp.java (context, contextDecl): Mome field and methods
	to super-class ...
	* AccessExp.java (context, contextDecl): ... here.
	* FindTailCalls.java (walkReferenceExp, walkSetExp): If there is a
	contextDecl(), mark it as readable.
	* FindCapturedVars.java (walkSetExp): Pass context to capture.
	(capture): If containing Declaration is needed, capture it.
	* SetExp.java (compile): Pass context to Declaration's load.
	Fixes Savannah bug #4881.

	* SetExp.java (toString): New method.

2005-06-26  Per Bothner  <per@bothner.com>

	* LambdaExp.java (capture): New method.
	* FindCapturedVars.java (capture): Use new method.

	* Declaration.java (makeField): Make static fields for "dynamic"
	variables implemented using ThreadLocation.

2005-06-19  Per Bothner  <per@bothner.com>

	* Compilation.java (generateApplyMethodsWithContext): More carefully
	calculate method arguments to fix reported problems.
	(generateApplyMethodsWithoutContext): Likewise.

2005-06-15  Per Bothner  <per@bothner.com>

	* LambdaExp.java (addMethodFor): If nested in a ClassExp, add method
	to that class.  Fixes a verification error if it references a private.
	* Compilation.java (generateApplyMethodsWithContext): Tweak argument
	count calculation and pushing this for above case.
	(generateApplyMethodsWithoutContext): Likewise.

	* InlineCalls.java (walkApplyExp): Optimize call to method in same
	ClassExp.  This fix a bug when $this$ isn't captured.
	Fixes bug reported by Dean Ferreyra 06-09.

2005-06-11  Per Bothner  <per@bothner.com>

	* PrimProcedure.java: Use calls to usedType from one compile method,
	to method that it calls - and that is sometimes called directly.

2005-06-04  Per Bothner  <per@bothner.com>

	* Language.java:  Update for AbstractFormat move to gnu.lists.
	* QuoteExp.java: Likewise.

	* Language.java (getFormat): Change return type to AbstractFormat.
	(print): Update variable saveFormat to match OutPort's objectFormat.
	* QuoteExp.java (print): Likewise.

	* QuoteExp.java (toString): New method.

2005-06-03  Per Bothner  <per@bothner.com>

	* Language.java (declFromField): New method.  Body taken from
	ModuleInfo's makeDeclInModule1.
	* ModuleInfo.java (setupModuleExp): Inline what's left of
	makeDeclInModule1.
	(makeDeclInModule1): Remove method.

2005-06-02  Per Bothner  <per@bothner.com>

	* FindCapturedVars.java (cpature): If we have a context, we don't
	need to capture it - just mark it non-Simple.
	* ModuleInfo.java *getModuleExp): Inline from ModuleExp.make.
	(setupModuleExp, findFromInstance): New methods.
	(makeDeclInModule1, makeDeclInModule1): New methods, moved over from
	kawa.standard.require.
	(makeDeclInModule1): Don't need to setCapturedScope of Macro.
	* ModuleExp.java (info): New field.
	(make(String), make(ClassType)): Remove no-longer-needed methods.
	(firstDecl): Simplify - just use setupModuleExp.

	* ScopeExp.java (getDefine): Simplify by emitting two diagnostic
	messages on redefinition, since errors are no longer sorted.

2005-06-01  Per Bothner  <per@bothner.com>

	* ReferenceExp.java (<init>(Declaration)): Un-inline other constructor,
	to simplify debugging.

	* LambdaExp.java (allocChildClasses): Remove unused variable
	method_static.

2005-05-31  Per Bothner  <per@bothner.com>

	* InlineCalls.java (walkReferenceExp): New method - expand constants.
	* FindCapturedVars.java (capture): Don't short-circuit constants.
	Fixes bug reported 5/11 by Dominique Boucher.

	* PrimProcedure.java (compileArgs): Skip implicit isThisParameter().

2005-05-30  Per Bothner  <per@bothner.com>

	* Compilation.java: Remove pointless calls to setArtificial.
	* FindCapturedVars.java: Likewise.
	* LambdaExp.java: Likewise.

	* ThisExp.java (THIS_NAME): New static field.
	(<init>): Use THIS_NAME.
	(isForContext): New method.
	(eval, compile): Use it.  We default to the super behavior otherwise.
	* FindCapturedVars.java (walkThisExp): Likewise.
	* Declaration.java (isThisParameter): New method.
	* ClassExp.java (walkChildren): If the first parameter of a method
	isThisParameter, then set its type, if known.
	* LambdaExp.java (declareThis): If first param isThisParameter(),
	then note its Variable. 
	(addMethodFor): Skip first parameter if isThisParameter().
	(print): Don't get confused by isThisParameter().
	This fixes Savannah bug #10806.

	* FindCapturedVars.java (walkApplyExp): Force walk of function
	if NONSTATIC_SPECIFIED, to catch "non-static referenced by static"
	error in this case.
	(capture): Simplify "non-static referenced by static" message.

	* ClassExp.java (print): Simplify output.

2005-05-27  Per Bothner  <per@bothner.com>

	* ModuleExp.java (evalToClass): Don't set immediate flag here -
	it's supposed to be set earlier.

	* ThisExp.java (compile): Add an extension for static methods,
	which is used by define_syntax.
	* ProcInitializer.java (emitLoadModuleMethod): If module is static,
	use moduleInstanceMainField to access current $instance.

	* ClassExp.java (AbstractMethodFilter): Change to inner class.

	* Compilation.java (addClass): Don't call run method from <clinit>
	if immediate, even if --module-static-run was specified, since it
	needs to be done after declarations are made public in evalModule.

2005-05-19  Per Bothner  <per@bothner.com>

	* ClassExp.java (slotToMethodName): If we need to mangle, use the
	non-reversible mangling used for method names.

2005-05-19  Per Bothner  <per@bothner.com>

	* Compilation.java (pushScope):  New helper method - needed for Lambda.
	(push, letStart): Use it.

2005-05-18  Per Bothner  <per@bothner.com>

	* LitTable.java: Use use:java.util.IdentityHashMap, instead of
	JAVA2 - which was wrong since IdentityHashMap is new in JDK 1.4.

2005-05-18  Per Bothner  <per@bothner.com>

	* Language.java (getLangEnvironment): Renamed from getEnvironment.
	(getEnvironment): Now is just an alias for Environment.getCurrent().
	* BuiltinEnvironment.java (getLangEnvironment): Use new method.

2005-05-17  Per Bothner  <per@bothner.com>

	* Language.java (eval): Pass current Environment, rather than language
	Environment, to evalModule.

2005-05-14  Per Bothner  <per@bothner.com>

	* Declaration.java (makeField): New overload, takes frame class.
	* LambdaExp.java (enterFunction): Use new makeField.  This is needed to
	handle indirect bindings, as might be forced by location or fluid-let.
	* FindCapturedVars.java (walkFluidLetExp): Only allocate an unbound
	decl if base is null - i.e. if there is no lexical binding.
	* LetExp.java (store_rest): Replace emitStore call by more general
	compileStore in the indirectBinding case.
	* SetExp.java (compile): Simplify for correct indirectBinding case.
	* FindTailsCalls.java (walkFluidLetExp): If there is a base declaration
	note that it too can be read/written.

	* ScopeExp.java (addDeclaration): Trivial optimizations.

2005-05-10  Per Bothner  <per@bothner.com>

	* PrimProcedure.java (<init>): Remove unused constructor.
	Simplify another constructor by using new ClassType.getMethod.

	* PrimProcedure.java (<init>, init): If talesContext(), method
	return type is void, so we set retType to Object.
	Fixes bug reported 2005-05-08 by dominique.boucher@nuecho.com.

2005-05-08  Per Bothner  <per@bothner.com>

	* BuiltinEnvironment.java: New class, extends Environment.
	* Makefile.am: Update accordingly.
	* Compilation.java (getEnvironment): Remove now-inappropriate method.
	(resolve): Use Environment.getCurrent() instead of getEnvironment.
	* Declaration.java (load): Likewise.
	* InlineCalls.java (walkApplyExp): Likewise.
	* Language.java: Set global Environment to a BuiltinEnvironment.
	(setEnvironment, getNewEnvironment): Remove methods.
	(lookupBuiltin): New method.
	(setDefaults): Language enviroment should *not* be current environement.
	(eval): Don't change current Environment.
	(runAsApplication): Don't need to explicitly create Environment.

2005-05-08  Per Bothner  <per@bothner.com>

	* ModuleBody.java (runAsMain): Call zero-argument run(), which checks
	runDone, though only if results should not be printed.

2005-05-06  Per Bothner  <per@bothner.com>

	* Language.java (current): Update ThreadLocation construction.
	* BindingInitializer.java (emit): Argument to makePrivate method of
	ThreadLocation now takes a String.

2005-04-21  Per Bothner  <per@bothner.com>

	* SetExp.java: Give consistent visibility and finality to constants.

	* ReferenceExp.java (context): Make private.
	(contextDecl, setContextDecl): New accessor methods.
	(compile): Use new methods.
	* Declaration.java (load): Likewise.
	* SetExp.java (compile): Likewise.

	* FindCapturedVars.java (walkReferenceExp, capture): Likewise.
	* FindTailCalls.java (walkDecl): Likewise.

2005-04-20  Per Bothner  <per@bothner.com>

	* Declaration.java (load): Use new CREATE_FIELD_REFERENCE flag.
	(setValue): New method.
	(MODULE_REFERENCE): New constant.
	(makeField): Don't prepend PRIVATE_PERFIX if MODULE_REFERENCE.
	* FindTailCalls.java (walkDecl): May need to set EXTERNAL_ACCESS
	of context variable.
	* ReferenceExp.java (CREATE_FIELD_REFERENCE): New constant.
	* SetExp.java (compile): "Inline" call to followAliases, so we
	can extract 'context' field.  Use that context.

	* FindTailCalls.java (walkDecl): Trivial optimization.

2005-04-20  Per Bothner  <per@bothner.com>

	* Declaration.java (loadOwningObject): Make non-public.
	Add 'owner' parameter.
	(load): Simplify by passing owner to loadOwningObject.
	(compileStore): Update to pass null 'owner' to loadOwningObject.
	* LambdaExp.java (enterFunction): Likewise.
	* SetExp.java (compile): Likewise.

2005-04-03  Per Bothner  <per@bothner.com>

	* TypedValue.java: Fix javadoc.

2005-03-31  Dean Ferreyra <dferreyra@igc.org>

	* ModuleExp.java (STATIC_RUN_SPECIFIED): New flag.
	(staticInitRun): Check new flag.

2005-03-29  Per Bothner  <per@bothner.com>

	* ModuleExp.java (firstDecl): Get instance using ModuleInfo.
	* ModuleInfo.java (exp): New field.
	(getModuleExp): New method.

	* ResolveNames.java (resolveModule): Do Compilation.setCurrent.

	* QuoteExp.java (getType): Type of undefined_exp is Object.

2005-03-27  Per Bothner  <per@bothner.com>

	* ClassExp.java (compile): Don't declareThis is STATIC_SPECIFIED.

2005-03-25  Per Bothner  <per@bothner.com>

	* BindingInitializer.java (create): New factory method.
	* Declaration.java (load): Minor code re-arranging,makes it easier
	to set correct stack type in variable rtype.
	* Declaration.java (load): No longer need to DEFER_DECL_BASE, since we
	now get inported module instances at init time, rather than 'run' time.
	(EARLY_INIT): New flag.
	(makeField): Set type to more precise FieldLocation if applicable.
	Using BindingInitializer - but not if EARLY_INIT.
	* SetExp.java (compile): Remove DEFER_DECL_BASE special handling,
	but add special handling for EARLY_INIT instead.
	* ReferenceExp.java (DEFER_DECL_BASE): Defer no-longer-used flag.
	This re-fixes Savannah bug #11822.

2005-03-23  Per Bothner  <per@bothner.com>

	* Compilation.java (push): Set STATIC_SPECIFIED if immediate module.
	(addClass): This allows removing some special casing for immediate.
	If immediate call ModuleExp.setupLiterals to do so.
	(generateConstructor): Don't register an immediate module.
	* ModuleExp.java: In immediate mode initialize literals using a
	call-back from the <clinit> to new setupLiterals method.
	(setupLiterals): New static method, called from compiled code.
	(evalModule): Cleanup importing of module-exported declarations.
	* Declaration.java (makeField): Don't need special case for immediate.
	* LambdaExp.java (allocFieldFor): Likewise.

2005-03-22  Per Bothner  <per@bothner.com>

	* BindingInitializer.java: Generalize to work without a field.
	(<init>): Remove field parameter - set it from decl.field.
	(emit): If no field, use decl's type instead of field type.
	Store value into local Variable if there is no field.
	* Declaration.java (makeField): Adjust call to match.

2005-03-18  Per Bothner  <per@bothner.com>

	* CatchClause.java (<init>): Change to take a LambdaExp rather than
	a LetExp - with a bogus init value.  Fixes Savannah bug #11540.

	* CatchClause.java (print): Add writeSpaceFill call.
	* TryExp.java (print): Likewise.

2005-03-17  Per Bothner  <per@bothner.com>

	* ProcInitializer.java (<init>): Undo yesterday's change - we really
	should initialize a static field in <clinit> - especially if final.

	* Language.java: Make the default current language be fluid.
	(defaultLanguage): Remove field, replace by ...
	(current): New static ThreadLocation field.
	(getDefaultLanguage, setDefaultLanguage): Update accordingly.
	(setDefaults): Must setDefaultLanguage after we set default
	Environment, since ThreadLocation depends on Environment.
	(runAsApplication): Update accordingly.

2005-03-16  Per Bothner  <per@bothner.com>

	Change handling of static module to be more similar to non-static. 
	* Language.java (defineAll): Skip *$instance and PRIVATE_PREFIX fields.
	* ModuleExp.java (staticInitRun): New method.
	* Compilation.java (moduleStatic): Change to handle --module-static-run.
	(addClass): Static modules now implement Runnable.
	(addClass): Static modules now use "run", instead of "$run$".
	Call to generateConstructor for static module must now be done after
	body is emitted, since ProcInitializers are no longer static.
	Create and initialize $instance field.module.staticInitRun
	Emit call to run in <clinit> only if 
	(generateConstructor): Register module.
	* ProcInitializer.java (<init>): No longer place on clinitChain.

	* ModuleBody.java (runDone): New field.
	(run): Return immediately if run done earlier.
	* ModuleInfo.java (register): New static method.
	(getInstance): If there is a static $instance field, use that.
	(needsRun): Remove field - run checks runDone instead.
	(getRunInstance): Don't check needsRun.

2005-03-11  Per Bothner  <per@bothner.com>

	* Language.java (defProcStFld): Call FieldLocation's setProcedure.

2005-03-07  Per Bothner  <per@bothner.com>

	* Language.java: Merge in remaining methods from Interpreter.
	* Interpreter.java: Removed class.
	* Makefile.am: Update accordingly.

	* Compilation.java: Update Interpreter -> Language.
	* ConditionalTarget.java: Likewise.
	* NameLookup.java: Likewise.
	* ScopeExp.java: Likewise.

2005-03-04  Per Bothner  <per@bothner.com>

	* Interpreter.java (getPromter): Remove unused method.
	(eval - various overloaded versions): Move to Language.
	(defaultInterpreter): Rename to defaultLanguage and made non-public.
	* Language.java (eval - various): Moved from Interpreter.
	* ModuleBody.java: Update Interpreter->Language various places.
	* SetExp.java: Likewise.

	* Compilation.java (getInterpreter): Remove deprecated method.
	* BindingInitializer.java: Update Interpreter->Lanuguage various places.
	* InlineCalls.java: Likewise.
	* ModuleExp.java: Likewise.

2005-03-03  Per Bothner  <per@bothner.com>

	* ReferenceExp.java (context): New field.
	(DEFER_DECL_BASE): New constant.	
	(eval): "Optimize" if constant - needed for odule imports.
	(compile): Replace body by call to Declaration's load method.
	* Declaration.java (load): Generalize, take extra parameters.
	Merge in functionality from ReferenceExp.compile.
	(needsContext): New method.
	(followAliases): Some simplification.  Now used much less.
	(makeField): Simplify due to some clarifications.
	* FindCapturedVars.java (capture(Declaration, Declaration)): New
	method.  We need to be a little smarter about aliases.
	(walkSetExp): Ignore if ignorable.
	* FluidLetExp.java: Update for new load method from Declaration.
	* ModuleExp.java (evalModule): Use new FieldLocation class.
	(allocFields): Do pass value to makeField if isAlias().
	* SetExp.java (compile):  If needed, emit setInstance call.

2005-03-02  Per Bothner  <per@bothner.com>

	* Declaration.java (makeField): Field.setConstantValue now handles
	boolean and char fields - but expects java.lang.Character.

2005-02-25  Per Bothner  <per@bothner.com>

	* Declaration.java (makeField): Revert 2005-02-11 change.
	* BindingInitializer.java (emit): In the default case of an indirect
	but not dynamic/fluid, create an "anonymous" ThreadLocation instead.

2005-02-24  Per Bothner  <per@bothner.com>

	* ScopeExp.java (popScope): New method.
	* ApplyExp.java (compile): Use new popScope method.
	* FluidLetExp.java (compile): Likewise.
	* LambdaExp.java (compileEnd): Likewise.
	* LetExp.java (compile): Likewise.
	* FluidLetExp.java (compile): Remove redundant pushScope/popScope pair.

	* FindTailCalls.java (walkSetExp): Move setCanWrite so it is only
	called for SetExp, not LetExp.

	* LambdaExp.java (loadHeapFrame): Use getCaller method.

	* Compilation.java (getLanguage): Change return type to Language.
	* IfExp.java (getInterpreter): Change to getLanguage.
	* ClassExp.java: Update Interpreter -> Language etc.
	* FindCapturedVars.java: Likewise.
	* InlineCalls.java: Likewise.
	* ModuleMethod.java: Likewise.
	* PrimProcedure.java: Likewise.
	* QuoteExp.java: Likewise.

	*  Interpreter.java (getInstance): Change return type.
	(getInstanceFromFilenameExtension): Change return type and internals.
	* Language.java (setDefaults): New static helper method.

2005-02-16  Per Bothner  <per@bothner.com>

	* Declaration.java (setName): Move closer to getName and setSymbol.

2005-02-15  Per Bothner  <per@bothner.com>

	* ModuleInfo.java: New class.
	* Makefile.am: Update accordingly.

	* Expression.java (match0): New method.
	(eval(CallContext)): Use match0.
	* BeginExp.java (apply): Use match0 to setup tail-call.
	* IfExp.java (apply): Likewise.
	
	* ApplyExp.java (apply): Defer Procedure cast.

2005-02-14  Per Bothner  <per@bothner.com>

	* ModuleExp.java (evalModule): Fix think eval -> apply.

2005-02-12  Per Bothner  <per@bothner.com>

	* Expression.java: Change to extens Procedure0.
	(apply0): New final method.
	(eval(Environment,CallContext)): Remove method, in favor of ...
	(apply(CallContext)): ... this new method.
	(eval(CallContext)): New final helper method.
	* ApplyExp.java (apply(CallContext)): New tail-call-safe method.
	(eval(Environment,CallContext)): Above replaces this method.
	* IfExp.java (apply(CallContext)): New method, replaces ...
	(eval(Environment,CallContext)): ... this replaced method.
	* BeginExp.java (apply(CallContext)): New tail-call-safe method.

	* LambdaExp.java (setName(String), setName(Object), getName):
	Remove methods that conflict with Named, which is now an ancestor.
	(name): Remove field used by setName/getName.
	(toString, addMethodFor, print): Use methods instead of 'name' field.
	* ClassExp.java: Use getName/getSymbol methods instead of name field.
	* ModuleExp.java: Likewise.
	* ProcInitializer.java (emit): Don't emit "name" property.

2005-02-12  Per Bothner  <per@bothner.com>

	* SetExp.java (compile): Call new setAlias method for aliases.

	* AccessExp.java: New class, extends Expression.
	(binding): Make field private.
	* Makefile.am: Update accordingly.
	* ReferenceExp.java (symbol, binding): Move fields to AccessExp.
	(getName, getSymbol, getBinding, setBinding): Likewise.
	* SetExp.java: Ditto.

	* SetExp.java (flags): Remove private field - use inherited field.

2005-02-11  Per Bothner  <per@bothner.com>

	Any non-alias indirect field should use ThreadLocation for
	proper Location access when multiple threads are mixed.
	* BindingInitializer.java (emit):  Create a ThreadLocation rather
	than a plain single-thread Location if decl is indirect non-alias.
	* Declaration.java (makeField): Make indirect non-alias field static.
	Fixes Savannah bug #11801.

	* Interpreter.java (defineFromFieldValue): Handle the case of Location
	with non-null getKeySymbol but not NamedLocation - e.g. ThreadLocation.

2005-02-07  Per Bothner  <per@bothner.com>

	* ReferenceExp.java (compile): Use new StaticFieldLocation.make.
	Fixes Savannah bug #11822 - but only for macros in static modules.

2005-01-31  Per Bothner  <per@bothner.com>

	* InlineCalls.java (walkLetExp): New method - propagate types.

2005-01-30  Per Bothner  <per@bothner.com>

	* ModuleExp.java (evalModule): Extract value if decl IS_CONSTANT.
	Fixes Savannah bug #11791.

	* Compilation.java (compile): Wrap Throwable if needed. Print messages.
	(addClass): Don' catch exceptions and exit here.  Handle later.

2005-01-28  Per Bothner  <per@bothner.com>

	* Compilation.java (loadClassRef):  Fix JAVA5 case to use
	emitPushClass, which fixes a popType error.  Then comment the JAVA5
	case out because it causes a verification error I haven't figured out.

2005-01-25  Per Bothner  <per@bothner.com>

	* Compilation.java (interp): Remplace field by ...
	(language): ... new field.
	(getLanguage): New method.
	(getInterpreter):  Update, deprecate.
	(<init>):  Take Language rather than Interpreter.
	Update various places.

2005-01-22  Per Bothner  <per@bothner.com>

	* Interpreter.java (getDefaultLanguage, setDefaultLanguage): New.

2005-01-19  Per Bothner  <per@bothner.com>

	* Language.java: New class, extends Interpreter.
	* Makefile.am: Update accordingly.
	* Interpreter.java: Note that Language should be used instead.

2005-01-16  Per Bothner  <per@bothner.com>

	* Interpreter.java (getFormat, getName, getTypeFor): Provide default
	implementations for formerly abstract methods.

2005-01-09  Per Bothner  <per@bothner.com>

	* ClassExp.java (compilePushClass): Use new loadClassRef method.
	* Compilation.java (loadClassRef): New helper method.
	(getForNameHelper): Handle Java1, which doesn't have 3-operand forName.

	* ModuleExp.java (make(ClassType)): New constructor.
	(writeExternal): If a non-existing class, write ClassType, not String.
	(readExternal): Handling reading either a ClassType or a String.
	* LitTable.java (store): New private helper method.
	(emit): Use store.
	(emit): Special handling of not-existing ClassType literals.
	This fixes Savannah bug #11491.

2005-01-08  Per Bothner  <per@bothner.com>

	* Declaration.java (load): If immediate and constant, load latter.
	Needed for the instance value from requiring a module.
	(getConstantValue): Return null if undefined_exp.

	* ThisExp.java (EVAL_TO_CONTEXT): New constant.
	(context): Type is always a ScopeExp.
	(makeGivingContext): New factory method.
	(eval): New method.

2005-01-07  Per Bothner  <per@bothner.com>

	* FluidLetExp: Use class name to static reference, to shut up ecj.
	* LambdaExp.java: Likewise.

	* LitTable.java: Comment out line if JAVA2, which is the default.

2005-01-05  Per Bothner  <per@bothner.com>

	* Compilation.java: Remove various unused static fields.

2005-01-03  Per Bothner  <per@bothner.com>

	* LitTable.java (liertaltable): Use an IdentityHashMap #ifndef JAVA2.

2005-01-02  Per Bothner  <per@bothner.com>

	* Compilation.java: Change "select" (preprocessor) syntax.

2004-12-29  Per Bothner  <per@bothner.com>

	* Declaration.java (makeField): If immediate,make fields final and
	static, but do initialization in <init>, not <clinit>.
	* SetExp.java (compile): Make immediate mode more consistent
	with non-immediate mode by removing two tests.
	(allocFields): Can avoid immediate-mode kludge.
	* Interpreter.java (getEnvPropertyFor): New method.
	* ModuleExp.java (evalModule):Import declarations from immediate-mode
	modules by iterating over module's declarations..

2004-12-27  Per Bothner  <per@bothner.com>

	* Compilation.java (isStatic): New method.
	* ProcInitializer.java: Use it.

2004-12-24  Per Bothner  <per@bothner.com>

	* Expression.java (compileWithPosition - 2 methods): Use new
	putLineNumber method, also passing in the filename.
	* Compilation.java: Likewise, various places.

	* Compilation.java (emitSourceDebugExtAttr): New static.
	(addClass): Optionally call setStratum, which causes a
	SourceDebugExtension attribute to be generated.

	* QuoteExp.java (print): If value is an Exprssion, just print short
	toString format, since otherwise macro expansion can cause a cycle.

	* ExitExp.java (print): Write extra space.

2004-12-22  Per Bothner  <per@bothner.com>

	* Compilation.java (syntaxError): Move here from Translator.

2004-12-20  Per Bothner  <per@bothner.com>

	* Keyword.java:  New extends Symbol.
	(keywordTable): Field replaced by ...
	(keywordNamespace): New static field.
	(make, readResolve): Rewrite to use Namespace methods.
	(hashCode, getName): removed - inherited from Symbol.

2004-12-05  Per Bothner  <per@bothner.com>

	Update for new Symbol/Location changes.
	* BindingInitializer.java (createNewSymbol): Replace field with
	new local lookupInEnv in emit.
	(emit): Looking up Location may need FUNCTION property.
	(makeLocationMethod): New helper method.
	* Compilation.java: Various updates.
	(getEnvironment): New method.
	* Declaration.java (load): Update kludge for immediate mode.
	(UNKNOWN_PREFIX): Changed, since it now names Location, not Symbols.
	(IS_DYNAMIC): New constant.
	(initBinding): Remove method.
	(followAliases): Stop if aliased field is non-static.
	* FindCapturedVars.java (allocUnboundDecl): Handle FUNCTION binding.
	* FluidLetExp.java (compile, doInits): Rewrite for new fluid handling.
	* InlineCalls.java: Update.
	* Interpreter.java (define_method): Remove method.  Replace by
	(defineFunction): New method.
	(defineFromFieldValue): Take field instead of name.  Rewrite,
	(getEnvPropertyFor, getSymbol): New helper methods.
	(getDefaultSymbolValue, getSymbolValue, getSymbolProcedure): Remove.
	* ModuleBody.java: Update ClassMemberConstraint -> ClassMemberLocation.
	* ModuleExp.java (evalModule): Don't do defineAll.
	* ReferenceExp.java (eval, compile): Update for new Location handling.
	* SetExp.java (eval, comple): Likewise.

	* LetExp.java: Optimize letrec-like bindings.

	* ModuleExp.java: Implement externalizable.
	(writeExternal, readExternal): New methods.
	(LAZY_DECLARATION): New constant.
	(make): New static method.
	(firstDecl): New method - get lazy declarations.

	* ThisExp.java (getType): Simplify. Also do getType of ModuleExp.

2004-12-05  Per Bothner  <per@bothner.com>

	* Declaration.java (getCode, setCode): New methods.
 	* Declaration.java (needsExternalAccess): New helper method.
	(makeField): Use it.
	(makeField): Check for existing field to guards against duplicates.
	* LambdaExp.java (allocFieldFor): Use needsExternalAccess.
	(addMethodFor): Check needsExternalAccess().

	* Declaration.java (IS_DYNAMIC): New constant.
	* Expression.java (setLine): New method.
	* LambdaExp.java (setType): New method.
	* ScopeExp.java (firstDecl): Make non-final, for the sake of ModuleExp.

	* GenericProc.java (methods): Make protected, for new ClassMethodProc.
	(add): New method overloading.  Make synchronized.
	Fix bug where minArgs didn't get changed from 0.
	* PrimProcedure.java (getMethodFor): Add method overloadings.
	Check for GenericProc.
	
	* Symbols.java (makeUninterned): Remove unused method.

2004-12-02  Per Bothner  <per@bothner.com>

	* ApplyExp.java (tailCall): Turn field into flag.
	(TAILCALL): New flag.
	(isTailCall, setTailCall, compile): Modify appropriately.

	* ApplyExp.java (INLINE_IF_CONSTANT): New flag.
	(inlineIfConstant): Add overload.
	Also recognize reference to constant.
	* InlineCalls.java (walkApplyExp): Maybe call inlineIfConstant.

	* InlineCalls.java (walkApplyExp): Check for null base of decl.

2004-11-16  Per Bothner  <per@bothner.com>

	* InlineCalls.java (walkIfExp): Handle null else_clause.

	* Interpreter.java (define_field): Remove unused methods.

2004-11-15  Per Bothner  <per@bothner.com>

	* ScopeExp.java (getVarScope): New method. Allocate scope if needed.
	(<init>): Don't allocate scope field until needed.
	(scope): Make private.
	* ApplyExp.java: Use getVarScope methods.
	* CatchClause.java: Likewise
	* Compilation.java: Likewise
	* Declaration.java: Likewise
	* FluidLetExp.java: Likewise
	* LambdaExp.java: Likewise
	* LetExp.java: Likewise

	* Declaration.java (printInfo(StringBuffer)): New method.

2004-11-14  Per Bothner  <per@bothner.com>

	* Interpreter.java (defProcStFld): Two new methods.

2004-11-10  Per Bothner  <per@bothner.com>

	* Compilation.java (addClass): If static, name apply_method "$run$",
	and make it private, to avoid Jikes complaining about inheritance.

2004-11-05  Per Bothner  <per@bothner.com>

	* LambdaExp.java (count, id): Move to ScopeExp.
	* ScopeExp.java (counter, id): New fields.
	(toString): New method.

	* LambdaExp.java (allocFieldFor): Take into account EXTERNAL_ACCESS.

	* LambdaExp.java (getRetunrType): A little safety addition.

	* ScopeExp.java (replaceFollowing, nesting): New methods.
	(remove): Fix bug using wrong variable.

	* ModuleExp.java (alwaysCompile): New static flag.
	(evalModule): Use new flag, and eliminate extra tests.

	* Compilation.java (setCurrentScope): New method.
	(getCurrent, setCurrent): New static methods.
	* Declaration.java (setSymbol): New method.

	* Interpreter.java (languages): Add "xq" and "xquery" as extensions
	for XQuery, to match section H.2.3 of 20041029 XQuery draft.

	* InlineCalls.java (walkApplyExp):  More specific error message.

	* CatchClause.java (<init>): New constructor.
	(print): Do pretty-printing.
	* TryExp.java (print): Do pretty-printing.
	* LetExp.java (print): Print more info, more robustly.

2004-10-27  Per Bothner  <per@bothner.com>

	* ModuleExp.java (mustCompile): Move field from here ...
	* Compilation.java (mustCompile): ... to here.
	(mustCompileHere): Is now much simpler.
	* ModuleExp.java (evalModule):  Update accordingly.

	* ModuleExp.java (dumpZipCounter):  Removed/replaced by ...
	(interactiveCounter): ... new static field, updated by Shell.run.
	(evalToClass): Use interactiveCounter instead of dumpZipCounter.

	* ModuleExp.java (evalModul):  Don't print expression if mustCompile,
	since then Compililation.compile takes care of it.

2004-10-23  Per Bothner  <per@bothner.com>

	* Compilation.java (compileToFiles):  Move debugPrintExpr handling ...
	(compile): ... to here, so it also works when compiling to archive.

	* Compilation.java (compileToArchive):  Enable .jar support.

	* FindTailCalls.java (walkLetExp): Optimize letrec-like forms.
	(walkSetExp): Supress assignment if optimized above.

	* LetExp.java (compile): If init value is #!undefined, convert
	to #!null or zero.
	
	* QuoteExp.java (getInstance): New static method.

2004-10-23  Per Bothner  <per@bothner.com>

	* CheckedTarget.java (argno): Make field 1-orgin, matching WrongType.
	(<init>): New constructor, for general non-call casting.
	(getInstance): New factor method, for non-call casting.
	(initWrongType): Called methods now take extra parameter.
	(emitCheckedCoerce): Take an extra Variable with argValue.
	(emitCheckedCoerce): Pass incoming value to WrongType.make.
	* LambdaExp.java (enterFunction): Adjust argument number to 1-origin.
	* PrimProcedure.java (compileArgs): Likewise.
	* Compilation.java (generateApplyMethodsWithoutContext,
	generateApplyMethodsWithContext): Likewise.
	(generateApplyMethodsWithoutContext): Pass incoming Variable to
	CheckedTarget.emitCheckedCoerceif there is one.
	* LetExp.java (compile): Coerce value using CheckedTarget.

2004-10-14  Per Bothner  <per@bothner.com>

	* Compilation.java (usedClass):  Generalize parmater to Type, so we
	can also handle ArrayTypes.  Check immediate here, instead of callers.
	* PrimProcedure.java (compile):  Can thus simplify here.
	* StackTarget.java (emitCoerceFromObject):  Call usedClass.

2004-10-07  Per Bothner  <per@bothner.com>

	* Compilation.java (addClass):  Move staticModule variable earlier.
	Make the apply_method ("run") static in a staticModule.
	Call the apply_method from "<cinit>" if staticModule, regardless
	of whether we have a moduleInstanceVar.
	Fixes Savannah bug #10600 "top level vars not always initialized".

2004-09-05  Per Bothner  <per@bothner.com>

	* IfExp.java (walkChildren):  Allow else_clause to be null.

	* LitTable.java (findLiteral): Also search superclasses for
	static fields.

2004-08-11  Per Bothner  <per@bothner.com>

	* Compilation.java (addClass): Don't implement Runnable for Servlets.

	* Compilation.java (generateApplyMethodsWithContext):  May need to load
	moduleInstanceMainField, just as in generateApplyMethodsWithoutContext.

2004-08-06  Per Bothner  <per@bothner.com>

	Change tailcall function API to use matchX+apply.
	* ApplyExp.java (eval):  Update to use checkN instead of setArgsN.
	(compile):  Likewise use checkX instead of setArgsX.
	Don't set proc field - that's checkX's responsibility now.
	* Compilation.java (typeModuleWithContext):  New field.
	(typeCallFrame, typeCpsMethodProc, typeCpsMethodContainer):  Remove.
	(getMethodProcType):  Remove method - result always typeModuleMethod..
	(getModuleType, generateMatchMethods):  New methods.
	(generateApplyMethods):  Replace by two ...
	(generateApplyMethodsWithContext, generateApplyMethodsWithoutContext):
	... new methods.
	(compile):  If module is not a ModuleBody, create frame helper class.
	(addClass):  Don't emit numArgs.
	Just generate "run" for module body.
	* GenericProc.java (applyN):  Update to use matchN+runUntilValue.
	(match, applyV):  Remove method.
	(match0, match1, match2, match3, match4, applyN):  New methods.
	* LambdaExp.java (compileEnd):  Generate match methods, and right kind
	of apply methods, depending on defailtCallonvention.
	(getSelectorValue):  Get separate selector value for each method.
	(allocFieldFor):  All modules are now ModuleBody or a subclass.
	(allocFrame):  Use Compilation's getModuleType.
	* ModuleBody.java (apply0):  Update to use match0.
	(run):  Tweaks, since CallConsumer no longer has "run" method..
	 (runCleanup):  New helper method used by run and compiled code.
	(runAsMain):  Calls run method.
	(match0, match1, match2, match3, match4, matchN):  New methods.
	* ModuleExp.java (evalModule):  Run module explicitly.
	* ModuleMethod.java (<init>):  New constructor.
	(getName, math0, match1, match2, match3, match4, matchN, apply,
	apply0Default, apply1Default, apply2Default, apply3Default, 
	apply4Default, applyNDefault, applyError):  New methods.
	(applyV):  Remove method.
	* ModuleWithContext.java:  New class, extends ModuleBody.
	* Makefile.am:  Update accordingly.
	* PrimProcedure.java (match, applyV):  Remove methods.
	(match0, match1, match2, match2, match4, matchN, apply):  New methods.
	(getProcedureClass):  Don't test for removed CpsMethodProc.
	* ProcInitializer.java (emitLoadModuleMethod):  Don't use removed
	getMethodProcType.

	* CheckedTarget.java (emitCheckedCoerce):  Argument numbering
	has been changed to 1-orgin.

2004-08-03  Per Bothner  <per@bothner.com>

	* ModuleBody.java:  Extend Procedure0 instead of CpsProcedure.
	(apply0):  Use CallContext's runUntilValue instead of applyV.

	* Compilation.java (typeCpsProcedure):  Remove field.
	(typeCpsMethodProc):  Don't inherit from CpsProcedure.

	* Compilation.java (moduleClass):  New field.
	(typeApplyMethodProc, typeApplyMethodContainer):  Remove fields.
	(getMethodProcType):  Never return typeApplyMethodProc.
	(compile):  If mainClass doesn't extend ModuleBody,
	allocate helper class moduleClass.
	Implement Runnable independent of super class.
	(generateApplyMethods):  We never generate ApplyMethodContainer,
	but we may add methoods to moduleClass instead.
	(addClass):  $instance variable is now generated in ProcInitializer.
	If we do have a helper moduleClass, we do have to generate "run".
	* ProcInitializer.java (emitLoadModuleMethod):  Allocate moduleClass
	here.  May need to add a $main field to reference mainClass.
	* PrimProcedure.java:  Don't need to handle ApplyMethodProc.

	* ModuleExp.java (evalModule):  Don't default module to static.

	* ModuleBody.java (run()):  Use existing VoidConsumer instance.

	* ModuleBody.java (run(Environment)):  Remove obsolete method.
	(run(Consumer)):  Don't call run(Environment).

2004-08-01  Per Bothner  <per@bothner.com>

	Optimization in <clinit>:  Change $instance from field to variable.
	* Compilation.java (instanceField):  Remove Field field, replaced by
	(moduleInstanceVar):  ... new Variable field.
	(addClass):  Allocate moduleInstanceVar in a local Scope.
	* ProcInitializer.java (<init>):  Don't check instanceField.
	(emitLoadModuleMethod):  Use moduleInstanceVar.

2004-07-31  Per Bothner  <per@bothner.com>

	* Compilation.java (emitLiterals):  Inline and remove method.
	(addClass):  Use new fixupChain methods.
	This removes need for generating $literals$ method.

	* CheckedTarget.java (emitCheckedCoerce):  Use new Label-based
	addHandler.  Use new beginFragment/endFragment methods.

	* LambdaExp.java (enterFunction):  Use updated setStartPC method.

2004-07-27  Chris Dean  <ctdean@sokitomi.com>

	* Compilation.java:  Add --warn-as-error.
	* ExpWalker.java (ExpWalker):  Check --warn-as-error.

2004-07-20  Per Bothner  <per@bothner.com>

	* ApplyExp.java:  Use static syntax to access static fields/methods.
	* BindingInitializer.java:  Likewise.
	* ClassExp.java:  Likewise.
	* Compilation.java:  Likewise.
	* ConsumerTarget.java:  Likewise.
	* Declaration.java:  Likewise.
	* LambdaExp.java:  Likewise.
	* ObjectExp.java:  Likewise.
	* ProcInitializer.java:  Likewise.
	* SetExp.java:  Likewise.
	* CheckedTarget.java:  Remove unused import statements.
	* InlineCalls.java:  Likewise.
	* Keyword.java:  Likewise.
	* ModuleExp.java:  Likewise.
	* ObjectExp.java:  Likewise.
	* PrimProcedure.java:  Likewise.
	* SeriesTarget.java:  Likewise.
	* Symbols.java:  Likewise.
	* Undefined.java:  Likewise.

	* FindTailCalls.java (findTailCalls):  Take Compilation parameter.
	* Compilation.java (compile):  Pass this to findTailCalls.
	* Compilation.java (usingCPSStyle):  Make non-static. 
	* FindTailCalls.java (walkLambdaExp):  Update accordingly.
	* FindCapturedVars.java (capture):  Likewise.

2004-07-17  Per Bothner  <per@bothner.com>

	* Keyword.java:  Make no longer extend CpsProcedure.
	(apply):  Remove method.
	Reverts 2002-02-13, 2001-06-03 changes.
	
2004-06-27  Per Bothner  <per@bothner.com>

	* FindCapturedVars.java (walkReferenceExp):  Check for '<classname>'.

2004-06-21  Per Bothner  <per@bothner.com>

	* ClassExp.java (getCompiledClassType):  Method body moved to ...
	(setParts):  ... new non-public void method.
	Also, catch exception to warn about unknown class.
	(getCompiledClassType):  Now just returns type.  Make protected.
	(walk):  Call setParts instead of getCompiledClassType.
	* InlineCalls.java (walkClassExp):  Likewise.
	* LambdaExp.java (getCompiledClassType):  Make protected.

	* LambdaExp.java (throwsSpecification):  New field.
	(setExceptions):  New method.
	(addMethodFor):  If throwsSpecification is set, add Exceptions
	attribute for generated Method.

2004-06-08  Per Bothner  <per@bothner.com>

	* Compilation.java (emitLiterals):  Merge some stuff from caller.
	(addClass):  Simplify - almost always create $literals$ method.
	Simplify call to emitLiterals.
	Fixes Savannah bug #9158 "defmacro & archive/files compilation broken".

2004-05-19  Per Bothner  <per@bothner.com>

	* Compilation.java (addClass):  Restore curLambda *after* compileEnd.
	Fixes Savannah bug #9010 "compilation of define-alias form causes NPE".

2004-05-17  Per Bothner  <per@bothner.com>

	* LambdaExp.java (inlinedIn):  Our caller might be the outer lambda.
	Fixes Savannah bug #8955 "VerifyError in srfi1.scm".

2004-05-10  Per Bothner  <per@bothner.com>

	* FindTailCalls.java (walkApplyExp):  Don't call walkLambdaExp
	in the case of a ClassExp.
	(walkSetExp):  Likewise.
	Fixes bug #8711.

2004-05-09  Per Bothner  <per@bothner.com>

	* Compilation.java (generateApplyMethods):  Emit line numbers.

2004-05-07  Per Bothner  <per@bothner.com>

	* Compilation.java (addClass):  Move call to compileEnd (specifically
	to generateApplyMethods) after initializers (since they may contain
	lambdas) but do emitLiterals after them.
	Move literals initialization to new '$literals' method.
	Fixes bug #8818.

2004-04-22  Per Bothner  <per@bothner.com>

	* LambdaExp.java (loadHeapFrame):  May need to use closureEnv,
	even when this is curLambda.  Fix verification error on psyntax.pp
	* LambdaExp.java (compileEnd):  Don't popScope if inlineOnly,
	since closureEnv may be needed for nested inlined methods.
	* ApplyExp.java (compile): Do popScope later after compileChildMethods.

2004-03-09  Per Bothner  <per@bothner.com>

	* Declaration.java (isStatic):  Also check NONSTATIC_SPECIFIED.
	(makeField):  Use isStatic method.
	* LambdaExp.java (allocFieldFor):  If immediate default to static.
	(compile):  Don't allocate field if immediate and module-level.
	* ModuleExp.java (evalModule):  Default to static.
	(allocField):  Don't allocate field if immediate, even for LambdaExp.
	
2004-03-08  Per Bothner  <per@bothner.com>

	* Declaration.java (load):  If indirect and immediate, load symbol.
	* ModuleExp.java (allocFields):  In immediate mode, make indirect.
	* ReferenceExp.java (compile):  If indirect, fix return type.
	* SetExp.java (compile):  If immediate, skip first two options.
	If indirect procedure use setFunctionValue.

	* Interpreter.java (getSymbolProcedure):  Trivial optimization.

2004-03-03  Per Bothner  <per@bothner.com>

	* Compilation.java (generateApplyMethods):  Move save/set/restore of
	curClass here from LambdaExp's compileEnd.
	* LambdaExp.java (compileEnd):  Simplify generateApplyMethods call.

	* ModuleExp.java (allocFields):  Remove special case for IS_SYNTAX.
	* SetExp.java (compile):  Likewise.
	* LambdaExp.java (NO_FIELD):  Make public; needed by defined_syntax.
	(compile):  If NO_FIELD, need to addApplyMethod here.
	* Declaration.java (setSyntax):  New method.

	* Compilation.java (typeMacro):  Remove unused static field.

2004-02-15  Per Bothner  <per@bothner.com>

	* Interpreter.java (asType):  Handle FString.

2004-02-13  Per Bothner  <per@bothner.com>

	* Interpreter.java (languages):  Add entry for "q2".

2004-02-12  Per Bothner  <per@bothner.com>

	* LangExp.java:  New class, extends Expression.
	* Makefile.am:  Update accordingly.
	* ExpWalker.java (walkLangExp):  New method.

	* LambdaExp.java (addMethodFor):  Set access flags from nameDecl.

	* LambdaExp.java (nameDecl, returnType):  Make public, for Lambda.

2004-02-11  Per Bothner  <per@bothner.com>

	* Compilation.java (compileToFiles):  Don't outputClass after error.

	* Declaration.java (PRIVATE_ACCESS, PROTECTED_ACCESS, PUBLIC_ACCESS,
	PACKAGE_ACCESS):  New flags.
	(getAccessFlags):  New method.
	* ClassExp.java (declareParts):  Use new method.
	Take Compilation parameter.  Pass it to LambdaExp's addMethodFor.
	(getCompiledClassType):  Adjust declareParts call accordingly.

	* ClassExp.java (walk):  Set/restore Compilation's curClass.
	Used by isAccessible calls in gnu.kawa.reflect.

2003-12-25  Per Bothner  <per@bothner.com>

	* ReferenceExp.java (ReferenceExp):  Use decl's getSymbol, not getName.

	* ResolveNames.java (<init>):  New constructors.
	(resolveModule):  New helper method.
	(resolveNames):  Remove static method
	(walkScopeExp):  Split initial lookup.push into separate ...
	(push): ... new method that can be overridden.
	(walkReferenceExp, setExp):  Split lookup.lookup into separate ...
	(lookup): ... new method that can be overridden.

2003-12-24  Per Bothner  <per@bothner.com>

	* ApplyExp.java (getFunctionValue):  New method.

	* Interpreter.java (NAMESPACE_PREFIX_NAMESPACE):  New constant.
	* Declaration.java (IS_NAMESPACE_PREFIX):  New constant.
	(isNamespaceDecl):  New constant.

	* Compilation.java (<init>):  New constructor.

	* Interpreter.java (read):  Remove unused method.

2003-12-20  Per Bothner  <per@bothner.com>

	* Compilation.java (forNameHelper):  New field.
	(getForNameHelper):  New method.
	* ClassExp.java (compilePushClass):  Call method generated by
	getForNameHelper, instead of the 1-argument Class.forName, which
	prematurely initializes class.

	* ClassExp.java (clinitMethod):  New field.
	(declareParts):  Handle clinitMethod.
	(addMethodFor):  Likewise.

	* Compilation.java (setTypes):  Take Compilation parameter,
	and if non-null use it for error messages.
	(getCompiledClassType):  Call setTypes directly, passing Compilation.

2003-12-20  Per Bothner  <per@bothner.com>

	* Interpreter.java (quote_sym, unquote_sym, unquotesplicing_sym,
	quasiquote_sym):  Move constants to gnu.kawa.lispexpr.LispInterpreter.

2003-11-22  Per Bothner  <per@bothner.com>

	* Interpreter.java (getDefaultSymbolValue):  Allow ':local'
	as well as 'prefix:local'.

2003-11-09  Per Bothner  <per@bothner.com>

	* PrimProcedure.java (applyV):  Handle takesContext().

	* Interpreter.java (eval):  Use CallContext's startFromContext
	and getFromContext methods.

2003-11-06  Per Bothner  <per@bothner.com>

	* Interpreter.java (parse): Change abstract method to take a Lexer.
	Add final method with older interface.

2003-11-05  Per Bothner  <per@bothner.com>

	* Declaration.java (<init>):  Use setName method.
	(setName):  Make final.

	* SetExp.java (compile):  Implement isSetIfUnbound, as used by
	Scheme define-variable and Common Lisp defvar.

2003-11-02  Per Bothner  <per@bothner.com>

	* Interpreter.java (PARSE_IMMEDIATE, PARSE_ONE_LINE):  New constants.
	(parse, parseFile):  Combine two abstract methods into new method.
	(parse(InPort,SourcesMessages,int)):  New abstract method.

2003-10-30  Per Bothner  <per@bothner.com>

	* StackTarget.java (emitCoerceFromObject):  New static helper method.
	(convert, compileFromStack):  Use it.
	* CheckedTarget.java (emitCheckedCoerce):  Likewise.

2003-10-19  Per Bothner  <per@bothner.com>

	* Compilation.java (<init>)  Add Interpreter argument.
	(interp):  New Interpreter field.
	(getInterpreter):  Change to return interp.
	(resolve):  Moved here from kawa/lang/Translator.

	* FindCapturedVars.java (walkReferenceExp):  Warn if the flag
	'warn-undefined-variable' is and decl is unknown.

	* BeginExp.java (compileOptions):  New field.
	(setCompileOptions, pushOptions, popOptions):  New methods.
	(compile, walkChildren):  Use pushOptions and popOptons.
	(print):  Print compileOptions is non-null.

	* Compilation.java (getBooleanOption(Sring,boolean)):  New method.

	* Compilation.java:  New option "warn-invoke-unknown-method".

2003-10-16  Per Bothner  <per@bothner.com>

	* Compilation.java (options):  New static field.
	(currentOptions):  New field.
	(getBooleanOption):  New helper method,
	
2003-10-12  Per Bothner  <per@bothner.com>

	* BeginExp.java (canonicalize):  New static method.

	* Inlinecalls.java (walkApplyExp):  If procedure is Inlineable,
	replace reference by quoted value.

	* Compilation.java (mangleURI):  New static method.

2003-10-11  Per Bothner  <per@bothner.com>

	* Declaration.java (makeField):  Revert 10-08 change.

2003-10-09  Per Bothner  <per@bothner.com>

	* ModuleBody.java:  No longer implement Runnable.
	* Compilation.java (getModuleSuperType):  Inline into addClass.
	(addClass):  Add Runnable as implemented interface if non-static.
	(allocClass):  Inline into addClass.
	(addClass):  Set instanceField earlier since used by ProcInitializer.

	* PrimProcedure.java (compile/4):  Change 2nd operand to ApplyExp.
	Also optimize IgnoreTarget.  Add sometimes-needed runUntilDone call.
	(compile/3):  Change caller appropriately.
	* ApplyExp.java (compile):  Likewise.

	* PrimProcedure.java (numArgs):  Adjust for takesContext().
	(getProcedureClass):  Handle ApplyMethodProc and CpsMethodProc.
	(getMethodFor/5):  Also search for methods ending in $X and $V$X.
	Remove unused local variable 'variable'.

2003-10-08  Per Bothner  <per@bothner.com>

	* Declaration (makeField):  If name is a Symbol for an indirect
	binding (e.g. a top-level XQuery variable), compile name to field.
	* FindCapturedVars.java (walkFluidLetExp, walkReferenceExp,
	walkSetExp):  Pass name as Object, not String, to allocUnboundDecl.
	(allocUnboundDecl):  Variable name may be Symbol. not just String.
	* ProcInitializer.java (emitLoadModuleMethod):  If Procedure has a
	nameDecl, use its symbol, which in XQuery or CLisp may be a Symbol.
	* ModuleMethod.java (<init>):  Name can be a Symbol or a String.

	* LambdaExp.java (getCallConvention, isHandlingTailCalls):  Don't
	treat static modules different from non-static.
	(allocChildClasses):  Check for inline methods.  Check for
	CALL_WITH_CONSUMER convention rather than just tailcall convention.
	* Compilation.java (addClass):  Make static modules simpler and more
	consistent with non-static by using apply method.

	* InlineCalls.java (walkApplyExp):  If function is a Symbol with
	bound function, use the latter.
	* PrimProcedure.java (takesContext):  New method.
	(takesVarArgs):  Check for method name ending with $V$X as well as $V.
	(compileArgs):  Make non-static and simplify.  Adjust for context arg.
	(compile):  Handle methods that take context arg.
	(getMethodFor):  Handle case of incoming PrimProcedure.
	* ApplyExp.java (compile):  Allow direct invocation of known method if
	CALL_WITH_CONSUMER or if CALL_WITH_TAILCALLS and not in tail position.

	* FindTailCalls.java (walkApplyExp):  If function is append-values,
	then last operand may be a tail-call.

2003-10-07  Per Bothner  <per@bothner.com>

	* LitTable.java (staticTable):  New static field.
	(findLiteral):  If not in literalTable, try staticTable, and if that
	fails, search public static final fields of class.
	Remove various special cases, such as values.empty.
	* Compilation (voidConstant, undefinedConstant, emptyConstant,
	eofConstant):  Remove no-longer needed static fields.
	(compileConstantToField):  New helper method.
	(compileConstant):  Use it.
	Fixes Savannah bug #5651.
	* Interpreter.java (trueObject, falseObject, undefinedObject,
	voidObject):  Remove unused static fields.

2003-10-02  Per Bothner  <per@bothner.com>

	* Undefined.java (undef):  Rename field to undefined, and make it
	public, final, and initialized.
	(getInstance):   Just return the value of the undefined field.

2003-09-18  Per Bothner  <per@bothner.com>

	* PrimProcedure.java (<init>(Method,LambdaExp)):  Re-set retType.
	* ApplyExp.java (compile):  Defer method inlining to PrimProcedure.

2003-09-09  Per Bothner  <per@bothner.com>

	* Declaration.java (setNext):  New method.

2003-09-04  Per Bothner  <per@bothner.com>

	* ApplyExp.java (compile):  Remove redundant error checks.
	* LambdaExp.java (isClassGenerated):  Simplify.
	(restArgType):  Check for CallContext parameter.
	(addMethodFor):  When CALL_USING_CONSUMER or _TAILCALLS generate stubs
	and methods with real arguments in addition to CallContext.
	(allocChildClasses, allocParameters, enterFunction):  Related changes.
	* Compilation.java (generateApplyMethods):  Likewise.

	* Compilation.java (defaultCallConvention):  New static field.
	(CALL_WITH_UNSPECIFIED, CALL_WITH_RETURN, CALL_WITH_CONSUMER,
	CALL_WITH_TAILCALLS, CALL_WITH_CONTINUATIONS):  New constants.
	CALL_WITH_CONSUMER is a new API, new default for XQuery and ModuleExps.
	(usingCPStyle, usingTailCalls):  Remove static fields.
	* Compilation.java, ApplyExp.java, FindCapturedVars.java,
	LambdaExp.java, ObjectExp.java:  Update accordingly.
	* LambdaExp.java (getCallConvention):  New method.

	* Compilation.java (letStart, letVariable, letEnter, letDone):
	New helper methods for constructing a LetExp.
	(loopStart, loopVariable, loopEnter, loopCond, loopBody, loopRepeat):
	New helper methods for constructing a for-style loop.

	* InlineCalls.java (getCompilation):  Move method to base class.
	* ExpWalker.java (getCompilation):  Moved method.

2003-08-20  Per Bothner  <per@bothner.com>

	* ApplyExp.java (type):  New field.
	(getType):  Cache result in type field.

2003-08-17  Per Bothner  <per@bothner.com>

	* ConsumerTarget.java (isContextTarget):  New field.
	(isContextTarget, makeContextTarget):  New methods.
	* LambdaExp.java (compileBody):  Use makeContextTarget.
	* ApplyExp.java (compile):  Minor optimization.

2003-08-09  Per Bothner  <per@bothner.com>

	* Compilation.java (callInitMethods):  Don't call recursively
	on superclass - that gets handled by super's <init>.
	Fixes Savannah bug #4540.

2003-08-06  Per Bothner  <per@bothner.com>

	* ExpWalker.java (comp):  New field.
	(setContext):  New method.
	* ChainLambdas.java (comp):  Remove field - use super.comp instead.
	(chainLambda):  Use setContext methods.
	* InlineCalls.java (comp):  Remove field - use super.comp instead.
	(inlineCalls):  Use setContext methods.
	* FindCapturedVars.java (findCapturedVars):  Take new Compilation
	parameter, and pass value to ExpWalker's setContext.
	(capture):  Emit error if static references non-static.
	* Compilation.java (compile):  Pass this to FindCapturedVars.

	* InlineCalls.java (walkApplyExp):  Do followAliases.

	* PairClassType.java (<init>):  Don't set INTERFACE - it is possible
	this isn't an actual class pair, but we need the static link.

	* Declaration.java (makeField):  If a non-captured ClassExp,
	make field static.

2003-08-01  Per Bothner  <per@bothner.com>

	* Declaration.java (makeField):  Use implementation type for field.
	(allocateVariable):  Use implementation type for bytecode variable.
	* LambdaExp.java (allocChildClasses):  Likewise for captured variable.
	(enterFunction):  Likewise for method parameter type.

2003-07-26  Per Bothner  <per@bothner.com>

	* ConsumerTarget.java (compileUsingConsumer): New static helper method.
	(compileUsingConsumer):  Use new method.

2003-07-22  Per Bothner  <per@bothner.com>

	* LambdaExp.java (compileBody):  Use LambdaExp's language-based
	return type, not the methods primitive type.
	Fixes Savannah bug #4423.

2003-07-22  Daniel Bonniot  <Daniel.Bonniot@inria.fr>

	* ModuleMethod.java (<init>):  Optimization.

2003-07-16  Per Bothner  <per@bothner.com>

	* ApplyExp.java (compile):  Check if func's closureEnv is null.
	Fixes by reported by Chris.Dean@sokitomi.com 03-19.
	Needed because of 03-02 change to LambdaExp.java.

2003-07-15  Chris Dean  <Chris.Dean@sokitomi.com>

	* PrimProcedure.java: Add invoke-special to call super classes.
	Add constructor and emit byte code for invoke-special.

2003-07-16  Per Bothner  <per@bothner.com>

	* ApplyExp.java (inlineIfConstant):  New overload - pass ExpWalker.
	Print warning and return argument if folding throws exception.
	(inlineIfConstant):  Remove old no-longer-needed method.

2003-07-14  Per Bothner  <per@bothner.com>

	* PrimProcedure.java (makeBuiltinUnary):  New factory method.

2003-06-13  Per Bothner  <per@bothner.com>

	* Keyword.java (apply):  Use CallContext's getNextArg
	method rather than getArgAsObject, which will be deprecated.
	* PrimProcedure.java (match):  Likewise.

	* Interpreter.java (eval):  Fix incorrect instanceof test.

2003-06-06  Per Bothner  <per@bothner.com>

	* Expression.java (compileNotePosition):  Take extra parameter.
	(compileWithPosition):  Add overloaded version.
	* PrimProcedure.java (compileArgs):  Update compileNotePosition call.
	* LambdaExp.java (compileBody):  If body doesn't have line,
	use LambdaExp's line.

	* InlineCalls.java (rewriteToInvocation, walkApplyExp):  Call setLine
	to copy line number info on newly allocated ApplyExp.

2003-06-03  Per Bothner  <per@bothner.com>

	* LambdaExp.java (inlinedIn):  New helper method.
	(declareClosureEnv):  Partially revert 05-30 change, but make
	use to inlineIn to simplify and fix one case.
	(enterFunction):  Don't set closureEnv if inlinedIn outer.

2003-05-31  Per Bothner  <per@bothner.com>

	* Interpreter.java (getOutputConsumer):  Generalize to take Writer.
	(eval(String,PrintConsumer)):  Call getOutputConsumer.
	(eval(Reader,Writer)):  Likewise,

2003-05-30  Per Bothner  <per@bothner.com>

	* LambdaExp.java (declareClosureEnv):  Simplify - if inline-only,
	used the parentFrame.
	(enterFunction):  Don;'t need to set closeEnv if inline-only.
	Fixes bug reported 05-26 by Sven.Hartrumpf@FernUni-Hagen.de.

2003-05-23  Per Bothner  <per@bothner.com>

	* Compilation.java (compileConstant):  Better error message on void.

2003-05-18  Per Bothner  <per@bothner.com>

	* FindCapturedVars.java (walkLetExp):  Generalize letrec-optimization.

2003-05-17  Per Bothner  <per@bothner.com>

	* InlineCalls.java (getCompilation):  New method.

2003-05-04  Per Bothner  <per@bothner.com>

	* Compilation.java (lexical):  Make non-final.  Having it final
	triggers a bug in JDK 1.1.8's javac, and it doesn't need to be final.

2003-04-30  Per Bothner  <per@bothner.com>

	* InlineCalls.java (rewriteToInvocation):  Make non-static.
	Call inline method on resulting Invoke procedure.

	* Interpreter.java (getDefaultSymbolValue):  Check for unresolved
	namespace prefix.

2003-04-28  Per Bothner  <per@bothner.com>

	* ChainLambda.java (walkClassExp):  Don't set ClassExp types here
	(since that is too late given that it may be needed by Inlinecalls).
	* InlineCalls.java (walkClassExp):  Do it here instead.
	Fixes bug reported 03-20 by Vladimir Tsichevski <wowa1@online.ru>.
	
2003-04-27  Per Bothner  <per@bothner.com>

	* ThisExp.java (compile):  Do nothing if IgnoreTarget.  Otherwise call
	compileFromStack.  Fixes bug reported 04-24 by Vladimir Tsichevski.

2003-04-21  Per Bothner  <per@bothner.com>

	* PrimProcedure.java (compileArgs, compile):  Call usedClass on
	classes declaring method and parameter and return types.

2003-04-19  Per Bothner  <per@bothner.com>

	* ResolveNames.java:  New class, extends ExpWalker.
	* Makefile.am (java_sources):  Update.

2003-04-19  Chris Dean  <Chris.Dean@sokitomi.com>

	* ModuleMethod.java (match):  Allow null as parameter.
	
2003-04-19  Per Bothner  <per@bothner.com>

	* LambdaExp.java (compileAsMethod):  Fix call to deprecated method.

	* Compilation.java (lexical):  New field, moved from Translation.
	(<init>):  Initialize lexical field.
	(pus, pop):  Also call corresponding operations on lexical.
	(push(Declaration)):  New method.
	(lookup):  Just call lexical.lookup.

2003-04-18  Per Bothner  <per@bothner.com>

	* LambdaExp.java (compile):  Do nothing if target is IgnoreTarget,
	and if function isn't read.

	* NameLookup.java:  New class.
	* Makefile.am (java_sources):  Update.

2003-04-14  Per Bothner  <per@bothner.com>

	* Declaration.java (compileStore):  Use emitPutStatic if static field.
	* Declaration.java (isStatic):  If current scope is not a LambdaExp,
	check the outer LambdaExp for whether it is a static module.
	* FindCapturedVars.java (capture):  If we capture a simple static
	variable, we still have to save it in the caturedDecls list.
	* LambdaExp.java (enterFunction):  Alloocate cpapturedVars as static
	fields if there is no heapFrame.
	Fixes bug reported 3/31 by Wen_Chun Ni <wcn@tbcommerce.com>.

	* LambdaExp.java (loadHeapFrame):  If closureEnv is null, push this.
	Change needed because of 03-02 change.

2003-04-12  Per Bothner  <per@bothner.com>

	* Declaration.java (FIELD_OR_METHOD):  New flag.

2003-04-12  Vladimir Tsichevski <wowa1@online.ru>

	* ObjectExp.java (compile): If closureEnv is null, push this instead.
	Change needed because of 03-02 change.

2003-04-08  Per Bothner  <per@bothner.com>

	* Special.java (make):  Return Special instead of Object.
	Since eof instead a Special, don't handle eof here.
	Fixes bug reported 04-05 by Vladimir Tsichevski.

2003-04-06  Per Bothner  <per@bothner.com>

	* ModuleExp.java (evalToClass):  Don't use SFormat for debug output.
	* ReferenceExp.java (print):  Don't use SFormat.
	* SetExp.java (print):  Likewise.

2003-04-05  Per Bothner  <per@bothner.com>

	* LambdaExp.java (getOwningLambda):  New methods, replaces
	static getHeapLambda.
	Don't stop at ClassExp unless getNeedsCloseEnv.
	(allocFieldFor, compileSetField, addMethodFor):  Use getOwningLambda.
	* ApplyExp.java (compile):  Use getOwningLambda.
	* ObjectExp.java (compile):  Likewise.
	* ProcInitializer.java (<init>):  Likewise.
	* ClassInitializer.java (<init>):  Likewise.
	
	* ClassExp.java (compilePushClass):  New method.
	(compile):  Use compilePushClass.
	* ClassInitializer.java (<init>):  Call ClassExp.compile here instead
	of indirectly in emit.  The latter may be too late if compile
	generates extra initializers, such as if there is a lambda.

2003-04-04  Per Bothner  <per@bothner.com>

	* FindTailCalls.java (walklambdaExp):  Set CANNOT_INLINE for
	class methods.
	* ModuleExp.java (allocFields):  A ClassExp always gets a field,
	even if it is private.
	* SetExp.java (compile):  Call compileSetField for a ClassExp
	even if it is private.

2003-03-29  Per Bothner  <per@bothner.com>

	* BindingInitializer.java (emit):  Modify optimization of 200-06-09.
	Fixes bug reported 03-29 by Vladimir Tsichevski <wowa1@online.ru>.

	* Interpreter.java (define_method):  Remove last parameter.
	Use ClassMethods.apply.

2003-03-28  Per Bothner  <per@bothner.com>

	* Interpreter.java (define_method):  New method.

2003-03-15  Per Bothner  <per@bothner.com>

	* Declaration.java (pushIndirectBinding):  Update to use named
	Symbol.make -> makeUninterned method.

2003-03-06  Per Bothner  <per@bothner.com>

	* LetExp.java (print):  Add a writeSpaceFill call.

2003-03-02  Per Bothner  <per@bothner.com>

	* LambdaExp.java (addMethodFor):  Don't set closureEnv.

	* Declaration.java (printInfo):  New method.
	* LetExp.java (print):  Use printInfo.
	* LambdaExp.java (print):  Likewise.  Create logical blocks.
	* ModuleExp.java (print):  Likewise.

2003-03-02  Per Bothner  <per@bothner.com>

	* LambdaExp.java (enterFunction):  No need to allocate a staticLink
	field if this is a ModuleExp - it's never used.

	* FindCapturedVars.java (capture):  If decl has a base field, just
	capture that, but don't do anything else.

2003-02-23  Per Bothner  <per@bothner.com>

	* InlineCalls.java (walkIfExp):  New method - fold if constant test.

2003-02-20  Tom Reilly <treilly@macromedia.com>

	* Compilation.java (outputClass):  Made separate method,
	for use by gnu.kawa.servlet.KawaPageServlet.
	(compileToFiles):  Call outputClass.

2003-02-19  Per Bothner  <per@bothner.com>

	* ClassExp.java (getCompiledClassType):  Add package prefixes to
	names of simple classes.

	* ClassExp.java (compile):  Replace deprecated init_param_slots calls
	by startCode.

2003-02-04  Per Bothner  <per@bothner.com>

	* LambdaExp.java (addMethodFor):  Only make $finit$ method private
	if this is a simple (non-pair) class.

2003-01-24  Per Bothner  <per@bothner.com>

	* ApplyExp.java (eval): If procedure is null, throw exception.

2003-01-01  Per Bothner  <per@bothner.com>

	Field names now use the reversible mangleNameIfNeeded - though
	method names don't.
	* Interpreter.java (define_field):  Use mangleNameIfNeeded.
	* LambdaExp.java (allocFieldFor):  Use mangleNameIfNeeded.
	* Declaration.java (allocateVariable, makeField):  Likewise.
	* PrimProcedure.java (getMethodFor):  Don't use field name for
	mangledName, as they may be mangled differently.

2002-12-16  Per Bothner  <per@bothner.com>

	* Compilation.java (compileTarget):  Better handling of Values.

	* Interpreter.java (eval(String,PrintConsumer)):  New method overload.

2002-11-23  Per Bothner  <per@bothner.com>

	*  Interpreter.java (define_field):  Move 2 methods from
	kawa.standard.Scheme.

2002-11-20  Per Bothner  <per@bothner.com>

	* Interpreter.java (getSymbolValue, getSymbolProcedure,
	getDefaultSymbolValue):  New methods.
	* Compilation.java (lookup):  Argument can be Symbol as well as String.
	(getSymbolValueMethod, getSymbolProcedureMethod):  New fields.
	* ReferenceExp.java (eval):  Handle Symbol better.
	(eval, compile):  Use new Interpreter methods.
	* InlineCalls.java (rewriteToInvocation):  New method.
	(walkApplyExp):  If function is Symbol, try rewriteToInvocation.

2002-11-16  Per Bothner  <per@bothner.com>

	* Interpreter.java (NAMESPACE_PREFIX):  New constant.

	* ReferenceExp (getName):  If name is a Symbol, use Symbol.getName.
	* Interpreter.java (asType):  Likewise.
	* LambdaExp.java (setName):  New method.

	* LambdaExp.java (print):  Print decl itself, rather than its name,

2002-11-15  Per Bothner  <per@bothner.com>

	* CatchClause.java (<init>):  Name parameter need not be a String.

2002-11-12  Per Bothner  <per@bothner.com>

	* Declaration.java (name):  Removed field, replaced by:
	(symbol):  New field, either a String or a Symbol.
	(getName, toString):  Changed to match.
	(getSymbol):  New method.
	(setName. <init>):  Changed parameter type.
	* ScopeExp.java (lookup, getNoDefined, getDefine, addDeclaration):
	Declaration name an be arbitrary Object, not just String.
	* SetExp.java:  Removed field, replaced by:
	(symbol):  New field, either a String or a Symbol.
	(getSymbol):  New method.
	(getName, <init>, eval, compile. print):  Changed accordingly.

2002-11-10  Per Bothner  <per@bothner.com>

	* PrimProcedure.java (match): Catch ClassCastException if coercing
	'this' fails.

	* FindTailCalls.java (walkFluidLetExp): Set inTailContext to false for
	body, since we need to restore bindings at end.
	Fixes bug reported by Wen-Chun Ni <wcn@tbcommerce.com>.

	* LetExp.java (print):  New overloaded method.
	* FluidLetExp.java (print):  New method.

2002-11-05  Per Bothner  <per@bothner.com>

	* Interpreter.java (parseFile):  Take extra 'immediate' argument.
	(eval):  Set/restore current Envronment and Interpreter.
	Call parseFile with 'immediate' argument as true.

2002-10-28  Per Bothner  <per@bothner.com>

	* Symbol.java:  Renamed to Symbol.java.
	* Makefile.am, Keyword.java:  Update to match.

2002-10-22  Daniel Bonniot  <bonniot@users.sourceforge.net>

	* Compilation.java (compileConstant(Object,Target)): Convert integer
	constants when the target is type short or type byte.

2002-10-20  Per Bothner  <per@bothner.com>

	* Declaration.java (followAliases):  If decl is an import decl created
	by require, and not exported, then skip to the exported field.
	(makeField):  If this is an alias, but it is constant, use base's type.

	* ModuleExp.java (allocFields):  Skip if decl.ignorable().

	* Compilation.java (addClass):  Change first arg to ModuleExp.
	This allows some simplification.

2002-10-16  Per Bothner  <per@bothner.com>

	* LambdaExp.java (allocFrame): Never set type from frameType.
	Change suggested by Daniel.Bonniot@inria.fr.

2002-09-27  Per Bothner  <per@bothner.com>

	* Compilation.java (inlineOk):  Ignore flag if nested procedure.

2002-09-26  Per Bothner  <per@bothner.com>

	* Declaration.java (IS_ALIAS):  Make public.
	(isLexical):  Static can be lexical.
	(makeField):  If decl is alias, make field a Location, not a Binding.
	* FindTailCalls.java (walkSetExp):  Walk value even if defining alias.
	* SetExp.java (compile):  Don't initialize simple public alias
	using an AliasConstraint - Location is set by BindingInitializer.
	* ModuleExp.java (allocFields):  Don't clear value if an alias.
	* Interpreter.java (getTypeFor):  Handle imported aliases.

2002-09-24  Per Bothner  <per@bothner.com>

	* Compilation.java (inlineOk):  New static field.
	(inlineOk):  Two new methods.
	* ApplyExp.java (compile):  Only inline if inlineOk.
	* InlineCalls.java (walkApplyExp):  Only inline if inlineOk.

2002-09-20  Per Bothner  <per@bothner.com>

	* ConsumerTarget.java (compileFromStack):  Handle the case where
	the stack value is long or double, which emitSwap doesn't support.
	Fixes bug reported by Jim White <jim@pagesmiths.com>.

2002-08-10  Per Bothner  <per@bothner.com>

	* SetExp.java (walkChildren):  Use new ExpWalker walk method.

	* Compilation.java (generateConstructor):  Create dummy LambdaExpr
	for processing initChain.
	* SetExp.java (compile):  Combine IS_SYNTAX case with QuoteExp case.
	Also handle IS_CONSTANT here.  Allow private and immediate.
	* Declaration.java (makeField):  Unknowns are no longer automatically
	static.  If type not specified, don't infer it from value.
	Do create BindingInitializer for unknowns.
	* FindCapturedVars.java (walkModuleExp):  Don't generate SetExps
	for unknowns - they should to be emitted earlier, in case of
	mutual dependent modules (when they are implemented).
	(capture):  Now need to handle captured unknowns - not always static.
	However, force static if in a static function or class,
	(walkReferenceExp, walkSetExp):  Unknowns are no longer always static.
	* ModuleExp.java (allocFields):  Allocate unknowns first.

	* ApplyExp.java (compile):  Don't call using tailcall-handling API
	unless either call is a tail-call or target is ConsumerTarget.

2002-08-09  Per Bothner  <per@bothner.com>
(
	* ModuleBody.java (runAsMain):  Do defineAll, so exported bindings
	get placed in environment.

	* StackTarget.java (compileFromStack0):  If we did a emitCoerceToObject
	then the stackType changed.

	* InlineCalls.java (walkApplyExp):  Micro-optimization.

2002-08-06  Per Bothner  <per@bothner.com>

	* Compilation (usedClass):  New method.
	(callInitMethods):  New method.
	(generateConstructor):  Use callInitMethods to generate $finit$ calls.

	* ClassExp.java (usedSuperClasses):  New private helper method.
	(compile):  Call usedSuperClasses.
	* Compilation (loader):  New field.
	* Moduleexp.java (evalToClass):  Allocate ClassLoader early.
	Re-arrange loops to classes to class-loader using addClass.

2002-08-04  Per Bothner  <per@bothner.com>

	* Interpreter.java (loadClass):  Slightly better exception message.

	* PrimProcedure.java (getParameterType):  Handle <list> #!rest type.
	(getMethodFor):  New overload, takes ClassType rather than Class.
	Looks for most specific definitely applicable method.

2002-07-25  Per Bothner  <per@bothner.com>

	* Compilation.java (compile):  Pass this to InlineCalls.
	* InlineCalls.java (inlineCalls):  Save Compilation and messages.
	(walkApplyExp):  Check for correct argument count.
	Resolve known procedures to PrimProcedure.  This used to be done
	in ApplyExp, but it is better to do it earlier.
	* ApplyExp.java (walkChildren):  Inline 1-argument walkExps.
	(compile):  Don't check argument count or look for PrimProcedure here.

	* Compilation.java (error):  Remove no-longer used methods.

2002-07-24  Per Bothner  <per@bothner.com>

	* Compilation.java:  Merge in functionality of Parser.java.
	(current_scope, messages):  New fields.
	(filename, position):  Remove fields - uses messages instead.
	(error):  Chaneg to use messages.
	(currentLambda, getModule, setModule, currentModule, currentScope,
	musCompileHerem push, pop, lookupm getMessages, setMessages,
	getFile, getLine, getColumn, setFile, setLine, setColumn): New methods.
	(immediate):  Make public.
	(getIntepreter):  Call Interpreter's static getInterpreter.
	(<init>):  New simple constructors.
	(compile):  New method, contains bulk of old constructor.
	Add two tests to return if seenErrors.
	(compileToFiles, compileToArchive):  Moved from ModuleExp.java.
	* Parser.java:  Remove file.
	* Makefile.am (java_sources):  Remove Parser.java.
	* ModuleExp.java (eval):  Remove method - inlined in evalModule.
	(evalToCall, evalModule):  Make static - pass in Compilation.
	(compileToFiles, compileToArchive):  Moved to COmpilation.java.
	* CheckedTarget.java (emitCheckedCoerce):  Use comp's getLine method.
	* Expression.java (compileNotePosition):  Use line-related methods.
	(makeWhile):  Update Parser->Compilation.
	* ScopeExp.java (getDefine):  Likewise.
	* Interpreter.java (parse):  Return Compilation, not ModuleExp.
	(parseFile):  Likewise.
	(eval):  Update accordingly.

2002-07-23  Per Bothner  <per@bothner.com>

	* ChainLambdas.java.(chainLambdas):  Use new walk method.
	* FindTailCalls.java (findTailCalls):  Likewise.
	* PushApply.java (pushApply):  Likewise.
	* LetExp.java (walkChildren):  Use new ExpWalker.walk method.

	* GenericProc.java (<init>):  New constructors.
	(setProperties):  New method.
	(make):  Change to use setProperties.

	* PrimProcedure.java (applyV):  Removed unused is_static variable.

	* PrimProcedure.java (compileArgs):  Fix off-by-one bug.

2002-07-22  Per Bothner  <per@bothner.com>

	* ExpWalker.java (messages):  New field.
	(getFile, getLine, getColumn, setFile, setLine, setColumn,
	error, notError):  New methods.
	(walk(Expression)):  New method.
	(walkExps):  Re-write to set/restore line numbers.
	* BlockExp.java, CatchClause.java, ExitExp.java, IfExp.java,
	LambdaExp.java (walkChildren):  Use new ExpWalk walk method.

2002-07-21  Per Bothner  <per@bothner.com>

	* CanInline.java (inline):  Take extra ExpWalker parameter.
	* InlineCalls.java(walkApplyExp):  Pass extra parameter.

	* ReferenceExp.java (print):  Don't lose if symbol is null.

2002-07-02  Per Bothner  <per@bothner.com>

	* StackTarget.java (getInstance):  Handle type.isVoid() specially.

	* ConsumerTarget.java (compileUsingConsumer):  Call canonicalize
	method gnu.mapping.Values.

2002-06-18  Per Bothner  <per@bothner.com>

	* ClassExp.java (slotToMethodName):  Do Compilation.mangleNameIfNeeded.

	* FindCapturedVars.java (walkClassExp):  New method.
	  Fixes bug reported by Jocelyn Paine.

	* LambdaExp.java (enterFunction): Remove redundant test.

2002-06-11  Per Bothner  <per@bothner.com>

	* Interpreter.java (languages):  Add "xslt".

2002-06-05  Per Bothner  <per@bothner.com>

	* ClassExp.java (setTypes):  Always explicitly do setInterfaces.

2002-05-28  Per Bothner  <per@bothner.com>

	* Declaration.java (UNKNOWN_PREFIX. PRIVATE_PREFIX, EXTERNAL_ACCESS):
	New constants.
	(makeField):  Pre-pend PRIVATE_PREFIX if appropriate.
	* ScopeExp.java (getNoDefine):  Also set IS_UNKNOWN.
	(getDefine):  Clear both NOT_DEFINING an IS_UNKNOWN.

	* LetExp.java (print):  Print Declaration, not just its name.
	* ReferenceExp.java (print):  Print Declaration if known.
	* SetExp.java (print):  Likewise.

2002-05-19  Per Bothner  <per@bothner.com>

	* BlockExp.java (oldTryState):  New field.
	(compile):  Set/clear oldTryState,
	* ExitExpr.java  (compile):  Call doPendingFinalizers.

2002-05-18  Per Bothner  <per@bothner.com>

	* Declaration.java (makeField):  Always mangle, but not reversible.
	Needed for compatibility with Scheme.define_field.

	* ApplyExp.java (compile):  Don't inline if INDIRECT_BINDING.

2002-04-18  Per Bothner  <per@bothner.com>

	* ModuleBody.java (runAsMain):  Call kawa.repl's exitDecrement.

	* Compilation.java:  Use Methods's new startCode method.

2002-03-18  Per Bothner  <per@bothner.com>

	* Interpreter.java (getInstance):  Check for InvocationTargetException.

2002-03-06  Per Bothner  <per@bothner.com>

	* ApplyExp.java (setFunction):  New method.

	* Compilation.java (loadCallContext):  Look for $ctx variable,
	instead of using callStackContext field.
	(addClass):  Use loadCallContext.
	(callStackContext):  Remove field.
	* ApplyExp.java (compile):  Use Compilation's loadCallContext method.
	* LambdaExp.java (allocParameters, compileBody):  Likewise.
	(allocParameters):  callStackContext is now local.
	(compileAsMethod):  Don't save/restore/set removed variable.
	
	* Declaration.java:  New constructor, takes Variable.

	* SeriesTarget.java (value):  Replace field by Declaration param.
	(scope):  New field.
	(compileFromStackSimple):  Update for new fields.

2002-03-02  Per Bothner  <per@bothner.com>

	* Interpreter.java (parseFile):  Now throws IOException and
	SyntaxException.

	* Interpreter.java (eval):  Eight new utility methods.

2002-02-15  Per Bothner  <per@bothner.com>

	* ReferenceExp.java (compile):  Use Procedure type if appropriate.

	* ApplyExp.java (compile):  Factor out common code.

	* Interpreter.java (defineFunction):  New methods.

2002-02-13  Per Bothner  <per@bothner.com>

	* Keyword.java (apply):  Emit attribute, not group.

	* ModuleBody.java (runAsMain):  Use CallContext.getInstance.

2002-02-12  Per Bothner  <per@bothner.com>

	* Compilation.java (loadCallContext):  Call CallContent.getInstance()
	unless method isHandlingTailCalls().
	* FluidLetExp.java (compile):  Get fluids from CallContext, not Future.
	* ModuleExp.java (evalModule):  Use CallContent.getInstance().
	* ModuleBody.java (run, apply0):  Likewise.
	(run) Set/restore CallContext's consumer.
	(runAsMain):  Use CallContext.setMainContext.

	* ModuleBody.java (run(Environment)):  New method, for compatibility.
	(run):  Call run(Environment).

	* GenericProc.java (add):  Sort methods by specificity.
	(applyN, match):  Since methods are sorted, just use first match.
	(applyV):  Update to match change to match.

2002-01-31  Per Bothner  <per@bothner.com>

	* Interpreter.java (defineFromFieldValue):  New method.
	(defineAll):  Make non-static, and use defineFromFieldValue.
	(loadClass):  Change to use non-static defineAll.

2002-01-29  Per Bothner  <per@bothner.com>

	* Interpreter.java (languages):  Add "krl".
	(getInstanceFromFilenameExtension):  New static.
	(getInstance):  Also look for "get"+LANGNAME+"Instance" method.

	* Interpreter.java (defineAll, loadClass);  Moved from
	gnu.xquery.lang.XQuery and made non-static.
	
2002-01-29  Daniel Bonniot  <bonniot@users.sourceforge.net>
 
 	* LambdaExp.java (addMethodFor): Rename conflicting methods in the same
 	class.
 
2002-01-26  Daniel Bonniot  <bonniot@users.sourceforge.net>

	* TryExp.java, CatchClause.java:  Visit catch clauses during a walk.

2002-01-23  Per Bothner  <per@bothner.com>

	* Interpreter.java (languages):  Add "brl".

2002-01-19  Per Bothner  <per@bothner.com>

	* Compilation.java:  If generating main, and the --output-format
	was specified, have compiled main call Shell's setDefaultFormat.

	* ModuleBody.java (runAsMain):  Call new CallContext.setInstance.

	* ModuleBody.java (runAsMain):  Use new Shell.getOutputConsumer.

2002-01-18  Nic Ferrier <nferrier@tf1.tapsellferrier.co.uk>

	* Interpreter.java (registerLanguage):  New static method.

2002-01-07  Per Bothner  <per@bothner.com>

	* Compilation.java (literalTable, literalsCount, literalsChain,
	findLiteral):  Moved to LitTable.java.
	(emitLiterals):  New method; replaces Literal.emit.
	* LitTable.java (literalTable, literalsCount, literalsChain,
	findLiteral):  Moved from Compilation.java.
	(emitPrimArray): Removed; replaced by CodeAttr.emitPushPrimArray.
	* BindingInitializer.java, Declaration.java, ModuleExp.java:  Update.
	* Literal.java:  Methods that took Compilation now take LitTable.
	(emit):  Remove; replaced by Compilation.emitLiterals.

	* Compilation.java (addClass):  Remove generateConstructor call.
	This generated a duplicate call to initialize ModuleBody.

2001-12-24  Per Bothner  <per@bothner.com>

	* ConditionalTarget.java (emitGotoFirstBranch):  New method.
	(compileFromStack):  Use emitGotoFirstBranch.

	* TypeValue.java:  New interface.
	* Makefile.am (java_sources):  Add TypeValue.java.

2001-11-24  Per Bothner  <per@bothner.com>

	* Expression.java (makeGetField):  Moved to gnu.kawa.reflect.SlotGet.
	(makeCoercion):  Moved to gnu.kawa.functions.Convert..

	* Expression.java (setLine):  New method.

2001-11-23  Per Bothner  <per@bothner.com>

	* CheckedTarget.java (emitCheckedCoerce)  If target type is
	tostring_target, don't need to catch cast exception.
	* StackTarget.java (compileFromStack0):  Use isSubclass rather than
	isSubtype to check that we don't need to emit a conversion.

	* PrimProcedure.java:  Remove unneeded variable.
	* ConsumerTarget.java:  Use Compilation.typeConsumer.

	* Declaration.java (IS_SINGLE_VALUE):  New constant.
	* ReferenceExp.java (compilation):  Optimize if SeriesTarget
	and IS_SINGLE_VALUE is set.

	* Compilation.java (loadCallContext):  New helper function.

	* LambdaExp.java (returnType):  New field.
	(getReturnType):  Guard against cycles.
	(setReturnType):  New method.
	* ApplyExp.java (getType):  Use LambdaExp's getReturnType.

2001-11-18  Per Bothner  <per@bothner.com>

	* ApplyExp.java (compile):  If isHandlingTailCalls use CallContext
	even for non-TailCalls (so CallContext gets passed through).
	(compileToArray):  Thus we can no longer re-use ctx.values.
	* Compilation.java (usingTailCalls):  Make non-static.
	(getModuleSuperType):  Handle usingCPStyle() case.
	(addClass):  Some tweaks for usingCPStyle() case.
	* FindCapturedVars.java (walkApplyExp):  Skip optimization to avoid
	function lambda if usingTailCalls, at least for now.
	* LambdaExp.java:  Tweaks for usingCPStyle() case.
	(allocParameters):  If isHandlingTailCalls() use getArgs method.

	* LambdaExp.java (enterFunction):  Use decl's parameter type,
	rather than the method's type, which is the implementation type.

	* LambdaExp.java (returnContinuation):  Make public, for ValuesMap.

	* ModuleBody.java (runAsMain):  Call runUntilDone rather than run,
	which wraps exceptions.  Instead, catch and print exceptions here.
	
	* PrimProcedure.java (<init>): Don't set interface flag as it prevents
	future getModifiers calls from getting the reflectClass's modifiers.
	
	* Expression.java (printLineColumn):  New method.
	* ApplyExp.java, BeginExp.java, LambdaExp.java, LetExp.java,
	SetExp.java (print): Use printLineColumn.

	* SetExp.java (getNewValue):  New method.

	* SetExp.java (compile):  Do compileSetField even if usingCPStyle.

2001-11-14  Per Bothner  <per@bothner.com>

	* GenericProc.java (match):  Look for best match, not first.

2001-11-12  Per Bothner  <per@bothner.com>

	* LitTable.java (writeObject);  Don't assign field for null.

	* LambdaExp.java (applyMethods):  Now initialized only if needed.
	(addApplyMethod):  New method; initialize applyMethods if needed.
	(compileSetField):  Call addApplyMethod.
	* Compilation.java (generateApplyMethods):  applyMethods can be null.
	* SetExp.java (compile):  Call addApplyMethod.

	* ModuleMethod (resolveParameterTypes):  New method.
	(match):  Also check parameter types.

2001-11-05  Per Bothner  <per@bothner.com>

	* ConsumerTarget.java (compileFromStack):  Use CallContent's new
	writeValues method.

2001-10-31  Per Bothner  <per@bothner.com>

	* ApplyExp.java (getArgCount):  New method.

	* FindTailCalls.java (walkLambdaExp):  Check if marked as inlined.
	Fixes problem where ValuesMap.inline terms tail-call to non-tailcall.

	* SeriesTarget.java (compile):  Don't pushScope/popScope, since that
	causes register conflicts due to our unusual jsr-based control flow.

2001-10-25  Per Bothner  <per@bothner.com>

	* SeriesTarget.java:  New class, extends Target.
	* Makefile.am (java_sources):  Add SeriesTarget.java.
	* StackTarget.java (compileFromStack0):  New static helper method.
	(convert):  New static helper method.  Uses compileFromStack0.

2001-10-20  Daniel Bonniot  <Daniel.Bonniot@inria.fr>

	* ModuleExp.java (compileToFiles):  Use File.separatorChar.

	* LitTable.java (writeObject): support for java.lang.* literals.

2001-10-19  Per Bothner  <per@bothner.com>

	* Expression.java, ApplyExp.java, BeginExp.java, IfExp.java,
	ModuleExp.java, SetExp.java, SynchronizedExp.java, TryExp.java (eval):
	Now specify throws Throwable.
	* ModuleExp.java (evalModule):  Likewise.
	Use CallContext's new runUntilDone method.
	* GenericProc.java, ModuleBody.java (apply* methods):   Likewise.
	* PrimProcedure.java (applyV):  Now throws Throwable, so on an
	InvocationTargetException just re-throw target exception.
	* ApplyExp.java (inlineIfConstant):  Catch Throwable.

2001-10-16  Daniel Bonniot  <Daniel.Bonniot@inria.fr>

	* Compilation.java (allocClass(ModuleExp)): Replaces 
	allocClass(LambdaExp). Cut dead code accordingly.
	* LambdaExp (getJavaName): Moved to ModuleExp.
	(compile, setNameMethod, compileAlloc): Removed.
	* ModuleExp (getJavaName): New method.

2001-10-11  Per Bothner  <per@bothner.com>

	* Compilation.java:  Added support --servlet.
	(typeServlet, generateServletDefault, generateServlet):  New fields
	(getModuleSuperType, startClassInit, addClass): Handle generateServlet.
	(generateApplyMethods):  Simplify - use getMethodProcType.
	* LambdaExp.java (allocFieldFor):  Pass correct frameType to
	Compilation.getMethodProcType.

	* PrimProcedure.java (applyV):  Use WrappedException.

2001-10-05  Per Bothner  <per@bothner.com>

	* Interpreter.java (asType):  CharSequence has been renamed to CharSeq.

2001-10-02  Per Bothner  <per@bothner.com>

	* Compilation.java (addClass):  Create clinit if --main or --applet.

2001-09-29  Per Bothner  <per@bothner.com>

	* ClassExp.java (getImplMethods):  Use Vector's 'addElement' method
	instead of 'add', for JDK 1.1.x compatibility.

2001-09-20  Per Bothner  <per@bothner.com>

	* Declaration.java (PRIVATE_SPECIFIED):  New flag.
	(makeField):  Only mangle if needed.
	Don't make UNKNOWN field final if we don't set it in clinit.

	* Declaration,java (isStatic):  Replace broken definition.
	* SetExp.java (eval):  No longer use isStatic; just check if ModuleExp.

	* StackTarget.java (compileFromStack0):  Add test that type is a
	ClassType.  Fixes bug reported by Jocelyn Paine.

2001-09-18   Andreas Schlapbach  <schlpbch@kde.org>

	* Interpreter.java (getLanguages):  New static method.

2001-09-15  Per Bothner  <per@bothner.com>

	Fix bug reported by Jocelyn Paine in returning #!null.
	* Compilation.java (generateApplyMethods):  Coerce return type
	using source lambda's return type, not method's implementation type.
	* ApplyExp.java (compile):  Likewise.
	* LambdaExp.java (getReturnType):  New method.
	(addMethodFor):  Use getReturnType.  Get implementation type of result.

2001-09-13  Per Bothner  <per@bothner.com>

	Reimplement --full-tailcalls to generate CpsMethodContainer.
	* LambdaExp.java (heapFrameLambda):  Removed field.
	(declareClosureEnv, allocFrame):  Don't test heapFrameLambda.
	(isClassGenerated):  No need to test for isHandlingTailCalls.
	(compileAlloc, compileEnd):  Likewise.
	(compile):  Simplify, remove cases no longer needed.
	(addMethodFor):  This is now also used if usingTailCalls, so modify.
	(allocChildClasses, enterFunction):  Remove no-longer-used code.
	(allocParameters):  Allocate $ctx parameter if handling tail-calls.
	(compileBody):  Get $ctx parameter from comp's callStackContext.
	(walkChildren):  Split into two methods ...
	(walkChildrenOnly, walkProperties):  New methods.
	* ApplyExp.java (compile):  No longer special-case handling
	of inline calls when --full-tailcalls.
	(popParams):  Also skip $ctx variable.
	* ChainLambdas.java (walkLambdaExp):  Split call to walkScopeExp
	so walkProperties is not scope of this lambda.
	* Compilation.java (getMethodProcType):  Extra case for usingTailCalls.
	(getConstructor):  No longer need to spacial-case usingTailCalls.
	(generateConstructor):  Likewise.
	(generateApplyMethods):  Handle usingTailCalls.
	(addClass):  Rename parameter "stack" to "$ctx".
	(compileConstant):  Do nothing if empty and target is ConsumerTarget.
	* FindCapturedVars.java (walkApplyExp):  Do walk function part
	if --full-tailcalls and calling to current function, for now.
	(capture):  Never set heapFrameLambda.
	* FindTailCalls.java (walkModuleExp):  No longer needed.
	(walkLambdaExp):  Call walkDecls at the appropriate time.
	* ReferenceExp.java (compile):  If fluid and field is null then
	load has alreadyloaded the value, so don't get the value field.
	* SetExp.java (compile):  Remove --full-tailcall Syntax special test.
	* ClassExp.java (compile):  Don't test heapFrameLambda.

	* ClassExp.java (getImplMethods):  Make static.
	Fix thinko, change reference to type field to interfaceType parameter.
	If incoming interfaceType is not an interface, return immediately.

2001-08-30  Per Bothner  <per@bothner.com>

	* Compilation.java (mangleNameIfNeeded):  New method.
	(mangleName): If reversible, '?' becomes plain "$Qu".
	(demangle2):  Re-write to use one big switch and add missing chars.
	* ClassExp.java (getCompiledClassType):  Use mangleNameIfNeeded.
	(getJavaName):  Likewise.
	(declareParts):  Likewise.  Mangling was missing before.

2001-08-27  Per Bothner  <per@bothner.com>

	* ModuleExp.java (evalModule):  Call CallContext's run method always.
	Fixes bug reported by Patrick Barta <patr@welchlink.welch.jhu.edu>

2001-08-24  Per Bothner  <per@bothner.com>

	* ClassExp.java (getType0:  Don't call declareParts.
	(partsDeclared):  New field.
	(getCompiledClassType):  Call declareParts if not already called.
	Always mangle name, even if simple, if name is not a valid Java name.
	* Compilation.java (isValidJavaName):  New static helper method.
	* Compilation.java (addClass): Emit class initializers even
	when immediate, to handle define-class.
	* Declaration.java (makeField):  Use reversible mangling.
	* Interpreter.java (getTypeFor):  Try looking up type name in
	current Environment.
	* ReferenceExp.java (getType):  Make non-final.
	* ThisExp.java (context):  New field.
	(<init>):  New constructor.
	(getType):  New method.

2001-08-23  Per Bothner  <per@bothner.com>

	* ClassExp.java (getCompiledClassType):  Map "<TNAME>" to "TNAME" here.
	(declareParts):  Make static field if specified.
	If making class pair, get method types from decl.
	Don't add Method for initMethod to instance method of pair.
	(getImplMethods):  New method to find implementation methods.
	(compile):  Use getImplMethods
	
	* PairClassType.java (reflectInstanceClass):  Renamed to instanceType.
	* ClassExp.java (setTypes): Update accordingly.

	* Compilation.java (typeObjectType):  New field.
	(generateClassName):  Do reversible name mangling.
	(generateConstructor):  If a ClassExp, call initMethod.
	* ObjectExp.java (compile):  Don't call initMethod here.

	Be more careful distingusihing source types (such as LispPrimType)
	and implementation types (such as PrimType) e.g. in conversions.
	* LambdaExp.java (addMethodFor):  Use implementation type when
	getting a Method.	
	* PrimProcedure.java (<init>):  Likewise, but used source types
	to set this.argTypes and this.retType.
	(compileArgs):  Use type from source, rather than method's type.
	* Compilation.java (generateApplyMethods):  Likewise.
	
	* LambdaExp.java (addMethodFor):  If a ClassExp's initMethod, then
	set the PRIVATE flag to prevent bad overrides.

	* Compilation.java (addClass):  Set SUPER flag.

	* FindCapturedVars.java (capture):  If decl IS_CONSTANT, do nothing.
	
	* SetExp.java (compile):  If a declaration is a class slot
	but without an actual field, look for and call a "set" method.

2001-08-16  Per Bothner  <per@bothner.com>

	* ClassExp.java:  Major re-write, to handle define-class, first-class
	classes, and true multiple inheritance.
	(simple, makeClassPair, instanceType):  New fields.
	(isSimple, setSimple, isMakingClassPair, setMakingClassPair):  New.
	(declareParts, slotToMethodName):  New methods.
	(class AbstractMethodFilter):  New class, extends Filter.

	* ClassInitializer.java:  New helper class, extends Initializer.
	* PairClassType.java:  New class, extends ClassType.
	* Makefile.am:  Update for new classes.

	* ModuleExp.java:  Now inherits directly from LambdaExp.
	(allocFields):  Add check for ClassExp.
	* ClassExp.java:  Now inherts directly from LambdaExp.
	Lots of code moved over from ObjectExp.
	* ObjectExp.java:  Now inherits from ClassExp, instead of vice versa.
	* ExpWalker.java (walkClassExp):  New method.
	(walkObjectExp):  Default to calling walkClassExp.
	* FindTailCalls.java (walkObjectExp):  Changed to walkClassExp.
	* ChainLambda.java:  Update for changed inheritance graph.
	* FindCapturedVars.java:  Likewise.
	(capture):  Don't set heapFrameLambda to ClassExp.
	* LambdaExpr.java:  Update for changed inheritance graph.
	* LambdaExp.java (compileEnd):  Kludge to handle usingTailCalls.
	* LambdaExp.java (addMethodFor):  Set isStatic if in ClassType.
	
	* ChainLambdas.java (walkClassExp):  If we are making a class-pair,
	name and addClass for instanceType class,

	* Compilation.java (typeClassType):  New static field.

	* Compilation.java (mangleName):  Take extra 'reversible' parameter
	to make an inveritble mangling.  Add overload.
	(demangle2):  Add support for '>', '<', and '('
	(demangleName):   Methods moved from kawa.stamdard.Scheme.
	Add extra 'reversible' option.

	* Compilation.java (<init>):  Add catch for error, to try to produce
	better error message on a compiler crash.

	* Compilation.java (addClass):  'Or' in PUBLIC, instead of assigning,
	since other code may have set other flags.

	* Compilation.java (getConstructor):  Add overload.
	(generateConstructor):  Add overload.
	If class has a staticLinkField, emit code to set it.
	* LambdaExp.java (enterFunction):  Use new getConstructor method.

	* LambdaExp.java (getExpClassName):  New method.
	(toString):  Use getExpClassName.
	
	* Interpreter.java (getTypeFor):  If a ClassExp, return its type.

	* Declaration.java (load):  If there is no variable and not field,
	but there is a "get" method, emit code to use that.

	* SynchronizedExp.java (compile):  Check for a ConsumerTarget.

2001-07-16  Per Bothner  <per@bothner.com>

	* Interpreter.java (languages):  Added xquery.
	(getOutputConsumer, getPrompter):  New methods.
	(parse, parseFile):  New abstract methods.

	* Parser.java:  Make non-abstract - used directly by XQuery.
	(currentModule, lookup):  New methods.
	(popBinding, pushBinding, push, pop, pushecls, popDecls):
	Moved to Translator.
	* ApplyExp.java (compile):  If handling tail calls, use setArgsN.

	* LambdaExp.java (compileBody):  New method.
	(compile, compileAsMethod):  Use compileBody.
	* ObjectExp.java (compile):  Likewise.
	* Compilation.java (addClass):  Likewise.
	* TailTarget.java:  Remove - use compileBody instead.
	* Makefile.am (java_sources):  Update accordingly.
	* Target.java (returnObject, returnValue):  Removed.

	* Compilation.java (typeConsumer):  New static field.

	* LambdaExp.java:  Overdue update of package containing LList.

	* ConsumerTarget.java:  Re-formatted.
	(cunsumer):  Fieldtype changed from Declaration to Variable.
	(compileUsingConsumer):  New static helper method.
	* Keyword.java (apply):  Update for endAttribute change in Consumer.

	* ModuleBody.java (runAsMain):  Optionally print values.
	(getMainPrintValues, setMainPrintValues):  New methods.

	* ScopeExp.java (currentModule):  New method.

2001-06-19  Per Bothner  <per@bothner.com>

	* Interpreter.java (asType):  Allow argument to be Binding.

2001-06-17  Per Bothner  <per@bothner.com>

	* BindingInitializer.java (emit):  No longer deal with Binding2.
	* Compilation.java (typeBinding2, functionValueBinding2Field,
	getBinding2Method):  Removed as Binding2 was removed.
	* Declaration.java (makeField):  No longer deal with Binding2.
	* SetExp.java (eval):  No longer need to handle Binding2.

	* Declaration.java (ignorable):  Return false if writing to unknown.
	(setCanWrite()):  New method.	
	* FindTailCalls.java (walkSetExp):  Use new method.

	* InlineCalls.java:  Preliminary code to check argument count.

	* ScopeExp.java (remove, lookup):  New methods.
	(getDefine):  Check for IS_UNKNOWN flag.

	* ReferenceExp.java (symbol):  Change type to Object so it
	could be a Binding.

2001-06-03  Per Bothner  <per@bothner.com>

	* Compilation.java (debugPrintFinalExpr):  New static field.
	(<init>):  If debugPrintFinalExpr, print expression.
	* ModuleExp.java (debugPrintExpr):  New static field.
	(evalModule, compileToFiles):  If debugPrintExpr, print expression.

	* Keyword.java:  Inherit from CpsProcedure.  A keyword FOO: sends a
	beginGroup of "FOO" to a Consumer, like xml <FOO>...</FOO>.
	
	* ApplyExp.java (eval(Environment,CallContext)):  For proper tailcalls
	don't call apply; leave that for the CallContext run method.

	* Expression.java (print(OutPort)):  New abstract method.
	(print(PrintWriter)):  Make final, and call new method.
	* ApplyExp.java, BeginExp.java, BlockExp.java, CatchClause.java,
	ErrorExp.java, ExitExp.java, IfExp.java, LambdaExp.java, LetExp.java,
	ModuleExp.java, ObjectExp.java, QuoteExp.java, ReferenceExp.java,
	SetExp.java, SynchronizedExp.java, TryExp.java (print):
	Changed to take OutPort parameter, and to do pretty-printing.

	* Interpreter.java (getFormat):  New abstract method.
	(print):  Add default implementation using getFormat.

	* ModuleBody.java (runAsMain):  Make sure OutPort.runCleanups is run.

2001-05-16  Per Bothner  <per@bothner.com>

	* ApplyExp.java (eval(Environment,CallContext)):  New method.

	* LambdaExp.java (compileEnd):  Always emitReturn if isModuleBody
	or isClassMethod, even if usingTailCalls.

	* ModuleBody.java (run(Consumer)):  New method.

2001-05-08  Per Bothner  <per@bothner.com>

	Change full-tailcalls calling convention so result is Consumer.
	ModuleBody uses full-tailcalls calling convention.
	* ApplyExp.java (compile):  Comment out usingCPStyle code for now.
	* Compilation.java (valueCallContextField):  Removed field.
	(addClass):  If non-static module-exp generate CpsProcedure apply.
	* Expression.java (eval(Environment,CallContext)):  New method.
	* IfExp.java (eval(Environment,CallContext)):  New method.
	* LambdaExp.java (isHandlingTailCalls):  A non-static module body
	now implements the CprProcedure calling convention.
	* ModuleBody.java:  Now extends CpsProcedure instead of Procedure0.
	Also implements Runnable.
	(run):  Return type is now void, with result ignored.
	(apply0):  New method, returns result value,
	* ModuleExp.java (evalModule(Environment,CallContext)):  New method.
	Call eval(Environment,CallContext) if not compiling.
	* TailTarget.java (compileFromStack):  Call StackContext's writeValue.

2001-05-01  Per Bothner  <per@bothner.com>

	* Interpreter.java (getNamespaceof):  New method.
	(VALUE_NAMESPACE, FUNCTION_NAMESPACE): New constants.

2001-04-24  Per Bothner  <per@bothner.com>

	* PrimProcedure.java (compileArgs):  Use compileNotePosition.
	* Checkedtarget.java (emitCheckedCoerce):  Do putLineNumber.

	* ApplyExp.java (getType):  Avoid infinite recursion.

2001-04-23  Per Bothner  <per@bothner.com>

	* ApplyExp.java (getType):  Handle functions that are ReferenceExp
	and LambdaExp as well as QuoteExp.  Fixes many warnings in kawa/lib.

2001-04-23  Per Bothner  <per@bothner.com>

	* ApplyExp.java (setArgs):  New method.

2001-04-09  Per Bothner  <per@bothner.com>

	* ApplyExpr.java (compile):  After too many/few-arguments message,
	set exp_lambda to 0, but don't make a new ReferenceExp.

2001-03-09  Per Bothner  <per@bothner.com>

	* Compilation.java (<init>):  Add a debugging hook.

	* PushApply.java (walkApplyExp):  Add walkChildren call.

	* SetExp.java (<init>):  Remove "%do%loop" kludge; hopefully unneeded.

2001-03-06  Per Bothner  <per@bothner.com>

	* ApplyExp.java	(compile):  When calling an inlined function,
	use parameter's type as target when evaluating arguments.

	* LambdaExp.java (compileAlloc, allocChildClasses):  Use old
	closure handling code when Compilation.usingTailCalls.

	* ModuleExp.java:  Add debugging code.

	* LitTable.java (writeObject):  Update FString package name.
	* Compilation.java:  Update classnames for new gnu.list changes.
	* Interpreter.java (<init>):  Constructor sets Convert.instance.
	* KawaConvert.java:  New class, extends gnu.lists.Convert.
	* Makefile.am:  Add KawaConvert.java.
	* Special.java (eof):  Now use gnu.lists.Sequence.eofValue.

2001-02-28  Per Bothner  <per@bothner.com>

	* LambdaExp.java (enterFunction):  If getInlineOnly(), set closureEnv
	from using loadHeapFrame of outerLambda.  (Fixes new test-case.)

2001-02-26  Per Bothner  <per@bothner.com>

	Use ModuleMethod to implement nested procedures too.
	* ApplyExp.java (compile):  Use LambdaExp.getHeapLambda.
	Use LambdaExp's compileEnd (unless --full-tailscalls).
	* Declaration.java (makeField):  Use comp.mainLambda's chain.
	* Compilation.java (applyMethods, initChain):  Moved to LambdaExp.
	(mainLambda):  New field.
	(typeCpsMethodProc, typeCpsMethodContainer):  New types.
	(<init>):  now requires ModuleExp, not LambdaExp.
	(getConstructor):  New method.
	(generateConstructor):  Return void.  Make on-argument overload.
	Use getConstructor.  Always traverse LambdaExp's (new) initChain.
	(generateApplyMethods):  Take LambdaExp parameter.
	(addClass):  Call compileEnd even if staticModule.
	* FindCapturedVars.java (capture):  Don't set heapFrameLambda.
	* LambdaExp.java (applyMethod):  New field, moved from Compilation.
	(isClassGenerated):  Return false for normal methods.
	(compileEnd):  Handle applyMethods, check for getInlineOnly().
	(allocFieldFor):  Don't make field FINAL if static.
	New scheme for selecting frame for field.
	(compileSetField):  Handle applyMethods moving from Compilation.
	(compile):  Don't return on IgnoreTraget (unless inlined or
	--full-tailcalls);  causes test failures from missing methods.
	(compile):  Frame is not always this.
	(getHeapFrameType, getHeapLambda):  New methods.
	(addMethodFor):  Use getHeapFrameType to find method's class.
	(allocFrame, enterFunction): In ObjectExp, frameType is object's class.
	(evalToClass, dumpZipPrefix, dumpZipCounter, eval): Moved to ModuleExp.
	* ClassExp.java:  Now extends LambdaExp, not ObjectExp.
	* ModuleExp.java:  Now inherit from ClassExp.
	(compile):  Commented out.
	(evalToClass, dumpZipPrefix, dumpZipCounter, eval):
	Moved from LambdaExp.
	* ObjectExp.java (compile):  Use Compilation's new generateConstructor.
	* ProcInitializer.java (<init>):  Chain is now managed by heapLambda.
	* SetExp.java (compile):  Handle applyMethods moving to LambdaExp.

	* Parser.java (mustCompileHere):  Look for enclosing ModuleExp.

2000-12-13  Per Bothner  <per@bothner.com>

	* Expression.java (makeGetField):  New static convenience method.

2000-12-11  Per Bothner  <per@bothner.com>

	* Expression.java (walk):  Make protected and change return type to
	Expression.  Make non-abstract - just call walkExpression.
	(walkChildren):  New virtual method.
	* ApplyExp.java, BeginExp.java, BlockExp.java, ExitExp.java,
	FluidLetExp.java, IfExp.java, LambdaExp.java, LetExp.java,
	ModuleExp.java, ObjectExp.java, ScopeExp.java, SetExp.java,
	SynchronizedExp.java, ThisExp.java, TryExp.java (walk):
	Make protected and change return type to Expression.
	* ApplyExp.java, BeginExp.java, BlockExp.java, ExitExp.java,
	IfExp.java, LambdaExp.java, LetExp.java, ObjectExp.java,
	ReferenceExp.java, SetExp.java, SynchronizedExp.java,
	TryExp.java (walkChildren):
	New method, with logic taken from ExpFullWalker.
	* ErrorExp.java (walk):  Removed - inherited version now works.

	* ExpWalker.java (walkExpression):  Change to protected and return
	type as Expression.  Change default to walkChildren and return this.
	(walkApplyExp etc):  Change to protected and return type to Expression.
	(currentLambda, exitVlaue):  New fields moved from ExpFullWalker.
	(getCurrentLambda, walkExps, walkDefaultArgs):  New methods, likewise.
	* ChainLambdas.java, FindCapturedVars.java, FindTailCalls.java,
	InlineCalls.java, PushApply.java:  Inherit from ExpWalker.
	(walkLambdaExp etc):  Change to protected and return Expression.
	* ExpFullWalker.java:  Removed.  Functionality moved either up to
	ExpWalker or to walkChildren methods in Expression sub-classes.
	* Makefile.am (java_JAVA):  Removed ExpFullWalker.java.

	* ChainLambdas.java (walkScopeExp):  Setup 'outer' links of ScopeExp
	and its sub-classes.  Call new walkChildren to walk children.
	(walkLambdaExp):  Call walkScopeExp.
	* Compilation.java (<init>):  Call InlineCalls early, since that may
	generate new tree.  Call ChainLambdas immediately after.
	* ExpFullWalker.java (walkScopeExp):  Just call walkChildren.
	(walkLambdaExp, walkObjectExp):  Removed.

	* LambdaExp.java (<init>(int)):  New constructor.

	* FindCapturedVars.java (allocUnboundDecl):  Use name as is.
	* Declaration.java (makeField): Handle IS_UNKNOWN declarations,
	and prepend "id$" here.

2000-12-09  Per Bothner  <per@bothner.com>

	* Declaration.java (IS_UNKNOWN):  New flag.
	(load):  If need Variable, and not yet allocated, do so now.
	(followAliases): Exit loop before returning null.
	(makeField):  If decl IS_UNKNOWN, make field static for now.
	No longer create BindingItitializer for unknown decls.
	* ApplyExp.java (<init>(Method,Expression[])):  New constructor.
	* ApplyExp.java (compile):  Check if decl IS_UNKNOWN, rather than null.
	* Interpreter.java (getTypeFor):  Likewise, but check null first.
	* Compilation.java (getBindingField):  Removed method - no longer used.
	(bindingFields):  Removed field.
	(initBindingFields):  Removed method.
	(generateConstructor, addClass):  Don't call initBindingFields.
	* FindCapturedVars.java (walkModuleExp, walkFluidLetExp):  New methods.
	(unknwonDecls, currentModule):  New fields.
	(allocUnboundDecl):  New method.
	(walkReferenceExp, walkSetExp):  Call allocUnboundDecl if needed.
	* FluidLetExp.java (compile):  Load decl.base to get (unknown) Binding.
	* SetExp.java (getName):  New method.
	(compile):  Changes since binding is now never null.
	* ReferenceExp.java (compile:  Likewise.

2000-12-02  Per Bothner  <per@bothner.com>

	* Compilation.java (generateConstructor):  Don't generate call to
	setName if module super-class has been specified, since super-class
	might not have setName.

2000-11-21  Per Bothner  <per@bothner.com>

	* PrimProcedure.java:  Handle more stringent SecurityManager.

2000-10-23  Per Bothner  <per@bothner.com>

	* StackTarget.java (compileFromStack0):  Always call emitCoerceToObject
	even when stackType.isSubtype(type).  Fixes bug in Stalin's
	destruct.sc benchmark, reported by Brian D. Carlstrom <bdc@ai.mit.edu>.

	* Interpreter.java (languages):  Recognize ".sc" as a Scheme
	extension (used in Stalin).

2000-10-12  Per Bothner  <per@bothner.com>

	* SetApplyExp.java:  Removed, as part of "setter" re-implementation.
	* Makefile.am (java_JAVA):  Update accordingly.
	* ExpWalker.java (walkSetApplyExp):  Removed field.

	* ApplyExp.java (compile):  Add overloading.
	New checkInlineable parameter.
	
	* Compilation.java (argsCallContextField):  Use "values" field,
	instead of removed "args" field.
	(dumpInitializers):  Reverse the order (to make it normal).

	* Compilation.java, FindCapturedVars.java, LambdaExp.java:
	Various fixes that apply when usingCPStyle().

	* LambdaExp.java (allocFieldFor):  If anonymous lambda, make
	field static if it doesn't need a closure.
	* FindCapturedVars.java (capture):  Return if decl has a static field.
	* ReferenceExp.java (eval):  If decl has ststic field, get its value.

	* Declaration.java (getConstantValue):  New helper method.
	* Declaration.java (IS_SYNTAX):  New flag constant.
	* SetExp.java (compile):  Update for Macro not extendeding Declaration.
	* ModuleExp.java (allocField):  Likewise.

	* PrimProcedure.java (takesVarArgs):  Return false if not a method.
	* ProcInitializer.java (emit):  Handle property value being
	an Expression, as opposed to a constant value.
	* ReferenceExp.java (setBinding):  New method.

2000-10-12  Per Bothner  <per@bothner.com>

	* CanInline.java:  New interface.
	* InlineCalls.java:  New class, extends ExpFullWalker.
	* Makefile.am (java_JAVA):  Add new classes.
	* ApplyExp.java (inlineIfConstant):  New utility method.
	* Compilation.java (<init>):  Call inlineCalls.inlineCalls.

	* Initializer.java (reverse):  New static method.

	* Declaration.java (<init>(String,Field)):  New constructor.
	(getDeclaration):  Two new static methods.

	* PrimProcedure.java (makeBuiltinBinary):  New static method.
	(compileArgs):  Update for moved class kawa.standard.list_v
	-> gnu.kawa.functions.MakeList.

	* SetApplyExp.java (setterProcedure):  Update for moved class
	kawa.standard.setter -> gnu.kawa.functions.Setter.

2000-10-09  Per Bothner  <per@bothner.com>

	* GenericProc.java (applyN):  If a method matches, don't re-use the
	matching CallContext for future match attempts, but use a new one.

2000-10-02  Per Bothner  <per@bothner.com>

	* ModuleExp.java (allocFields):  If decl.field is already set (e.g.
	by a require), don't allocate a field.

2000-08-23  Daniel Bonniot <bonniot@cma.ensmp.fr>

	* SetExp.java (compile):  Handle more cases of needValue.

2000-08-17  Per Bothner  <per@bothner.com>

	* SetExp.java (compile):  Add check for !comp.usingCPStyle().

	* ApplyExp.java, Compilation.java, LambdaExp.java, TailTarget.java:
	Renamed CallStack->CallContext, typeCallStack->typeCallContext etc.

	* ApplyExp.java (compile):  Don't crash if incorrect number of args.

	* Compilation.java (<init>):  Set mainClass before doing walks.

	* Compilation.java (addClass):  New method, takes ClassType.
	(allocClass(LambdaExp,String)):  Removed method.
	(allocClass(LambdaExp)):  Use new addClass, but not for an ObjectExp.

	* Compilation.java:  Some fixes towards the goal of call/cc support.
	* LambdaExp.java:  Likewise.

	* ConsumerTarget.java: New class, extends Target.
	* Makefile.am (java_JAVA):  Add ConsumerTarget.java.
	* LambdaExp.java (SEQUENCE_RESULT):  New flag.
	(addMethodFor):  If SEQUENCE_RESULT is set, append "$C" to method name.
	Also in that case, method returns void.
	(compileAsMethod):  If SEQUENCE_RESULT set, target is ConsumerTarget.
	
	* GenericProc.java (getVarBuffer):  Removed method.
	(match, applyV):  Update for new MethodProc api.
	* ModuleMethod.java:  Similar updates.
	* PrimProcedure.java:  Similar updates.
	(getProcedureClass, getMethodFor):  New static methods.

	* BeginExp.java (length):  New field.
	Allow variable number of sub-Expressions.
	(canonicalize, add):  New methods.
	* FindCapturedVars.java (walkLetExp):  Use BeginExp's new length field.
	* FindTailCalls.java (walkBeginExp):  Use BeginExp's new length field.
	* ExpFullWalker.java (walkExps):  New overload takes explicit length.
	(walkBeginExp):  Pass BeginExp's new length field to walkExps.

	* Expression.java (makeCoercion):  New static methods.

	* ChainLambdas.java (walkLambdaExp):  If lambda is bound to a
	unique declaration, make that its name.

	* ScopeExp.java (add):  New method.

	* ThisExp.java (<init>):  New constructors take/create Declaration.

2000-08-06  Per Bothner  <per@bothner.com>

	* LitTable.java (writeObject):  Handle null argument.
	(Fixes bug reported by Martin Atzmueller <ygrats@gmx.net>.)

	* ApplyExp.java (compile):  If direct method call needs closure,
	just call loadHeapFrame on parent.  This is a simplification
	which allows Dorai Sitaram pregexp package to work.

2000-06-26  Per Bothner  <per@bothner.com>

	* Interpreter.java (languages):  Add ".cl" extension for Common Lisp.

2000-06-24  Per Bothner  <per@bothner.com>

	* Interpreter.java (languages):  Add Common Lisp.

	* Special.java (print):  Also print #!" prefix.

	* SetExp.java (compile):  Add missing compileFromStack call.

2000-06-17  Per Bothner  <per@bothner.com>

	* ConditionalTarget.java (<init>(Label,Label)):  Remove constructor.

	* LambdaExp.java (properties):  New field.
	(getProperty, setProperty):  New methods.
	* ExpFullWalker.java (walkLambdaExp):  Also walk properties.
	* ProcInitializer.java (emit):  Also handle properties list.

	* Compilation.java (addClass):  Generate numArgs if --full-tailcalls.

	* GenericProc.java (make$V):  Renamed to plain make.

	* Interpreter.java (asType):  New method.

	* MethodProc.java:  Moved to gnu.mapping.
	* Makefile.am:  Update accordingly.

2000-06-09  Per Bothner  <per@bothner.com>

	* QuoteExp.java (getType):  If value is null, type is Type.nullType.
	* Literal.java (nullLiteral):  Its type is now Type.nullType.
	* LitTable.java (emit):  Handle null value.

	* Compilation.java (literalsChain):  New field.
	(addClass):  Call Literal.emit.  Do it *after* processing clinitChain,
	but make sure it is executed first.  (Gotos - sigh.)
	* Literal.java:  New longer inherit from Initializer.
	(next, field):  New fields (no longer inherited).
	(assign(Field,Compilation)):  New overload.
	Link on new comp.literalsChain, not comp.clinitChain.
	(emit):  Make static.
	* LambdaExp.java (evalToClass):  Update accordingly.
	* LitTable.java (emit):  Literals are no longer in clinitChain.
	* BindingInitializer.java (emit):  Add optimization.

	* Compilation.java (nameField):  Removed, since sym_name is gone.
	(setNameMethod):  New method.
	(addClass): Invoke setNameMethod instead of setting nameField.

	* LitTable.java (emit(Literal,booolen)):  Serialization spec says
	readResolve should return Object.  Hence, add needed cast.
	* Keyword.java (readResolve):  Fix return type to Object.
	* Special.java (readResolve):  Likewise.

	* Keyword.java (<init>):  Don't copy argument String.

	* Declaration.java (makeField):  New method, based on code from
	BindingInitializer constructor.
	* ModuleExp.java (allocFields):  Use Declaration's makeField method.
	* BindingInitializer.java (<init>):  Likewise.
	* SetExp.java (compile):  Use Declaration's new makeField method.
	Do nothing here for constant ModuleExp fields.

	* Declaration.java (noteValue):  If same Expression, same value.

	* CompiledProc.java:  Removed old file.

	* GenericProc.java (make$V):  New method.

	* Interpreter.java (languages):  Add language file extensions.

2000-06-05  Per Bothner  <per@bothner.com>

	* MethodProc.java (mostSpecific):  Fix type comparisons.

2000-05-28  Per Bothner  <per@bothner.com>

	* Compilation.java (mangleName):  Readable mangling of initial digit.

	* LambdaExp.java (addmethodFor):  Check for conflicting method names.

	* ModuleBody.java (apply0):  Use Values.noArgs, not rocedure.noArgs.

	* ModuleExp.java (SUPERTYPE_SPECIFIED):  New flag constant.
	(isStatic): Not default static if SUPERTYPE_SPECIFIED.

2000-05-27  Per Bothner  <per@bothner.com>

	Support (module-static ...) and (module-export ...).
	* ExpWalker.java (walkModuleExp):  New method.
	* ModuleExp.java (<init>):  Don't declareThis here.
	(isStatic, walk):  New methods.
	(allocFields):  Alloc field if !isSimple even if private.
	Add special test (kludge) for Macro.
	Don't setIndirectBinding here (do it in BindingInitializer instead).
	(EXPORT_SPECIFIED, EXPORT_SPECIFIED, NONSTATIC_SPECIFIED):  new flags.
	* FindTailCalls.java (walkDecls, walkModuleExp):  New methods.
	* ScopeExp.java (getDefine, getNoDefine):  New methods.
	* Declaration.java (fieldNum, assignField):  Unused, removed.
	(NOT_DEFINING, EXPORT_SPECIFIED, STATIC_SPECIFIED, NONSTATIC_SPECIFIED,
	TYPE_SPECIFIED, IS_CONSTANT):  New flag constants.
	(getFlag, setFlag, needsInit):  New methods.
	(setCanRead, setCanCall):  New method overloading.
	(needInit):  New method.
	* LambdaExp.java (NEXT_AVAIL_FLAG):  New constant.
	(declareClosureEnv):  Check if parent is ModuleExp.
	(allocFieldFor, addMethodFor):  Check if decl has STATIC_SPECIFIED.
	(allodFrame, enterFunction):  Check if ModuleExp.
	* ObjectExp.java (getType):  New method.
	(getCompiledClassType):  Now does not handle superclasses.
	* FindCapturedVars.java (capture):  Handle STATIC_SPECIFIED.
	If declaration has a 'base', handle it even if non-simple.
	* ModuleBody.java (run):  Make non-abstract.
	* Compilation.java (moduleStatic):  New static field.
	(instanceField):  New field.
	(allocClass):  Don't addClass if ModuleExp (since already done).
	(initBindingFields, startClassInit):  New method.
	(addClass, generateConstructor):  Call initBindingFields.
	(addClass):  Some extra complications to handle static modules.
	* ChainLambdas.java (comp):  New Compilation field.
	(walkObjectExp):  Create and name ClassType for ObjectExp.
	* ProcInitializer.java:  If field is static, link on initChain.
	(emitLoadModuleMethod):  If method static get comp's instanceField.
	* BindingInitializer.java:  Handle static vars and explicit types.
	* LetExp.java (store_rest, compile):  Use new Declaration needs_init.

	* Compilation.java (mangleName):  Uppercase following $-escape.
	Handle special characters in switch statement.

	More efficient handling of simple aliases.
	* Declaration.java (followAliases):  New method.
	(allocateVariable):  Call it.
	* FindTailCalls.java (walkApplyExp, walkReferenceExp, walkSetExp):
	Call Declaration.followAliases.
	* FindCapturedVars.java:  Likewise.
	* SetExp.java (compile):  Call Declaration.followAliases.
	* ReferenceExp.java (compile):  Likewise.

2000-05-23  Per Bothner  <per@bothner.com>

	* Compilation.java (makeNullPairMethod, makePairMethod):  Removed.
	(Reported by Edouard G. Parmelan <Edouard.Parmelan@quadratec.fr>.)

2000-05-22  Per Bothner  <per@bothner.com>

	* LitTable.java:  New class, manages the literals of a Compilation.
	* Compilable.java:   Removed, no longer used.
	* Makefile.am (java_JAVA):  Update accordingly.
	* Literal.java (argVlaues, argTypes0:  New fields.
	(ALLOCATING, ALLOCATED, INITIALIZED, ASSIGNED):  Removed flags values.
	(WRITING, WRITTEN, CYCLIC, EMITTED):  New flags values.
	(emitArray, emit(Compilation,boolean)):  Remove now-unused methods.
	* Compilation.java (scmListType):  Renamed to typeLList.
	(emptyConstant):  New Field field.
	(litTable):  New field.
	(findLiteral):  Nothing to do now if we already have literal.
	No special handling for Compilable or Object[].
	(emitLiteral):  Remove unused now-methods.

	* Interpreter.java (getTypeFor):  New methods.
	(string2Type):  New static method, based on method in Scheme class.
 	
	* Keyword.java:  No longer implements Compilable.
	* Special.java:  No longer implements Compilable.

	* PrimProcedure.java (<init>(Method, Interpreter):  New constructor.

	* MethodProc.java (mostSpecific):  Use Type.compare once instead
	of isSubtype twice.

2000-05-09  Per Bothner  <per@bothner.com>

	* Keyword.java:  Implement java.io.Externalizable
	* Special.java:  Likewise.
	Change so name does not include "#!" prefix.
	
	* PrimProcedure.java (<init>):  Call non-deprecated addMethod version.

	* Parser.java (current_filename, current_line, current_column,
	messages):  Move fields here from Translator.
	(<init>):  New constructor.
	(error(char,Declaration,String,String)):  New method.
	(getMessages, setMessages, error):  Methods moved from Translator.
	(getFile, getLine, getColumn, setFile, setLine, setColumn

	* Interpreter.java (languages):  New static table.
	(getInstance):  New overloaded static methods.

2000-05-07  Per Bothner  <per@bothner.com>

	* ApplyExp.java (compile):  If calling a name bound to a constant
	that is not a procedure, emit a warning (instead of an exception).
	Based on a patch from Daniel Bonniot <bonniot@cma.ensmp.fr>.

	* Expression.java (makeWhile):  Remove old unsafe overloaded variant.

2000-04-22  Per Bothner  <per@bothner.com>

	* PrimProcedure.java (init):  New private helper method.
	New constructors take java.lang.reflect.Method and Interpreter.
	(getMethodFor):  New method overloads use new constructor/
	* ApplyExp.java (compile):  Pass interpreter to
	PrimProcedure.getMethodFor.

2000-04-21  Per Bothner  <per@bothner.com>

	* Parser.java:  A new class, an abstract super-class for Translator.
	* Expression.java (makeWhile):  New overload, uses Parser.
	* Makefile.am (java_JAVA):  Add parser.java.

	* LambdaExp.java (addMethodFor):  Don't make method FINAL
	(the user may want to inherit from this module).

	* ModuleMethod.java:  Change to extend MethodProc.
	(getVarBuffer, match, applyV):  New methods.

	* SetExp.java (getType):  Handle the HAS_VALUE case.

	* Interpreter.java (emitPushBoolean, emitCoerceToBoolean): New methods.

2000-04-13  Per Bothner  <per@bothner.com>

	* SetExp (eval, compile):  If define-alias, create an AliasConstraint.
	* Declaration.java (IS_ALIAS):  New flag.
	(isAlias, setAlias):  New methods.
	* ReferenceExp.java (eval, compile, getType):  Handle case when
	getDontDereference() is true.  (Return Location instead.)
	
	* ModuleExp.java (compileToFiles):  If module name is specified,
	always set topname from module name (even if compound).
	Set prefix from module name only if prefix is not specified.
	Use File.mkdirs to create missing output directories.

	* Interpreter.java (coerceToObject(int)):  New method.

	* Compilation.java (mangleName): Change mangling for '!', '->', '%'.
	(demangle2):  New static method.

2000-03-21  Per Bothner  <per@bothner.com>

	* gnu/expr/Compilation.java (typeRunnable):  New static.
	(allocClass):  Handle explicit super-class and interfaces.
	(generateApplyMethods):  Set generateApplyMethodContainer whenever
	super class is not Procedure.
	(addClass):  Handle "run" method differently if explicit superclass.
	(getMethodProcType):  Made static;  takes ClassType argument.
	(getModuleSuperType):  Take ModuleExp parameter, check its supertype.
	* LambdaExp.java (allocFieldFor):   Update getMethodProcType call.
	* ProcInitializer.java (emitLoadModuleMethod):  Likewise.
	* gnu/expr/ModuleExp.java (superType, interfaces):  New field.
	(getSuperType, setSuperType, getInterfaces, setInterfaces):  New.
	(compileToFiles):  Handle explicit specified module name.

2000-03-12  Per Bothner  <per@bothner.com>

	* Compilation.java (mangleName):  Add manglings for ascii characters.

	* Expression.java (makeWhile):  New static.
	(noExpressions):  New static field.

	* Expression.java (flags):  New field.
	(setFlag, getFlag, getFlags):  New methods.
	* ReferenceExp.java:  Use inherited flags field and conventions.
	(PREFER_BINDING2):  New flag bit.
	(eval, compile):  More kludges for ELisp support.
	* SetExp.java:  Use inherited flags field and conventions.
	(PREFER_BINDING2):  New flag bit.
	(eval, compile):  Get "noValue" from Interpreter.
	(eval, compile):  More kludges for ELisp support.
	* LambdaExp.java (flags, getFlags, setFlags):  Now inherited.

	* IfExp.java (compile):  Pass interpreter to ConditionalTarget.
	* Interpreter.java (getInterpreter):  New static method.
	* ConditionalTarget.java (interpreter):  New field.
	(<init>):  Take Interpreter argument.
	(compileFromStack):  Use interpreter's boolean values.
	
2000-03-06  Per Bothner  <per@bothner.com>

	* ApplyExp.java (compile):  Handle identifier bound to declaration
	with constant value (as created by `require').
	* Declaration.java *base):  New field.
	(loadOwningObject):  If base is non-null, load that.
	* FindCapturedVars.java (capture):  If captured Declaration has a
	null-null base, mark it as readable, and capture it as well.
	* PrimProcedure.java (compile):  Split into two methods.
	(getMethodFor):  Likewise.

	* LambdaExp.java (getCaller):  Don't loop looking for inlined callers.

	* LambdaExp.java (enterFunction):  Use main methods parameter
	types to set stack type.

	* FindTailCalls (walkSetExp):  Check for decl.isPublic, rather
	if the context is a ModuleExp (which doesn't work for private decls).

	* Special.java (print):  Just print the name.

2000-03-02  Per Bothner  <per@bothner.com>

	* CheckedTarget.java (emitCheckedCoerce):  Don't add handler if we
	didn't add any coercion code.  Slightly modified from a patch from
	Daniel Bonniot <bonniot@cma.ensmp.fr>.

	* ExitExp.java (getType):  New method - return Type.neverReturnsType.

2000-02-29  Per Bothner  <per@bothner.com>

	* LambdaExp.java (allocChildClasses):  Set firstArgsArrayArg for
	child when isClassGenerated().  Fixes bug reported by Bruce R. Lewis.

2000-02-27  Per Bothner  <per@bothner.com>

	Various tweaks for better javadoc processing.
	* overview.html:  Renamed to package.html.

	* Compilation.java (nameField):  Now name is in Procedure, not Named.
	* LambdaExp.java (compileAlloc):  Update for setName method.

2000-02-26  Per Bothner  <per@bothner.com>

	* Literal.java (nullIteral):  New final static field.
	(emit):  Handle null value.
	* Compilation.java (findLiteral):  Handle null value.
	(emitLiteral):  Likewise.

2000-02-25  Per Bothner  <per@bothner.com>

	* ExpFullWalker.java (walkDefaultArgs):  New method.
	(walkLambdaExp):  Call walkDefaultArgs.
	* FindCapturedVars.java (walkDefaultArgs):  New method.
	Check if default expression captures a parameter.
	* LambdaExp.java (DEFAULT_CAPTURES_ARG):  New flag.
	(setFlag): New (non-public) method.
	(addMethodFor):  Generate stubs unless DEFAULT_CAPTURES_ARG is set.
	(compileAsMethod):  For stubs, make parameter be simple.

2000-02-12  Per Bothner  <per@bothner.com>

	* Compilation.java (typeApplyMethodContainer):  New static field.
	(generateApplyMethods):  If applet. implement ApplyMethodContent.
	Add generateApplyMethodContainer local variable.
	* LambdaExp.java (addMethodFor):  Set closureEnv for applets.
	Make method non-static if thisVariable is set.

	* ThisExp.java:  New class; extends ReferenceExp.
	* Makefile.am, Makefile.in (java_JAVA):  Added ThisExp.java.
	* ExpWalker.java (walkThisExp):  New virtual method.
	* FindCapturedVars.java (walkThisExp):  New method.

2000-02-11  Per Bothner  <per@bothner.com>

	* BindingInitializer.java:  Create Binding2 instead of Binding
	if the languge hasSeparateFunctionNamespace().
	* Declaration.java (isProcedureDecl, setProcedureDecl):  New flags.
	* Interpreter.java (hasSeparateFunctionNamespace):  New method.
	* ApplyExp.java (eval, compile):  Remove hacks for checking "function
	binding" - let ReferenceExp.isProcedureDecl() handle it instead.
	* ModuleBody.java (runAsMain):  Don't create kawa.standard.Scheme here;
	instead compiler inserts call to Scheme.registerEnvironment.
	* ReferenceExp.java (flags):  New int field.
	(dontereference):  Folded into flags field.
	(isProcedureName, setProcedureName):  New methods.
	(eval, compile):  Use function name space, if appropriate.
	* SetExp.java (getHasValue, setHasValue, isFuncDef, setFunDef,
	isSetIfBound, setSetIfUnbound):  New methods.
	(eval, compile):  Update to use new flags.

	* Compilation.java (scmInterpreterType):  Renamed to typeInterpreter.
	(typeBinding2, functionValueBinding2Field, getBindingEnvironmentMethod,
	getBinding2Method, defineFunctionMethod, typeApplet, typeValues,
	noArgsField):  New static fields.
	(apply*ModuleMethod etc):  Remove many no-longer-needed fields.
	(generateAppletDefault, generateAppletDefault):  New fields.
	(getMethodProcType, getModuleSuperType):  New method.
	(generateApplyMethods):  Fix various small but critical bugs.
	Handle the main class inheriting from Applet.
	(addClass):  Generate code to "registerEnvironment" if main or applet.
	* LambdaExp.java (addMethodFor):  Declare `this' for applet methods.
	(compileAsMethod):  Fix various small but serious bugs.

	* Compilation.java (mangleName):  Mangle initial digit.

	* ProcInitializer.java (emitLoadModuleMethod):  Get ModuleMethod's
	<init> method using ClassType.getDeclaredMethod.
	(constructor_args, initModuleMethod):  No longer needed.

2000-01-31  Per Bothner  <per@bothner.com>

	* ApplyExp.java (eval):  Use getProcedure to get function value.
	* Interpreter.java:  Moved from kawa.lang.
	(defaultInterpreter):  New static field.
	(isTrue, booleanObject, noValue):  New methods.
	(boolObject):  Removed method.
	(getName):  Made abstract.
	* Makefile.am, Makefile.in (java_JAVA):  Added Interpreter.java.
	* Compilation.java (getInterpreter):  New method.
	(scmInterpreterType):  Interpreter moved from kawa.lang to gnu.expr.
	(compileConstant):  Use getInterpreter().isTrue method.
	* IfExp.java (eval, compile):  Likewise.
	(getInterpreter):  New method.
	(is_true):  Removed method.

	* SetExp.java (HAS_VALUE):  New flag.
	(getHasValue, setHasValue):  New methods.
	(eval):  If getHasValue() return RHS, else return 
	(compile):  Likewise.

	* QuoteExp.java (getType):  If value is null, type is Object.

2000-01-25  Daniel Bonniot <bonniot@cma.ensmp.fr>

	* QuoteExp.java: (getType):  For null, return Type.pointer_type.

2000-01-24  Per Bothner  <per@bothner.com>

	* BeginExp.java (<init>):  New default constructor.
	(setExpressions):  New method.
	(getExpression):  Make private.

2000-01-22  Per Bothner  <per@bothner.com>

	* BindingInitializer.java:  New class, inherits from Initializer.
	* Makefile.am, Makefile.in (java_JAVA):  Add BindingInitializer.java.

	* Compilation.java (argsArray):  Removed field.
	(typemacro, typeLocation, getLocationMethod):  New static fields.
	(findLiteral):  If empty Object[], use noArgsProcedureField.
	Handle Object[] where some elements are null.
	(mangleName):  If name starts with "->" mangle to "to", not "To".
	(generateConstructor):  More robust loop for processing initChain.
	Generate code to initialize bindingFields fields (not in "run").
	(generateApplyMethods):  New method.  Code moved from addClass,
	and generalized to handle LambdaExps with multiple primMethods.
	* LambdaExp.java (argArray, firstArgsArrayArg):  New fields.
	(flags):  Make protected.
	(METHODS_COMPILED, NO_FIELD):  New flag enums.
	(isClassgenerated):  Needing closure no longer forces class generation.
	(primMethod):  Rmeoved field; replaced by ...
	(primMethods):  New field.
	(getMethod, getmainmethod, restTypeArgs):  New methods.
	(declareArgsArray):  Removed method.
	(allocFieldFor, compileSetField):  New methods.
	(compile):  Use new methods.
	(addMethodFor):  New interface - can generate multiple Methods.
	(allocParameters, enterFunction):  New longer takes argsArray argument.
	(enterFunction):  Handle both fix args plus final var args array/list.
	Generate better coed for keywordw when default is constant.
	(compileAsMethod):  Handle multiple methods;  generate stubs.
	* ObjectExp.java (compile):  Use LambdaExp's getMainMethod.
	* ApplyExp.java (compile):  Use LambdaExp's getMethod.
	Call that method using PrimProcedure.compileArgs.

	* FindTailCalls.java: Use Declaration's getValue method.
	* FindCapturedVars.java (walkApplyExp):  New method.
	(capture):  No longer return immediately if decl.isStatic().
	No need to chain decl on owner's capturedVars if decl is public.
	* Keyword.java (searchForKeyword):  New static method.
	* ModuleExp.java (evalModule):  Call ClassMemberConstraint.defineAll.
	(allocFields, print):   New methods.
	
	* SetExp.java (compile):  Various hacks mostly so that top-level
	definitions get exported as fields.
	* Literal.java (assign):  New overloaded method.
	(emit):  Better error message if Compilable not implemented.

	* PrimProcedure.java (match):  Optimize if rest arg is LList.
	(compileArgs):  New static helper method.
	(compile):  Use it.
	* ProcInitializer.java (emitLoadModuleMethod):  New static method.
	(emit):  Use emitLoadModuleMethod.
	(<init>):  New constructor.
	* ReferenceExp.java (compile):  Use Compilation.getLocationMethod.
	Handle non-static Binding method.
	
	* Declaration.java (shadowed):  Removed fields.
	(getValue):  Make final.
	(isPublic):  New method.

1999-12-24  Per Bothner  <per@bothner.com>

	* Initializer.java:  New abstract class.
	* ProcInitializer.java:  New class;  extends Initializer.
	* Makefile.am, Makefile.in (java_JAVA):  Add new classes.
	* Literal.java:  New inherits from Initializer,
	(next, field):  Replace by super-class fields.
	(assign):  Like to comp.comp.clinitChain not comp.comp.literalsChain.
	(emit):  New method (to satisfy super's abstract method).
	* Compilation.java (dumpLiterals):  Replaced by dumpInitializers.
	(literalsChain):  Rename to clinitChain;  change type to Initializer.
	(initChain):  New field.
	(generateConstructor):  Do dumpInitializers(initChain).

	* Compilation.java (addClass):  Remove now-unused "apply" generation.

	* Expression.java (compileNotePosition):  Do not use a try-finally
	to restore linenumber.
	* Compilation.java (addClass):  If an exception (internal error)
	is thrown while compiling, catch it and print an error.

	* Declaration.java:  No longer inherit from Variable.
	(sym):  Field re-named to `name'.
	(string_name, symbol):  Renmoved methods;  use getName instead.
	(next, var):  New fields.
	(IS_SIMPLE):  New flag.
	(getName, setName, setType, getType, nextDecl, getVariable, isSimple,
	setSimple):  New methods.
	(load, compileStore, initBinding):  Pass getVariable() instead of this.
	(allocateVariable):  New method.
	* ScopeExp.java (decls, last):  New fields.
	(firstDecl, add):  New methods.
	(addDeclaration):  Use new add method.
	* CatchClause.java (compile):  Change Declaration catchDecl
 	to Variable catchVar.
	* LambdaExp.java (declareThis, declareClosureEnv, declareArgsArray):
  	Now return Variables.
	(isClassGenerated):  Always generate class for ObjectExp;  never
	if outerLambda is a ModuleExp. 
 	(heapFrame, closureEnv, thisVariable):	Change from Declaration
 	to Variable.
	* Compilation.java (thisDecl, callStackContext):  Likewise.
	* ObjectExp.java (compile):  May need staticLink even of caller's
	closureEnv is null.  Call the Variable "closureEnv", not "staticLink".
	* FindTailCalls.java:   Update to use Declaration instead of Variable.
	* ApplyExp.java, FluidLetExp.java, LetExp.java, SerExp.java:  Likewise.
	* FindCapturedVars.java:  Likewise.
	(capture):  The heapFrame of a ModuleExp is its thisVariable.
	* ModuleExp.java (<init>):  Call declareThis.

1999-12-17  Per Bothner  <per@bothner.com>

	* CheckedTarget.java (emitCheckedCoerce): Use "lambda" as default name.

1999-12-11  Per Bothner  <per@bothner.com>

	* FindCapturedVars.java (walkLetExp)  Don't optimize if FluidLetExp.
	* gnu/expr/FindTailCalls.java (walkFluidLetExp):  New method.  Fixes
	bug reported by Walter C. Pelissero <wcp@lpds.sublink.org>.
	* gnu/expr/PushApply.java (walkApplyExp):  Don't re-write if
	function is FluidLetExp.

1999-12-06  Per Bothner  <per@bothner.com>

	* PrimProcedure.java (compile):  If too few/many arguments,
	call comp.error instead of throwing WrongArguments.

1999-12-06  Bruce R. Lewis  <brlewis@alum.mit.edu>

	* ModuleExp.java (compileToArchive):  Re-write to use java.util.zip.*
	instead of gnu.bytecode.ZipArchive.

1999-12-05  Daniel Bonniot <bonniot@cma.ensmp.fr>

	* Declaration.java (load):  Call emitPutStatic if appropriate.
	* SetExp.java (compile):  Likewise.

1999-11-28  Per Bothner  <per@bothner.com>

	* FindCapturedVars.java (capture):  When chasing down callers of
	inline-only functions, watch out for infinite cycles.
	* FindTailCalls.java (walkLambdaExp): If child has one *or zero*
 	callers, mark it as inline-only.

1999-11-27  Per Bothner  <per@bothner.com>

	* FindCapturedVars.java (capture):  If the captured decl is an
	inline-only procedure, we're done.  Likewise if we're calling ourself.
	Fixes bugs reported by Walter C. Pelissero <wcp@lpds.sublink.org>.
	Don't "capture" decl is it is a call-only variable.  (We don't
	need a closureEnv for a call-only ufnction.)  Instead, rely on
	new setCallersNeedStaticLink/setNeedsStaticLink() methods.
	* LambdaExp.java (getNeedsClosureEnv):  New method.  Use it various
 	places instead of (getImportsLexVars() || getNeedsStaticLink()).
	(setNeedsStaticLink()):  New method (overload).
	(setCallersNeedStaticLink):  New helper method.
	(declareThis): Remove duplicate semi-colon.
	(allocChildClasses):  Keep searching parent chain for closureEnvType.

1999-11-26  Per Bothner  <per@bothner.com>

	* Compilation.java (compileConstant): Coerce value to target type.
	Tell compileFromStack that the current type is the value's class.
	Suggested by Daniel Bonniot <bonniot@cma.ensmp.fr>.

1999-11-16  Per Bothner  <per@bothner.com>

	* ApplyExp.java (compile):  Minor fix for tail-recursion with many
	arguments. (Bug reported by Walter C. Pelissero <wcp@lpds.sublink.org>)

1999-11-15  Per Bothner  <per@bothner.com>

	Suggested by Daniel Bonniot <bonniot@cma.ensmp.fr>:
	* ExpFullWalker.java (walkBlockExp):  Test if exitBody is null.
	* Compilation.java (findLiteral):  Use Type.make(value.getClass()).

	* ObjectExp.java (getCompiledClassType):  Use Scheme.exp2Type.

	* MethodProc.java (isApplicable):  Fix incorrect return code.
	(mostSpecific):  New method.
	* GenericProc.java (applyN):  Select most specific matching method.

	* PrimProcedure.java (getParameterType):  Adjust for static/non-static.
	(getMethodFor):  If class is ModuleMethod, get the module's class.

1999-11-03  Per Bothner  <per@bothner.com>

	* ApplyExp.java (compile):  If function is Inlineable but we didn't
	line it, try PrimProcedure.getMethodFor.
	* MethodProc.java (isApplicable):  Change arg types and return codes.
	Implementation now uses Type.compare.
	(numParameters, getParameterType, mostSpecific):  New methods.
	* GenericProc.java (isApplicable):  Change arg types and return codes.
	* PrimProcedure.java (setReturnType, getParameterType): New methods.
	(getMethodFor):  New static method.  (Code moved from Translator.)

1999-10-25  Per Bothner  <per@bothner.com>

	* ApplyExp.java (popParams):  Take extra argument.
	(compile):  Handle tail-recursion for varargs functions.

	* ClassExp.java:  New class; extends ObjectExp.
	* Makefile.am, Makefile.in (java_JAVA):  Added ClassExp.java.
	* Compilation.java (addClass):  ClassExp cannot have "apply" method.
	* LambdaExp.java (evalToClass):  New method.

	* PrimProcedure.java (compile):  Handle takesVarArgs() methods.

1999-09-14  Per Bothner  <per@bothner.com>

	* GenericProc.java:  New inherits from MethodProc.
	(getVarBuffer, isApplicable, match, applyV):  New methods.

	* PrimProcedure.java:  Interpret methods whose names end in "$V"
	as taking a variable number of arguments;  the excess ones are
	bundled in an array passed as the last argument.

1999-09-08  Per Bothner  <per@bothner.com>

	No longer create new class for top-level procedures;
	instead allocate a ModuleMethod for each procedure.
	* LambdaExp.java (isClassGenerated):  Update for new behavior.
	(selectorValue, getSelectorValue):  New field and method.
	(compile):  Generate static methods, plus allocate ModuleMethod.
	(addMethodFor):  Better way of selectiing method names.
	* ModuleMethod.java (apply4):  Add "missing" method.
	* ModuleBody.java (apply4):  Likewise.
	(applyN):  Try calling apply0 .. apply4, if appropriate.
	* Compilation.java:  Allocate static types and methods needed.
	(addClass):  Generate the ModuleBody applyX methods.

	* Declaration.java:  New fields and methods for line number info.

	* Compilation.java (typeObject):  Renamed from scmObjectType.
	(typeString, typePair):  New preferred field names.
	* Literal.java, ReferenceExp.java, SetApplyExp.java:  Update
 	references accordingly.

1999-09-05  Per Bothner  <per@bothner.com>

	* Declaration.java (PRIVATE, isPrivate, setPrivate):  New flag.
	(isStatic, isLexical):  New methods.
	(load, compileStore):  Don't loadOwningObject if field is static.
	* SetExp.java (eval, compile):  Handle binding to static Declaration.
	* ReferenceExp.java (eval.compile):  Likewise.
	* FindTailCalls.java (walkSetExp):  Likewise.
	* FindCapturedVars.java (capture):  Do nothing if decl.isStatic().

	* ModuleMethod.java:  New class, which extends ProcedureN.
	* ModuleBody.java:  New apply methods that take a ModuleMethod.
	* Makefile.am, Makefile.in (java_JAVA):  Add ModuleMethod.java.

1999-08-26  Per Bothner  <per@bothner.com>

	* GenericProc.java:  New class;  inherits from ProcedureN.
	* MethodProc.java:  New class;  inherits from ProcedureN.
	* Makefile.am, Makefile.in (java_JAVA):  Add new .java files.
	* PrimProcedure.java:   Re-organized to inherit from MethodProc.

	* Declaration.java (sym, value):  Make fields protected.
	(<init>):  New protected empty constructor (for kawa.lang.Syntax).

	* ReferenceExp.java (compile):  Indirect bindings are now Locations.
	* SetExp.java (compile):  Likewise.

1999-08-22  Per Bothner  <per@bothner.com>

	* Compilation.java (error):  New methods, like those in Translator.
	(addClass):  Use new ApplyExp constructor.
	(scmPatternType):  Removed - no longer needed.
	* ApplyExp.java (<init>):  New constructor.
	(compile):  Use new Compilation.error methods.

	* Expression.java (compileNotePosition):  New method.

	* LambdaExp.java:  Provide a cache for evaluated value.

	* BlockExp.java (exitBody):  New field.
	(setBody):  New overloaded methods.
	(compile): Handle exitBody.  Set this.exitLabel.
	* Declaration.java (getValue):  New method.
	(<init>(String, Type)):  Handle the name being null.
	* IfExp.java (compile):  Optimize if else part is ExitExp.
	* ExpFullWalker.java (walkBlockExp, walkExitExp):  New methods.
	* ExitExp.java (<init>):  New constructors.
	(compile):  Remove bogus compilation of void.	
	* BeginExp.java (<init>):  New convenience constructor.
	* LetExp.java (getBody, setBody):  New methods.
	* ReferenceExp.java (<init>):  New overloaded constructor.

1999-08-18  Per Bothner  <per@bothner.com>

	* PrimProcedure.java (getName):  Use super.getName() instead of
 	deprecated name().

1999-08-17  Per Bothner  <per@bothner.com>

	* FindTailCalls.java (walkObjectExp):   Don't call super.walkObjectExp,
	instead call walkLambdaExp on each method so setCanRead is not called.
	* LambdaExp.java (allocFrame):  Don't create closureEnvField here,
	since it is not appropriate for ObjectExp.
	(allocChildClasses):  Create closureEnvField here instead.
	* ObjectExp.java (compile):  Don't create staticLinkField if this is
	our parent's heapFrameLambda (since parent has already done it).

1999-08-06  Per Bothner  <per@bothner.com>

	* CheckedTarget.java:  New class, extends StackTarget.
	* Makefile.am, Makefile.in:  Update accordingly.
	* StackTarget.java (compileFromStack0):  New protected method.
	* Compilation.java (addClass):  Specificy LambdaExp to PrimProcedure.
	* LambdaExp.java (enterFunction):  Do checked coerce on argument.
	* PrimProcedure.java (applyN):  Catch ClassCastException.
	(<init>):  New overload.
	(compile):  Catch ClassCastException.
	(getVerboseName):  New method.

1999-07-19  Per Bothner  <per@bothner.com>

	* ApplyExp.java (compile):  When doing a direct method call,
	pass the correct closure environment.
	* LambdaExp.java (getCaller):  New method.
	(declareClosureEnv):  Fix problems with inline functions.

1999-07-15  Per Bothner  <per@bothner.com>

	* Target.java (pushValue, returnValue):  New static methods.
	* IgnoreTarget.java (compileFromStack):  Use Type.isVoid().
	* TailTarget.java (getInstance):  New method.
	* Compilation.java (addClass):  Use Target.returnValue().
	* ObjectExp.java (compile):  Likewise.
	* Expression.java (compile):  Use StackTarget.getInstance.
	* StackTarget.java (getInstance):  New method.
	(compileFromStack):  Use Type.isVoid and Type.isSubtype.
	* LambdaExp.java (compileAsMethod):  Likewise.

	* ObjectExp.java (print):  New method.
	(getCompiledClassType):  Fix incorrect implied superclass handling.

	* ApplyExp.java (compile):  Check real parent (even if inline), when
	seeing if we need to pass a closure when calling a method directly.	
	* LambdaExp.java (allocFrame):  When allocating closureEnvField, check
 	real parent (even if inline).  Inline functions can have heapFrame.
	(enterFunction):  Fix logic bug when renaming duplicate field.

1999-04-22  Per Bothner  <bothner@Magnus.Cygnus.COM>

	* LetExp.java (compile):  Target for init expr is decl type.

1999-04-22  Per Bothner  <bothner@cygnus.com>

	* Compilation.java (addClass):  Remove (commented-out) call to
 	declareClosureEnv.
	* FindTailCalls.java (walkSetExp):  Don't call walkLambdaExp if the
	value is an ObjectExp.
	* expr/LambdaExp.java (declareClosureEnv):  If isClassMethod(),
	then the closureEnv variable is "this".
	* expr/ObjectExp.java (compile):  Create staticLinkField if needed.

1999-04-15  Per Bothner  <bothner@Magnus.Cygnus.COM>

	* Compilation.java (addClass):  Don't create primitive methods here.
	* LambdaExp.java (allocChildClasses):  Do it here instead,
	* Compilation.java (addClass):  Don't compiled child methods here.
	* LambdaExp.java (compileChildMethods):  Do it here instead (new).
	(compileAsMethod):  New - logic taken from Compilation.addClass.
	* ApplyExp.java (compile):  Call compileChildMethods if inline call.
	* ObjectExp.java (compile):  Likewise for child methods.

1999-04-11  Per Bothner  <bothner@cygnus.com>

	* LambdaExp.java (declareClosureEnv):  Fix for object methods.

Wed Apr  7 18:04:27 1999  Per Bothner  <bothner@Magnus.Cygnus.COM>

	* FluidLetExp.java:  New LetExp class.
	* BlockExp.java:  New Expression class (untested).
	* ExitExp.java:  New Expression class (untested).
	* Makefile.am (java_JAVA), Makefile.in:  Update for new classes.

	* Declaration.java (IS_FLUID):  New flag bit.
	(setFlag, isFluid, setFluid):  New methods.
	* ExpWalker.java (walkBlockExp, walkExitExp, walkFluidLetExp):  New.
	* LetExp.java (getType):  New method.
	* SetExp.java (getType):  New method.
	* ReferenceExp.java (compile, getType):  Check if isFluid().
	* SetExp.java (compile):  Check if isFluid().

Tue Mar 30 17:15:14 1999  Per Bothner  <bothner@Magnus.Cygnus.COM>

	* LambdaExp.java (CLASS_METHOD):  New flag.
	(isClassMethod, setClassMethod):  New methods.
	(isHandlingTailCalls):  Return false if isClassMethod/
	* ObjectExp (compile):  Call compileExp on actual child method.

Mon Mar 29 23:28:59 1999  Per Bothner  <bothner@cygnus.com>

	* LambdaExp.java (getCompiledClassType):  Add Compilation parameter.
	* ObjectExp.java (getCompiledClassType):  Likewise.
	Call Compilation.generateClassName to avoid duplicate names.
	(compile):  Call super.allocFrame.
	* Compilation.java, LambdaExp.java:  Fix getCompiledClassType calls.
	* LambdaExp.java (declareClosureEnv):  If parent is ObjectExp,
	get its parent instead.  Re-order logic for object methods.
	(allocChildClasses):  Move latter half into new method allocFrame.
	(allocFrame):  New method.  Use outerLambdaNotInline.
	(enterFunction):  Initialize closureEnv also for methods in ObjectExp.

	* ApplyExp.java (compile), ReferenceExp.java (compile):  Verifier
	in JDK1.2 rejects emitInvokeSpecial so use emitInvokeVirtual instead.

	* PrimProcedure.java (applyN):  Check for thrown Error.

Sat Mar 20 11:25:01 1999  Per Bothner  <bothner@Magnus.Cygnus.COM>

	* Declaration.java (pushIndirectBinding):  New method.
	(initBinding):  Use pushIndirectBinding.
	* LambdaExp.java (isClassGenerated):  Use isHandlingTailCalls.
	(allocParameters, enterFunction):  Handle isIndirectBinding.
	* ModuleBody.java (runAsMain):  Re-enable, for now.
	* ObjectExp.java (<init>):  Call setCanRead to force class generation.
	* PrimProcedure.java (compile):  Use new Type.isVoid().
	* ReferenceExp.java (lookup):  Remove - no longer used.
	(eval):  Just call env.getChecked.
	(compile):  Use Binding.get rather than Environment.lookup.
	* ApplyExp.java:  If function is a globally-bound symbol,
	emit (get Binding).getProcedure().
	* Compilation (getBindingField):  New method.
	(typeBinding, getBindingMethod, getProcedureBindingMethod,
	getBindingEnvironmentMethod, getCurrentEnvironmentMethod): New statics.
	(addClass):  Move generateConstructor to end.
	Emit code to allocate global Bindings.

	* Compilation (scmProcedureType):  Renamed to typeProcedure.
	(scmEnvironmentType):  Renamed to typeEnvironment.
	* ApplyExp,java, LambdaExp.java, SetApplyExp.java:
  	Update scmProcedureType -> typeProcedure.

Sun Mar  7 17:28:59 1999  Per Bothner  <bothner@Magnus.Cygnus.COM>

	* ApplyExp.java (compileToArray, compile):  Handle full tailcalls.
	* Compilation.java:  Various new static fields.
	(fwitchIndex, callStackContext):  New fields.
	(findLiteral):  Check for null array elements.
	(allocClass):  Set superType differently if handling tailscalls.
	(addClass):  Some things are different if handling tailcalls.
	* Declaration.java (assignField):  New field.
	(ignorable):  Different rules for full tailcalls.
	* FindTailCalls.java (walkBeginExp, walfIfExp):  Last expr is in
	tail context only if whole expr is.
	(walkLambdaExp):  Do setInlineOnly here, not  in FindCapturedVars.
	* FindCapturedVars.java (walkLetExp):  Optimize letrec-style forms.
	(walkLambdaExp):  Removed;  functionality handled by FindTailCalls.
	(capture):  Handle full tail calls;  various bug fixes.
	* LambdaExp.java (closureEnvField, closureEnv):  New fields.
	(NEEDS_STATIC_LINK, CANNOT_INLINE):  New flags.
	(getNeedsStaticLink, setNeedsStaticLink):  New methods.
	(isClassGenerated, isHandlingTailCalls):  New methods.
	(outerLambdaNotInline, declareClosureEnv, compileEnv):  New methods.
	(thisVariable): New field.
	(declareThis):  Set/use thisVariable.
	(compile(Compilation)):  Save/restore comp.callStackContext.
	(compileAlloc):  Simplify by using new closureEnvField.
	(compile(Compilation,Target)):   Redo.  Preliminary cps support.
	(addMethodFor):  Change call interface.  Various changes.
	(loadHeapFrame, allocChildClasses):  Extensive changes.
	(allocParameters, enterFunction):  Still more changes.
	* ModuleBody.java (run):  No longer takes environment arguemnt.
	* ModuleExp.java (evalModule):  ModuleBody.run no longer takes env.
	* ObjectExp.java (compile):  Use compileEnd.
	Update for new LambdaExp.addMethodFor.
	* PrimProcedure.java (applyN):  Catch InvocationTargetException.
	* TailTarget.java (compileFromStack):  New method, for full tailcalls.
	* TryExp.java (compile):  Fix to handle more general Targets.
	* Literal.java (emitArray):  Nothing to do if value is null.

Fri Jan 15 20:30:58 1999  Per Bothner  <bothner@cygnus.com>

	* ApplyExp.java (compile):  Even if a function is inlined, we
	need to call allocChildClasses.

Wed Dec 23 13:51:35 1998  Per Bothner  <bothner@Magnus.Cygnus.COM>

	Literals in immediate mode are now allocated to fields (instead
	of a literals array), just like for non-immediate mode.
	Use reflection to initialize the fields.
	* Compilation.java (literalsField):  Removed field.
	(compileConstant):  Don't generate code to index from literalsField.
	(<init>):  Don't initialize literalsField.
	* LambdaExp.java (compile_setLiterals):  Removed method.
	(eval):  Don't call compile_setLiterals.  Don't create literals array.
	Don't set lierals[literal.index] to literal.value.  Instead, use
	reflection to set the static field uses for the literal.
	* Literal.java (assign):  Create a field, even if immediate.
	(<init>):  Set type from the value's class.
	* Makefile.am (java_JAVA), Makefile.in:  Rmeoved Compiledproc.java.
	* ReferenceExp.java (compile):  No longer need cast if immediate.

	* Compilation.java (mangleName):  More natural mangling.
	E.g.  "foo-bar?" now becomes "isFooBar".

	* ObjectExp.java (initMethod):  New field.
	(getCompiledClassType):  Allow extended super-types and implemented
	interfaces to come in any order.
	(compile):  New method, to make sure $finit$ is called.
 	(compile):  Don't add field for declarations corresponding to methods.
	
	* QuoteExp.java (getType):  If value is Values.empty, type is void.
	* SetExp.java (compile):  Compile rhs to correct type.

	* Expression (compile): Re-use Target.pushObject if possible.

Tue Dec 15 10:50:53 1998  Per Bothner  <bothner@Magnus.Cygnus.COM>

	* ChainLambdas.java:  New ExpFullWalker sub-class.
	* PushApply.java:  New ExpFullWalker sub-class.
	* Makefile.am, Makefile.in (java_Java):  Add new source files.
	* FindTailCalls.java:  Moved some functionality to ChainLambdas
	and PushApply in order to keep things less convoluted.
	(walkObjectExp):  New method.
	* ExpWalker.java (walkObjectExp):  New trivial method.
	* ExpFullWalker.java (walkObjectExp):  New method.
	* Compilation.java (<init>): Invoke ChainLambdas and PushApply walkers.

	* Compilation.java (allocClass):  Use getJavaName.
 	(allocClass):  Use getCompiledClassType for ObjectExp.
	* LambdaExp.java (isSharedSwitchMethod): New (currently unused) method.
	(getJavaName):  New method.
	(eval):  Use getJavaName,
	(loadHeapFrame, allocChildClasses):  Test for and handle ObjectExp.
	(toString):  Tolerate null body (as in ObjectExp).
	* ObjectExp.java (<init>):  Set type initially to null.
	(getJavaName, getCompiledClassType, walk, toString):  New methods.
	* ReferenceExp.java:  Remove Scheme-specific support for <TYPE>.
	(This functionality has moved to kawa.standard.ScmEnv.)

Mon Nov 23 16:04:42 1998  Per Bothner  <bothner@cygnus.com>

	* Inlineable.java (getReturnType):  New method.
	* PrimProcedure.java (getReturnType):  New method.
	* ApplyExp.java (getType):  Generalize with Inlineable.getReturnType;

	* ObjectExp.java:  New Expression class.
	* BeginExp.java (getExpressions):  New method.
	* Compilation.java (addClass):  Remove unused local 'main'.
	* FindTailCalls.java (walkLambdaExp):  Allow null body.
	* ExpFullWalker.java (walkLambdaExp):  Allow null body.
	* LambdaExp.java (firstChild, nextSibling):  Make public.
	* Makefile.am, Makefile.in (java_JAVA):  Add ObjectExp.java.

Sun Nov 15 21:31:59 1998  Per Bothner  <bothner@cygnus.com>

	* ReferenceExp.java (lookup):  Remove magic for Scheme <TYPE>
	(that is now handled by kawa.standard.ScmEnv).

Sat Oct 17 13:23:50 1998  Per Bothner  <bothner@Magnus.Cygnus.COM>

	* SynchronizedExp.java:  New class.
	* Makefile.am (java_JAVA), Makefile.in:  Add SynchronizedExp.java.
	* ExpWalker.java (walkSynchronizedExp):  New method.
	* ExpFullWalker.java (walkSynchronizedExp):  New method.
	* FindTailCalls.java (walkSynchronizedExp):  New method.

	* StackTarget.java (compileFromStack):  Use two-argument emitConvert.

Thu Sep 24 19:35:14 1998  Per Bothner  <bothner@cygnus.com>

	* ExpFullWalker.java:  New conventions to support replacement.
	* FindCapturedVars.java, FindTailCalls.java:  Change to new convention.
	* FindTailCalls.java:  Add some extra optimizations.
	* FindCapturedVars.java (walkLambdaExp):  Inline if single caller.
	* LambdaExp.java (returnContinuation, unknownContinuation):
	New fields, used to determine if local function can be inlined.

	* ApplyExp.java (popParams):  Handle zero parameters, not even "this".

Sun Sep 13 13:00:01 1998  Per Bothner  <bothner@cygnus.com>

	* ApplyExp.java (context, nextCall):  New fields.
	* FindTailCalls.java (walkApplyExp):  Set context and nextCall.
	* Declaration.java (nextCall):  New field.
	(noteValue):  Update LambdaExp.nameDecl.
	* FindCapturedVars.java:  Call new setImportsLexVars variant.
	* LambdaExp.java (nameDecl):  New field. 
	(setImportsLexVars):  New method - also chases down callers.

Fri Sep 11 20:20:12 1998  Per Bothner  <bothner@cygnus.com>

	More efficient procedure representation:  Inlining, directly
	callable statics, procedures that don't require own Classes.
	* ApplyExp.java (compileToArray):  New method.
	(compile):  Handle different kinds of apply methods.
	* Compilation.java (generateConstructor, allocClass):  New methods.
	(addClass):  Handle specialized more efficient procedure schemes.
	* Declaration.java:  Add various flags, getters, and setters.
	* FindCapturedVars.java (capture):  More general (and complex).
	* FindTailCalls.java:  Also setCanRead, setCancall etc of
	of Declarations and LambdaExps, and chain LambdaExp children together.
	* LambdaExp.java:  Add various flags.
	(declareArgsArray, loadHeapFrame, addMethodFor,
	allocChildClasses):  New methods.
	(eval):  Dumping .zip files is now controlled by static dumpZipPrefix.
	* LetExp.java (store_rest):  Don't initBinding if decl is ignorable.
	(compile):  Ignore init expression if target is ignorable.
	
	* PrimProcedure.java:  Moved from kawa.lang package.
	* Makefile.am, Makefile.in:  Update accordingly.

	* QuoteExp.java (nullExp):  New static.

	* QuoteExp.java (getType):  New method.
	* BeginExp.java (getType):  New method.
	* ReferenceExp.java (getType):  New method.

	* SetExp.java (compile):  If lhs is ignorable, target is Ignore.
	* StackTarget.java (compileFromStack):  If stack type inherits
	from target type, we can avoid coercion.

	* TryExp.java (print):  Handle null finally_clause.

Sat Aug 29 20:32:46 1998  Per Bothner  <bothner@cygnus.com>

	* FindCapturedVars.java (capture):  Handle inline functions better.
	* Compilation.java (addClass):  Move lots of stuff to LambdaExp.
	* LambdaExp.java (allocParameters, enterFunctions):  New functions
	* ApplyExp.java:  Handle inlined functions.
	* Declaration.java (loadOwningObject):  Skip inlined functions first.
	* ScopeExp.java (currentLambda):  Inline functions are not special.
	* SetExp.java (<init>):  Handle do special form specially.

	* Compilation.java, Special.java:  Do ClassType.make instead of
	new ClassType.

Sat Aug 29 09:16:01 1998  Per Bothner  <bothner@cygnus.com>

	* ApplyExp.java (compile):  Fix problems with tails-calls.
	* Compilation.java (addClass):  Fix procedure prologue for tails-calls.

	* Declaration.java (toString):  Print with name and new uid.

1998-08-28  Per Bothner  <bothner@cygnus.com>

	* ExpWalker.java, ExpFullWalker.java, FindTailCalls.java,
	FindCapturedVars.java:  New tree-walker (visitor) classes.
	* Expression.java (walk):  New method.
	* *Exp.java:  Add walk method to Expression sub-classes.

	* ApplyExp.java (tailCall, isTailCall, setTailCall):  New flag, methods.
	(compile):  Inline function if it has the getInlineOnly() flag.

	Changed a bunch of stuff for new closure implementation.
	* LambdaExp.java (compileAlloc):  New method.
	* Declaration.java (loadOwningObject, load, compileStore, initBinding):
	New methods for new closures.
	* ReferenceExp.java (compile_load):  Removed.
	* Compilation.java (<init>):  Merge constructors.  Call walkers.

	* LambdaExp.java, ReferenceExp.java:  Add unique number to ease debugging.

1998-08-25  Per Bothner  <bothner@cygnus.com>

	* Declaration.java (isIndirectBinding, setIndirectBinding):  New.

Fri Jul 24 16:11:36 1998  Lynn Quam <quam@ai.sri.com>

	* Compilation.java (putGlobalMethod):  New static field.
	* SetExp.java (compile):  If !isDefining(), compile
	putGlobalMethod instead of defineGlobalMethod.

Wed Jul 22 21:42:42 1998  Per Bothner  <bothner@cygnus.com>

	New directory.  Files mostly moved from ../../kawa/lang.
