203 | | Revision 31432 was a 1.4% performance regression because it moved the register vector from a local to a parameter. Making the register vector a data member has the same effect. WTF? |
204 | | |
205 | | }}} |
206 | | |
| 203 | Revision 31432 was a 1.4% performance regression because it moved the register vector from a |
| 204 | local to a parameter. Making the register vector a data member has the same effect. WTF? |
| 205 | }}} |
| 206 | |
| 207 | {{{ |
| 208 | Exception handling throw logic has to pass vPC to a function, and assign the result to vPC, eg. |
| 209 | if (!(vPC = throwException(codeBlock, k, scopeChain, registers, r, vPC))) |
| 210 | But this causes a 25% regression on the above empty-for-loop test, despite never being hit. |
| 211 | To avoid this we need to do: |
| 212 | void* throwTarget; |
| 213 | ... |
| 214 | void Machine::privateExecute(..) |
| 215 | { |
| 216 | ... |
| 217 | // in address table initialiser |
| 218 | throwTarget = &&gcc_dependency_hack; |
| 219 | ... |
| 220 | BEGIN_OPCODE(op_throw) { |
| 221 | ... |
| 222 | if (!(exceptionTarget = throwException(codeBlock, k, scopeChain, registers, r, vPC))) { ... } |
| 223 | ... |
| 224 | goto *throwTarget; |
| 225 | } |
| 226 | gcc_dependency_hack: |
| 227 | { |
| 228 | vPC = exceptionTarget; |
| 229 | NEXT_OPCODE; |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | Without this _indirect_ goto we get a 25% regression, if we use a direct goto we still get an 18% regression. |
| 234 | |
| 235 | }}} |