Changeset 45904 in webkit for trunk/JavaScriptCore/parser


Ignore:
Timestamp:
Jul 15, 2009, 5:16:38 AM (16 years ago)
Author:
[email protected]
Message:

REGRESSION: fast/js/postfix-syntax.html fails with interpreter
https://bugs.webkit.org/show_bug.cgi?id=27294

Reviewed by Simon Hausmann.

When postfix operators operating on locals assign to the same local
the order of operations has to be to store the incremented value, then
store the unmodified number. Rather than implementing this subtle
semantic in the interpreter I've just made the logic explicit in the
bytecode generator, so x=x++ effectively becomes x=ToNumber(x) (for a
local var x).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/parser/Nodes.cpp

    r45609 r45904  
    496496static RegisterID* emitPostIncOrDec(BytecodeGenerator& generator, RegisterID* dst, RegisterID* srcDst, Operator oper)
    497497{
     498    if (srcDst == dst)
     499        return generator.emitToJSNumber(dst, srcDst);
    498500    return (oper == OpPlusPlus) ? generator.emitPostInc(dst, srcDst) : generator.emitPostDec(dst, srcDst);
    499501}
Note: See TracChangeset for help on using the changeset viewer.