Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

ApplyCache.C File Reference

#include <Basics.H>
#include <FP.H>
#include <Model.H>
#include <FV.H>
#include <CacheIndex.H>
#include <CacheC.H>
#include "ApplyCache.H"
#include "Expr.H"
#include "Val.H"
#include "Pickle.H"
#include "Err.H"
#include "PrimRunTool.H"
#include "Debug.H"
#include "ThreadData.H"
#include <Table.H>

Go to the source code of this file.

Functions

void Tags (const CompactFV::List &names, const Context &c, FP::List &tags)
bool NamesTagsPickle (Val val, bool cutoff, const Context &inPKArgs, char *&types, FV2::List &names, FP::List &tags, VestaVal::T &vval)
void CollectKids (CacheEntry::IndicesApp *orphanCIs, int kidsIndex, CacheEntry::Indices &kids)
void UpdateOrphans (CacheEntry::IndicesApp *orphanCIs, int kidsIndex, CacheEntry::Index ci)
void Checkpoint ()
void FreeNamesTags (CompactFV::List &names, FP::List &tags)
Context BindApplicationArgs (ClosureVC *clos, ArgList actuals, const Context &c)
Val ApplicationFromCache (ClosureVC *clos, const Context &argsCon, SrcLoc *loc)
Val ApplyFunction (ClosureVC *clos, ApplyEC *ae, const Context &c)
Val NormalModelFromCache (ModelVC *fun, const Context &evalCon, SrcLoc *loc)
Val ModelFromCache (ModelVC *fun, const Context &argsCon, SrcLoc *loc)
Val ApplyModel (ModelVC *fun, ApplyEC *ae, const Context &c)
bool CheckTreatment (TextVC *tr)
bool AllTexts (BindingVC *b)
bool BindRunToolArgs (ArgList args, const Context &c, RunToolArgs &runToolArgs)
void RunToolPK (const RunToolArgs &runToolArgs, FP::Tag &pk)
Val MergeArgsDpnd (Val result, const RunToolArgs &args)
void StartRenewLeaseThread ()
Val RunToolFromCache (const RunToolArgs &runToolArgs, const Context &c, SrcLoc *loc)
Val ApplyRunTool (ArgList args, const Context &c)

Variables

const char * evaluatorRunToolVersion = "Fri Feb 11 13:30:46 2005"
const FP::Tag evaluatorRunToolVersionTag (evaluatorRunToolVersion)
const char * evaluatorFunctionVersion = "Fri Feb 11 13:30:46 2005"
const FP::Tag evaluatorFunctionVersionTag (evaluatorFunctionVersion)


Function Documentation

bool AllTexts BindingVC b  ) 
 

Definition at line 924 of file ApplyCache.C.

References BindingVC::elems, ListT< Value >::Null(), ListT< Value >::Pop(), TextVK, AssocVC::val, and ValC::vKind.

Referenced by BindRunToolArgs().

Val ApplicationFromCache ClosureVC clos,
const Context argsCon,
SrcLoc loc
 

Definition at line 312 of file ApplyCache.C.

References CacheC::AddEntry(), CacheIntf::AddEntryResName(), appCallCounter, ListT< Value >::Append(), appHitCounter, FuncEC::args, FuncEC::body, BooleanVK, cacheOption, SrcLoc::character, Checkpoint(), ClosureVK, CollectKids(), ClosureVC::con, ArgListEC::elems, CacheIntf::EntryAdded, Error(), ErrorVK, ExprC::Eval(), evaluatorFunctionVersionTag, FP::Tag::Extend(), SrcLoc::file, AssocVC::FingerPrint(), ClosureVC::FingerPrintExpr(), FpVK, FreeNamesTags(), CacheC::FreeVariables(), ClosureVC::func, ThreadData::funcCallDepth, FuncDpnd(), CacheIntf::FVMismatch, CacheIntf::Hit, IncCounter(), ArgListEC::inPKs, IntegerVK, IntToText(), CacheEntry::Indices::len, FP::List::len, SrcLoc::line, ExprC::loc, Basics::mutex::lock(), CacheC::Lookup(), CacheIntf::LookupResName(), CacheIntf::Miss, ModelVK, SRPC::failure::msg, FuncEC::name, NamesTagsPickle(), NEW, noAddEntry, FuncEC::noCache, ListT< Value >::Null(), ThreadData::orphanCIs, outputMu, ListT< Value >::Pop(), PrimitiveVK, ListT< Value >::Push(), SRPC::failure::r, SrcLoc::shortId, Sequence< Elem, elem_ptrfree >::size(), Basics::OBufStream::str(), Tags(), TextVK, theCache, ThreadDataGet(), Basics::mutex::unlock(), Unpickle(), UpdateOrphans(), AssocVC::val, and ValC::vKind.

