Changeset 153213 in webkit for trunk/Source/JavaScriptCore/dfg/DFGAbstractValue.cpp
- Timestamp:
- Jul 24, 2013, 9:02:13 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGAbstractValue.cpp
r153210 r153213 84 84 } 85 85 86 void AbstractValue::filter(Graph& graph, const StructureSet& other) 87 { 86 FiltrationResult AbstractValue::filter(Graph& graph, const StructureSet& other) 87 { 88 if (isClear()) 89 return FiltrationOK; 90 88 91 // FIXME: This could be optimized for the common case of m_type not 89 92 // having structures, array modes, or a specific value. … … 106 109 filterArrayModesByType(); 107 110 filterValueByType(); 108 normalizeClarity(); 109 110 checkConsistency(); 111 } 112 113 void AbstractValue::filterArrayModes(ArrayModes arrayModes) 111 return normalizeClarity(); 112 } 113 114 FiltrationResult AbstractValue::filterArrayModes(ArrayModes arrayModes) 114 115 { 115 116 ASSERT(arrayModes); 117 118 if (isClear()) 119 return FiltrationOK; 116 120 117 121 m_type &= SpecCell; 118 122 m_arrayModes &= arrayModes; 119 normalizeClarity(); 120 121 checkConsistency(); 122 } 123 124 void AbstractValue::filter(SpeculatedType type) 125 { 123 return normalizeClarity(); 124 } 125 126 FiltrationResult AbstractValue::filter(SpeculatedType type) 127 { 128 if (isClear()) 129 return FiltrationOK; 130 126 131 if (type == SpecTop) 127 return; 132 return isClear() ? Contradiction : FiltrationOK; 133 128 134 m_type &= type; 129 135 … … 136 142 filterArrayModesByType(); 137 143 filterValueByType(); 138 normalizeClarity(); 139 140 checkConsistency(); 144 return normalizeClarity(); 145 } 146 147 FiltrationResult AbstractValue::filterByValue(JSValue value) 148 { 149 FiltrationResult result = filter(speculationFromValue(value)); 150 if (m_type) 151 m_value = value; 152 return result; 141 153 } 142 154 … … 201 213 } 202 214 203 voidAbstractValue::normalizeClarity()215 FiltrationResult AbstractValue::normalizeClarity() 204 216 { 205 217 // It's useful to be able to quickly check if an abstract value is clear. 206 218 // This normalizes everything to make that easy. 207 219 208 if (shouldBeClear()) 220 FiltrationResult result; 221 222 if (shouldBeClear()) { 209 223 clear(); 224 result = Contradiction; 225 } else 226 result = FiltrationOK; 227 228 checkConsistency(); 229 230 return result; 210 231 } 211 232
Note:
See TracChangeset
for help on using the changeset viewer.