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.
