extend existing local predicate skeletons in LoadState::compile
This commit is contained in:
@@ -1099,14 +1099,39 @@ impl<'a> LoadState<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
let mut skeleton = PredicateSkeleton::new();
|
||||
skeleton.clause_clause_locs = clause_clause_locs;
|
||||
match self
|
||||
.wam
|
||||
.indices
|
||||
.get_local_predicate_skeleton_mut(
|
||||
&self.compilation_target,
|
||||
predicates.compilation_target.clone(),
|
||||
key.clone(),
|
||||
)
|
||||
{
|
||||
Some(skeleton) => {
|
||||
self.retraction_info
|
||||
.push_record(RetractionRecord::SkeletonLocalClauseTruncateBack(
|
||||
self.compilation_target.clone(),
|
||||
predicates.compilation_target.clone(),
|
||||
key.clone(),
|
||||
skeleton.clause_clause_locs.len(),
|
||||
));
|
||||
|
||||
self.add_local_extensible_predicate(
|
||||
predicates.compilation_target.clone(),
|
||||
key.clone(),
|
||||
skeleton,
|
||||
);
|
||||
skeleton.clause_clause_locs.extend_from_slice(
|
||||
&clause_clause_locs[0 ..]
|
||||
);
|
||||
}
|
||||
None => {
|
||||
let mut skeleton = PredicateSkeleton::new();
|
||||
skeleton.clause_clause_locs = clause_clause_locs;
|
||||
|
||||
self.add_local_extensible_predicate(
|
||||
predicates.compilation_target.clone(),
|
||||
key.clone(),
|
||||
skeleton,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set_code_index(
|
||||
|
||||
@@ -76,6 +76,7 @@ pub(crate) enum RetractionRecord {
|
||||
SkeletonClausePopFront(CompilationTarget, PredicateKey),
|
||||
SkeletonLocalClauseClausePopBack(CompilationTarget, CompilationTarget, PredicateKey),
|
||||
SkeletonLocalClauseClausePopFront(CompilationTarget, CompilationTarget, PredicateKey),
|
||||
SkeletonLocalClauseTruncateBack(CompilationTarget, CompilationTarget, PredicateKey, usize),
|
||||
SkeletonClauseTruncateBack(CompilationTarget, PredicateKey, usize),
|
||||
SkeletonClauseStartReplaced(CompilationTarget, PredicateKey, usize, usize),
|
||||
RemovedSkeletonClause(
|
||||
@@ -519,6 +520,27 @@ impl<'a> Drop for LoadState<'a> {
|
||||
None => {}
|
||||
}
|
||||
}
|
||||
RetractionRecord::SkeletonLocalClauseTruncateBack(
|
||||
src_compilation_target,
|
||||
local_compilation_target,
|
||||
key,
|
||||
len,
|
||||
) => {
|
||||
match self
|
||||
.wam
|
||||
.indices
|
||||
.get_local_predicate_skeleton_mut(
|
||||
&src_compilation_target,
|
||||
local_compilation_target,
|
||||
key,
|
||||
)
|
||||
{
|
||||
Some(skeleton) => {
|
||||
skeleton.clause_clause_locs.truncate_back(len);
|
||||
}
|
||||
None => {}
|
||||
}
|
||||
}
|
||||
RetractionRecord::SkeletonClauseTruncateBack(compilation_target, key, len) => {
|
||||
match self
|
||||
.wam
|
||||
|
||||
Reference in New Issue
Block a user