Ignore:
Timestamp:
Jan 22, 2013, 9:35:23 PM (13 years ago)
Author:
[email protected]
Message:

Convert CSE phase to not rely too much on NodeIndex
https://bugs.webkit.org/show_bug.cgi?id=107616

Reviewed by Geoffrey Garen.

  • Instead of looping over the graph (which assumes that you can simply loop over all nodes without considering blocks first) to reset node.replacement, do that in the loop that sets up relevantToOSR, just before running CSE on the block.


  • Instead of having a relevantToOSR bitvector indexed by NodeIndex, made NodeRelevantToOSR be a NodeFlag. We had exactly one bit left in NodeFlags, so I did some reshuffling to fit it in.
  • dfg/DFGCSEPhase.cpp:

(JSC::DFG::CSEPhase::CSEPhase):
(JSC::DFG::CSEPhase::eliminateIrrelevantPhantomChildren):
(JSC::DFG::CSEPhase::performNodeCSE):
(JSC::DFG::CSEPhase::performBlockCSE):
(CSEPhase):

  • dfg/DFGNodeFlags.h:

(DFG):

  • dfg/DFGNodeType.h:

(DFG):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGNodeFlags.h

    r137963 r140504  
    3737// Entries in the NodeType enum (below) are composed of an id, a result type (possibly none)
    3838// and some additional informative flags (must generate, is constant, etc).
    39 #define NodeResultMask              0xF
     39#define NodeResultMask              0x7
    4040#define NodeResultJS                0x1
    4141#define NodeResultNumber            0x2
     
    4444#define NodeResultStorage           0x5
    4545                               
    46 #define NodeMustGenerate           0x10 // set on nodes that have side effects, and may not trivially be removed by DCE.
    47 #define NodeHasVarArgs             0x20
    48 #define NodeClobbersWorld          0x40
    49 #define NodeMightClobber           0x80
     46#define NodeMustGenerate           0x08 // set on nodes that have side effects, and may not trivially be removed by DCE.
     47#define NodeHasVarArgs             0x10
     48#define NodeClobbersWorld          0x20
     49#define NodeMightClobber           0x40
    5050                               
    51 #define NodeBehaviorMask          0x300
    52 #define NodeMayOverflow           0x100
    53 #define NodeMayNegZero            0x200
     51#define NodeBehaviorMask          0x180
     52#define NodeMayOverflow           0x080
     53#define NodeMayNegZero            0x100
    5454                               
    55 #define NodeBackPropMask         0x7C00
     55#define NodeBackPropMask         0x3E00
    5656#define NodeUseBottom            0x0000
    57 #define NodeUsedAsNumber          0x400 // The result of this computation may be used in a context that observes fractional, or bigger-than-int32, results.
    58 #define NodeNeedsNegZero          0x800 // The result of this computation may be used in a context that observes -0.
    59 #define NodeUsedAsOther          0x1000 // The result of this computation may be used in a context that distinguishes between NaN and other things (like undefined).
     57#define NodeUsedAsNumber         0x0200 // The result of this computation may be used in a context that observes fractional, or bigger-than-int32, results.
     58#define NodeNeedsNegZero         0x0400 // The result of this computation may be used in a context that observes -0.
     59#define NodeUsedAsOther          0x0800 // The result of this computation may be used in a context that distinguishes between NaN and other things (like undefined).
    6060#define NodeUsedAsValue          (NodeUsedAsNumber | NodeNeedsNegZero | NodeUsedAsOther)
    61 #define NodeUsedAsInt            0x2000 // The result of this computation is known to be used in a context that prefers, but does not require, integer values.
    62 #define NodeUsedAsIntLocally     0x4000 // Same as NodeUsedAsInt, but within the same basic block.
     61#define NodeUsedAsInt            0x1000 // The result of this computation is known to be used in a context that prefers, but does not require, integer values.
     62#define NodeUsedAsIntLocally     0x2000 // Same as NodeUsedAsInt, but within the same basic block.
    6363
    64 #define NodeDoesNotExit          0x8000 // This flag is negated to make it natural for the default to be that a node does exit.
     64#define NodeDoesNotExit          0x4000 // This flag is negated to make it natural for the default to be that a node does exit.
     65
     66#define NodeRelevantToOSR        0x8000
    6567
    6668typedef uint16_t NodeFlags;
Note: See TracChangeset for help on using the changeset viewer.