Changeset 155497 in webkit for trunk/Source/JavaScriptCore/dfg/DFGNodeFlags.h
- Timestamp:
- Sep 10, 2013, 8:24:09 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGNodeFlags.h
r155482 r155497 38 38 // Entries in the NodeType enum (below) are composed of an id, a result type (possibly none) 39 39 // and some additional informative flags (must generate, is constant, etc). 40 #define NodeResultMask 0x741 #define NodeResultJS 0x142 #define NodeResultNumber 0x243 #define NodeResultInt32 0x344 #define NodeResultBoolean 0x445 #define NodeResultStorage 0x540 #define NodeResultMask 0x0007 41 #define NodeResultJS 0x0001 42 #define NodeResultNumber 0x0002 43 #define NodeResultInt32 0x0003 44 #define NodeResultBoolean 0x0004 45 #define NodeResultStorage 0x0005 46 46 47 #define NodeMustGenerate 0x08 // set on nodes that have side effects, and may not trivially be removed by DCE.48 #define NodeHasVarArgs 0x1049 #define NodeClobbersWorld 0x2050 #define NodeMightClobber 0x4047 #define NodeMustGenerate 0x0008 // set on nodes that have side effects, and may not trivially be removed by DCE. 48 #define NodeHasVarArgs 0x0010 49 #define NodeClobbersWorld 0x0020 50 #define NodeMightClobber 0x0040 51 51 52 #define NodeBehaviorMask 0x18053 #define NodeMayOverflow 0x08054 #define NodeMayNegZero 0x10052 #define NodeBehaviorMask 0x0180 53 #define NodeMayOverflow 0x0080 54 #define NodeMayNegZero 0x0100 55 55 56 #define NodeB ackPropMask 0x1E0057 #define Node UseBottom 0x000058 #define Node UsedAsNumber 0x0200 // The result of this computation may be used in a context that observes fractional, or bigger-than-int32, results.59 #define Node NeedsNegZero 0x0400 // The result of this computation may be used in a context that observes -0.60 #define Node UsedAsOther 0x0800 // The result of this computation may be used in a context that distinguishes between NaN and other things (like undefined).61 #define Node UsedAsValue (NodeUsedAsNumber | NodeNeedsNegZero | NodeUsedAsOther)62 #define Node UsedAsInt 0x1000 // The result of this computation is known to be used in a context that prefers, but does not require, integer values.56 #define NodeBytecodeBackPropMask 0x1E00 57 #define NodeBytecodeUseBottom 0x0000 58 #define NodeBytecodeUsesAsNumber 0x0200 // The result of this computation may be used in a context that observes fractional, or bigger-than-int32, results. 59 #define NodeBytecodeNeedsNegZero 0x0400 // The result of this computation may be used in a context that observes -0. 60 #define NodeBytecodeUsesAsOther 0x0800 // The result of this computation may be used in a context that distinguishes between NaN and other things (like undefined). 61 #define NodeBytecodeUsesAsValue (NodeBytecodeUsesAsNumber | NodeBytecodeNeedsNegZero | NodeBytecodeUsesAsOther) 62 #define NodeBytecodeUsesAsInt 0x1000 // The result of this computation is known to be used in a context that prefers, but does not require, integer values. 63 63 64 #define NodeArithFlagsMask (NodeBehaviorMask | NodeBackPropMask)64 #define NodeArithFlagsMask (NodeBehaviorMask | NodeBytecodeBackPropMask) 65 65 66 #define NodeDoesNotExit 0x2000 // This flag is negated to make it natural for the default to be that a node does exit.66 #define NodeDoesNotExit 0x2000 // This flag is negated to make it natural for the default to be that a node does exit. 67 67 68 #define NodeRelevantToOSR 0x400068 #define NodeRelevantToOSR 0x4000 69 69 70 #define NodeExitsForward 0x800070 #define NodeExitsForward 0x8000 71 71 72 72 typedef uint32_t NodeFlags; 73 73 74 static inline bool nodeUsedAsNumber(NodeFlags flags)74 static inline bool bytecodeUsesAsNumber(NodeFlags flags) 75 75 { 76 return !!(flags & Node UsedAsNumber);76 return !!(flags & NodeBytecodeUsesAsNumber); 77 77 } 78 78 79 static inline bool nodeCanTruncateInteger(NodeFlags flags)79 static inline bool bytecodeCanTruncateInteger(NodeFlags flags) 80 80 { 81 return ! nodeUsedAsNumber(flags);81 return !bytecodeUsesAsNumber(flags); 82 82 } 83 83 84 static inline bool nodeCanIgnoreNegativeZero(NodeFlags flags)84 static inline bool bytecodeCanIgnoreNegativeZero(NodeFlags flags) 85 85 { 86 return !(flags & Node NeedsNegZero);86 return !(flags & NodeBytecodeNeedsNegZero); 87 87 } 88 88 … … 92 92 } 93 93 94 static inline bool nodeMayNegZero(NodeFlags flags) 95 { 96 return !!(flags & NodeMayNegZero); 97 } 98 94 99 static inline bool nodeCanSpeculateInt32(NodeFlags flags) 95 100 { 96 if ( flags & NodeMayOverflow)97 return ! nodeUsedAsNumber(flags);101 if (nodeMayOverflow(flags)) 102 return !bytecodeUsesAsNumber(flags); 98 103 99 if ( flags & NodeMayNegZero)100 return nodeCanIgnoreNegativeZero(flags);104 if (nodeMayNegZero(flags)) 105 return bytecodeCanIgnoreNegativeZero(flags); 101 106 102 107 return true;
Note:
See TracChangeset
for help on using the changeset viewer.