Referenced by ApplyFunction(), and Map().

Val ApplyFunction ClosureVC clos,
ApplyEC ae,
const Context c
 

Definition at line 513 of file ApplyCache.C.

References ApplicationFromCache(), ApplyEC::args, FuncEC::args, BindApplicationArgs(), conEmpty, ErrorDetail(), ErrorExpr(), SrcLoc::file, ClosureVC::func, ThreadData::funcCallDepth, ExprC::loc, Basics::mutex::lock(), FuncEC::name, NEW, outputMu, ThreadDataGet(), ThreadData::traceRes, and Basics::mutex::unlock().

Referenced by ApplyEC::Eval().

Val ApplyModel ModelVC fun,
ApplyEC ae,
const Context c
 

Definition at line 868 of file ApplyCache.C.

References ApplyEC::args, ModelVC::content, ExprC::EError(), ArgListEC::elems, ThreadData::funcCallDepth, Sequence< Elem, elem_ptrfree >::getlo(), ExprC::loc, Basics::mutex::lock(), ModelFromCache(), nameDot, NEW, NEW_CONSTR, outputMu, PushToContext(), Sequence< Elem, elem_ptrfree >::size(), ThreadDataGet(), ThreadData::traceRes, and Basics::mutex::unlock().

Referenced by ApplyEC::Eval(), and Interpret().

Val ApplyRunTool ArgList  args,
const Context c
 

Definition at line 1526 of file ApplyCache.C.

References BindRunToolArgs(), SrcLoc::file, ThreadData::funcCallDepth, IncCounter(), ExprC::loc, NEW, RunToolFromCache(), ThreadDataGet(), toolCallCounter, and ThreadData::traceRes.

Referenced by PrimInit().

Context BindApplicationArgs ClosureVC clos,
ArgList  actuals,
const Context c
 

Definition at line 253 of file ApplyCache.C.

References FuncEC::args, AssignEK, ClosureVC::con, conEmpty, ExprC::EError(), ArgListEC::elems, ErrorDetail(), ErrorExpr(), ClosureVC::func, Sequence< Elem, elem_ptrfree >::get(), NameEC::id, ExprC::kind, AssignEC::lhs, ExprC::loc, Basics::mutex::lock(), nameDot, NameEK, NEW_CONSTR, outputMu, PushToContext(), AssignEC::rhs, Sequence< Elem, elem_ptrfree >::size(), and Basics::mutex::unlock().

Referenced by ApplyFunction().

bool BindRunToolArgs ArgList  args,
const Context c,
RunToolArgs runToolArgs
 

Definition at line 933 of file ApplyCache.C.

References AllTexts(), BindingVK, BooleanVK, CheckTreatment(), RunToolArgs::command_line, RunToolArgs::dot, emptyText, RunToolArgs::existing_writable, RunToolArgs::fp_content, fpContent, Sequence< Elem, elem_ptrfree >::get(), IntegerVK, ListVK, RunToolArgs::loc, Basics::mutex::lock(), BindingVC::Lookup(), LookupInContext(), nameDot, NEW_CONSTR, ListT< Value >::Null(), ok(), outputMu, RunToolArgs::platform, ListT< Value >::Pop(), RunToolArgs::signal_treatment, RunToolArgs::status_treatment, RunToolArgs::stderr_treatment, RunToolArgs::stdin_data, RunToolArgs::stdout_treatment, TextVK, Basics::mutex::unlock(), ValC::vKind, and RunToolArgs::wd_name.

Referenced by ApplyRunTool().

void Checkpoint  ) 
 

Definition at line 224 of file ApplyCache.C.

bool CheckTreatment TextVC tr  ) 
 

Definition at line 915 of file ApplyCache.C.

References TextVC::NDS().

Referenced by BindRunToolArgs().

