1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-03 07:24:58 +03:00

Fix for Jira bug I7-2328

This commit is contained in:
Graham Nelson 2023-04-22 23:14:53 +01:00
parent 88a99eb932
commit a2c1274a39
3 changed files with 40 additions and 24 deletions

View file

@ -206,6 +206,15 @@ or if the Gestalt said that the VM didn't support this after all, no harm would
be done except for a slight slowdown.
</p>
<p class="commentary">At the suggestion of Adrian Welcker, the code below uses the new accelerated
function numbers 8 to 13 in place of the previously valid 2 to 7, which are new
in Glulx 3.1.3. This is a trade-off: it means they behave correctly if the
Inform 6 constant <span class="extract"><span class="extract-syntax">NUM_ATTR_BYTES</span></span> is altered &mdash; in effect, it's getting around
a bug in the previous Glulx spec &mdash; but on the other hand, these accelerated
functions do not exist in earlier Glulx implementations. However, takeup of
3.1.3 has been swift. (See Jira bug I7-2328 and I7-1162.)
</p>
<p class="commentary"><span class="named-paragraph-container code-font"><span class="named-paragraph-defn">Inject code at the top of FINAL_CODE_STARTUP_R</span><span class="named-paragraph-number">2.7</span></span><span class="comment-syntax"> =</span>
</p>
@ -226,12 +235,12 @@ be done except for a slight slowdown.
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"addr = #cpv__start;\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"@accelparam 8 addr;\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"@accelfunc 1 Z__Region;\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"@accelfunc 2 CP__Tab;\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"@accelfunc 3 RA__Pr;\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"@accelfunc 4 RL__Pr;\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"@accelfunc 5 OC__Cl;\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"@accelfunc 6 RV__Pr;\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"@accelfunc 7 OP__Pr;\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"@accelfunc 8 CP__Tab;\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"@accelfunc 9 RA__Pr;\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"@accelfunc 10 RL__Pr;\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"@accelfunc 11 OC__Cl;\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"@accelfunc 12 RV__Pr;\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"@accelfunc 13 OP__Pr;\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"#endif;\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"rfalse;\n"</span><span class="plain-syntax">);</span>
</pre>

View file

@ -1,7 +1,7 @@
100.0% in inform7 run
70.5% in compilation to Inter
50.3% in //Sequence::undertake_queued_tasks//
4.6% in //MajorNodes::pre_pass//
70.0% in compilation to Inter
49.4% in //Sequence::undertake_queued_tasks//
4.9% in //MajorNodes::pre_pass//
3.3% in //MajorNodes::pass_1//
1.7% in //ImperativeDefinitions::assess_all//
1.5% in //RTPhrasebook::compile_entries//
@ -9,25 +9,24 @@
1.1% in //Sequence::lint_inter//
0.5% in //MajorNodes::pass_2//
0.5% in //Sequence::undertake_queued_tasks//
0.5% in //Sequence::undertake_queued_tasks//
0.5% in //World::stage_V//
0.3% in //ImperativeDefinitions::compile_first_block//
0.3% in //Sequence::undertake_queued_tasks//
0.1% in //Closures::compile_closures//
0.1% in //CompletionModule::compile//
0.1% in //InferenceSubjects::emit_all//
0.1% in //RTKindConstructors::compile_permissions//
0.1% in //Task::make_built_in_kind_constructors//
2.8% not specifically accounted for
26.1% in running Inter pipeline
9.7% in step 14/15: generate inform6 -> auto.inf
5.8% in step 5/15: load-binary-kits
5.4% in step 6/15: make-synoptic-module
2.9% not specifically accounted for
26.3% in running Inter pipeline
10.2% in step 14/15: generate inform6 -> auto.inf
5.7% in step 5/15: load-binary-kits
5.5% in step 6/15: make-synoptic-module
1.7% in step 9/15: make-identifiers-unique
0.3% in step 12/15: eliminate-redundant-operations
0.3% in step 4/15: compile-splats
0.3% in step 7/15: shorten-wiring
0.3% in step 8/15: detect-indirect-calls
0.1% in step 11/15: eliminate-redundant-labels
1.5% not specifically accounted for
2.9% in supervisor
1.3% not specifically accounted for
3.1% in supervisor
0.4% not specifically accounted for

View file

@ -117,6 +117,14 @@ reimplements some of the veneer functions in "hardware". If it weren't here,
or if the Gestalt said that the VM didn't support this after all, no harm would
be done except for a slight slowdown.
At the suggestion of Adrian Welcker, the code below uses the new accelerated
function numbers 8 to 13 in place of the previously valid 2 to 7, which are new
in Glulx 3.1.3. This is a trade-off: it means they behave correctly if the
Inform 6 constant |NUM_ATTR_BYTES| is altered -- in effect, it's getting around
a bug in the previous Glulx spec -- but on the other hand, these accelerated
functions do not exist in earlier Glulx implementations. However, takeup of
3.1.3 has been swift. (See Jira bug I7-2328 and I7-1162.)
@<Inject code at the top of FINAL_CODE_STARTUP_R@> =
WRITE("#ifdef TARGET_GLULX;\n");
WRITE("@gestalt 9 0 res;\n");
@ -134,12 +142,12 @@ be done except for a slight slowdown.
WRITE("addr = #cpv__start;\n");
WRITE("@accelparam 8 addr;\n");
WRITE("@accelfunc 1 Z__Region;\n");
WRITE("@accelfunc 2 CP__Tab;\n");
WRITE("@accelfunc 3 RA__Pr;\n");
WRITE("@accelfunc 4 RL__Pr;\n");
WRITE("@accelfunc 5 OC__Cl;\n");
WRITE("@accelfunc 6 RV__Pr;\n");
WRITE("@accelfunc 7 OP__Pr;\n");
WRITE("@accelfunc 8 CP__Tab;\n");
WRITE("@accelfunc 9 RA__Pr;\n");
WRITE("@accelfunc 10 RL__Pr;\n");
WRITE("@accelfunc 11 OC__Cl;\n");
WRITE("@accelfunc 12 RV__Pr;\n");
WRITE("@accelfunc 13 OP__Pr;\n");
WRITE("#endif;\n");
WRITE("rfalse;\n");