# Changeset d5f6a14

Ignore:
Timestamp:
Jul 5, 2021, 2:11:58 PM (15 months ago)
Branches:
enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
b7763da
Parents:
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Files:
8 edited

Unmodified
Removed
• ## doc/theses/andrew_beach_MMath/performance.tex

 rf7f07f6 \textbf{Just because of the stage of testing there are design notes for the tests as well as commentary on them.} \todo{Revisit organization of the performance chapter once tests are chosen.} % What are good tests for resumption? Performance has been of secondary importance for most of this project. amount of time. %\section{Termination Comparison} \section{Test Set-Up} Tests will be run on \CFA, C++ and Java. The should provide a guide as to where the EHM's costs can be found. \paragraph{Raise/Handle} What is the basic cost to raise and handle an exception? Tests are run in \CFA, \Cpp and Java. Not every test is run in every language, if the feature under test is missing the test is skipped. These cases will be noted. In addition to the termination tests for every language, \CFA has a second set of tests that test resumption. These are the same except that the raise statements and handler clauses are replaced with the resumption variants. There are a number of factors that can effect this. For \CFA this includes the type of raise, \paragraph{Raise and Handle} The first group of tests involve setting up So there is three layers to the test. The first is set up and a loop, which configures the test and then runs it repeatedly to reduce the impact of start-up and shutdown on the results. Each iteration of the main loop \begin{itemize} \item Empty Function: The repeating function is empty except for the necessary control code. \item Destructor: The repeating function creates an object with a destructor before calling itself. (Java is skipped as it does not destructors.) \item Finally: The repeating function calls itself inside a try block with a finally clause attached. (\Cpp is skipped as it does not have finally clauses.) \item Other Handler: The repeating function calls itself inside a try block with a handler that will not match the raised exception. (But is of the same kind of handler.) \end{itemize} Main loop, pass through a catch-all, call through some empty helper functions to put frames on the stack then raise and exception. \todo{Raise/Handle (or a similar test) could also test how much it costs to search over things, not sure if that is a useful test.} \paragraph{Cross Try Statement} The next group measures the cost of a try statement when no exceptions are raised. The test is set-up, then there is a loop to reduce the impact of start-up and shutdown on the results. In each iteration, a try statement is executed. Entering and leaving a loop is all the test wants to do. \begin{itemize} \item Handler: The try statement has a handler (of the matching kind). \item Finally: The try statement has a finally clause. \end{itemize} \paragraph{Unwinding} Isolating the unwinding of the stack as much as possible. This has the same set-up as the raise/handle test except the intermediate stack frames contain either an object declaration with a destructor or a try statement with no handlers except for a finally clause. \paragraph{Enter/Leave} What is the cost of entering and leaving a try block, even if no exception is thrown? This test is a simple pattern of entering and leaving a try statement. The only tunables here are which clauses are attached to the try block: termination handlers, resumption handlers and finally clauses. \paragraph{Re-throw and Conditional-Catch} How expensive it is to run a non-exception type check for a handler? In this case different languages approach this problem differently, either through a re-throw or a conditional-catch. Where \CFA uses its condition other languages will have to unconditionally catch the exception then re-throw if the condition if the condition is false. The set up is as follows: main loop, a catch-all exception handler, a conditional catch and then the raise. % We could do a Cforall test without the catch all and a new default handler % that does a catch all. As a point of comparison one of the raise/handle tests (which one?) has same layout but never catches anything. The main tunable in this test is how often the conditional-catch matches. \paragraph{Conditional Matching} This group of tests checks the cost of conditional matching. Only \CFA implements the language level conditional match, the other languages must mimic with an unconditional" match (it still checks the exception's type) and conditional re-raise. \begin{itemize} \item Catch All: The condition is always true. (Always matches or never re-raises.) \item Catch None: The condition is always false. (Never matches or always re-raises.) \end{itemize} %\section{Cost in Size}
• ## src/AST/Node.cpp

 rf7f07f6 const ast::ParseNode * parse = dynamic_cast( node ); if ( nullptr == parse ) { assertf(nullptr, "%s (no location)", toString(node).c_str()); assertf(false, "%s (no location)", toString(node).c_str()); } else if ( parse->location.isUnset() ) { assertf(nullptr, "%s (unset location)", toString(node).c_str()); assertf(false, "%s (unset location)", toString(node).c_str()); } else { assertf(nullptr, "%s (at %s:%d)", toString(node).c_str(), assertf(false, "%s (at %s:%d)", toString(node).c_str(), parse->location.filename.c_str(), parse->location.first_line); }
• ## src/GenPoly/GenPoly.cc

 rf7f07f6 } __attribute__((ununsed)) bool hasPolyParams( const std::vector> & params, const TyVarMap & tyVars, const ast::TypeSubstitution * env) { for (auto ¶m : params) {
• ## src/ResolvExpr/CandidateFinder.cpp

 rf7f07f6 const ast::SymbolTable & symtab; public: static size_t traceId; // static size_t traceId; CandidateFinder & selfFinder; CandidateList & candidates; } } // if argType is an unbound type parameter, all special functions need to be searched. if (isUnboundType(argType)) { // unification run for side-effects unify( toType, cand->expr->result, cand->env, need, have, open, symtab ); Cost thisCost = Cost thisCost = (castExpr->isGenerated == ast::GeneratedFlag::GeneratedCast) ? conversionCost( cand->expr->result, toType, cand->expr->get_lvalue(), symtab, cand->env ) found->second.ambiguous = true; } } else { } else { // xxx - can satisfyAssertions increase the cost? PRINT( std::cerr << "cost " << newCand->cost << " loses to " << found->second.candidate->cost << std::endl; ) ) } } else { if ( mode.failFast && pruned.empty() ) { std::ostringstream stream; if (found) { if (found) { CandidateList winners = findMinCost( candidates ); stream << "Cannot choose between " << winners.size() << " alternatives for "
• ## src/ResolvExpr/Unify.cc

 rf7f07f6 } return { new ast::TupleType{ std::move(out) } }; return new ast::TupleType{ std::move(out) }; }
• ## src/SymTab/Validate.cc

 rf7f07f6 } }; */ /// expand assertions from a trait instance, performing appropriate type variable substitutions } } /* /// Associates forward declarations of aggregates with their definitions
• ## src/SynTree/AggregateDecl.cc

 rf7f07f6 std::list< Expression * > copy_parameters; cloneAll( new_parameters, copy_parameters ); return makeInst( move( copy( copy_parameters ) ) ); return makeInst( copy( copy_parameters ) ); }
• ## src/SynTree/ReferenceToType.cc

 rf7f07f6 Type::print( os, indent ); os << "instance of " << typeString() << " "; const auto & name_ = get_name(); if( deterministic_output && isUnboundType(name) ) os << "[unbound]"; else os << name;
Note: See TracChangeset for help on using the changeset viewer.