The Trunk: Compiler-ct.415.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Compiler-ct.415.mcz

commits-2
Nicolas Cellier uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-ct.415.mcz

==================== Summary ====================

Name: Compiler-ct.415
Author: ct
Time: 17 January 2020, 1:51:09.030813 pm
UUID: 8c7af075-6a3d-c54b-87a8-135580d7ec7c
Ancestors: Compiler-mt.413

Fixes a compiler bug that occured when sending a cascade to a block, caused by trouble with copies in Parser >> cascade. Each message of a cascade must be able to access the same instance of the cascadeReceiver in order to perform possible transformations. This bug is also tested in Tests-ct.425. Please revise carefully. Replaces Compiler-ct.414.

Furthermore, this commit refines the documentation of #blockExtent and fixes several spelling errors in the class comment of BlockNode (featuring Grammarly).

Thanks to Eliot & Nicolas for their support! For more information, see: http://forum.world.st/BUG-Cannot-compile-cascade-sent-to-block-td5108942.html

=============== Diff against Compiler-mt.413 ===============

Item was changed:
  ParseNode subclass: #BlockNode
  instanceVariableNames: 'arguments statements returns nArgsNode size temporaries optimized optimizedMessageNode actualScopeIfOptimized blockExtent remoteTempNode copiedValues closureCreationNode startOfLastStatement tempsMark'
  classVariableNames: ''
  poolDictionaries: ''
  category: 'Compiler-ParseNodes'!
 
+ !BlockNode commentStamp: 'ct 1/17/2020 13:05' prior: 0!
- !BlockNode commentStamp: 'eem 5/4/2017 17:26' prior: 0!
  I represent a bracketed block with 0 or more arguments and 1 or more statements. If I am initialized with no statements, I create one. I have a flag to tell whether my last statement returns a value from the enclosing method. I can emit for value in the usual way, in which case I create a BlockClosure to be evaluated by sending it value: at run time. Or I can emit code to be evaluated in line; this only happens at the top level of a method and in certain optimized control structures (see MessageNode class>>initialize MacroSelectors).
 
  Instance Variables
+     actualScopeIfOptimized:    <nil | BlockNode>
+     arguments:                    <SequencableCollection of: TempVariableNode>
+     blockExtent:                <nil | Interval>
+     closureCreationNode:        <LeafNode>
+     copiedValues:                <nil | (SequencableCollection of: TempVariableNode)>
+     nArgsNode:                    <nil | Integer>
+     optimized:                    <Boolean>
+     optimizedMessageNode:    <nil | MessageNode>
+     remoteTempNode:            <nil | RemoteTempVectorNode>
+     returns:                    <Boolean>
+     size:                        <nil | Integer>
+     startOfLastStatement:        <nil | Integer>
+     statements:                <SequencableCollection of: ParseNode>
+     temporaries:                <SequencableCollection of: TempVariableNode>
+     tempsMark:                    <nil | Integer>
- actualScopeIfOptimized: <nil | BlockNode>
- arguments: <SequencableCollection of: TempVariableNode>
- blockExtent: <nil | Interval>
- closureCreationNode: <LeafNode>
- copiedValues: <nil | (SequencableCollection of: TempVariableNode)>
- nArgsNode: <nil | Integer>
- optimized: <Boolean>
- optimizedMessageNode: <nil | MessageNode>
- remoteTempNode: <nil | RemoteTempVectorNode>
- returns: <Boolean>
- size: <nil | Integer>
- startOfLastStatement: <nil | Integer>
- statements: <SequencableCollection of: ParseNode>
- temporaries: <SequencableCollection of: TempVariableNode>
- tempsMark: <nil | Integer>
 
  actualScopeIfOptimized
+     - if the receiver has been inlined this is the non-optimized BlockNode the receiver is inlined into.
- - if the receiver has been inlined this is the non-optimized BlockNode the receiver is inlined into.
 
  arguments
