Skip to content
Snippets Groups Projects
Forked from cmucl / cmucl
Source project has a limited visibility.
  • gerd's avatar
    f3fe0b8d
    Dynamic-extent support for x86. Use boot16.lisp for · f3fe0b8d
    gerd authored
    	bootstrapping.
    
    	* src/bootfiles/18e/boot16.lisp: New file.
    
    	* src/docs/cmu-user/extensions.tex (Dynamic-Extent Declarations):
    	New section.
    
    	* src/compiler/x86/macros.lisp (dynamic-extent-allocation):
    	Rename from stack-allocation, save an instruction.
    	(allocation): Don't call trust-dynamic-extent-declaration-p.
    
    	* src/compiler/x86/alloc.lisp (%dynamic-extent-start)
    	(%dynamic-extent-end): New vops.
    	(list-or-list*): Add constant arg dynamic-extent.
    	(fixed-alloc): Likewise.
    
    	* src/compiler/generic/vm-ir2tran.lisp (do-fixed-alloc): Call
    	fixed-alloc with dynamic-extent arg.
    
    	* src/compiler/hppa/alloc.lisp (%dynamic-extent-start)
    	(%dynamic-extent-end): Add dummy vops.
    	* src/compiler/mips/alloc.lisp:
    	* src/compiler/ppc/alloc.lisp:
    	* src/compiler/alpha/alloc.lisp:
    	* src/compiler/rt/alloc.lisp: Likewise.
    
    	* src/compiler/seqtran.lisp (mapper-transform): Add dynamic-extent
    	declarations.
    
    	* src/compiler/node.lisp (continuation): Add slot
    	dynamic-extent.
    	(cleanup): Add :dynamic-extent to type of slot kind.
    
    	* src/compiler/knownfun.lisp (dynamic-extent-closure-safe):
    	New attribute.
    
    	* src/compiler/ir2tran.lisp (ir2-stack-allocate): New function.
    	(ir2-convert-closure): Handle dynamic-extent case differently.
    	(%dynamic-extent, %dynamic-extent-start, %dynamic-extent-end)
    	<ir2-convert>: New optimizers.
    	(list, list*): Handle dynamic-extent.
    
    	* src/compiler/ir1tran.lisp (*trust-dynamic-extent-declarations*)
    	(*dynamic-extent-trace*): New variables.
    	(trust-dynamic-extent-declaration-p): New function.
    	(process-dynamic-extent-declaration)
    	(dynamic-extent-allocation-p, dynamic-extent-closure-args)
    	(gen-%dynamic-extent, with-dynamic-extent): New functions/macros.
    	(ir1-convert-combination): Handle dynamic-extent closure args.
    	(ir1-convert-combination-args): Add arg dynamic-extent-args.
    	Set continuation-dynamic-extent for these args.
    	(process-dynamic-extent-declaration): Rewritten.
    	(ir1-convert-dynamic-extent-bindings): New function.
    	(ir1-convert-special-bindings): Call it.
    	(ir1-convert-lambda-body): Handle dynamic-extent rest lists.
    	(let): Handle dynamic-extent vars.
    	(let*): Call ir1-convert-dynamic-extent-bindings.
    
    	* src/compiler/globaldb.lisp (*trust-dynamic-extent-declarations*)
    	(trust-dynamic-extent-declaration-p): Remove.
    
    	* src/compiler/fndb.lisp: Add dynamic-extent-closure-safe
    	attribute to assorted functions.
    
    	* src/compiler/envanal.lisp (environment-analyze): Call
    	find-dynamic-extent-safe-closures.
    	(emit-cleanups): Handle :dynamic-extent cleanups.
    	(*suppress-dynamic-extent-closure-safe*): New variable.
    	(mark-dynamic-extent-safe-closures)
    	(find-dynamic-extent-safe-closures): New functions.
    
    	* src/compiler/byte-comp.lisp (compute-produces-and-consumes):
    	Treat :dynamic-extent like :tagbody cleanups.
    
    	* src/code/exports.lisp ("C"): Export ir2-stack-allocate,
    	%dynamic-extent, %dynamic-extent-start, %dynamic-extent-end.
    
    	* src/code/byte-interp.lisp (%dynamic-extent):
    	(%dynamic-extent-start, %dynamic-extent-end): New functions.
    	(toplevel): Enable block compilation.
    f3fe0b8d
    History
    Dynamic-extent support for x86. Use boot16.lisp for
    gerd authored
    	bootstrapping.
    
    	* src/bootfiles/18e/boot16.lisp: New file.
    
    	* src/docs/cmu-user/extensions.tex (Dynamic-Extent Declarations):
    	New section.
    
    	* src/compiler/x86/macros.lisp (dynamic-extent-allocation):
    	Rename from stack-allocation, save an instruction.
    	(allocation): Don't call trust-dynamic-extent-declaration-p.
    
    	* src/compiler/x86/alloc.lisp (%dynamic-extent-start)
    	(%dynamic-extent-end): New vops.
    	(list-or-list*): Add constant arg dynamic-extent.
    	(fixed-alloc): Likewise.
    
    	* src/compiler/generic/vm-ir2tran.lisp (do-fixed-alloc): Call
    	fixed-alloc with dynamic-extent arg.
    
    	* src/compiler/hppa/alloc.lisp (%dynamic-extent-start)
    	(%dynamic-extent-end): Add dummy vops.
    	* src/compiler/mips/alloc.lisp:
    	* src/compiler/ppc/alloc.lisp:
    	* src/compiler/alpha/alloc.lisp:
    	* src/compiler/rt/alloc.lisp: Likewise.
    
    	* src/compiler/seqtran.lisp (mapper-transform): Add dynamic-extent
    	declarations.
    
    	* src/compiler/node.lisp (continuation): Add slot
    	dynamic-extent.
    	(cleanup): Add :dynamic-extent to type of slot kind.
    
    	* src/compiler/knownfun.lisp (dynamic-extent-closure-safe):
    	New attribute.
    
    	* src/compiler/ir2tran.lisp (ir2-stack-allocate): New function.
    	(ir2-convert-closure): Handle dynamic-extent case differently.
    	(%dynamic-extent, %dynamic-extent-start, %dynamic-extent-end)
    	<ir2-convert>: New optimizers.
    	(list, list*): Handle dynamic-extent.
    
    	* src/compiler/ir1tran.lisp (*trust-dynamic-extent-declarations*)
    	(*dynamic-extent-trace*): New variables.
    	(trust-dynamic-extent-declaration-p): New function.
    	(process-dynamic-extent-declaration)
    	(dynamic-extent-allocation-p, dynamic-extent-closure-args)
    	(gen-%dynamic-extent, with-dynamic-extent): New functions/macros.
    	(ir1-convert-combination): Handle dynamic-extent closure args.
    	(ir1-convert-combination-args): Add arg dynamic-extent-args.
    	Set continuation-dynamic-extent for these args.
    	(process-dynamic-extent-declaration): Rewritten.
    	(ir1-convert-dynamic-extent-bindings): New function.
    	(ir1-convert-special-bindings): Call it.
    	(ir1-convert-lambda-body): Handle dynamic-extent rest lists.
    	(let): Handle dynamic-extent vars.
    	(let*): Call ir1-convert-dynamic-extent-bindings.
    
    	* src/compiler/globaldb.lisp (*trust-dynamic-extent-declarations*)
    	(trust-dynamic-extent-declaration-p): Remove.
    
    	* src/compiler/fndb.lisp: Add dynamic-extent-closure-safe
    	attribute to assorted functions.
    
    	* src/compiler/envanal.lisp (environment-analyze): Call
    	find-dynamic-extent-safe-closures.
    	(emit-cleanups): Handle :dynamic-extent cleanups.
    	(*suppress-dynamic-extent-closure-safe*): New variable.
    	(mark-dynamic-extent-safe-closures)
    	(find-dynamic-extent-safe-closures): New functions.
    
    	* src/compiler/byte-comp.lisp (compute-produces-and-consumes):
    	Treat :dynamic-extent like :tagbody cleanups.
    
    	* src/code/exports.lisp ("C"): Export ir2-stack-allocate,
    	%dynamic-extent, %dynamic-extent-start, %dynamic-extent-end.
    
    	* src/code/byte-interp.lisp (%dynamic-extent):
    	(%dynamic-extent-start, %dynamic-extent-end): New functions.
    	(toplevel): Enable block compilation.