On Sat, Oct 12, 2013 at 2:57 PM, Jason Orendorff <[email protected]> wrote: > What's up with #2? Do the debug epilogues really cost that much? Or are > we accidentally inhibiting Baseline somehow?
When debug mode is enabled we do the following: (1) Call DebugPrologue and DebugEpilogue (jit/VMFunctions.cpp) when entering/leaving a frame. (2) At the start of every bytecode op, ensure all values (even constants) are stored on the stack and emit a patchable NOP instruction (for breakpoints / step mode). What (2) means is that for instance for "var x = 0" inside a function, we usually emit only two instructions with debug mode disabled: movl $0xffffff81, -0x30(%ebp) movl $0x0, -0x34(%ebp) With debug mode enabled: cmpl %eax, ((205)) // patchable NOP, JSOP_ZERO push $0xffffff81 push $0x0 cmpl %eax, ((220)) // patchable NOP, JSOP_SETLOCAL movl -0x3c(%ebp), %edx movl -0x38(%ebp), %ecx movl %edx, -0x34(%ebp) movl %ecx, -0x30(%ebp) cmpl %eax, ((237)) // patchable NOP, JSOP_POP addl $0x8, %esp Especially if Esprima has many short-running function calls, the 5x instead of 3x slowdown is not unexpected I think. It should be easy to temporarily disable the prologue/epilogue calls and see how much faster that makes us (search for debugMode_ in BaselineCompiler.cpp) Jan _______________________________________________ dev-tech-js-engine-internals mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