+     - the sequence of arguments to the block (or method if a top-level block)
- - the sequence of arguments to the block (or method if a top-level block)
 
  blockExtent
+     - the interval defining the range of block scopes the receiver comprises, which is itself and any blocks it may contain.  See #analyseArguments:temporaries:rootNode:
- - the interval defining the range of block scopes the receiver comprises, which is itself and any blokcs it may contain.  See #analyseArguments:temporaries:rootNode:
 
  closureCreationNode
+     - a place-holder representing the body of the block.
- - a place-holder representing the body of the block.
 
  copiedValues
+     - blocks do not reference the temporary variables of their outer context they close over directly; instead, temporary variables which won't change value are collected and copied into the block, and temporary variables that are modified either within the block or after it has closed over the variables are allocated in a remote temp vector that again becomes one of the block's copied values.  In this way, a block refers to the outer temporaries it closes over only through copiedValues.  copiedValues is the sequence of these TempVariableNodes.
- - blocks do not reference the temporary variables of their outer context they cose over directly; instead temporary variables which won't change value are collected and copied into the block, and temporary variables that are modified either within the block or after it has closed over the variales are allocated in a remote temp vector that again becomes one of the block's copied values.  In this way, a block refers to the outer teporaries it closes over only throguh copiedValues.  copiedValues is the sequence of these TempVariableNodes.
 
  nArgsNode
+     - a place holder for the encoder to allow it to number block temporaries
- - a place holder for the encoder to allow it to number block temporaries
 
  optimized
+     - true if the receiver is inlined, false if a true block
- - true if the receiver is inlined, false if a true block
 
  optimizedMessageNode
+     - the MessageNode in which the receiver is optimized, if it is optimized.
- - the MessageNode in which the receiver is optimized, if it is optimized.
 
  remoteTempNode
+     - if any of the blocks nested into the receiver either modify a temp or access a temp that is modified after the block is created, then this temp is allocated remotely in a remote temp vector that allows the temp's location to be shared between blocks.  This is the node that creates the remote temp vector.
- - if any of the blocks nested into the receiver either modify a temp or access a temp that is modified after the block is created, then this temp is allocated remotely in a remote temp vector that allows the temp's location to be shared between blocks.  This is the node that creates the remote temp vector.
 
  returns
+     - true if the receiver contains a method return.
- - true if the receiver contains a method return.
 
  size
+     - the size of the block's bytecodes if it is generated by embedding its bytecodes within an enclosing CompiledMethod.
- - the size of the block's bytecodes if it is generated by embedding its bytecodes within an enclosing CompiledMethod.
 
  startOfLastStatement
+     - the index in the source of the start of the last statement in the block.
- - the index in the source of the start of the last statement in the block.
 
  statements
+     - the sequence of statements comprising the receiver
- - the sequence of statements comprising the receiver
 
  temporaries
+     - the sequence of temporaries (including the remoteTempNode if any) of block-local temporaries
- - the sequence of temporaries (including the remoteTempNode if any) of block-local temporaries
 
  tempsMark
+     - the index in the source of the last block-local temporary, used to auto-insert temps declared during compilation!
- - the index in the source of the last block-local temporary, used to auto-insert temps declared during compilation!

Item was changed:
  ----- Method: BlockNode>>blockExtent (in category 'closure analysis') -----
+ blockExtent "^<nil | Interval>"
- blockExtent "^<Interval>"
  ^blockExtent!

Item was changed:
  ----- Method: MessageNode>>receiver:arguments:precedence: (in category 'private') -----
  receiver: rcvr arguments: args precedence: p
 
  receiver := rcvr.
+ originalReceiver := rcvr.
- originalReceiver := rcvr copy.
  arguments := args.
  originalArguments := arguments copy.
  sizes := Array new: arguments size.
  precedence := p!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Compiler-ct.415.mcz

Christoph Thiede

Thank you Nicolas! :-)



Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Samstag, 18. Januar 2020 18:00 Uhr
An: [hidden email]; [hidden email]
Betreff: [squeak-dev] The Trunk: Compiler-ct.415.mcz
 
