§12. Attaching and detaching rules. The following routine contains a bit of a surprise: that the act of
diff --git a/docs/assertions-module/6-rls.html b/docs/assertions-module/6-rls.html
index 4233f1d02..9c3dbd72d 100644
--- a/docs/assertions-module/6-rls.html
+++ b/docs/assertions-module/6-rls.html
@@ -109,7 +109,7 @@ different dynamics altogether. In short, then: rules are not phrases.
structrulebook *kind_of_rule_set_from;structimperative_defn *defn_as_I7_source; if defined by an I7 id_body
-structstacked_variable_access_list *variables_visible_in_definition; if so
+structshared_variable_access_list *variables_visible_in_definition; if sostructtext_stream *defn_as_Inter_function; if notstructbooking *automatic_booking; how this is placed in rulebooks
@@ -158,7 +158,7 @@ rule called W,
R->kind_of_rule_set_from = NULL;R->defn_as_I7_source = NULL;
-R->variables_visible_in_definition = StackedVariables::new_access_list();
+R->variables_visible_in_definition = SharedVariables::new_access_list();R->defn_as_Inter_function = NULL;R->automatic_booking = NULL;
@@ -326,14 +326,14 @@ nothing.
returnR->defn_as_I7_source;}
-
§10. Inside such a definition, certain stacked variables may be in scope. For
+
§10. Inside such a definition, certain shared variables may be in scope. For
example, if a rule is in an activity rulebook, then it will be able to see
the variables belonging to that activity.
-voidRules::put_variables_in_scope(rule *R, stacked_variable_access_list *access) {
-StackedVariables::append_access_list(R->variables_visible_in_definition, access);
+voidRules::put_variables_in_scope(rule *R, shared_variable_access_list *access) {
+SharedVariables::append_access_list(R->variables_visible_in_definition, access);}voidRules::put_action_variables_in_scope(rule *R) {
@@ -344,13 +344,13 @@ the variables belonging to that activity.
#endif}
-structstacked_variable_access_list *all_action_processing_vars = NULL;
+structshared_variable_access_list *all_action_processing_vars = NULL;
-stacked_variable_access_list *Rules::all_action_processing_variables(void) {
+shared_variable_access_list *Rules::all_action_processing_variables(void) {if (all_action_processing_vars == NULL) {
-all_action_processing_vars = StackedVariables::new_access_list();
+all_action_processing_vars = SharedVariables::new_access_list();rulebook *B = Rulebooks::std(ACTION_PROCESSING_RB);
-if (B) StackedVariables::add_set_to_access_list(all_action_processing_vars, B->my_variables);
+if (B) SharedVariables::add_set_to_access_list(all_action_processing_vars, B->my_variables); }returnall_action_processing_vars;}
diff --git a/docs/assertions-module/8-am.html b/docs/assertions-module/8-am.html
index 585373764..2e2751092 100644
--- a/docs/assertions-module/8-am.html
+++ b/docs/assertions-module/8-am.html
@@ -448,14 +448,14 @@ whether it is able to do this or not.
typedefstructap_clause {intclause_ID;
-structstacked_variable *stv_to_match; can be NULL for some built-in clause IDs
+structshared_variable *stv_to_match; can be NULL for some built-in clause IDsstructparse_node *clause_spec; what the pattern says about this valueintclause_options; a bitmap of flags: see belowstructap_clause *next; in the linked list of clauses for an action pattern
@@ -348,9 +348,9 @@ variables:
diff --git a/docs/index-module/3-act.html b/docs/index-module/3-act.html
index a9ff7ffd4..e471c565f 100644
--- a/docs/index-module/3-act.html
+++ b/docs/index-module/3-act.html
@@ -192,9 +192,9 @@ function togglePopup(material_id) {
if (CommandsIndex::index_list_with_action(OUT, an->command_parser_grammar_producing_this) == FALSE)WRITE("<i>None</i>");HTML_CLOSE("p");
-if (StackedVariables::set_empty(an->action_variables) == FALSE) {
+if (SharedVariables::set_empty(an->action_variables) == FALSE) {HTML_OPEN("p"); WRITE("<b>Named values belonging to this action</b>\n"); HTML_CLOSE("p");
-StackedVariables::index_owner(OUT, an->action_variables);
+IXVariables::index_stv_set(OUT, an->action_variables); }HTML_OPEN("p"); WRITE("<b>Rules controlling this action</b>"); HTML_CLOSE("p");
diff --git a/docs/knowledge-module/1-ap.html b/docs/knowledge-module/1-ap.html
index efcd91456..8e40b5523 100644
--- a/docs/knowledge-module/1-ap.html
+++ b/docs/knowledge-module/1-ap.html
@@ -392,7 +392,7 @@ interpret no indication of a kind as meaning "object".
nonlocal_variable *q = NonlocalVariables::new_global(NW, K);current_interpretation_as_infs[v] = NULL;current_interpretation_as_spec[v] = Lvalues::new_actual_NONLOCAL_VARIABLE(q);
-if (is_a_const) NonlocalVariables::make_constant(q, FALSE);
+if (is_a_const) NonlocalVariables::make_constant(q, FALSE); } else {instance *nc = Instances::new(NW, K);current_interpretation_as_infs[v] = Instances::as_subject(nc);
@@ -625,7 +625,7 @@ but just in case.
if (Node::is(spec, NONLOCAL_VARIABLE_NT)) {inference_subject *diversion =
-NonlocalVariables::get_alias(Node::get_constant_nonlocal_variable(spec));
+NonlocalVariables::get_alias(Node::get_constant_nonlocal_variable(spec));if (diversion) returndiversion; }
diff --git a/docs/knowledge-module/2-nv.html b/docs/knowledge-module/2-nv.html
index d03e5517b..96da8073e 100644
--- a/docs/knowledge-module/2-nv.html
+++ b/docs/knowledge-module/2-nv.html
@@ -94,7 +94,7 @@ These variables are created by assertion sentences.
These semantics are so different that it makes no compelling sense to try to
give them a common implementation inside the compiler; so, nonlocal variables
are handled below, but local variables have a different implementation at
-Local Variables (in imperative).
+Local Variables (in imperative).
A pragmatic, but questionable,2 implementation decision by Inform is that
@@ -116,7 +116,7 @@ closer to global variables than to literals such as structwordingname; text of the namestructkind *nlv_kind; what kind of value it holds
-structstacked_variable *scope; where it exists, or NULL for everywhere
+structshared_variable *scope; where it exists, or NULL for everywherestructinference_subject *as_subject; so that assertions can discuss it...structinference_subject *alias_subject; ...or perhaps the thing it aliases
@@ -143,14 +143,14 @@ reference to how it's stored at run-time.
Note that we only register the name of the variable as a proper noun if it's
global and will live forever, because nouns are both of those things. Anyone
-creating a stacked variable will have to make their own arrangements to parse
+creating a shared variable will have to make their own arrangements to parse
the names of them.
nonlocal_variable *NonlocalVariables::new_global(wordingW, kind *K) {PROTECTED_MODEL_PROCEDURE;
-nonlocal_variable *nlv = NonlocalVariables::new(W, K, NULL);
+nonlocal_variable *nlv = NonlocalVariables::new(W, K, NULL);if (Wordings::nonempty(nlv->name)) {Nouns::new_proper_noun(nlv->name, NEUTER_GENDER, ADD_TO_LEXICON_NTOPT,VARIABLE_MC, Lvalues::new_actual_NONLOCAL_VARIABLE(nlv),
@@ -164,7 +164,7 @@ only match globals, since variables of lesser scope are not in the lexicon.
-nonlocal_variable *NonlocalVariables::parse_global(wordingW) {
+nonlocal_variable *NonlocalVariables::parse_global(wordingW) {W = Articles::remove_the(W);if (<s-global-variable>(W)) {parse_node *val = <<rp>>;
@@ -173,18 +173,7 @@ only match globals, since variables of lesser scope are not in the lexicon.
returnNULL;}
-
§4. This one is unprotected, that is, can be called outside of asserting some
-proposition; that's because variables with a finite lifetime are not part
-of the model, since they do not exist at the start of play.
-
@@ -193,10 +182,10 @@ of the model, since they do not exist at the start of play.
returnlatest_nonlocal_variable;}
-nonlocal_variable *NonlocalVariables::new(wordingW, kind *K, stacked_variable *scope) {
+nonlocal_variable *NonlocalVariables::new(wordingW, kind *K, shared_variable *shv) {if (K == NULL) internal_error("created variable without kind");if (Kinds::Behaviour::definite(K) == FALSE)
-Issue problem message for an indefinite variable5.1;
+Issue problem message for an indefinite variable4.1;nonlocal_variable *nlv = CREATE(nonlocal_variable);latest_nonlocal_variable = nlv;
@@ -207,7 +196,7 @@ of the model, since they do not exist at the start of play.
nlv->alias_subject = NULL;nlv->constant_at_run_time = FALSE;nlv->var_is_allowed_to_be_zero = FALSE;
-nlv->scope = scope;
+nlv->scope = shv;nlv->substitution_marker = 0;nlv->as_subject = VariableSubjects::new(nlv);nlv->compilation_data = RTVariables::new_compilation_data();
@@ -219,7 +208,7 @@ of the model, since they do not exist at the start of play.
returnnlv;}
-
§5.1. Issue problem message for an indefinite variable5.1 =
+
§4.1. Issue problem message for an indefinite variable4.1 =
@@ -235,13 +224,13 @@ of the model, since they do not exist at the start of play.
"is a list of numbers that varies' would be better.");Problems::issue_problem_end();
§5. So much for creation; and here's how we log and write them:
voidNonlocalVariables::log(nonlocal_variable *nlv) {
-NonlocalVariables::write(DL, nlv);
+NonlocalVariables::write(DL, nlv);}voidNonlocalVariables::write(OUTPUT_STREAM, nonlocal_variable *nlv) {
@@ -250,7 +239,7 @@ of the model, since they do not exist at the start of play.
Kinds::Textual::write(OUT, nlv->nlv_kind);}
-
§7. The author can demand with a "translates as" sentence that a given
+
§6. The author can demand with a "translates as" sentence that a given
variable is equivalent to an Inter variable supplied in some kit:
@@ -274,16 +263,16 @@ variable is equivalent to an Inter variable supplied in some kit:
Wordings::first_wn(Node::get_text(p2)));}
-
§8. Nonlocal variables are inference subjects in order that they can be given
+
§7. Nonlocal variables are inference subjects in order that they can be given
initial values by inference: see Variable Subjects for more.
§10. The kind can in fact be changed after creation, though this never happens
+
§9. The kind can in fact be changed after creation, though this never happens
to variables declared in source text: it allows us to have a few globals which
are reused for different purposes and are typeless.
@@ -312,14 +301,14 @@ are reused for different purposes and are typeless.
nlv->nlv_kind = K;}
-
§11. This is a curiosity, used to force the textual contents of a bibliographic
+
§10. This is a curiosity, used to force the textual contents of a bibliographic
data variable (such as "story title") to be treated as text.
wordingNonlocalVariables::initial_value_as_plain_text(nonlocal_variable *nlv) {inference *inf;
-inference_subject *infs = NonlocalVariables::to_subject(nlv);
+inference_subject *infs = NonlocalVariables::to_subject(nlv);POSITIVE_KNOWLEDGE_LOOP(inf, infs, property_inf)if (PropertyInferences::get_property(inf) == P_variable_initial_value)returnNode::get_text(
@@ -327,7 +316,7 @@ data variable (such as "story title") to be treated as text.
returnEMPTY_WORDING;}
-
§12. "Constant" means that no change is permitted at run-time; "initialisable"
+
§11. "Constant" means that no change is permitted at run-time; "initialisable"
means that a value can be set by an assertion in the source text.
@@ -355,7 +344,7 @@ means that a value can be set by an assertion in the source text.
returnFALSE;}
-
§13. Substitution is the down-side if handling constants as if they were variables.
+
§12. Substitution is the down-side if handling constants as if they were variables.
At some point, the constant has to be replaced by its value, and this is where.
Note that it's easy to imagine a chain of constants defined each as being
equal to the next, but that a cycle of those is illegal.
@@ -391,7 +380,7 @@ equal to the next, but that a cycle of those is illegal.
returnspec;}
-
§14. "Aliasing" is the ability to divert inferences about a variable to
+
§13. "Aliasing" is the ability to divert inferences about a variable to
inferences about something else. Inform uses this for interactive fiction
projects with "the player"; authors tend to think "the player" is an instance
and they write assertions accordingly, but in fact it's a variable. Because
diff --git a/docs/knowledge-module/4-is.html b/docs/knowledge-module/4-is.html
index 774b914fd..2230b8015 100644
--- a/docs/knowledge-module/4-is.html
+++ b/docs/knowledge-module/4-is.html
@@ -378,7 +378,7 @@ kinds and instances.
inference *VariableSubjects::get_initial_value_inference(nonlocal_variable *nlv) {if (nlv) {
-inference_subject *infs = NonlocalVariables::to_subject(nlv);
+inference_subject *infs = NonlocalVariables::to_subject(nlv);inference *inf;POSITIVE_KNOWLEDGE_LOOP(inf, infs, property_inf)if (PropertyInferences::get_property(inf) == P_variable_initial_value)
@@ -136,7 +136,7 @@ about the same subject.
returnNULL;}
-parse_node *VariableSubjects::get_initial_value(nonlocal_variable *nlv) {
+parse_node *VariableSubjects::get_initial_value(nonlocal_variable *nlv) {inference *inf = VariableSubjects::get_initial_value_inference(nlv);if (inf) returnPropertyInferences::get_value(inf);returnSpecifications::new_UNKNOWN(EMPTY_WORDING);
@@ -188,7 +188,7 @@ is "room" would therefore be uncheckable at assertion time.
intmodel_checking_stage) {if (nlv == NULL) internal_error("tried to initialise null variable");
-kind *kind_as_declared = NonlocalVariables::kind(nlv);
+kind *kind_as_declared = NonlocalVariables::kind(nlv);kind *constant_kind = Specifications::to_kind(val);intoutcome = Kinds::compatible(constant_kind, kind_as_declared);
diff --git a/docs/knowledge-module/5-pi.html b/docs/knowledge-module/5-pi.html
index 2bd46918a..3d6ed2eef 100644
--- a/docs/knowledge-module/5-pi.html
+++ b/docs/knowledge-module/5-pi.html
@@ -238,7 +238,7 @@ and properties which store the state of certain relations.
-property *PropertyInferences::get_property(inference *i) {
+property *PropertyInferences::get_property(inference *i) {if (i->family != property_inf) returnNULL;property_inference_data *data = RETRIEVE_POINTER_property_inference_data(i->data);returndata->inferred_property;
@@ -255,7 +255,7 @@ the initial value property to be textual for certain bibliographic data.
-parse_node *PropertyInferences::set_value_kind(inference *i, kind *K) {
+parse_node *PropertyInferences::set_value_kind(inference *i, kind *K) {property_inference_data *data = RETRIEVE_POINTER_property_inference_data(i->data);Node::set_kind_of_value(data->inferred_property_value, K);returndata->inferred_property_value;
diff --git a/docs/runtime-module/2-cu.html b/docs/runtime-module/2-cu.html
index 9a2db2249..05c8250d2 100644
--- a/docs/runtime-module/2-cu.html
+++ b/docs/runtime-module/2-cu.html
@@ -182,7 +182,7 @@ but that's now easy, as we just have to read off the annotation made above &mdas
-compilation_unit *CompilationUnits::find(parse_node *from) {
+compilation_unit *CompilationUnits::find(parse_node *from) {if (from == NULL) returnNULL;returnNode::get_unit(from);}
diff --git a/docs/runtime-module/2-emt.html b/docs/runtime-module/2-emt.html
index 6d10ab504..1ce5d987d 100644
--- a/docs/runtime-module/2-emt.html
+++ b/docs/runtime-module/2-emt.html
@@ -84,7 +84,7 @@ function togglePopup(material_id) {
inter_tree *I7_generation_tree = NULL;
-inter_tree *Emit::tree(void) {
+inter_tree *Emit::tree(void) {returnI7_generation_tree;}
@@ -222,7 +222,7 @@ insert them into the Inter stream close to the top.
Produce::guard(Inter::Kind::new(Packaging::at(Emit::tree()), SID, TID, SUP, constructor, arity, operands, Produce::baseline(Packaging::at(Emit::tree())), NULL));}
-inter_symbol *Emit::variable(inter_name *name, kind *K, inter_tiv1, inter_tiv2, text_stream *rvalue) {
+inter_symbol *Emit::variable(inter_name *name, kind *K, inter_tiv1, inter_tiv2, text_stream *rvalue) {packaging_statesave = Packaging::enter_home_of(name);inter_symbol *var_name = Produce::define_symbol(name);inter_symbol *var_kind = Produce::kind_to_symbol(K);
@@ -531,7 +531,7 @@ insert them into the Inter stream close to the top.
Emit::array_iname_entry(Hierarchy::find(MAX_POSITIVE_NUMBER_HL));}
-voidEmit::array_generic_entry(inter_tival1, inter_tival2) {
+voidEmit::array_generic_entry(inter_tival1, inter_tival2) {if (current_A == NULL) internal_error("entry outside of inter array");Emit::add_entry(val1, val2);}
@@ -782,18 +782,18 @@ insert them into the Inter stream close to the top.
structpackaging_statesaved_PS;} ival_emission;
-ival_emissionEmit::begin_ival_emission(inter_name *iname) {
+ival_emissionEmit::begin_ival_emission(inter_name *iname) {ival_emissionIE;IE.emission_VH = Holsters::new(INTER_DATA_VHMODE);IE.saved_PS = Packaging::enter_home_of(iname);returnIE;}
-value_holster *Emit::ival_holster(ival_emission *IE) {
+value_holster *Emit::ival_holster(ival_emission *IE) {return &(IE->emission_VH);}
-voidEmit::end_ival_emission(ival_emission *IE, inter_ti *v1, inter_ti *v2) {
+voidEmit::end_ival_emission(ival_emission *IE, inter_ti *v1, inter_ti *v2) {Holsters::unholster_pair(&(IE->emission_VH), v1, v2);Packaging::exit(Emit::tree(), IE->saved_PS);}
diff --git a/docs/runtime-module/2-hrr.html b/docs/runtime-module/2-hrr.html
index 68f77f6ce..7c58d6dbf 100644
--- a/docs/runtime-module/2-hrr.html
+++ b/docs/runtime-module/2-hrr.html
@@ -1714,7 +1714,7 @@ function togglePopup(material_id) {
caseK_SCENE_XPACKAGE:returnKinds::Behaviour::package(K_scene);caseV_COMMAND_PROMPT_XPACKAGE:returnInterNames::location(
-RTVariables::iname(RTTemporaryVariables::command_prompt_variable()));
+RTVariables::iname(RTTemporaryVariables::command_prompt_variable())); }internal_error("unknown exotic package");returnNULL;
@@ -1723,11 +1723,11 @@ function togglePopup(material_id) {
§5. Suppose Inform is compiling code to represent this:
@@ -185,7 +185,7 @@ variables "new entry" and "L" with those kinds.
-voidIDCompilation::initialise_stack_frame_from_type_data(ph_stack_frame *phsf,
+voidIDCompilation::initialise_stack_frame_from_type_data(stack_frame *phsf,id_type_data *idtd, kind *kind_in_this_compilation, intfirst) {if (Kinds::get_construct(kind_in_this_compilation) != CON_phrase)internal_error("no function kind");
@@ -261,7 +261,7 @@ response to "requests". All other phrases are compiled just once.
voidIDCompilation::compile(id_body *idb, int *i, intmax_i,
-stacked_variable_access_list *legible, to_phrase_request *req, rule *R) {
+shared_variable_access_list *legible, to_phrase_request *req, rule *R) {if ((req) || (idb->compilation_data.at_least_one_compiled_form_needed)) {Routines::Compile::routine(idb, legible, req, R);if (idb->compilation_data.at_least_one_compiled_form_needed) {
diff --git a/docs/runtime-module/4-rart.html b/docs/runtime-module/4-rart.html
index 191b14ff2..978ccce13 100644
--- a/docs/runtime-module/4-rart.html
+++ b/docs/runtime-module/4-rart.html
@@ -2031,7 +2031,7 @@ whether or not $R(t_0<
packaging_statesave = Routines::begin(rname);
-ph_stack_frame *phsf = Frames::current_stack_frame();
+stack_frame *phsf = Frames::current_stack_frame();RTRelations::add_term_as_call_parameter(phsf, par1);RTRelations::add_term_as_call_parameter(phsf, par2);
@@ -2061,7 +2061,7 @@ matches the specific necessary kind of object if there is one.
-voidRTRelations::add_term_as_call_parameter(ph_stack_frame *phsf,
+voidRTRelations::add_term_as_call_parameter(stack_frame *phsf,bp_term_detailsbptd) {kind *K = BPTerms::kind(&bptd);kind *PK = K;
diff --git a/docs/runtime-module/4-rls.html b/docs/runtime-module/4-rls.html
index 3a5037c58..025b07965 100644
--- a/docs/runtime-module/4-rls.html
+++ b/docs/runtime-module/4-rls.html
@@ -108,9 +108,9 @@ function togglePopup(material_id) {
returnrcd;}
-ph_stack_frame *RTRules::stack_frame(rule *R) {
+stack_frame *RTRules::stack_frame(rule *R) {if ((R == NULL) || (R->defn_as_I7_source == NULL)) returnNULL;
-return &(R->defn_as_I7_source->body_of_defn->compilation_data.stack_frame);
+return &(R->defn_as_I7_source->body_of_defn->compilation_data.id_stack_frame);}voidRTRules::prepare_rule(imperative_defn *id, rule *R) {
@@ -862,16 +862,18 @@ code are the real outcome of the code in this section.
voidRTRules::rulebook_var_creators(void) {rulebook *B;LOOP_OVER(B, rulebook)
-if (StackedVariables::set_empty(B->my_variables) == FALSE)
-StackedVariables::compile_frame_creator(B->my_variables,
+if (SharedVariables::set_empty(B->my_variables) == FALSE) {
+SharedVariables::set_frame_creator(B->my_variables,RTRules::get_stv_creator_iname(B));
+RTVariables::compile_frame_creator(B->my_variables);
+ }if (global_compilation_settings.memory_economy_in_force == FALSE) {inter_name *iname = Hierarchy::find(RULEBOOK_VAR_CREATORS_HL);packaging_statesave = Emit::named_array_begin(iname, K_value);LOOP_OVER(B, rulebook) {
-if (StackedVariables::set_empty(B->my_variables)) Emit::array_numeric_entry(0);
-elseEmit::array_iname_entry(StackedVariables::frame_creator(B->my_variables));
+if (SharedVariables::set_empty(B->my_variables)) Emit::array_numeric_entry(0);
+elseEmit::array_iname_entry(SharedVariables::frame_creator(B->my_variables)); }Emit::array_numeric_entry(0);Emit::array_end(save);
@@ -895,7 +897,7 @@ code are the real outcome of the code in this section.
rulebook *B;LOOP_OVER(B, rulebook)
-if (StackedVariables::set_empty(B->my_variables) == FALSE) {
+if (SharedVariables::set_empty(B->my_variables) == FALSE) {Produce::inv_primitive(Emit::tree(), CASE_BIP);Produce::down(Emit::tree());Produce::val(Emit::tree(), K_value, LITERAL_IVAL, (inter_ti) (B->allocation_id));
diff --git a/docs/runtime-module/4-rsfk.html b/docs/runtime-module/4-rsfk.html
index 9d7824c9f..aa27bcd15 100644
--- a/docs/runtime-module/4-rsfk.html
+++ b/docs/runtime-module/4-rsfk.html
@@ -180,7 +180,7 @@ chosen), but no problem message has been issued about this, or
Holsters::to_val_mode(Emit::tree(), &VH);returnrv;}
-intRTKinds::compile_default_value_vh(value_holster *VH, kind *K,
+intRTKinds::compile_default_value_vh(value_holster *VH, kind *K,wordingW, char *storage_name) {if (Kinds::eq(K, K_value))"Value" is too vague to be the kind of a variable5.3;
@@ -476,10 +476,12 @@ data, not merely the pointer to them, which is a "deep copy".
if (Kinds::Constructors::uses_pointer_values(L)) {if (Kinds::Constructors::allow_word_as_pointer(L, R)) {
-pointer_allocation *pall =
-Frames::add_allocation(Kinds::base_construction(L),
-"*=-BlkValueCompare(*1, BlkValueCast(*##, *#2, *!2))==0");
-returnFrames::pall_get_expanded_schema(pall);
+local_block_value *pall =
+Frames::allocate_local_block_value(Kinds::base_construction(L));
+text_stream *promotion = Str::new();
+WRITE_TO(promotion, "*=-BlkValueCompare(*1, BlkValueCast(%S, *#2, *!2))==0",
+pall->to_refer->prototype);
+returnpromotion; } }
@@ -508,29 +510,6 @@ data, not merely the pointer to them, which is a "deep copy".
§10.
-intRTKinds::cast_call(OUTPUT_STREAM, kind *from, kind *to) {
-if (RTKinds::cast_possible(from, to)) {
-if (Str::len(Kinds::Behaviour::get_name_in_template_code(to)) == 0) {
-WRITE("(");
-returnTRUE;
- }
-if ((Kinds::FloatingPoint::uses_floating_point(from)) &&
- (Kinds::FloatingPoint::uses_floating_point(to))) {
-WRITE("(");
-returnTRUE;
- }
-WRITE("%S_to_%S(",
-Kinds::Behaviour::get_name_in_template_code(from),
-Kinds::Behaviour::get_name_in_template_code(to));
-if (Kinds::Behaviour::uses_pointer_values(to)) {
-Frames::compile_allocation(OUT, to);
-WRITE(",");
- }
-returnTRUE;
- }
-returnFALSE;
-}
-
intRTKinds::emit_cast_call(kind *from, kind *to, int *down) {if (RTKinds::cast_possible(from, to)) {if (Str::len(Kinds::Behaviour::get_name_in_template_code(to)) == 0) {
@@ -550,7 +529,7 @@ data, not merely the pointer to them, which is a "deep copy".
*down = TRUE;Produce::down(Emit::tree());if (Kinds::Behaviour::uses_pointer_values(to)) {
-Frames::emit_allocation(to);
+Frames::emit_new_local_value(to); }returnTRUE; }
@@ -1041,7 +1020,7 @@ list of 20 texts. For the cases above, it's always 1.
intstack_offset;} heap_allocation;
-heap_allocationRTKinds::make_heap_allocation(kind *K, intmultiplier,
+heap_allocationRTKinds::make_heap_allocation(kind *K, intmultiplier,intstack_offset) {if (Kinds::Behaviour::uses_pointer_values(K) == FALSE)internal_error("unable to allocate heap storage for this kind of value");
@@ -1059,7 +1038,7 @@ list of 20 texts. For the cases above, it's always 1.
returnha;}
-voidRTKinds::emit_heap_allocation(heap_allocationha) {
+voidRTKinds::emit_heap_allocation(heap_allocationha) {if (ha.stack_offset >= 0) {inter_name *iname = Hierarchy::find(BLKVALUECREATEONSTACK_HL);Produce::inv_call_iname(Emit::tree(), iname);
@@ -1086,7 +1065,7 @@ list of 20 texts. For the cases above, it's always 1.
defineBLK_FLAG_TRUNCMULT0x00000010
-voidRTKinds::emit_block_value_header(kind *K, intindividual, intsize) {
+voidRTKinds::emit_block_value_header(kind *K, intindividual, intsize) {if (individual == FALSE) Emit::array_numeric_entry(0);intn = 0, c = 1, w = 4;if (TargetVMs::is_16_bit(Task::vm())) w = 2;
@@ -1108,7 +1087,7 @@ each such kind, and needed at run-time.
-intRTKinds::base_represented_in_inter(kind *K) {
+intRTKinds::base_represented_in_inter(kind *K) {if ((Kinds::Behaviour::is_kind_of_kind(K) == FALSE) && (Kinds::is_proper_constructor(K) == FALSE) && (K != K_void) &&
@@ -1129,7 +1108,7 @@ each such kind, and needed at run-time.
defineMAX_KIND_ARITY32
-inter_name *RTKinds::iname(kind *K) {
+inter_name *RTKinds::iname(kind *K) {if (RTKinds::base_represented_in_inter(K) == FALSE) {kind_interaction *KI;LOOP_OVER(KI, kind_interaction)
@@ -1241,7 +1220,7 @@ each such kind, and needed at run-time.
-voidRTKinds::check_can_have_property(kind *K) {
+voidRTKinds::check_can_have_property(kind *K) {if (Kinds::Behaviour::is_object(K)) return;if (Kinds::Behaviour::definite(K) == FALSE) return;property *prn;
diff --git a/docs/runtime-module/4-rsp.html b/docs/runtime-module/4-rsp.html
index 4f4239285..de4c36552 100644
--- a/docs/runtime-module/4-rsp.html
+++ b/docs/runtime-module/4-rsp.html
@@ -82,7 +82,7 @@ that rule. This enables them to be manipulated or changed.
structrule *responding_rule; named rule in which this response occursintresponse_marker; 0 for A, 1 for B, and so on upstructtext_substitution *original_text;
-structph_stack_frame *original_stack_frame;
+structstack_frame *original_stack_frame;structinter_name *resp_iname;structinter_name *constant_iname;structpackage_request *resp_package;
@@ -140,7 +140,7 @@ but also (in most cases) a TX
response_message *Strings::response_cue(value_holster *VH, rule *owner, intmarker,
-wordingW, ph_stack_frame *phsf, intvia_I6) {
+wordingW, stack_frame *phsf, intvia_I6) {response_message *resp = CREATE(response_message);resp->original_stack_frame = Frames::boxed_frame(phsf);resp->responding_rule = owner;
@@ -545,7 +545,7 @@ divided up by the extensions containing the rules which produce them.
§7.
-ph_stack_frame *Strings::frame_for_response(response_message *resp) {
+stack_frame *Strings::frame_for_response(response_message *resp) {if (resp == NULL) returnNULL;returnresp->original_stack_frame;}
@@ -671,7 +671,7 @@ text needs to be printed in a particular way.
"some text as a response, then it can only occur once in its rule.");return; }
-ph_stack_frame *phsf = Frames::current_stack_frame();
+stack_frame *phsf = Frames::current_stack_frame();if (Holsters::data_acceptable(VH)) {intdowns = LocalVariables::emit_storage(phsf);response_message *resp =
diff --git a/docs/runtime-module/4-rtn.html b/docs/runtime-module/4-rtn.html
index 2d6bb9f0a..b04e31e45 100644
--- a/docs/runtime-module/4-rtn.html
+++ b/docs/runtime-module/4-rtn.html
@@ -89,7 +89,7 @@ already been set up, or not. Here's not:
-ph_stack_frame *currently_compiling_in_frame = NULL; the stack frame for this routine
+stack_frame *currently_compiling_in_frame = NULL; the stack frame for this routineintcurrently_compiling_nnp = FALSE; is this a nonphrasal stack frame we made ourselves?inter_package *currently_compiling_inter_block = NULL; where Inter is being emitted tointer_name *currently_compiling_iname = NULL; routine we end up with
@@ -108,7 +108,7 @@ pre-existing stack frame:
-voidRoutines::end(packaging_statesave) {
+voidRoutines::end(packaging_statesave) {kind *R_kind = LocalVariables::deduced_function_kind(currently_compiling_in_frame);inter_name *kernel_name = NULL, *public_name = currently_compiling_iname;
-if ((currently_compiling_in_frame->allocated_pointers) ||
+if ((Frames::uses_local_block_values(currently_compiling_in_frame)) || (currently_compiling_in_frame->no_formal_parameters_needed > 0))kernel_name = Produce::kernel(Emit::tree(), public_name);
@@ -185,7 +185,6 @@ did not.
inter_package *block_package = Produce::block(Emit::tree(), NULL, public_name);inter_symbol *I7RBLK_symbol = NULL;Compile I6 locals for the outer shell5.1.1;
-intNBV = 0;Compile some setup code to make ready for the kernel5.1.2;Compile a call to the kernel5.1.3;Compile some teardown code now that the kernel has finished5.1.4;
@@ -218,23 +217,11 @@ after the call parameters, and is used only as a scratch variable.
§5.1.5. Compile a return from the outer shell5.1.5 =
diff --git a/docs/runtime-module/4-ts.html b/docs/runtime-module/4-ts.html
index 6026a6943..277a12c5c 100644
--- a/docs/runtime-module/4-ts.html
+++ b/docs/runtime-module/4-ts.html
@@ -93,7 +93,7 @@ don't exist, and ignore them until they come up later.
intresponding_to_marker;structparse_node *sentence_using_this; where this occurs in sourceintlocal_names_existed_at_usage_time; remember in case of problems
-structph_stack_frame *parked_stack_frame; for cases where possible
+structstack_frame *parked_stack_frame; for cases where possiblestructinter_name *ts_iname; the I6 array for thisstructinter_name *ts_routine_iname; the routine to implement itintts_sb_needed; reference copy of small block needed as a constant?
@@ -137,7 +137,7 @@ to the same routines to print them.
text_substitution *Strings::TextSubstitutions::new_text_substitution(wordingW,
-ph_stack_frame *phsf, rule *R, intmarker, package_request *P) {
+stack_frame *phsf, rule *R, intmarker, package_request *P) {text_substitution *ts = CREATE(text_substitution);if (no_further_text_subs) Panic, because it is really too late4.1;ts->unsubstituted_text = Wordings::first_word(W);
@@ -146,7 +146,7 @@ to the same routines to print them.
if (R) {ts->parked_stack_frame = NULL; } else {
-ph_stack_framenew_frame = Frames::new();
+stack_framenew_frame = Frames::new();ts->parked_stack_frame = Frames::boxed_frame(&new_frame);if (phsf) LocalVariables::copy(ts->parked_stack_frame, phsf); }
@@ -215,7 +215,7 @@ that routine later. This appearance of the routine name is called the "cue".
if (adopted_rule_for_compilation) {Rules::log(adopted_rule_for_compilation); }
-ph_stack_frame *phsf = NULL;
+stack_frame *phsf = NULL;if (adopted_rule_for_compilation) {Write the actual cue7.1; } else {
@@ -227,7 +227,7 @@ that routine later. This appearance of the routine name is called the "cue".
phsf = Frames::boxed_frame(phsf);Produce::inv_call_iname(Emit::tree(), Hierarchy::find(TEXT_TY_EXPANDIFPERISHABLE_HL));Produce::down(Emit::tree());
-Frames::emit_allocation(K_text);
+Frames::emit_new_local_value(K_text); }text_substitution *ts = Strings::TextSubstitutions::new_text_substitution(W, phsf,adopted_rule_for_compilation, adopted_marker_for_compilation, Emit::current_enclosure());
@@ -361,7 +361,7 @@ compiling it.
current_ts_being_compiled = ts;ts->tr_done_already = TRUE;packaging_statesave = Routines::begin(ts->ts_routine_iname);
-ph_stack_frame *phsf = ts->parked_stack_frame;
+stack_frame *phsf = ts->parked_stack_frame;if ((ts->responding_to_rule) && (ts->responding_to_marker >= 0)) {response_message *resp = Rules::get_response(ts->responding_to_rule, ts->responding_to_marker);
diff --git a/docs/runtime-module/4-vrb.html b/docs/runtime-module/4-vrb.html
index 7b2c13a77..1a361f01a 100644
--- a/docs/runtime-module/4-vrb.html
+++ b/docs/runtime-module/4-vrb.html
@@ -200,7 +200,7 @@ run-time locations to any variable without them:
§7. The following routine compiles the correct initial value for the given
variable. If it has no known initial value, it is given the initial
value for its kind where possible: note that this may not be possible
if the source text says something like
@@ -383,24 +474,24 @@ which makes its kind safe. Hence the error messages.
diff --git a/docs/runtime-module/5-ts.html b/docs/runtime-module/5-ts.html
index 99ed03605..687f09845 100644
--- a/docs/runtime-module/5-ts.html
+++ b/docs/runtime-module/5-ts.html
@@ -80,7 +80,7 @@
Hierarchy::make_available(Emit::tree(), iname);if (VariableSubjects::has_initial_value_set(max_score_VAR)) {inter_tiv1 = 0, v2 = 0;
-RTVariables::seek_initial_value(iname, &v1, &v2, max_score_VAR);
+RTVariables::seek_initial_value(iname, &v1, &v2, max_score_VAR);Emit::named_generic_constant(iname, v1, v2); } else {Emit::named_numeric_constant(iname, 0);
diff --git a/docs/values-module/4-teav.html b/docs/values-module/4-teav.html
index 2a25b9e60..25ad1a27e 100644
--- a/docs/values-module/4-teav.html
+++ b/docs/values-module/4-teav.html
@@ -455,7 +455,7 @@ membership, which is to say, not really a difference at all.
§13. Variables. Internally there
are three sources of these: locals, defined by "let" or "repeat" phrases;
-stacked variables, which belong to rulebooks, actions or activities; and
+shared variables, which belong to rulebooks, actions or activities; and
global variables. The narrower in scope take priority over the broader: so
if there are both local and global variables called "grand total", then
the text "grand total" is parsed as the local.
@@ -496,13 +496,13 @@ the text "grand total" is parsed as the local.
<s-stacked-variable>internal{
-ph_stack_frame *phsf = Frames::current_stack_frame();
+stack_frame *phsf = Frames::current_stack_frame();if (phsf == NULL) { ==> { failnonterminal }; }
-stacked_variable *stv = StackedVariables::parse_from_access_list(
-Frames::get_stvol(), W);
+shared_variable *stv = SharedVariables::parse_from_access_list(
+Frames::get_shared_variable_access_list(), W);if (stv) {parse_node *spec = Lvalues::new_actual_NONLOCAL_VARIABLE(
-StackedVariables::get_variable(stv));
+SharedVariables::get_variable(stv)); ==> { -, spec }; returnTRUE; } ==> { failnonterminal };
diff --git a/inform7/Figures/memory-diagnostics.txt b/inform7/Figures/memory-diagnostics.txt
index a747655e6..ef20b60e9 100644
--- a/inform7/Figures/memory-diagnostics.txt
+++ b/inform7/Figures/memory-diagnostics.txt
@@ -1,12 +1,12 @@
-Total memory consumption was 266400K = 260 MB
+Total memory consumption was 269600K = 263 MB
-63.6% was used for 1349327 objects, in 294037 frames in 212 x 800K = 169600K = 165 MB:
+64.0% was used for 1354657 objects, in 299367 frames in 216 x 800K = 172800K = 168 MB:
- 9.5% inter_tree_node_array 36 x 8192 = 294912 objects, 25953408 bytes
- 5.3% text_stream_array 2583 x 100 = 258300 objects, 14547456 bytes
- 4.1% linked_list 20385 objects, 11415600 bytes
+ 9.4% inter_tree_node_array 36 x 8192 = 294912 objects, 25953408 bytes
+ 5.2% text_stream_array 2583 x 100 = 258300 objects, 14547456 bytes
+ 5.2% linked_list 25715 objects, 14400400 bytes
3.7% parse_node 129371 objects, 10349680 bytes
- 2.7% verb_conjugation 160 objects, 7425280 bytes
+ 2.6% verb_conjugation 160 objects, 7425280 bytes
2.5% parse_node_annotation_array 431 x 500 = 215500 objects, 6909792 bytes
2.2% inter_symbol_array 69 x 1024 = 70656 objects, 6219936 bytes
1.1% pcalc_prop_array 24 x 1000 = 24000 objects, 3264768 bytes
@@ -65,7 +65,7 @@ Total memory consumption was 266400K = 260 MB
---- actions_rcd_data 1880 objects, 60160 bytes
---- command_grammar 130 objects, 58240 bytes
---- pcalc_func_array 1 x 1000 objects, 56032 bytes
- ---- ph_stack_frame_box 577 objects, 55392 bytes
+ ---- stack_frame_box 577 objects, 55392 bytes
---- kind_constructor 77 objects, 54824 bytes
---- cg_token 603 objects, 53064 bytes
---- property_inference_data 1315 objects, 52600 bytes
@@ -82,9 +82,9 @@ Total memory consumption was 266400K = 260 MB
---- regions_data 670 objects, 32160 bytes
---- HTML_tag_array 1 x 1000 objects, 32032 bytes
---- property_permission 96 objects, 30720 bytes
- ---- stacked_variable_access_list_array 9 x 100 = 900 objects, 29088 bytes
+ ---- shared_variable_access_list_array 9 x 100 = 900 objects, 29088 bytes
---- verb_sense 403 objects, 29016 bytes
- ---- stacked_variable_set_array 6 x 100 = 600 objects, 28992 bytes
+ ---- shared_variable_set_array 6 x 100 = 600 objects, 28992 bytes
---- heading 198 objects, 28512 bytes
---- action_pattern_array 7 x 100 = 700 objects, 28224 bytes
---- counting_data 670 objects, 26800 bytes
@@ -113,7 +113,7 @@ Total memory consumption was 266400K = 260 MB
---- equation_node 68 objects, 7616 bytes
---- understanding_item_array 3 x 100 = 300 objects, 7296 bytes
---- determiner 22 objects, 7216 bytes
- ---- stacked_variable_array 1 x 100 objects, 6432 bytes
+ ---- shared_variable_array 1 x 100 objects, 6432 bytes
---- uniqueness_count 260 objects, 6240 bytes
---- verb 108 objects, 6048 bytes
---- text_literal_holder 145 objects, 5800 bytes
@@ -166,94 +166,94 @@ Total memory consumption was 266400K = 260 MB
---- quantifier 16 objects, 1024 bytes
---- table_column 16 objects, 896 bytes
---- inbuild_requirement 22 objects, 880 bytes
- ---- control_structure_phrase 12 objects, 864 bytes
---- code_generation 1 object, 864 bytes
+ ---- control_structure_phrase 12 objects, 864 bytes
---- cached_understanding 21 objects, 840 bytes
---- runtime_kind_structure 13 objects, 832 bytes
---- phrase_option_array 1 x 100 objects, 824 bytes
- ---- target_vm 6 objects, 816 bytes
---- pipeline_stage 17 objects, 816 bytes
+ ---- target_vm 6 objects, 816 bytes
---- generated_segment 25 objects, 800 bytes
---- inter_data_type 14 objects, 784 bytes
---- submodule_identity 23 objects, 736 bytes
---- inform_language 6 objects, 672 bytes
- ---- relation_guard 5 objects, 640 bytes
---- I6T_intervention 8 objects, 640 bytes
---- inter_warehouse_room 10 objects, 640 bytes
+ ---- relation_guard 5 objects, 640 bytes
---- nascent_array 7 objects, 616 bytes
- ---- inbuild_search_result 15 objects, 600 bytes
---- named_rulebook_outcome 15 objects, 600 bytes
+ ---- inbuild_search_result 15 objects, 600 bytes
---- label_namespace 10 objects, 560 bytes
---- rulebook_outcome 17 objects, 544 bytes
---- small_word_set 11 objects, 528 bytes
- ---- inform_kit 5 objects, 520 bytes
---- implication 13 objects, 520 bytes
+ ---- inform_kit 5 objects, 520 bytes
---- inference_family 11 objects, 440 bytes
---- i6_memory_setting 13 objects, 416 bytes
---- equation 4 objects, 416 bytes
- ---- module_package 10 objects, 400 bytes
---- dval_written 10 objects, 400 bytes
- ---- bp_family 12 objects, 384 bytes
+ ---- module_package 10 objects, 400 bytes
---- article_usage 8 objects, 384 bytes
+ ---- bp_family 12 objects, 384 bytes
---- source_file 5 objects, 360 bytes
---- inbuild_genre 7 objects, 336 bytes
- ---- door_dir_notice 5 objects, 320 bytes
---- pronoun 8 objects, 320 bytes
+ ---- door_dir_notice 5 objects, 320 bytes
---- grammatical_category 8 objects, 320 bytes
---- up_family 9 objects, 288 bytes
---- build_step 4 objects, 288 bytes
- ---- explicit_bp_data 5 objects, 280 bytes
---- door_to_notice 5 objects, 280 bytes
+ ---- explicit_bp_data 5 objects, 280 bytes
---- inform_pipeline 4 objects, 256 bytes
---- verb_usage_tier 5 objects, 240 bytes
---- adjective_meaning_family 7 objects, 224 bytes
- ---- release_instructions 1 object, 208 bytes
---- test_scenario 1 object, 208 bytes
- ---- compilation_unit 5 objects, 200 bytes
+ ---- release_instructions 1 object, 208 bytes
---- build_skill 5 objects, 200 bytes
+ ---- compilation_unit 5 objects, 200 bytes
---- kit_dependency 4 objects, 192 bytes
---- plural_dictionary_entry 4 objects, 192 bytes
---- inform_project 1 object, 176 bytes
- ---- link_instruction 4 objects, 160 bytes
---- imperative_defn_family 4 objects, 160 bytes
---- inference_subject_family 5 objects, 160 bytes
- ---- pointer_allocation 2 objects, 160 bytes
---- inter_architecture 4 objects, 160 bytes
---- code_generation_target 4 objects, 160 bytes
- ---- element_activation 4 objects, 128 bytes
+ ---- link_instruction 4 objects, 160 bytes
---- codegen_pipeline 1 object, 128 bytes
+ ---- element_activation 4 objects, 128 bytes
---- inbuild_nest 3 objects, 120 bytes
+ ---- local_block_value 2 objects, 112 bytes
---- inform_kit_ittt 2 objects, 96 bytes
- ---- list_together_routine 2 objects, 80 bytes
---- article 2 objects, 80 bytes
+ ---- list_together_routine 2 objects, 80 bytes
---- compile_task_data 1 object, 80 bytes
- ---- build_methodology 1 object, 56 bytes
---- inter_warehouse 1 object, 56 bytes
+ ---- build_methodology 1 object, 56 bytes
---- HTML_file_state 1 object, 48 bytes
- ---- figures_data 1 object, 48 bytes
---- star_invention 1 object, 48 bytes
- ---- by_routine_bp_data 1 object, 40 bytes
- ---- parse_name_notice 1 object, 40 bytes
+ ---- figures_data 1 object, 48 bytes
---- loop_over_scope 1 object, 40 bytes
+ ---- by_routine_bp_data 1 object, 40 bytes
---- kind_template_definition 1 object, 40 bytes
+ ---- parse_name_notice 1 object, 40 bytes
-36.3% was used for memory not allocated for objects:
+35.9% was used for memory not allocated for objects:
- 15.4% text stream storage 42068616 bytes in 264534 claims
- 3.4% dictionary storage 9278976 bytes in 16372 claims
+ 15.2% text stream storage 42067784 bytes in 264528 claims
+ 3.3% dictionary storage 9278976 bytes in 16372 claims
---- sorting 992 bytes in 3 claims
2.6% source text 7200000 bytes in 3 claims
3.9% source text details 10800000 bytes in 2 claims
---- linguistic stock array 81920 bytes in 2 claims
---- small word set array 105600 bytes in 22 claims
0.8% inter symbols storage 2280320 bytes in 13937 claims
- 6.1% inter bytecode storage 16802820 bytes in 14 claims
- 3.2% inter links storage 8750208 bytes in 246 claims
+ 6.0% inter bytecode storage 16802820 bytes in 14 claims
+ 3.1% inter links storage 8750208 bytes in 246 claims
0.6% instance-of-kind counting 1695204 bytes in 1 claim
---- compilation workspace for objects 21856 bytes in 25 claims
---- lists for type-checking invocations 16000 bytes in 1 claim
---- emitter array storage 12320 bytes in 8 claims
---- code generation workspace for objects 9200 bytes in 9 claims
-20.6% was overhead - 56335712 bytes = 55015K = 53 MB
+20.5% was overhead - 56627760 bytes = 55300K = 54 MB
diff --git a/inform7/Figures/timings-diagnostics.txt b/inform7/Figures/timings-diagnostics.txt
index 6576fcb26..828c2ae2e 100644
--- a/inform7/Figures/timings-diagnostics.txt
+++ b/inform7/Figures/timings-diagnostics.txt
@@ -1,15 +1,16 @@
100.0% in inform7 run
- 66.7% in compilation to Inter
- 25.7% in //ImperativeDefinitions::compile_first_block//
- 8.0% in //PhraseRequests::compile_as_needed//
- 6.8% in //Strings::compile_responses//
- 6.2% in //InferenceSubjects::emit_all//
- 4.2% in //MajorNodes::pre_pass//
- 3.3% in //MajorNodes::pass_1//
+ 66.9% in compilation to Inter
+ 25.3% in //ImperativeDefinitions::compile_first_block//
+ 8.1% in //PhraseRequests::compile_as_needed//
+ 6.9% in //Strings::compile_responses//
+ 6.0% in //InferenceSubjects::emit_all//
+ 4.3% in //MajorNodes::pre_pass//
+ 3.4% in //MajorNodes::pass_1//
2.0% in //RTRules::RulePrintingRule_routine//
- 1.8% in //ImperativeDefinitions::assess_all//
1.8% in //RTRules::rulebooks_array_array//
- 1.1% in //RTVerbs::ConjugateVerb//
+ 1.7% in //ImperativeDefinitions::assess_all//
+ 0.9% in //RTVerbs::ConjugateVerb//
+ 0.3% in //CommandGrammars::prepare//
0.3% in //MajorNodes::pass_2//
0.3% in //RTRelations::compile_defined_relations//
0.3% in //RTRules::compile_rulebooks//
@@ -17,11 +18,10 @@
0.1% in //RTCommandGrammars::compile_all//
0.1% in //RTKinds::compile_data_type_support_routines//
0.1% in //Task::make_built_in_kind_constructors//
- 0.1% in //World::stages_II_and_III//
- 3.3% not specifically accounted for
- 30.8% in running Inter pipeline
- 9.9% in inter step 2/12: link
- 9.9% in step preparation
+ 3.6% not specifically accounted for
+ 30.6% in running Inter pipeline
+ 10.0% in step preparation
+ 9.8% in inter step 2/12: link
7.1% in inter step 12/12: generate inform6 -> auto.inf
0.3% in inter step 9/12: make-identifiers-unique
0.1% in inter step 10/12: reconcile-verbs
@@ -30,6 +30,6 @@
0.1% in inter step 6/12: assimilate
0.1% in inter step 7/12: resolve-external-symbols
0.1% in inter step 8/12: inspect-plugs
- 2.4% not specifically accounted for
+ 2.1% not specifically accounted for
2.0% in supervisor
0.4% not specifically accounted for
diff --git a/inform7/assertions-module/Chapter 5/Adjectival Definition Family.w b/inform7/assertions-module/Chapter 5/Adjectival Definition Family.w
index a25f245fe..aa207a65a 100644
--- a/inform7/assertions-module/Chapter 5/Adjectival Definition Family.w
+++ b/inform7/assertions-module/Chapter 5/Adjectival Definition Family.w
@@ -81,7 +81,7 @@ void AdjectivalDefinitionFamily::given_body(imperative_defn_family *self, impera
wording CALLW = EMPTY_WORDING;
kind *K = NULL;
Phrases::Phrasal::define_adjective_by_phrase(id->at, body, &CALLW, &K);
- LocalVariables::add_pronoun(&(body->compilation_data.stack_frame), CALLW, K);
+ LocalVariables::add_pronoun(&(body->compilation_data.id_stack_frame), CALLW, K);
}
diff --git a/inform7/assertions-module/Chapter 5/Imperative Definition Families.w b/inform7/assertions-module/Chapter 5/Imperative Definition Families.w
index 823ed01e1..2643987f4 100644
--- a/inform7/assertions-module/Chapter 5/Imperative Definition Families.w
+++ b/inform7/assertions-module/Chapter 5/Imperative Definition Families.w
@@ -110,7 +110,7 @@ VOID_METHOD_TYPE(TO_RCD_IMP_DEFN_MTID, imperative_defn_family *f, imperative_def
id_runtime_context_data ImperativeDefinitionFamilies::to_phrcd(imperative_defn *id) {
current_sentence = id->at;
- Frames::make_current(&(id->body_of_defn->compilation_data.stack_frame));
+ Frames::make_current(&(id->body_of_defn->compilation_data.id_stack_frame));
id_runtime_context_data phrcd = RuntimeContextData::new();
VOID_METHOD_CALL(id->family, TO_RCD_IMP_DEFN_MTID, id, &phrcd);
Frames::remove_current();
diff --git a/inform7/assertions-module/Chapter 5/Runtime Context Data.w b/inform7/assertions-module/Chapter 5/Runtime Context Data.w
index c11b0d96d..91ae8849e 100644
--- a/inform7/assertions-module/Chapter 5/Runtime Context Data.w
+++ b/inform7/assertions-module/Chapter 5/Runtime Context Data.w
@@ -181,10 +181,10 @@ void RuntimeContextData::ensure_avl(rule *R) {
parse_node *save_cs = current_sentence;
current_sentence = id->at;
- ph_stack_frame *phsf = &(idb->compilation_data.stack_frame);
+ stack_frame *phsf = &(idb->compilation_data.id_stack_frame);
Frames::make_current(phsf);
- Frames::set_stvol(phsf, R->variables_visible_in_definition);
+ Frames::set_shared_variable_access_list(phsf, R->variables_visible_in_definition);
rcd->avl = RuntimeContextData::parse_avl(rcd->activity_context);
current_sentence = save_cs;
}
diff --git a/inform7/assertions-module/Chapter 6/Activities.w b/inform7/assertions-module/Chapter 6/Activities.w
index 678612f15..60f8915fd 100644
--- a/inform7/assertions-module/Chapter 6/Activities.w
+++ b/inform7/assertions-module/Chapter 6/Activities.w
@@ -13,7 +13,7 @@ typedef struct activity {
struct rulebook *for_rules;
struct rulebook *after_rules;
struct kind *activity_on_what_kind; /* or null */
- struct stacked_variable_set *activity_variables; /* activity variables owned here */
+ struct shared_variable_set *activity_variables; /* activity variables owned here */
struct activity_indexing_data indexing_data;
struct activity_compilation_data compilation_data;
CLASS_DEFINITION
@@ -84,7 +84,7 @@ activity *Activities::new(kind *K, wording W) {
@;
- av->activity_variables = StackedVariables::new_set(10000+av->allocation_id);
+ av->activity_variables = SharedVariables::new_set(10000+av->allocation_id);
av->before_rules = Activities::make_rulebook(av, 0, future_action_flag);
av->for_rules = Activities::make_rulebook(av, 1, future_action_flag);
@@ -210,7 +210,7 @@ void Activities::add_variable(activity *av, parse_node *cnode) {
@;
@;
- StackedVariables::add_empty(av->activity_variables, VW, Specifications::to_kind(spec));
+ SharedVariables::new(av->activity_variables, VW, Specifications::to_kind(spec));
}
@ =
diff --git a/inform7/assertions-module/Chapter 6/Rulebooks.w b/inform7/assertions-module/Chapter 6/Rulebooks.w
index 528632df8..5fa96b776 100644
--- a/inform7/assertions-module/Chapter 6/Rulebooks.w
+++ b/inform7/assertions-module/Chapter 6/Rulebooks.w
@@ -31,8 +31,8 @@ typedef struct rulebook {
int runs_during_activities; /* allow "while..." clauses to name these */
int used_by_future_action_activity; /* like "deciding the scope of something..." */
- struct stacked_variable_set *my_variables; /* rulebook variables owned here */
- struct stacked_variable_access_list *accessible_variables; /* and which can be named here */
+ struct shared_variable_set *my_variables; /* rulebook variables owned here */
+ struct shared_variable_access_list *accessible_variables; /* and which can be named here */
struct rulebook_compilation_data compilation_data;
struct rulebook_indexing_data indexing_data;
@@ -62,9 +62,9 @@ rulebook *Rulebooks::new(kind *create_as, wording W, package_request *R) {
@;
- B->my_variables = StackedVariables::new_set(B->allocation_id);
- B->accessible_variables = StackedVariables::new_access_list();
- StackedVariables::add_set_to_access_list(B->accessible_variables, B->my_variables);
+ B->my_variables = SharedVariables::new_set(B->allocation_id);
+ B->accessible_variables = SharedVariables::new_access_list();
+ SharedVariables::add_set_to_access_list(B->accessible_variables, B->my_variables);
B->compilation_data = RTRules::new_rulebook_compilation_data(B, R);
B->indexing_data = IXRules::new_rulebook_indexing_data(B);
@@ -352,7 +352,7 @@ void Rulebooks::add_variable(rulebook *B, parse_node *cnode) {
@;
@;
- StackedVariables::add_empty(B->my_variables, W, K);
+ SharedVariables::new(B->my_variables, W, K);
}
@ =
@@ -449,8 +449,8 @@ defined somewhere else -- but they still don't belong to |B|, so they do not
go into |B->my_variables|.
=
-void Rulebooks::grant_access_to_variables(rulebook *B, stacked_variable_set *set) {
- StackedVariables::add_set_to_access_list(B->accessible_variables, set);
+void Rulebooks::grant_access_to_variables(rulebook *B, shared_variable_set *set) {
+ SharedVariables::add_set_to_access_list(B->accessible_variables, set);
}
@h Attaching and detaching rules.
diff --git a/inform7/assertions-module/Chapter 6/Rules.w b/inform7/assertions-module/Chapter 6/Rules.w
index fe49f5e33..8bf15a06a 100644
--- a/inform7/assertions-module/Chapter 6/Rules.w
+++ b/inform7/assertions-module/Chapter 6/Rules.w
@@ -33,7 +33,7 @@ typedef struct rule {
struct rulebook *kind_of_rule_set_from;
struct imperative_defn *defn_as_I7_source; /* if defined by an I7 id_body */
- struct stacked_variable_access_list *variables_visible_in_definition; /* if so */
+ struct shared_variable_access_list *variables_visible_in_definition; /* if so */
struct text_stream *defn_as_Inter_function; /* if not */
struct booking *automatic_booking; /* how this is placed in rulebooks */
@@ -76,7 +76,7 @@ rule *Rules::obtain(wording W, int allow_responses) {
R->kind_of_rule_set_from = NULL;
R->defn_as_I7_source = NULL;
- R->variables_visible_in_definition = StackedVariables::new_access_list();
+ R->variables_visible_in_definition = SharedVariables::new_access_list();
R->defn_as_Inter_function = NULL;
R->automatic_booking = NULL;
@@ -231,13 +231,13 @@ imperative_defn *Rules::get_imperative_definition(rule *R) {
return R->defn_as_I7_source;
}
-@ Inside such a definition, certain stacked variables may be in scope. For
+@ Inside such a definition, certain shared variables may be in scope. For
example, if a rule is in an activity rulebook, then it will be able to see
the variables belonging to that activity.
=
-void Rules::put_variables_in_scope(rule *R, stacked_variable_access_list *access) {
- StackedVariables::append_access_list(R->variables_visible_in_definition, access);
+void Rules::put_variables_in_scope(rule *R, shared_variable_access_list *access) {
+ SharedVariables::append_access_list(R->variables_visible_in_definition, access);
}
void Rules::put_action_variables_in_scope(rule *R) {
@@ -248,13 +248,13 @@ void Rules::put_action_variables_in_scope(rule *R) {
#endif
}
-struct stacked_variable_access_list *all_action_processing_vars = NULL;
+struct shared_variable_access_list *all_action_processing_vars = NULL;
-stacked_variable_access_list *Rules::all_action_processing_variables(void) {
+shared_variable_access_list *Rules::all_action_processing_variables(void) {
if (all_action_processing_vars == NULL) {
- all_action_processing_vars = StackedVariables::new_access_list();
+ all_action_processing_vars = SharedVariables::new_access_list();
rulebook *B = Rulebooks::std(ACTION_PROCESSING_RB);
- if (B) StackedVariables::add_set_to_access_list(all_action_processing_vars, B->my_variables);
+ if (B) SharedVariables::add_set_to_access_list(all_action_processing_vars, B->my_variables);
}
return all_action_processing_vars;
}
diff --git a/inform7/assertions-module/Chapter 8/Adjective Meanings.w b/inform7/assertions-module/Chapter 8/Adjective Meanings.w
index 2bec16204..83289c8bd 100644
--- a/inform7/assertions-module/Chapter 8/Adjective Meanings.w
+++ b/inform7/assertions-module/Chapter 8/Adjective Meanings.w
@@ -340,13 +340,13 @@ whether it is able to do this or not.
=
INT_METHOD_TYPE(GENERATE_IN_SUPPORT_FUNCTION_ADJM_MTID, adjective_meaning_family *f,
- adjective_meaning *am, int T, int emit_flag, ph_stack_frame *phsf)
+ adjective_meaning *am, int T, int emit_flag, stack_frame *phsf)
@ This dual behaviour means there are two function calls invoking it:
=
int AdjectiveMeanings::generate_in_support_function(adjective_meaning *am,
- int T, ph_stack_frame *phsf) {
+ int T, stack_frame *phsf) {
int rv = AdjectiveMeanings::nscg_inner(am, T, TRUE, phsf);
am->has_been_compiled_in_support_function = TRUE;
return rv;
@@ -357,7 +357,7 @@ int AdjectiveMeanings::can_generate_in_support_function(adjective_meaning *am, i
}
int AdjectiveMeanings::nscg_inner(adjective_meaning *am, int T, int emit_flag,
- ph_stack_frame *phsf) {
+ stack_frame *phsf) {
AdjectiveMeanings::prepare_schemas(am, T);
@