Changeset 143955 in webkit for trunk/Source/JavaScriptCore/dfg/DFGVariableAccessData.h
- Timestamp:
- Feb 25, 2013, 12:23:55 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGVariableAccessData.h
r142544 r143955 47 47 , m_argumentAwarePrediction(SpecNone) 48 48 , m_flags(0) 49 , m_doubleFormatState(EmptyDoubleFormatState)50 49 , m_isCaptured(false) 50 , m_shouldNeverUnbox(false) 51 51 , m_isArgumentsAlias(false) 52 52 , m_structureCheckHoistingFailed(false) 53 , m_doubleFormatState(EmptyDoubleFormatState) 53 54 { 54 55 clearVotes(); … … 60 61 , m_argumentAwarePrediction(SpecNone) 61 62 , m_flags(0) 62 , m_doubleFormatState(EmptyDoubleFormatState)63 63 , m_isCaptured(isCaptured) 64 , m_shouldNeverUnbox(isCaptured) 64 65 , m_isArgumentsAlias(false) 65 66 , m_structureCheckHoistingFailed(false) 67 , m_doubleFormatState(EmptyDoubleFormatState) 66 68 { 67 69 clearVotes(); … … 81 83 bool mergeIsCaptured(bool isCaptured) 82 84 { 85 m_shouldNeverUnbox |= isCaptured; 83 86 bool newIsCaptured = m_isCaptured | isCaptured; 84 87 if (newIsCaptured == m_isCaptured) … … 91 94 { 92 95 return m_isCaptured; 96 } 97 98 bool mergeShouldNeverUnbox(bool shouldNeverUnbox) 99 { 100 bool newShouldNeverUnbox = m_shouldNeverUnbox | shouldNeverUnbox; 101 if (newShouldNeverUnbox == m_shouldNeverUnbox) 102 return false; 103 m_shouldNeverUnbox = newShouldNeverUnbox; 104 return true; 105 } 106 107 // Returns true if it would be unsound to store the value in an unboxed fashion. 108 // If this returns false, it simply means that it is sound to unbox; it doesn't 109 // mean that we have actually done so. 110 bool shouldNeverUnbox() 111 { 112 ASSERT(!(m_isCaptured && !m_shouldNeverUnbox)); 113 return m_shouldNeverUnbox; 114 } 115 116 // Returns true if we should be unboxing the value provided that the predictions 117 // and double format vote say so. This may return false even if shouldNeverUnbox() 118 // returns false, since this incorporates heuristics of profitability. 119 bool shouldUnboxIfPossible() 120 { 121 return !shouldNeverUnbox(); 93 122 } 94 123 … … 211 240 { 212 241 ASSERT(isRoot()); 213 return m_doubleFormatState == UsingDoubleFormat; 242 bool result = m_doubleFormatState == UsingDoubleFormat; 243 ASSERT(!(result && shouldNeverUnbox())); 244 ASSERT(!(result && isCaptured())); 245 return result; 214 246 } 215 247 … … 217 249 { 218 250 ASSERT(isRoot()); 251 252 if (operandIsArgument(local()) || shouldNeverUnbox()) 253 return DFG::mergeDoubleFormatState(m_doubleFormatState, NotUsingDoubleFormat); 219 254 220 255 if (m_doubleFormatState == CantUseDoubleFormat) … … 271 306 NodeFlags m_flags; 272 307 308 bool m_isCaptured; 309 bool m_shouldNeverUnbox; 310 bool m_isArgumentsAlias; 311 bool m_structureCheckHoistingFailed; 312 273 313 float m_votes[2]; // Used primarily for double voting but may be reused for other purposes. 274 314 DoubleFormatState m_doubleFormatState; 275 276 bool m_isCaptured;277 bool m_isArgumentsAlias;278 bool m_structureCheckHoistingFailed;279 315 }; 280 316
Note:
See TracChangeset
for help on using the changeset viewer.