Nicolas Cellier uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-ct.415.mcz

==================== Summary ====================

Name: Compiler-ct.415
Author: ct
Time: 17 January 2020, 1:51:09.030813 pm
UUID: 8c7af075-6a3d-c54b-87a8-135580d7ec7c
Ancestors: Compiler-mt.413

Fixes a compiler bug that occured when sending a cascade to a block, caused by trouble with copies in Parser >> cascade. Each message of a cascade must be able to access the same instance of the cascadeReceiver in order to perform possible transformations. This bug is also tested in Tests-ct.425. Please revise carefully. Replaces Compiler-ct.414.

Furthermore, this commit refines the documentation of #blockExtent and fixes several spelling errors in the class comment of BlockNode (featuring Grammarly).

Thanks to Eliot & Nicolas for their support! For more information, see: http://forum.world.st/BUG-Cannot-compile-cascade-sent-to-block-td5108942.html

=============== Diff against Compiler-mt.413 ===============

Item was changed:
  ParseNode subclass: #BlockNode
         instanceVariableNames: 'arguments statements returns nArgsNode size temporaries optimized optimizedMessageNode actualScopeIfOptimized blockExtent remoteTempNode copiedValues closureCreationNode startOfLastStatement tempsMark'
         classVariableNames: ''
         poolDictionaries: ''
         category: 'Compiler-ParseNodes'!
 
+ !BlockNode commentStamp: 'ct 1/17/2020 13:05' prior: 0!
- !BlockNode commentStamp: 'eem 5/4/2017 17:26' prior: 0!
  I represent a bracketed block with 0 or more arguments and 1 or more statements. If I am initialized with no statements, I create one. I have a flag to tell whether my last statement returns a value from the enclosing method. I can emit for value in the usual way, in which case I create a BlockClosure to be evaluated by sending it value: at run time. Or I can emit code to be evaluated in line; this only happens at the top level of a method and in certain optimized control structures (see MessageNode class>>initialize MacroSelectors).
 
  Instance Variables
+     actualScopeIfOptimized:    <nil | BlockNode>
+     arguments:                    <SequencableCollection of: TempVariableNode>
+     blockExtent:                <nil | Interval>
+     closureCreationNode:        <LeafNode>
+     copiedValues:                <nil | (SequencableCollection of: TempVariableNode)>
+     nArgsNode:                    <nil | Integer>
+     optimized:                    <Boolean>
+     optimizedMessageNode:    <nil | MessageNode>
+     remoteTempNode:            <nil | RemoteTempVectorNode>
+     returns:                    <Boolean>
+     size:                        <nil | Integer>
+     startOfLastStatement:        <nil | Integer>
+     statements:                <SequencableCollection of: ParseNode>
+     temporaries:                <SequencableCollection of: TempVariableNode>
+     tempsMark:                    <nil | Integer>
-        actualScopeIfOptimized: <nil | BlockNode>
-        arguments:                                      <SequencableCollection of: TempVariableNode>
-        blockExtent:                            <nil | Interval>
-        closureCreationNode:            <LeafNode>
-        copiedValues:                           <nil | (SequencableCollection of: TempVariableNode)>
-        nArgsNode:                                      <nil | Integer>
-        optimized:                                      <Boolean>
-        optimizedMessageNode:   <nil | MessageNode>
-        remoteTempNode:                 <nil | RemoteTempVectorNode>
-        returns:                                        <Boolean>
-        size:                                           <nil | Integer>
-        startOfLastStatement:           <nil | Integer>
-        statements:                             <SequencableCollection of: ParseNode>
-        temporaries:                            <SequencableCollection of: TempVariableNode>
-        tempsMark:                                      <nil | Integer>
 
  actualScopeIfOptimized
+     - if the receiver has been inlined this is the non-optimized BlockNode the receiver is inlined into.
-        - if the receiver has been inlined this is the non-optimized BlockNode the receiver is inlined into.
 
  arguments
