
and functionality improvements (including support for measuring coverage), primitive argument-checking fixes, and object-file changes resulting in reduced load times (and some backward incompatibility): - annotations are now preserved in object files for debug only, for profiling only, for both, or not at all, depending on the settings of generate-inspector-information and compile-profile. in particular, when inspector information is not enabled but profiling is, source information does not leak into error messages and inspector output, though it is still available via the profile tools. The mechanics of this involved repurposing the fasl a? parameter to hold an annotation flags value when it is not #f and remaking annotations with new flags if necessary before emitting them. compile.ss, fasl.ss, misc.ms - altered a number of mats to produce correct results even when the 's' directory is profiled. misc.ms, cp0.ms, record.ms - profile-release-counters is now generation-friendly; that is, it doesn't look for dropped code objects in generations that have not been collected since the last call to profile-release-counters. also, it no longer allocates memory when it releases counters. pdhtml.ss, gc.c, gcwrapper.c, globals.h, prim5.c - removed unused entry points S_ifile, S_ofile, and S_iofile alloc.c, externs.h - mats that test loading profile info into the compiler's database to guide optimization now weed out preexisting entries, in case the 's' directory is profiled. 4.ms, mat.ss, misc.ms, primvars.ms - counters for dropped code objects are now released at the start of each mat group. mat.ss - replaced ehc (enable-heap-check) option with hci (heap-check-interval) option that allows heap checks to be performed periodically rather than on each collection. hci=0 is equivalent to ehc=f (disabling heap checks) and hci=1 is equivalent to ehc=t (enabling heap checks every collection), while hci=100 enables heap checks only every 100th collection. allx and bullyx mats use this feature to reduce heap-checking overhead to a more reasonable level. this is particularly important when the 's' directory is profiled, since the amount of static memory to be checked is greatly increased due to the counters. mats/Mf-base, mat.ss, primvars.ms - added a mat that calls #%show-allocation, which was otherwise not being tested. misc.ms - removed a broken primvars mat and updated two others. in each case, the mat was looking for information about primitives in the wrong (i.e., old) place and silently succeeding when it didn't find any primitives to tests. the revised mats (along with a few others) now check to make sure at least one identifier has the information they look for. the removed mat was checking for library information that is now compiled in, so the mat is now unnecessary. the others were (not) doing argument-error checks. fixing these turned up a handful of problems that have also been fixed: a couple of unbound variables in the mat driver, two broken primdata declarations, a tardy argument check by profile-load-data, and a bug in char-ready?, which was requiring an argument rather than defaulting it to the current input port. primdata.ss, pdhtml.ss, io.ms, primdvars.ms, 4.ms, 6.ms, misc.ms, patch* - added initial support for recording coverage information. when the new parameter generate-covin-files is set, the compiler generates .covin files containing the universe of all source objects for which profile forms are present in the expander output. when profiling and generation of covin files are enabled in the 's' directory, the mats optionally generate .covout files for each mat file giving the subset of the universe covered by the mat file, along with an all.covout in each mat output directory aggregating the coverage for the directory and another all.covout in the top-level mat directory aggregating the coverage for all directories. back.ss, compile.ss, cprep.ss, primdata.ss, s/Mf-base, mat.ss, mats/Mf-base, mats/primvars.ms - support for generating covout files is now built in. with-coverage-output gathers and dumps coverage information, and aggregate-coverage-output combines (aggregates) covout files. pdhtml.ss, primdata.ss, compile.ss, mat.ss, mats/Mf-base, primvars.ms - profile-clear now adjusts active coverage trackers to avoid losing coverage information. pdhtml.ss, prim5.c - nested with-coverage calls are now supported. pdhtml.ss - switched to a more compact representation for covin and covout files; reduces disk space (compressed or not) by about a factor of four and read time by about a factor of two with no increase in write time. primdata.ss, pdhtml.ss, cprep.ss, compile.ss, mat.ss, mats/Mf-base - added support for determining coverage for an entire run, including coverage for expressions hit during boot time. 'all' mats now produce run.covout files in each output directory, and 'allx' mats produce an aggregate run.covout file in the mat directory. pdhtml.ss, mat.ss, mats/Mf-base - profile-release-counters now adjusts active coverage trackers to account for the counters that have been released. pdhtml.ss, prim5.c - replaced the artificial "examples" target with a real "build-examples" target so make won't think it always has to mats that depend upon the examples directory having been compiled. mats make clean now runs make clean in the examples directory. mats/Mf-base importing a library from an object file now just visits the object file rather than doing a full load so that the run-time code for the library is not retained. The run-time code is still read because the current fasl format forces the entire file to be read, but not retaining the code can lower heap size and garbage-collection cost, particularly when many object-code libraries are imported. The downside is that the file must be revisited if the run-time code turns out to be required. This change exposed several places where the code was failing to check if a revisit is needed. syntax.ss, 7.ms, 8.ms, misc.ms, root-experr* - fixed typos: was passing unquoted load rather than quoted load to $load-library along one path (where it is loading source code and therefore irrelevant), and was reporting src-path rather than obj-path in a message about failing to define a library. syntax.ss - compile-file and friends now put all recompile information in the first fasl object after the header so the library manager can find it without loading the entire fasl file. The library manager now does so. It also now checks to see if library object files need to be recreated before loading them rather than loading them and possibly recompiling them after discovering they are out of date, since the latter requires loading the full object file even if it's out of date, while the former takes advantage of the ability to extract just recompile information. as well as reducing overhead, this eliminates possibly undesirable side effects, such as creation and registration of out-of-date nongenerative record-type descriptors. because the library manager expects to find recompile information at the front of an object file, it will not find all recompile information if object files are "catted" together. also, compile-file has to hold in memory the object code for all expressions in the file so that it can emit the unified recompile information, rather than writing to the object file incrementally, which can significantly increase the memory required to compile a large file full of individual top-level forms. This does not affect top-level programs, which were already handled as a whole, or a typical library file that contains just a single library form. compile.ss, syntax.ss - the library manager now checks include files before library dependencies when compile-imported-libraries is false (as it already did when compile-imported-libraries is true) in case a source change affects the set of imported libraries. (A library change can affect the set of include files as well, but checking dependencies before include files can cause unneeded libraries to be loaded.) The include-file check is based on recompile-info rather than dependencies, but the library checks are still based on dependencies. syntax.ss - fixed check for binding of scheme-version. (the check prevents premature treatment of recompile-info records as Lexpand forms to be passed to $interpret-backend.) scheme.c - strip-fasl-file now preserves recompile-info when compile-time info is stripped. strip.ss - removed include-req* from library/ct-info and ctdesc records; it is no longer needed now that all recompile information is maintained separately. expand-lang.ss, syntax.ss, compile.ss, cprep.ss, syntax.ss - changed the fasl format and reworked a lot of code in the expander, compiler, fasl writer, and fasl reader to allow the fasl reader to skip past run-time information when it isn't needed and compile-time information when it isn't needed. Skipping past still involves reading and decoding when encrypted, but the fasl reader no longer parses or allocates code and data in the portions to be skipped. Side effects of associating record uids with rtds are also avoided, as are the side effects of interning symbols present only in the skipped data. Skipping past code objects also reduces or eliminates the need to synchronize data and instruction caches. Since the fasl reader no longer returns compile-time (visit) or run-time (revisit) code and data when not needed, the fasl reader no longer wraps these objects in a pair with a 0 or 1 visit or revisit marker. To support this change, the fasl writer generates separate top-level fasl entries (and graphs) for separate forms in the same top-level source form (e.g., begin or library). This reliably breaks eq-ness of shared structure across these forms, which was previously broken only when visit or revisit code was loaded at different times (this is an incompatible change). Because of the change, fasl "groups" are no longer needed, so they are no longer handled. 7.ss, cmacros.ss, compile.ss, expand-lang.ss, strip.ss, externs.h, fasl.c, scheme.c, hash.ms - the change above is surfaced in an optional fasl-read "situation" argument (visit, revisit, or load). The default is load. visit causes it to skip past revisit code and data; revisit causes it to skip past visit code and data; and load causes it not to skip past either. visit-revisit data produced by (eval-when (visit revisit) ---) is never skipped. 7.ss, primdata.ss, io.stex - to improve compile-time and run-time error checking, the Lexpand recompile-info, library/rt-info, library-ct-info, and program-info forms have been replaced with list-structured forms, e.g., (recompile-info ,rcinfo). expand-lang.ss, compile.ss, cprep.ss, interpret.ss, syntax.ss - added visit-compiled-from-port and revisit-compiled-from-port to complement the existing load-compiled-from-port. 7.ss, primdata.ss, 7.ms, system.stex - increased amount read when seeking an lz4-encrypted input file from 32 to 1024 bytes at a time compress-io.c - replaced the fasl a? parameter value #t with an "all" flag value so it's value is consistently a mask. cmacros.ss, fasl.ss, compile.ss - split off profile mats into a separate file misc.ms, profile.ms (new), root-experr*, mats/Mf-base - added coverage percent computations to mat allx/bullyx output mat.ss, mats/Mf-base, primvars.ms - replaced coverage tables with more generic and generally useful source tables, which map source objects to arbitrary values. pdhtml.ss, compile.ss, cprep.ss, primdata.ss, mat.ss, mats/Mf-base, primvars.ms, profile.ms, syntax.stex - reduced profile counting overhead by using calls to fold-left instead of calls to apply and map and by using fixnum operations for profile counts on 64-bit machines. pdhtml.ss - used a critical section to fix a race condition in the calculations of profile counts that sometimes resulted in bogus (including negative) counts, especially when the 's' directory is profiled. pdhtml.ss - added discard flag to declaration for hashtable-size primdata.ss - redesigned the printed representation of source tables and rewrote get-source-table! to read and store incrementally to reduce memory overhead. compile.ss - added generate-covin-files to the set of parameters preserved by compile-file, etc. compile.ss, system.stex - moved covop argument before the undocumented machine and hostop arguments to compile-port and compile-to-port. removed the undocumented ofn argument from compile-to-port; using (port-name ip) instead. compile.ss, primdata.ss, 7.ms, system.stex - compile-port now tries to come up with a file position to supply to make-read, which it can do if the port's positions are character positions (presently string ports) or if the port is positioned at zero. compile.ss - audited the argument-type-error fuzz mat exceptions and fixed a host of problems this turned up (entries follow). added #f as an invalid argument for every type for which #f is indeed invalid to catch places where the maybe- prefix was missing on the argument type. the mat tries hard to determine if the condition raised (if any) as the result of an invalid argument is appropriate and redirects the remainder to the mat-output (.mo) file prefixed with 'Expected error', causing them to show up in the expected error output so developers will be encouraged to audit them in the future. primvars.ms, mat.ss - added an initial symbol? test on machine type names so we produce an invalid machine type error message rather than something confusing like "machine type #f is not supported". compile.ss - fixed declarations for many primitives that were specified as accepting arguments of more general types than they actually accept, such as number -> real for various numeric operations, symbol -> endianness for various bytevector operations, time -> time-utc for time-utc->date, and list -> list-of-string-pairs for default-library-search-handler. also replaced some of the sub-xxxx types with specific types such as sub-symbol -> endianness in utf16->string, but only where they were causing issues with the primvars argument-type-error fuzz mat. (this should be done more generally.) primdata.ss - fixed incorrect who arguments (was map instead of fold-right, current-date instead of time-utc->date); switched to using define-who/set-who! generally. 4.ss, date.ss - append! now checks all arguments before any mutation 5_2.ss - with-source-path now properly supplies itself as who for the string? argument check; callers like load now do their own checks. 7.ss - added missing integer? check to $fold-bytevector-native-ref whose lack could have resulted in a compile-time error. cp0.ss - fixed typo in output-port-buffer-mode error message io.ss - fixed who argument (was fx< rather than fx<?) library.ss - fixed declaration of first source-file-descriptor argument (was sfd, now string) primdata.ss - added missing article 'a' in a few error messages prims.ss - fixed the copy-environment argument-type error message for the list of symbols argument. syntax.ss - the environment procedure now catches exceptions that occur and reraises the exception with itself as who if the condition isn't already a who condition. syntax.ss - updated experr and allx patch files for changes to argument-count fuzz mat and fixes for problems turned up by them. root-experr*, patch* - fixed a couple of issues setting port sizes: string and bytevector output port put handlers don't need room to store the character or byte, so they now set the size to the buffer length rather than one less. binary-file-port-clear-output now sets the index rather than size to zero; setting the size to zero is inappropriate for some types of ports and could result in loss of buffering and even suppression of future output. removed a couple of redundant sets of the size that occur immediately after setting the buffer. io.ss - it is now possible to return from a call to with-profile-tracker multiple times and not double-count (or worse) any counts. pdhtml.ss, profile.ms - read-token now requires a file position when it is handed a source-file descriptor (since the source-file descriptor isn't otherwise useful), and the source-file descriptor argument can no longer be #f. the input file position plays the same role as the input file position in get-datum/annotations. these extra read-token arguments are now documented. read.ss, 6.ms, io.stex - the source-file descriptor argument to get-datum/annotations can no longer be #f. it was already documented that way. read.ss - read-token and do-read now look for the character-positions port flag before asking if the port has port-position, since the latter is slightly more expensive. read.ss - rd-error now reports the current port position if it can be determined when fp isn't already set, i.e., when reading from a port without character positions (presently any non string port) and fp has not been passed in explicitly (to read-token or get-datum/annotations). the port position might not be a character position, but it should be better than nothing. read.ss - added comment noting an invariant for s_profile_release_counters. prim5.c - restored accidentally dropped fasl-write formdef and dropped duplicate fasl-read formdef io.stex - added a 'coverage' target that tests the coverage of the Scheme-code portions of Chez Scheme by the mats. Makefile.in, Makefile-workarea.in - added .PHONY declarations for all of the targets in the top-level and workarea make files, and renamed the create-bintar, create-rpm, and create-pkg targets bintar, rpm, and pkg. Makefile.in, Makefile-workarea.in - added missing --retain-static-relocation command-line argument and updated the date scheme.1.in - removed a few redundant conditional variable settings configure - fixed declaration of condition wait (timeout -> maybe-timeout) primdata.ss original commit: 88501743001393fa82e89c90da9185fc0086fbcb
511 lines
19 KiB
Plaintext
511 lines
19 KiB
Plaintext
# Mf-base
|
|
# Copyright 1984-2017 Cisco Systems, Inc.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
# Assumes recursive makes inherit command-line settings as in GNU make
|
|
|
|
# Running "make" or "make all" in this directory runs the mats (test
|
|
# programs) and produces a report of bugs and errors. Unless you make
|
|
# changes to the mats or to the system, the report file report-$(conf)
|
|
# (where $(conf) is set below)
|
|
|
|
# If an error or bug report occurs, refer to the offending ".mo" file
|
|
# produced by the mats and mentioned in the bug or error report to
|
|
# determine what failed.
|
|
|
|
# Running "make allx" runs a set of mats with various settings.
|
|
# "make bullyx" runs a different, more stressful set.
|
|
|
|
# Running make with the argument "clean" removes the .so files, .mo
|
|
# files, report files, and temporary files generated by the mats.
|
|
|
|
# The variables below may be changed to affect how the mats are run.
|
|
# For example, "make o=2 cp0=t ctb=8192" causes the mats to be run at
|
|
# optimize level 2 with cp0 enabled and collect-trip-bytes set to 8192.
|
|
|
|
ifeq (${OS},Windows_NT)
|
|
dirsep = ;
|
|
else
|
|
dirsep = :
|
|
endif
|
|
|
|
# Explicit ".exe" needed for WSL
|
|
ifeq ($(OS),Windows_NT)
|
|
ExeSuffix = .exe
|
|
else
|
|
ExeSuffix =
|
|
endif
|
|
|
|
# Scheme is the scheme executable to test, SCHEMEHEAPDIRS tells
|
|
# it where to find its boot files, and CHEZSCHEMELIBDIRS tells
|
|
# it where to find libraries.
|
|
Scheme = ../bin/$m/scheme${ExeSuffix}
|
|
export SCHEMEHEAPDIRS=.${dirsep}../boot/%m
|
|
export CHEZSCHEMELIBDIRS=.
|
|
|
|
# Include is the directory holding scheme.h.
|
|
Include = ../boot/$m
|
|
|
|
# patchfile is the name of a patch to be loaded while running the mats.
|
|
patchfile =
|
|
|
|
# o is the optimize level at which the mats should be run.
|
|
o = 0
|
|
|
|
# p determines whether profiling is enabled: f for false, t for true.
|
|
defaultp = f
|
|
p = $(defaultp)
|
|
|
|
# pdhtml determines whether profile-dump-html is called at end of a run: f for false, t for true.
|
|
# NB: beware of lost profile information due to mats that call profile-clear
|
|
defaultpdhtml = f
|
|
pdhtml = $(defaultpdhtml)
|
|
|
|
# cp0 determines whether cp0 is run: f for no, t for yes
|
|
defaultcp0 = f
|
|
cp0 = $(defaultcp0)
|
|
|
|
# eval is the evaluator to use.
|
|
defaulteval = compile
|
|
eval = $(defaulteval)
|
|
|
|
# ctb is the value to which collect-trip-bytes is set.
|
|
defaultctb = (collect-trip-bytes)
|
|
ctb = $(defaultctb)
|
|
|
|
# cgr is the value to which collect-generation-radix is set.
|
|
defaultcgr = (collect-generation-radix)
|
|
cgr = $(defaultcgr)
|
|
|
|
# cmg is the value to which collect-maximum-generation is set.
|
|
defaultcmg = (collect-maximum-generation)
|
|
cmg = $(defaultcmg)
|
|
|
|
# rmg is the value to which release-minimum-generation is set.
|
|
defaultrmg = (release-minimum-generation)
|
|
rmg = $(defaultrmg)
|
|
|
|
# cis defines the value to which compile-interpret-simple is set: f for
|
|
# #f, t for #t
|
|
defaultcis = f
|
|
cis = $(defaultcis)
|
|
|
|
# spi defines the value to which suppress-primitive-inlining is set:
|
|
# f for #f, t for #t
|
|
defaultspi = f
|
|
spi = $(defaultspi)
|
|
|
|
# hci defines the value to which heap-check-interval (mat.ss) is set:
|
|
# 0 to disable, > 0 to enable
|
|
defaulthci = 0
|
|
hci = $(defaulthci)
|
|
|
|
# eoc determines whether object counts are enabled
|
|
defaulteoc = t
|
|
eoc = $(defaulteoc)
|
|
|
|
# cl determines the commonization level
|
|
defaultcl = (commonization-level)
|
|
cl = $(defaultcl)
|
|
|
|
# ecpf determines whether the compiler checks prelex flags
|
|
defaultecpf = t
|
|
ecpf = $(defaultecpf)
|
|
|
|
# c determines whether mat coverage (.covout) files are created
|
|
defaultc = f
|
|
c = $(defaultc)
|
|
|
|
# set of coverage files to load
|
|
coverage-files = ../boot/$m/petite.covin ../boot/$m/scheme.covin
|
|
|
|
# set of mats to run
|
|
mats = primvars 3 4 5_1 5_2 5_3 5_4 5_5 bytevector thread profile\
|
|
misc cp0 5_6 5_7 5_8 6 io format 7 record hash enum 8 fx fl cfl foreign\
|
|
ftype unix windows examples ieee date exceptions oop
|
|
|
|
Examples = ../examples
|
|
|
|
MAKEFLAGS += --no-print-directory
|
|
|
|
conf = $(eval)-$o-$(spi)-$(cp0)-$(cis)
|
|
objdir=output-$(conf)
|
|
objname = $(mats:%=%.mo)
|
|
obj = $(objname:%=$(objdir)/%)
|
|
src = $(mats:%=%.ms)
|
|
|
|
# prettysrc is src to use for pretty-print test; we leave out mat files
|
|
# with cycles, e.g., primvars.ms, misc.ms, 4.ms, 5_1.ms, hash.ms
|
|
prettysrc = 3.ms 5_3.ms 5_4.ms 5_5.ms bytevector.ms thread.ms profile.ms\
|
|
5_6.ms 5_7.ms 5_8.ms 6.ms io.ms format.ms 7.ms record.ms enum.ms 8.ms\
|
|
fx.ms fl.ms cfl.ms foreign.ms unix.ms windows.ms examples.ms ieee.ms date.ms\
|
|
exceptions.ms
|
|
|
|
$(objdir)/%.mo : %.ms mat.so
|
|
echo '(optimize-level $o)'\
|
|
'(#%$$suppress-primitive-inlining #${spi})'\
|
|
'(heap-check-interval ${hci})'\
|
|
'(#%$$enable-check-prelex-flags #${ecpf})'\
|
|
'(compile-profile #$p)'\
|
|
'(collect-trip-bytes ${ctb})'\
|
|
'(collect-generation-radix ${cgr})'\
|
|
'(collect-maximum-generation ${cmg})'\
|
|
'(enable-object-counts #${eoc})'\
|
|
'(commonization-level ${cl})'\
|
|
'(compile-interpret-simple #${cis})'\
|
|
'(set! *examples-directory* "${Examples}")'\
|
|
'(enable-cp0 #${cp0})'\
|
|
'(set! *scheme* "${Scheme}")'\
|
|
'(current-eval ${eval})'\
|
|
'(when #$c (coverage-table (load-coverage-files ${coverage-files:%="%"})))'\
|
|
'(time ((mat-file "$(objdir)") "$*"))'\
|
|
'(unless (= (#%$$check-heap-errors) 0)'\
|
|
' (fprintf (console-error-port) "check heap detected errors---grep standard output for !!!\n")'\
|
|
' (abort))'\
|
|
| ${Scheme} -q mat.so ${patchfile}
|
|
|
|
# same as above except puts the .mo file in .
|
|
%.mo : %.ms mat.so
|
|
echo '(optimize-level $o)'\
|
|
'(#%$$suppress-primitive-inlining #${spi})'\
|
|
'(heap-check-interval ${hci})'\
|
|
'(#%$$enable-check-prelex-flags #${ecpf})'\
|
|
'(compile-profile #$p)'\
|
|
'(collect-trip-bytes ${ctb})'\
|
|
'(collect-generation-radix ${cgr})'\
|
|
'(collect-maximum-generation ${cmg})'\
|
|
'(enable-object-counts #${eoc})'\
|
|
'(commonization-level ${cl})'\
|
|
'(compile-interpret-simple #${cis})'\
|
|
'(set! *examples-directory* "${Examples}")'\
|
|
'(enable-cp0 #${cp0})'\
|
|
'(set! *scheme* "${Scheme}")'\
|
|
'(current-eval ${eval})'\
|
|
'(when #$c (coverage-table (load-coverage-files ${coverage-files:%="%"})))'\
|
|
'(time ((mat-file ".") "$*"))'\
|
|
'(parameterize ([source-directories (quote ("." "../s"))]) (when #${pdhtml} (profile-dump-html)))'\
|
|
'(unless (= (#%$$check-heap-errors) 0)'\
|
|
' (fprintf (console-error-port) "check heap detected errors---grep standard output for !!!\n")'\
|
|
' (abort))'\
|
|
| ${Scheme} -q mat.so ${patchfile}
|
|
|
|
%.so : %.ss
|
|
echo '(reset-handler abort) (time (compile-file "$*"))' | ${Scheme} -q ${patchfile}
|
|
|
|
report: report-$(conf)
|
|
|
|
experr: experr-$(conf)
|
|
|
|
report-$(conf): errors-$(conf)
|
|
$(MAKE) doreport
|
|
|
|
doreport: experr-$(conf)
|
|
rm -f report-$(conf)
|
|
-diff experr-$(conf) errors-$(conf) > report-$(conf) 2>&1
|
|
|
|
maybe-doreport:
|
|
-if [ -f errors-$(conf) ] ; then\
|
|
$(MAKE) doreport ;\
|
|
fi
|
|
|
|
errors-$(conf): ${obj}
|
|
$(MAKE) doerrors
|
|
|
|
doerrors:
|
|
rm -f errors-$(conf)
|
|
-(cd $(objdir); grep '^Error' $(objname)) > errors-$(conf)
|
|
-(cd $(objdir); grep '^Bug' $(objname)) >> errors-$(conf)
|
|
-(cd $(objdir); grep '^Warning' $(objname)) >> errors-$(conf)
|
|
-(cd $(objdir); grep '^Expected' $(objname))\
|
|
>> errors-$(conf)
|
|
|
|
fastreport:
|
|
$(MAKE) doerrors
|
|
$(MAKE) doreport
|
|
|
|
docoverage: mat.so
|
|
if [ "$c" = "t" ] ; then\
|
|
echo '(reset-handler abort) (combine-coverage-files "$(objdir)/all.covout" (quote ($(mats:%="$(objdir)/%.covout"))))' | ${Scheme} -q ${patchfile} mat.so ;\
|
|
echo '(reset-handler abort) (coverage-percent "$(objdir)/all.covout" ${coverage-files:%="%"})' | ${Scheme} -q ${patchfile} mat.so ;\
|
|
echo '(reset-handler abort) (coverage-percent "$(objdir)/run.covout" ${coverage-files:%="%"})' | ${Scheme} -q ${patchfile} mat.so ;\
|
|
fi
|
|
|
|
doallcoverage: mat.so
|
|
if [ "$c" = "t" ] ; then\
|
|
echo '(reset-handler abort) (combine-coverage-files "all.covout" (map symbol->string (quote ($(shell echo */all.covout)))))' | ${Scheme} -q ${patchfile} mat.so ;\
|
|
echo '(reset-handler abort) (coverage-percent "all.covout" ${coverage-files:%="%"})' | ${Scheme} -q ${patchfile} mat.so ;\
|
|
echo '(reset-handler abort) (combine-coverage-files "run.covout" (map symbol->string (quote ($(shell echo */run.covout)))))' | ${Scheme} -q ${patchfile} mat.so ;\
|
|
echo '(reset-handler abort) (coverage-percent "run.covout" ${coverage-files:%="%"})' | ${Scheme} -q ${patchfile} mat.so ;\
|
|
fi
|
|
|
|
partialx:
|
|
$(MAKE) allxhelp o=0
|
|
$(MAKE) allxhelp o=3
|
|
$(MAKE) allxhelp o=3 cp0=t
|
|
$(MAKE) allxhelp o=3 eval=interpret cp0=t rmg=2
|
|
|
|
allx: prettyclean
|
|
$(MAKE) allxhelp o=0
|
|
$(MAKE) allxhelp o=3
|
|
$(MAKE) allxhelp o=0 cp0=t cl=3
|
|
$(MAKE) allxhelp o=3 cp0=t cl=3
|
|
$(MAKE) allxhelp o=0 spi=t rmg=2 p=t
|
|
$(MAKE) allxhelp o=3 spi=t rmg=2 p=t
|
|
$(MAKE) allxhelp o=0 eval=interpret cl=6
|
|
$(MAKE) allxhelp o=3 eval=interpret cl=6
|
|
$(MAKE) allxhelp o=0 eval=interpret cp0=t rmg=2
|
|
$(MAKE) allxhelp o=3 eval=interpret cp0=t rmg=2
|
|
$(MAKE) allxhelp o=0 eoc=f hci=101 cl=9
|
|
$(MAKE) allxhelp o=3 eval=interpret hci=101 rmg=2
|
|
$(MAKE) doallcoverage
|
|
|
|
just-reports:
|
|
for EVAL in compile interpret ; do\
|
|
for O in 0 2 3 ; do\
|
|
for SPI in f t ; do\
|
|
for CP0 in f t ; do\
|
|
for CIS in f t ; do\
|
|
$(MAKE) maybe-doreport eval=$$EVAL o=$$O spi=$$SPI cp0=$$CP0 cis=$$CIS ;\
|
|
done\
|
|
done\
|
|
done\
|
|
done\
|
|
done
|
|
|
|
bullyx:
|
|
-$(MAKE) bully o=0
|
|
-$(MAKE) bully o=3
|
|
|
|
bully:
|
|
-$(MAKE) allxhelpnotall spi=t cp0=f
|
|
-$(MAKE) allxhelp spi=f cp0=f cl=9 ctb='(/ (collect-trip-bytes) 64)' hci=503
|
|
-$(MAKE) allxhelp spi=t cp0=f cis=t cmg=1
|
|
-$(MAKE) allxhelp spi=f cp0=f cis=t cmg=6 hci=101
|
|
-$(MAKE) allxhelp spi=t cp0=t ctb='(/ (collect-trip-bytes) 64)' cgr=6
|
|
-$(MAKE) allxhelp spi=t cp0=f p=t eoc=f hci=101
|
|
-$(MAKE) allxhelp spi=f cp0=t cl=9 p=t hci=101
|
|
-$(MAKE) allxhelp eval=interpret spi=f cp0=f
|
|
-$(MAKE) allxhelp eval=interpret spi=f cp0=t
|
|
-$(MAKE) allxhelp eval=interpret spi=t cp0=f ctb='(/ (collect-trip-bytes) 64)' hci=503
|
|
-$(MAKE) allxhelp eval=interpret spi=t cp0=t cgr=2 hci=101 p=t
|
|
$(MAKE) doallcoverage
|
|
|
|
allxhelp:
|
|
$(MAKE) doheader
|
|
-$(MAKE) all
|
|
$(MAKE) dosummary
|
|
|
|
doheader:
|
|
printf "%s" "-------- o=$o" >> summary
|
|
if [ "$(spi)" != "$(defaultspi)" ] ; then printf " spi=$(spi)" >> summary ; fi
|
|
if [ "$(hci)" != "$(defaulthci)" ] ; then printf " hci=$(hci)" >> summary ; fi
|
|
if [ "$(ecpf)" != "$(defaultecpf)" ] ; then printf " ecpf(ecpf)" >> summary ; fi
|
|
if [ "$(cp0)" != "$(defaultcp0)" ] ; then printf " cp0=$(cp0)" >> summary ; fi
|
|
if [ "$(cis)" != "$(defaultcis)" ] ; then printf " cis=$(cis)" >> summary ; fi
|
|
if [ "$p" != "$(defaultp)" ] ; then printf " p=$p" >> summary ; fi
|
|
if [ "$(eval)" != "$(defaulteval)" ] ; then printf " eval=$(eval)" >> summary ; fi
|
|
if [ "$(ctb)" != "$(defaultctb)" ] ; then printf " ctb=$(ctb)" >> summary ; fi
|
|
if [ "$(cgr)" != "$(defaultcgr)" ] ; then printf " cgr=$(cgr)" >> summary ; fi
|
|
if [ "$(cmg)" != "$(defaultcmg)" ] ; then printf " cmg=$(cmg)" >> summary ; fi
|
|
if [ "$(eoc)" != "$(defaulteoc)" ] ; then printf " eoc=$(eoc)" >> summary ; fi
|
|
if [ "$(cl)" != "$(defaultcl)" ] ; then printf " cl=$(cl)" >> summary ; fi
|
|
if [ "$(hdrmsg)" != "" ] ; then printf " $(hdrmsg)" >> summary ; fi
|
|
|
|
dosummary:
|
|
printf " --------\n" >> summary
|
|
if [ -f report-$(conf) ] ; then\
|
|
cat report-$(conf) >> summary ;\
|
|
else \
|
|
printf 'NO REPORT\n' >> summary ;\
|
|
fi
|
|
|
|
allxhelpnotall:
|
|
rm -f mat.so
|
|
$(MAKE) doheader hdrmsg="not all"
|
|
-$(MAKE)
|
|
$(MAKE) dosummary
|
|
$(MAKE) docoverage
|
|
|
|
all0: ; $(MAKE) all o=0
|
|
all1: ; $(MAKE) all o=1
|
|
all2: ; $(MAKE) all o=2
|
|
all3: ; $(MAKE) all o=3
|
|
|
|
all: makescript$o $(src) oop.ss ht.ss mat.so cat_flush ${fobj} m4test.in m4test.out prettytest.ss ftype.h freq.in freq.out ${patchfile} build-examples
|
|
${Scheme} --verbose -q mat.so ${patchfile} < script.all$o
|
|
$(MAKE) doerrors
|
|
$(MAKE) doreport
|
|
$(MAKE) docoverage
|
|
|
|
script.all$o: Mf-base
|
|
|
|
script.all$o makescript$o:
|
|
echo '(optimize-level $o)'\
|
|
'(#%$$suppress-primitive-inlining #${spi})'\
|
|
'(heap-check-interval ${hci})'\
|
|
'(#%$$enable-check-prelex-flags #${ecpf})'\
|
|
'(compile-profile #$p)'\
|
|
'(collect-trip-bytes ${ctb})'\
|
|
'(collect-generation-radix ${cgr})'\
|
|
'(collect-maximum-generation ${cmg})'\
|
|
'(enable-object-counts #${eoc})'\
|
|
'(commonization-level ${cl})'\
|
|
'(compile-interpret-simple #${cis})'\
|
|
'(set! *examples-directory* "${Examples}")'\
|
|
'(enable-cp0 #${cp0})'\
|
|
'(set! *scheme* "${Scheme}")'\
|
|
'(current-eval ${eval})'\
|
|
'(when #$c (coverage-table (load-coverage-files ${coverage-files:%="%"})))'\
|
|
'(record-run-coverage "$(objdir)/run.covout"'\
|
|
' (lambda ()'\
|
|
' (time (for-each (lambda (x) (time ((mat-file "$(objdir)") x)))'\
|
|
' (quote ($(mats:%="%")))))'\
|
|
' (parameterize ([source-directories (quote ("." "../s"))]) (when #${pdhtml} (profile-dump-html)))'\
|
|
' (unless (= (#%$$check-heap-errors) 0)'\
|
|
' (fprintf (console-error-port) "check heap detected errors---grep standard output for !!!\n")'\
|
|
' (abort))))'\
|
|
> script.all$o
|
|
|
|
source:
|
|
$(MAKE) source0 o=0
|
|
$(MAKE) source2 o=2
|
|
$(MAKE) source3 o=3
|
|
|
|
source$o: ${src} mat.ss oop.ss ht.ss cat_flush.c ${fsrc} freq.in freq.out m4test.in m4test.out script.all$o prettytest.ss ftype.h
|
|
|
|
rootsrc = $(shell cd ../../mats; echo *)
|
|
${rootsrc}:
|
|
ifeq ($(OS),Windows_NT)
|
|
cp -p ../../mats/$@ $@
|
|
else
|
|
ln -s ../../mats/$@ $@
|
|
endif
|
|
|
|
prettytest.ss:
|
|
rm -f prettytest.ss
|
|
$(MAKE) ${prettysrc}
|
|
cat ${prettysrc} > prettytest.ss
|
|
|
|
bullyprettytest.ss: ${src}
|
|
(cd ../s; make source)
|
|
cat ${src} ../s/*.ss > prettytest.ss
|
|
|
|
mat.so: ${patchfile}
|
|
foreign.mo ${objdir}/foreign.mo: ${fobj}
|
|
thread.mo ${objdir}/thread.mo: ${fobj}
|
|
examples.mo ${objdir}/examples.mo: m4test.in m4test.out freq.in freq.out build-examples
|
|
6.mo ${objdir}/6.mo: prettytest.ss
|
|
io.mo ${objdir}/io.mo: prettytest.ss
|
|
unix.mo ${objdir}/unix.mo io.mo ${objdir}/io.mo 6.mo ${objdir}/6.mo: cat_flush
|
|
oop.mo ${objdir}/oop.mo: oop.ss
|
|
ftype.mo ${objdir}/ftype.mo: ftype.h
|
|
hash.mo ${objdir}/hash.mo: ht.ss
|
|
|
|
build-examples:
|
|
( cd ../examples && ${MAKE} Scheme=${Scheme} )
|
|
touch build-examples
|
|
|
|
prettyclean:
|
|
rm -f *.o ${mdclean} *.so *.mo *.covout experr* errors* report* summary testfile* testscript\
|
|
${fobj} prettytest.ss cat_flush so_locations\
|
|
build-examples script.all? *.html experr*.rej experr*.orig
|
|
rm -rf testdir*
|
|
rm -rf output-*
|
|
( cd ../examples && ${MAKE} Scheme=${Scheme} clean )
|
|
|
|
clean: prettyclean
|
|
rm -f Make.out
|
|
|
|
|
|
### rules for generating various experr files
|
|
|
|
# everything starts with the root experr files with default
|
|
# settings for the various parameters
|
|
experr-compile-$o-f-f-f: root-experr-compile-$o-f-f-f
|
|
cp root-experr-compile-$o-f-f-f experr-compile-$o-f-f-f
|
|
|
|
root-experr: # don't list dependencies!
|
|
rm -f root-experr-compile-$o-f-f-f
|
|
cp errors-compile-$o-f-f-f root-experr-compile-$o-f-f-f
|
|
|
|
# derive spi=t experr files by patching spi=f experr files
|
|
# cp first in case patch is empty, since patch produces an empty output
|
|
# file rather than a copy of the input file if the patch file is empty
|
|
experr-compile-$o-t-f-f: experr-compile-$o-f-f-f patch-compile-$o-t-f-f
|
|
cp experr-compile-$o-f-f-f experr-compile-$o-t-f-f
|
|
-patch experr-compile-$o-t-f-f patch-compile-$o-t-f-f
|
|
|
|
# derive cp0=t experr files by patching cp0=f experr files
|
|
experr-compile-$o-$(spi)-t-f: experr-compile-$o-$(spi)-f-f patch-compile-$o-$(spi)-t-f
|
|
cp experr-compile-$o-$(spi)-f-f experr-compile-$o-$(spi)-t-f
|
|
-patch experr-compile-$o-$(spi)-t-f patch-compile-$o-$(spi)-t-f
|
|
|
|
# derive cis=t experr files by patching cis=f experr files
|
|
experr-compile-$o-$(spi)-$(cp0)-t: experr-compile-$o-$(spi)-$(cp0)-f patch-compile-$o-$(spi)-$(cp0)-t
|
|
cp experr-compile-$o-$(spi)-$(cp0)-f experr-compile-$o-$(spi)-$(cp0)-t
|
|
-patch experr-compile-$o-$(spi)-$(cp0)-t patch-compile-$o-$(spi)-$(cp0)-t
|
|
|
|
# derive eval=interpret experr files by patching eval=compile experr files
|
|
# (with cis=f, since compile-interpret-simple does not affect interpret)
|
|
experr-interpret-$o-$(spi)-$(cp0)-$(cis): experr-compile-$o-$(spi)-$(cp0)-f patch-interpret-$o-$(spi)-$(cp0)-f
|
|
cp experr-compile-$o-$(spi)-$(cp0)-f experr-interpret-$o-$(spi)-$(cp0)-$(cis)
|
|
-patch experr-interpret-$o-$(spi)-$(cp0)-$(cis) patch-interpret-$o-$(spi)-$(cp0)-f
|
|
|
|
|
|
### rebuilding patch files
|
|
|
|
patches:
|
|
for O in 0 2 3 ; do\
|
|
if [ -f errors-compile-$$O-f-f-f -a -e errors-compile-$$O-t-f-f ] ; then \
|
|
$(MAKE) xpatch-compile-$$O-t-f-f o=$$O spi=t ; \
|
|
fi ;\
|
|
for SPI in f t ; do\
|
|
if [ -f errors-compile-$$O-$$SPI-f-f -a -e errors-compile-$$O-$$SPI-t-f ] ; then \
|
|
$(MAKE) xpatch-compile-$$O-$$SPI-t-f o=$$O spi=$$SPI cp0=t ;\
|
|
fi ;\
|
|
for CP0 in f t ; do\
|
|
if [ -f errors-compile-$$O-$$SPI-$$CP0-f -a -e errors-compile-$$O-$$SPI-$$CP0-t ] ; then \
|
|
$(MAKE) xpatch-compile-$$O-$$SPI-$$CP0-t o=$$O spi=$$SPI cp0=$$CP0 cis=t ;\
|
|
fi ;\
|
|
if [ -f errors-compile-$$O-$$SPI-$$CP0-f -a -e errors-interpret-$$O-$$SPI-$$CP0-f ] ; then \
|
|
$(MAKE) xpatch-interpret-$$O-$$SPI-$$CP0-f o=$$O spi=$$SPI cp0=$$CP0 ;\
|
|
fi\
|
|
done\
|
|
done\
|
|
done
|
|
|
|
xpatch-compile-$o-t-f-f: # don't list dependencies!
|
|
rm -f patch-compile-$o-t-f-f
|
|
-diff --context errors-compile-$o-f-f-f\
|
|
errors-compile-$o-t-f-f\
|
|
> patch-compile-$o-t-f-f
|
|
|
|
xpatch-compile-$o-$(spi)-t-f: # don't list dependencies!
|
|
rm -f patch-compile-$o-$(spi)-t-f
|
|
-diff --context errors-compile-$o-$(spi)-f-f\
|
|
errors-compile-$o-$(spi)-t-f\
|
|
> patch-compile-$o-$(spi)-t-f
|
|
|
|
xpatch-compile-$o-$(spi)-$(cp0)-t: # don't list dependencies!
|
|
rm -f patch-compile-$o-$(spi)-$(cp0)-t
|
|
-diff --context errors-compile-$o-$(spi)-$(cp0)-f\
|
|
errors-compile-$o-$(spi)-$(cp0)-t\
|
|
> patch-compile-$o-$(spi)-$(cp0)-t
|
|
|
|
xpatch-interpret-$o-$(spi)-$(cp0)-f: # don't list dependencies!
|
|
rm -f patch-interpret-$o-$(spi)-$(cp0)-f
|
|
-diff --context errors-compile-$o-$(spi)-$(cp0)-f\
|
|
errors-interpret-$o-$(spi)-$(cp0)-f\
|
|
> patch-interpret-$o-$(spi)-$(cp0)-f
|