Changeset 156747 in webkit for trunk/Source/JavaScriptCore/dfg/DFGVariableEvent.h
- Timestamp:
- Oct 1, 2013, 4:28:51 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGVariableEvent.h
r156511 r156747 62 62 MovHintEvent, 63 63 64 // A SetLocalEvent means that a node's value has actually been stored into the 65 // bytecode operand that it's associated with. 64 // A SetLocalEvent means that a node's value has been stored into the stack. 66 65 SetLocalEvent, 67 66 … … 105 104 #endif 106 105 VariableEvent event; 107 event.m_ id = id;108 event. u.gpr = gpr;106 event.m_which.id = id.bits(); 107 event.m_representation.gpr = gpr; 109 108 event.m_kind = kind; 110 109 event.m_dataFormat = dataFormat; … … 117 116 ASSERT(kind == BirthToFill || kind == Fill); 118 117 VariableEvent event; 119 event.m_ id = id;120 event. u.pair.tagGPR = tagGPR;121 event. u.pair.payloadGPR = payloadGPR;118 event.m_which.id = id.bits(); 119 event.m_representation.pair.tagGPR = tagGPR; 120 event.m_representation.pair.payloadGPR = payloadGPR; 122 121 event.m_kind = kind; 123 122 event.m_dataFormat = DataFormatJS; … … 130 129 ASSERT(kind == BirthToFill || kind == Fill); 131 130 VariableEvent event; 132 event.m_ id = id;133 event. u.fpr = fpr;131 event.m_which.id = id.bits(); 132 event.m_representation.fpr = fpr; 134 133 event.m_kind = kind; 135 134 event.m_dataFormat = DataFormatDouble; … … 141 140 ASSERT(kind == BirthToSpill || kind == Spill); 142 141 VariableEvent event; 143 event.m_ id = id;144 event. u.virtualReg = virtualRegister.offset();142 event.m_which.id = id.bits(); 143 event.m_representation.virtualReg = virtualRegister.offset(); 145 144 event.m_kind = kind; 146 145 event.m_dataFormat = format; … … 151 150 { 152 151 VariableEvent event; 153 event.m_ id = id;152 event.m_which.id = id.bits(); 154 153 event.m_kind = Death; 155 154 return event; 156 155 } 157 156 158 static VariableEvent setLocal(VirtualRegister virtualRegister, DataFormat format) 159 { 160 VariableEvent event; 161 event.u.virtualReg = virtualRegister.offset(); 157 static VariableEvent setLocal( 158 VirtualRegister bytecodeReg, VirtualRegister machineReg, DataFormat format) 159 { 160 VariableEvent event; 161 event.m_which.virtualReg = machineReg.offset(); 162 event.m_representation.virtualReg = bytecodeReg.offset(); 162 163 event.m_kind = SetLocalEvent; 163 164 event.m_dataFormat = format; … … 165 166 } 166 167 167 static VariableEvent movHint(MinifiedID id, int operand)168 { 169 VariableEvent event; 170 event.m_ id = id;171 event. u.virtualReg = operand;168 static VariableEvent movHint(MinifiedID id, VirtualRegister bytecodeReg) 169 { 170 VariableEvent event; 171 event.m_which.id = id.bits(); 172 event.m_representation.virtualReg = bytecodeReg.offset(); 172 173 event.m_kind = MovHintEvent; 173 174 return event; … … 184 185 || m_kind == BirthToSpill || m_kind == Spill 185 186 || m_kind == Death || m_kind == MovHintEvent); 186 return m_id;187 return MinifiedID::fromBits(m_which.id); 187 188 } 188 189 … … 203 204 ASSERT(!(m_dataFormat & DataFormatJS)); 204 205 #endif 205 return u.gpr;206 return m_representation.gpr; 206 207 } 207 208 … … 211 212 ASSERT(m_kind == BirthToFill || m_kind == Fill); 212 213 ASSERT(m_dataFormat & DataFormatJS); 213 return u.pair.tagGPR;214 return m_representation.pair.tagGPR; 214 215 } 215 216 MacroAssembler::RegisterID payloadGPR() const … … 217 218 ASSERT(m_kind == BirthToFill || m_kind == Fill); 218 219 ASSERT(m_dataFormat & DataFormatJS); 219 return u.pair.payloadGPR;220 return m_representation.pair.payloadGPR; 220 221 } 221 222 #endif // USE(JSVALUE32_64) … … 225 226 ASSERT(m_kind == BirthToFill || m_kind == Fill); 226 227 ASSERT(m_dataFormat == DataFormatDouble); 227 return u.fpr;228 } 229 230 VirtualRegister virtualRegister() const228 return m_representation.fpr; 229 } 230 231 VirtualRegister spillRegister() const 231 232 { 232 233 ASSERT(m_kind == BirthToSpill || m_kind == Spill); 233 return static_cast<VirtualRegister>(u.virtualReg);234 } 235 236 int operand() const234 return VirtualRegister(m_representation.virtualReg); 235 } 236 237 VirtualRegister bytecodeRegister() const 237 238 { 238 239 ASSERT(m_kind == SetLocalEvent || m_kind == MovHintEvent); 239 return u.virtualReg; 240 } 241 242 const VariableRepresentation& variableRepresentation() const { return u; } 240 return VirtualRegister(m_representation.virtualReg); 241 } 242 243 VirtualRegister machineRegister() const 244 { 245 ASSERT(m_kind == SetLocalEvent); 246 return VirtualRegister(m_which.virtualReg); 247 } 248 249 const VariableRepresentation& variableRepresentation() const { return m_representation; } 243 250 244 251 void dump(PrintStream&) const; … … 248 255 void dumpSpillInfo(const char* name, PrintStream&) const; 249 256 250 MinifiedID m_id; 257 union { 258 int virtualReg; 259 uintptr_t id; 260 } m_which; 251 261 252 262 // For BirthToFill, Fill: … … 258 268 // For Death: 259 269 // - Unused. 260 VariableRepresentation u;270 VariableRepresentation m_representation; 261 271 262 272 int8_t m_kind;
Note:
See TracChangeset
for help on using the changeset viewer.