CVS difference for ais/ai-00147.txt

Differences between 1.13 and version 1.14
Log of other versions for file ais/ai-00147.txt

--- ais/ai-00147.txt	2002/10/29 20:24:56	1.13
+++ ais/ai-00147.txt	2002/12/04 23:43:36	1.14
@@ -1,4 +1,4 @@
-!standard 07.06    (21)                               02-10-23  AI95-00147/11
+!standard 07.06    (21)                               02-11-23  AI95-00147/12
 !class binding interpretation 96-06-06
 !status Amendment 200Y 02-10-23
 !status ARG Approved (with changes) 9-0-1  02-10-12
@@ -13,7 +13,7 @@
 !status received 96-06-06
 !priority High
 !difficulty Hard
-!subject Optimization of Controlled Types
+!subject Optimization of controlled types
 
 !summary
 
@@ -21,12 +21,12 @@
 Initialize and Finalize calls will happen as described in other
 paragraphs of the Standard.
 
-For non-limited controlled types, the implementation permission of
-RM-7.6(18-21) is extended.
+For nonlimited controlled types, the implementation permission of
+7.6(18-21) is extended.
 
 !question
 
-RM-7.6(18-21) give implementations permission to eliminate certain calls
+7.6(18-21) gives implementations permission to eliminate certain calls
 to Adjust and Finalize. The purpose of these rules is to allow greater
 efficiency than is implied by the canonical semantics of controlled
 types. However, it appears that these rules may not go far enough.
@@ -47,7 +47,7 @@
   begin
       X := something;        -- Finalize(X); Adjust(X);
       X := something_else;   -- Finalize(X); Adjust(X);
-      ... X.Comp             -- so that it isn't dead
+      ... X.Comp;            -- so that it isn't dead
   end;                       -- Finalize(X);
 
 The comments indicate the implicit calls, already taking advantage of
@@ -126,12 +126,12 @@
 
 Furthermore, an implementation is permitted to omit implicit
 Initialize, Adjust, and Finalize calls and associated assignment
-operations on an object of nonlimited controlled type if
+operations on an object of nonlimited controlled type provided that:
   a) any omitted Initialize call is not a call on a user-defined Initialize
      procedure, and
   b) any usage of the value of the object after the implicit Initialize or
      Adjust call and before any subsequent Finalize call on the object
-     does not have some effect on the external interactions of the program, and
+     does not change the external effect of the program, and
   c) after the omission of such calls and operations, any execution of
      the program that executes an Initialize or Adjust call on an object
      or initializes an object by an aggregate will also later execute a
@@ -155,21 +155,21 @@
 removal algorithms to work for controlled types, and for typical
 dead variable removal to work unless these objects are default
 initialized by a user-defined Initialize procedure. This latter
-exception is to allow locks to be performed by a paired Initialize
-Finalize pair, even if the type is non-limited.
+exception is to allow locks to be performed by an Initialize -
+Finalize pair, even if the type is nonlimited.
 
 !discussion
 
 The above examples show that the implicit calls can create a non-trivial
 overhead on the execution even when the existing Implementation Permission
-of RM-7.6. is applied. It is therefore worthwhile to consider extending the
+of 7.6 is applied. It is therefore worthwhile to consider extending the
 Implementation Permission even further.
 
 It is interesting to note that the declare block of the third example
 above is nothing but an Ada encoding of the canonical semantics of
-assignments as stated in RM 7.6(17), with the anonymous temporary
+assignments as stated in 7.6(17), with the anonymous temporary
 object being introduced as a named "temporary" object. In the case of
-the anonymous object, RM 7.6(21) allows the simplification asked for
+the anonymous object, 7.6(21) allows the simplification asked for
 in the question. It seems strange that the explicit introduction of
 the object in the code should make a significant difference in semantics.
 
@@ -210,16 +210,16 @@
 the side-effects of its Initialize and Finalize operations. (It is
 better to use Initialize for this purpose, rather than Finalize,
 because then the implementation has a better chance of optimizing away
-any finalization-related overhead.)  Therefore, 7.6(18-21) should
+any finalization-related overhead.) Therefore, 7.6(18-21) should
 certainly not be extended to apply to limited types in any way -- the
 Initialize and Finalize calls required by the canonical semantics
 should happen exactly (unless of course the compiler can prove that
-their side effects are irrelevant). For limited control types, we have
+their side effects are irrelevant). For limited controlled types, we have
 exactly one Initialize and exactly one Finalize call, making it
 possible to exploit the "once-only" semantics in the implementation of
 these operations.
 
-However, for non-limited types, the situation is somewhat different,
+However, for nonlimited types, the situation is somewhat different,
 since assignments cause additional Adjust and Finalize calls on an
 object; moreover, many Adjust calls may be applied to a value as it
 flows from object to object. By virtue of the existing implementation
@@ -235,7 +235,7 @@
 Conversely, it does make sense to weaken the canonical semantics for
 the benefit of important optimizations. We can do so by extending the
 permissions of 7.6(18-21) to Initialize/Finalize pairs and to
-Adjust/Finalize pairs for non-limited types in such a way that the
+Adjust/Finalize pairs for nonlimited types in such a way that the
 practical effect is merely more uncertainty over an already uncertain
 number of call pairs.
 
@@ -292,13 +292,13 @@
          X := then_something;   -- Finalize(X); Adjust(X);
       else
          X := else_something;   -- Finalize(X); Adjust(X);
-         ... X.Comp             -- so that it isn't dead
+         ... X.Comp;            -- so that it isn't dead
       end if;
       ...
 
 We would like to eliminate the first Adjust call and BOTH Finalize
-calls. As a group, they constitute the matching pairs. We cannot
-always eliminate single pairs. It is fairly easy to do in a compiler,
+calls. As a group, they constitute the matching operations. We cannot
+always eliminate pairs of operations. It is fairly easy to do in a compiler,
 but hard to describe in these terms in a language definition.
 
 The words in the !wording therefore capture the bounds of the
@@ -363,12 +363,12 @@
 
 Furthermore, an implementation is permitted to omit implicit
 Initialize, Adjust, and Finalize calls and associated assignment
-operations on an object of nonlimited controlled type if
+operations on an object of nonlimited controlled type provided that:
 @xbullet<any omitted Initialize call is not a call on a user-defined Initialize
 procedure, and>
 @xbullet<any usage of the value of the object after the implicit Initialize or
 Adjust call and before any subsequent Finalize call on the object
-does not have some effect on the external interactions of the program, and>
+does not change the external effect of the program, and>
 @xbullet<after the omission of such calls and operations, any execution of
 the program that executes an Initialize or Adjust call on an object
 or initializes an object by an @fa<aggregate> will also later execute a

Questions? Ask the ACAA Technical Agent