void CollectKids CacheEntry::IndicesApp orphanCIs,
int  kidsIndex,
CacheEntry::Indices kids
 

Definition at line 209 of file ApplyCache.C.

References CacheEntry::Indices::index, and CacheEntry::Indices::len.

Referenced by ApplicationFromCache(), ModelFromCache(), NormalModelFromCache(), and RunToolFromCache().

void FreeNamesTags CompactFV::List names,
FP::List tags
 

Definition at line 245 of file ApplyCache.C.

References FP::List::fp, and FP::List::len.

Referenced by ApplicationFromCache(), ModelFromCache(), NormalModelFromCache(), and RunToolFromCache().

Val MergeArgsDpnd Val  result,
const RunToolArgs args
 

Definition at line 1172 of file ApplyCache.C.

References RunToolArgs::command_line, ListVC::elems, ListVC::lenDps, ValC::Merge(), ValC::MergeDPS(), ListT< Value >::Null(), ValC::path, RunToolArgs::platform, ListT< Value >::Pop(), SharedTable< K, V >::T::Size(), RunToolArgs::stderr_treatment, RunToolArgs::stdin_data, RunToolArgs::stdout_treatment, ValueDpnd(), and RunToolArgs::wd_name.

Referenced by RunToolFromCache().

Val ModelFromCache ModelVC fun,
const Context argsCon,
SrcLoc loc
 

Definition at line 697 of file ApplyCache.C.

References CacheC::AddEntry(), CacheIntf::AddEntryResName(), ListT< Value >::Append(), ModelEC::block, cacheOption, Checkpoint(), CollectKids(), conEmpty, ModelVC::content, CacheIntf::EntryAdded, Error(), ErrorDetail(), ErrorVal(), ExprC::Eval(), evaluatorFunctionVersionTag, FP::Tag::Extend(), ModelVC::FingerPrint(), FreeNamesTags(), CacheC::FreeVariables(), ThreadData::funcCallDepth, CacheIntf::FVMismatch, CacheIntf::Hit, IncCounter(), IntToText(), CacheEntry::Indices::len, FP::List::len, Basics::mutex::lock(), CacheC::Lookup(), CacheIntf::LookupResName(), ValC::Merge(), CacheIntf::Miss, ModelCutOff(), ModelDpnd(), ModelVK, SRPC::failure::msg, NamesTagsPickle(), NEW, noAddEntry, NormalModelFromCache(), outputMu, SRPC::failure::r, sModelCallCounter, sModelHitCounter, Basics::OBufStream::str(), Tags(), theCache, ThreadDataGet(), ThreadData::traceRes, Basics::mutex::unlock(), Unpickle(), UpdateOrphans(), and ValC::vKind.

Referenced by ApplyModel(), and Map().

bool NamesTagsPickle Val  val,
bool  cutoff,
const Context inPKArgs,
char *&  types,
FV2::List names,
FP::List tags,
VestaVal::T vval
 

Definition at line 143 of file ApplyCache.C.

References ClosureVK, SharedTable< K, V >::T::Delete(), ValC::dps, ExprPK, FP::List::fp, FpVK, SharedTable< K, V >::KVPair::key, FP::List::len, FV2::List::len, DepPathTbl::DPS::Merge(), ModelCutOff(), ModelVK, FV2::List::name, NEW_ARRAY, NEW_CONSTR, NEW_PTRFREE_ARRAY, SharedTable< K, V >::Iterator::Next(), ListT< Value >::Null(), Pickle(), ListT< Value >::Pop(), SharedTable< K, V >::Iterator::Reset(), SharedTable< K, V >::T::Resize(), SharedTable< K, V >::T::Size(), ValC::SizeOfDPS(), SharedTable< K, V >::KVPair::val, and ValueDpnd().

Referenced by ApplicationFromCache(), ModelFromCache(), NormalModelFromCache(), and RunToolFromCache().

Val NormalModelFromCache ModelVC fun,
const Context evalCon,
SrcLoc loc
 

Definition at line 548 of file ApplyCache.C.

