remove redundant retraction records for incremental compilation
This commit is contained in:
@@ -1492,37 +1492,6 @@ impl<'a> LoadState<'a> {
|
|||||||
Ok(code_index)
|
Ok(code_index)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn record_incremental_compile(
|
|
||||||
&mut self,
|
|
||||||
key: PredicateKey,
|
|
||||||
compilation_target: CompilationTarget,
|
|
||||||
append_or_prepend: AppendOrPrepend,
|
|
||||||
) {
|
|
||||||
self.retraction_info
|
|
||||||
.push_record(match compilation_target {
|
|
||||||
CompilationTarget::User => match append_or_prepend {
|
|
||||||
AppendOrPrepend::Append => {
|
|
||||||
RetractionRecord::AppendedUserExtensiblePredicate(key)
|
|
||||||
}
|
|
||||||
AppendOrPrepend::Prepend => {
|
|
||||||
RetractionRecord::PrependedUserExtensiblePredicate(key)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
CompilationTarget::Module(module_name) => match append_or_prepend {
|
|
||||||
AppendOrPrepend::Append => RetractionRecord::AppendedModuleExtensiblePredicate(
|
|
||||||
module_name,
|
|
||||||
key,
|
|
||||||
),
|
|
||||||
AppendOrPrepend::Prepend => {
|
|
||||||
RetractionRecord::PrependedModuleExtensiblePredicate(
|
|
||||||
module_name,
|
|
||||||
key,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
fn extend_local_predicate_skeleton(
|
fn extend_local_predicate_skeleton(
|
||||||
&mut self,
|
&mut self,
|
||||||
compilation_target: &CompilationTarget,
|
compilation_target: &CompilationTarget,
|
||||||
@@ -1650,12 +1619,6 @@ impl<'a> LoadState<'a> {
|
|||||||
non_counted_bt: bool,
|
non_counted_bt: bool,
|
||||||
append_or_prepend: AppendOrPrepend,
|
append_or_prepend: AppendOrPrepend,
|
||||||
) -> Result<CodeIndex, SessionError> {
|
) -> Result<CodeIndex, SessionError> {
|
||||||
self.record_incremental_compile(
|
|
||||||
key.clone(),
|
|
||||||
compilation_target.clone(),
|
|
||||||
append_or_prepend,
|
|
||||||
);
|
|
||||||
|
|
||||||
let settings = match self
|
let settings = match self
|
||||||
.wam
|
.wam
|
||||||
.indices
|
.indices
|
||||||
|
|||||||
@@ -48,8 +48,6 @@ pub(crate) enum RetractionRecord {
|
|||||||
ReplacedMetaPredicate(ClauseName, ClauseName, Vec<MetaSpec>),
|
ReplacedMetaPredicate(ClauseName, ClauseName, Vec<MetaSpec>),
|
||||||
AddedModule(ClauseName),
|
AddedModule(ClauseName),
|
||||||
ReplacedModule(ModuleDecl, ListingSource, LocalExtensiblePredicates),
|
ReplacedModule(ModuleDecl, ListingSource, LocalExtensiblePredicates),
|
||||||
AppendedModuleExtensiblePredicate(ClauseName, PredicateKey),
|
|
||||||
PrependedModuleExtensiblePredicate(ClauseName, PredicateKey),
|
|
||||||
AddedModuleOp(ClauseName, OpDecl),
|
AddedModuleOp(ClauseName, OpDecl),
|
||||||
ReplacedModuleOp(ClauseName, OpDecl, usize, Specifier),
|
ReplacedModuleOp(ClauseName, OpDecl, usize, Specifier),
|
||||||
AddedModulePredicate(ClauseName, PredicateKey),
|
AddedModulePredicate(ClauseName, PredicateKey),
|
||||||
@@ -60,8 +58,6 @@ pub(crate) enum RetractionRecord {
|
|||||||
AddedUserOp(OpDecl),
|
AddedUserOp(OpDecl),
|
||||||
ReplacedUserOp(OpDecl, usize, Specifier),
|
ReplacedUserOp(OpDecl, usize, Specifier),
|
||||||
AddedExtensiblePredicate(CompilationTarget, PredicateKey),
|
AddedExtensiblePredicate(CompilationTarget, PredicateKey),
|
||||||
AppendedUserExtensiblePredicate(PredicateKey),
|
|
||||||
PrependedUserExtensiblePredicate(PredicateKey),
|
|
||||||
AddedUserPredicate(PredicateKey),
|
AddedUserPredicate(PredicateKey),
|
||||||
ReplacedUserPredicate(PredicateKey, IndexPtr),
|
ReplacedUserPredicate(PredicateKey, IndexPtr),
|
||||||
AddedIndex(OptArgIndexKey, usize), //, Vec<usize>),
|
AddedIndex(OptArgIndexKey, usize), //, Vec<usize>),
|
||||||
@@ -263,22 +259,6 @@ impl<'a> Drop for LoadState<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RetractionRecord::AppendedModuleExtensiblePredicate(module_name, key) => {
|
|
||||||
self.wam
|
|
||||||
.indices
|
|
||||||
.get_predicate_skeleton_mut(&CompilationTarget::Module(module_name), &key)
|
|
||||||
.map(|skeleton| {
|
|
||||||
skeleton.clauses.pop_back();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
RetractionRecord::PrependedModuleExtensiblePredicate(module_name, key) => {
|
|
||||||
self.wam
|
|
||||||
.indices
|
|
||||||
.get_predicate_skeleton_mut(&CompilationTarget::Module(module_name), &key)
|
|
||||||
.map(|skeleton| {
|
|
||||||
skeleton.clauses.pop_front();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
RetractionRecord::AddedModuleOp(module_name, mut op_decl) => {
|
RetractionRecord::AddedModuleOp(module_name, mut op_decl) => {
|
||||||
match self.wam.indices.modules.get_mut(&module_name) {
|
match self.wam.indices.modules.get_mut(&module_name) {
|
||||||
Some(ref mut module) => {
|
Some(ref mut module) => {
|
||||||
@@ -321,22 +301,6 @@ impl<'a> Drop for LoadState<'a> {
|
|||||||
.indices
|
.indices
|
||||||
.remove_predicate_skeleton(&compilation_target, &key);
|
.remove_predicate_skeleton(&compilation_target, &key);
|
||||||
}
|
}
|
||||||
RetractionRecord::AppendedUserExtensiblePredicate(key) => {
|
|
||||||
self.wam
|
|
||||||
.indices
|
|
||||||
.get_predicate_skeleton_mut(&CompilationTarget::User, &key)
|
|
||||||
.map(|skeleton| {
|
|
||||||
skeleton.clauses.pop_back();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
RetractionRecord::PrependedUserExtensiblePredicate(key) => {
|
|
||||||
self.wam
|
|
||||||
.indices
|
|
||||||
.get_predicate_skeleton_mut(&CompilationTarget::User, &key)
|
|
||||||
.map(|skeleton| {
|
|
||||||
skeleton.clauses.pop_front();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
RetractionRecord::AddedUserOp(mut op_decl) => {
|
RetractionRecord::AddedUserOp(mut op_decl) => {
|
||||||
op_decl.remove(&mut self.wam.indices.op_dir);
|
op_decl.remove(&mut self.wam.indices.op_dir);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user