• fpizlo@apple.com's avatar
    Get rid of forward exit on UInt32ToNumber by adding an op_unsigned bytecode instruction · 9089acbe
    fpizlo@apple.com authored
    Reviewed by Oliver Hunt.
    UInt32ToNumber was a super complicated node because it had to do a speculation, but it
    would do it after we already had computed the urshift. It couldn't just back to the
    beginning of the urshift because the inputs to the urshift weren't necessarily live
    anymore. We couldn't jump forward to the beginning of the next instruction because the
    result of the urshift was not yet unsigned-converted.
    For a while we solved this by forward-exiting in UInt32ToNumber. But that's really
    gross and I want to get rid of all forward exits. They cause a lot of bugs.
    We could also have turned UInt32ToNumber to a backwards exit by forcing the inputs to
    the urshift to be live. I figure that this might be a bit too extreme.
    So, I just created a new place that we can exit to: I split op_urshift into op_urshift
    followed by op_unsigned. op_unsigned is an "unsigned cast" along the lines of what
    UInt32ToNumber does. This allows me to get rid of all of the nastyness in the DFG for
    forward exiting in UInt32ToNumber.
    This patch enables massive code carnage in the DFG and FTL, and brings us closer to
    eliminating one of the DFG's most confusing concepts. On the flipside, it does make the
    bytecode slightly more complex (one new instruction). This is a profitable trade. We
    want the DFG and FTL to trend towards simplicity, since they are both currently too
    * bytecode/BytecodeUseDef.h:
    * bytecode/CodeBlock.cpp:
    * bytecode/Opcode.h:
    * bytecode/ValueRecovery.cpp:
    * bytecode/ValueRecovery.h:
    * bytecompiler/NodesCodegen.cpp:
    * dfg/DFGByteCodeParser.cpp:
    * dfg/DFGClobberize.h:
    * dfg/DFGNodeType.h:
    * dfg/DFGOSRExitCompiler32_64.cpp:
    * dfg/DFGOSRExitCompiler64.cpp:
    * dfg/DFGSpeculativeJIT.cpp:
    * dfg/DFGSpeculativeJIT.h:
    * dfg/DFGSpeculativeJIT32_64.cpp:
    * dfg/DFGSpeculativeJIT64.cpp:
    * dfg/DFGStrengthReductionPhase.cpp:
    * ftl/FTLFormattedValue.h:
    * ftl/FTLLowerDFGToLLVM.cpp:
    * ftl/FTLValueFormat.cpp:
    * ftl/FTLValueFormat.h:
    * jit/JIT.cpp:
    * jit/JIT.h:
    * jit/JITArithmetic.cpp:
    * jit/JITArithmetic32_64.cpp:
    * llint/LowLevelInterpreter32_64.asm:
    * llint/LowLevelInterpreter64.asm:
    * runtime/CommonSlowPaths.cpp:
    * runtime/CommonSlowPaths.h:
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160587 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DFGByteCodeParser.cpp 162 KB