References CacheC::AddEntry(), CacheIntf::AddEntryResName(), Checkpoint(), CollectKids(), conEmpty, ModelVC::content, CacheIntf::EntryAdded, Error(), evaluatorFunctionVersionTag, FP::Tag::Extend(), ModelVC::FingerPrintFile(), FreeNamesTags(), CacheC::FreeVariables(), ThreadData::funcCallDepth, CacheIntf::FVMismatch, CacheIntf::Hit, IncCounter(), IntToText(), FP::List::len, CacheEntry::Indices::len, Basics::mutex::lock(), CacheC::Lookup(), CacheIntf::LookupResName(), CacheIntf::Miss, ModelCutOff(), SRPC::failure::msg, NamesTagsPickle(), NEW, nModelCallCounter, nModelHitCounter, noAddEntry, outputMu, SRPC::failure::r, Basics::OBufStream::str(), Tags(), theCache, ThreadDataGet(), ThreadData::traceRes, Basics::mutex::unlock(), Unpickle(), UpdateOrphans(), and ValC::VError().

Referenced by ModelFromCache().

Val RunToolFromCache const RunToolArgs runToolArgs,
const Context c,
SrcLoc loc
 

Definition at line 1332 of file ApplyCache.C.

References CacheC::AddEntry(), CacheIntf::AddEntryResName(), cacheOption, Checkpoint(), CollectKids(), conEmpty, DeleteRootForTool(), ValC::dps, CacheIntf::EntryAdded, Error(), evaluatorRunToolVersionTag, SrcLoc::file, FreeNamesTags(), CacheC::FreeVariables(), ThreadData::funcCallDepth, CacheIntf::FVMismatch, CacheIntf::Hit, IncCounter(), IntToText(), FP::List::len, CacheEntry::Indices::len, Basics::mutex::lock(), CacheC::Lookup(), CacheIntf::LookupResName(), MergeArgsDpnd(), CacheIntf::Miss, SRPC::failure::msg, NamesTagsPickle(), NEW, noAddEntry, NullShortId, outputMu, SRPC::failure::r, RunTool(), RunToolPK(), Basics::OBufStream::str(), Tags(), theCache, ThreadDataGet(), ThreadLabel(), ToolCommandLineAsText(), toolHitCounter, ThreadData::traceRes, Basics::mutex::unlock(), Unpickle(), UpdateOrphans(), rtt_cond::wait(), and rtt_cond::wake().

Referenced by ApplyRunTool().

void RunToolPK const RunToolArgs runToolArgs,
FP::Tag pk
 

Definition at line 1152 of file ApplyCache.C.

References FP::Tag::Extend(), and ValC::FingerPrint().

Referenced by RunToolFromCache().

void StartRenewLeaseThread  ) 
 

Definition at line 1325 of file ApplyCache.C.

References cacheOption, Basics::thread::fork_and_detach(), and RenewLeases().

Referenced by StartEval().

void Tags const CompactFV::List names,
const Context c,
FP::List tags
 

Definition at line 120 of file ApplyCache.C.

References FP::List::fp, CompactFV::List::idx, FP::List::len, LookupPath(), NEW_ARRAY, NEW_PTRFREE_ARRAY, CompactFV::List::num, PrefixTbl::NumArcs(), CompactFV::List::tbl, and CompactFV::List::types.

Referenced by ApplicationFromCache(), ModelFromCache(), NormalModelFromCache(), and RunToolFromCache().

void UpdateOrphans CacheEntry::IndicesApp orphanCIs,
int  kidsIndex,
CacheEntry::Index  ci
 

Definition at line 216 of file ApplyCache.C.

References CacheEntry::IndicesApp::Append(), CacheEntry::Indices::len, Basics::mutex::lock(), and Basics::mutex::unlock().

Referenced by ApplicationFromCache(), ModelFromCache(), NormalModelFromCache(), and RunToolFromCache().


Variable Documentation

const char* evaluatorFunctionVersion = "Fri Feb 11 13:30:46 2005"
 

Definition at line 70 of file ApplyCache.C.

const FP::Tag evaluatorFunctionVersionTag(evaluatorFunctionVersion)
 

Referenced by ApplicationFromCache(), ModelFromCache(), and NormalModelFromCache().

const char* evaluatorRunToolVersion = "Fri Feb 11 13:30:46 2005"
 

Definition at line 66 of file ApplyCache.C.

const FP::Tag evaluatorRunToolVersionTag(evaluatorRunToolVersion)
 

Referenced by RunToolFromCache().


Generated on Mon May 8 00:49:02 2006 for Vesta by  doxygen 1.4.2