+     - the sequence of arguments to the block (or method if a top-level block)
-        - the sequence of arguments to the block (or method if a top-level block)
 
  blockExtent
+     - the interval defining the range of block scopes the receiver comprises, which is itself and any blocks it may contain.  See #analyseArguments:temporaries:rootNode:
-        - the interval defining the range of block scopes the receiver comprises, which is itself and any blokcs it may contain.  See #analyseArguments:temporaries:rootNode:
 
  closureCreationNode
+     - a place-holder representing the body of the block.
-        - a place-holder representing the body of the block.
 
  copiedValues
+     - blocks do not reference the temporary variables of their outer context they close over directly; instead, temporary variables which won't change value are collected and copied into the block, and temporary variables that are modified either within the block or after it has closed over the variables are allocated in a remote temp vector that again becomes one of the block's copied values.  In this way, a block refers to the outer temporaries it closes over only through copiedValues.  copiedValues is the sequence of these TempVariableNodes.
-        - blocks do not reference the temporary variables of their outer context they cose over directly; instead temporary variables which won't change value are collected and copied into the block, and temporary variables that are modified either within the block or after it has closed over the variales are allocated in a remote temp vector that again becomes one of the block's copied values.  In this way, a block refers to the outer teporaries it closes over only throguh copiedValues.  copiedValues is the sequence of these TempVariableNodes.
 
  nArgsNode
+     - a place holder for the encoder to allow it to number block temporaries
-        - a place holder for the encoder to allow it to number block temporaries
 
  optimized
+     - true if the receiver is inlined, false if a true block
-        - true if the receiver is inlined, false if a true block
 
  optimizedMessageNode
+     - the MessageNode in which the receiver is optimized, if it is optimized.
-        - the MessageNode in which the receiver is optimized, if it is optimized.
 
  remoteTempNode
+     - if any of the blocks nested into the receiver either modify a temp or access a temp that is modified after the block is created, then this temp is allocated remotely in a remote temp vector that allows the temp's location to be shared between blocks.  This is the node that creates the remote temp vector.
-        - if any of the blocks nested into the receiver either modify a temp or access a temp that is modified after the block is created, then this temp is allocated remotely in a remote temp vector that allows the temp's location to be shared between blocks.  This is the node that creates the remote temp vector.
 
  returns
+     - true if the receiver contains a method return.
-        - true if the receiver contains a method return.
 
  size
+     - the size of the block's bytecodes if it is generated by embedding its bytecodes within an enclosing CompiledMethod.
-        - the size of the block's bytecodes if it is generated by embedding its bytecodes within an enclosing CompiledMethod.
 
  startOfLastStatement
+     - the index in the source of the start of the last statement in the block.
-        - the index in the source of the start of the last statement in the block.
 
  statements
+     - the sequence of statements comprising the receiver
-        - the sequence of statements comprising the receiver
 
  temporaries
+     - the sequence of temporaries (including the remoteTempNode if any) of block-local temporaries
-        - the sequence of temporaries (including the remoteTempNode if any) of block-local temporaries
 
  tempsMark
+     - the index in the source of the last block-local temporary, used to auto-insert temps declared during compilation!
-        - the index in the source of the last block-local temporary, used to auto-insert temps declared during compilation!

Item was changed:
  ----- Method: BlockNode>>blockExtent (in category 'closure analysis') -----
+ blockExtent "^<nil | Interval>"
- blockExtent "^<Interval>"
         ^blockExtent!

Item was changed:
  ----- Method: MessageNode>>receiver:arguments:precedence: (in category 'private') -----
  receiver: rcvr arguments: args precedence: p
 
         receiver := rcvr.
+        originalReceiver := rcvr.
-        originalReceiver := rcvr copy.
         arguments := args.
         originalArguments := arguments copy.
         sizes := Array new: arguments size.
         precedence := p!




Carpe Squeak!