Changeset 45904 in webkit for trunk/JavaScriptCore


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).

Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r45903 r45904  
     12009-07-15  Oliver Hunt  <[email protected]>
     2
     3        Reviewed by Simon Hausmann.
     4
     5        REGRESSION: fast/js/postfix-syntax.html fails with interpreter
     6        https://bugs.webkit.org/show_bug.cgi?id=27294
     7
     8        When postfix operators operating on locals assign to the same local
     9        the order of operations has to be to store the incremented value, then
     10        store the unmodified number.  Rather than implementing this subtle
     11        semantic in the interpreter I've just made the logic explicit in the
     12        bytecode generator, so x=x++ effectively becomes x=ToNumber(x) (for a
     13        local var x).
     14
     15        * parser/Nodes.cpp:
     16        (JSC::emitPostIncOrDec):
     17
    1182009-07-15  Oliver Hunt  <[email protected]>
    219
  • 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.