Changeset 104762 in webkit


Ignore:
Timestamp:
Jan 11, 2012 4:14:42 PM (12 years ago)
Author:
ggaren@apple.com
Message:

REGRESSION: d3 Bullet Charts demo doesn't work (call with argument assignment is broken)
https://bugs.webkit.org/show_bug.cgi?id=75911

Source/JavaScriptCore:

  • bytecompiler/BytecodeGenerator.h:

(JSC::BytecodeGenerator::emitNodeForLeftHandSide): Cleanup: No need to
explicitly cast to our return type in C++.

  • bytecompiler/NodesCodegen.cpp:

(JSC::FunctionCallResolveNode::emitBytecode):
(JSC::ApplyFunctionCallDotNode::emitBytecode): Make sure to copy our function
into a temporary register before evaluating our arguments, since argument
evaluation might include function calls or assignments that overwrite our callee by name.

LayoutTests:

Reviewed by Filip Pizlo.

  • fast/js/function-argument-evaluation-expected.txt: Added.
  • fast/js/function-argument-evaluation.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r104761 r104762  
     12012-01-09  Geoffrey Garen  <ggaren@apple.com>
     2
     3        REGRESSION: d3 Bullet Charts demo doesn't work (call with argument assignment is broken)
     4        https://bugs.webkit.org/show_bug.cgi?id=75911
     5
     6        Reviewed by Filip Pizlo.
     7       
     8        * fast/js/function-argument-evaluation-expected.txt: Added.
     9        * fast/js/function-argument-evaluation.html: Added.
     10
    1112012-01-11  Adam Barth  <abarth@webkit.org>
    212
  • trunk/Source/JavaScriptCore/ChangeLog

    r104751 r104762  
     12012-01-09  Geoffrey Garen  <ggaren@apple.com>
     2
     3        REGRESSION: d3 Bullet Charts demo doesn't work (call with argument assignment is broken)
     4        https://bugs.webkit.org/show_bug.cgi?id=75911
     5
     6        * bytecompiler/BytecodeGenerator.h:
     7        (JSC::BytecodeGenerator::emitNodeForLeftHandSide): Cleanup: No need to
     8        explicitly cast to our return type in C++.
     9
     10        * bytecompiler/NodesCodegen.cpp:
     11        (JSC::FunctionCallResolveNode::emitBytecode):
     12        (JSC::ApplyFunctionCallDotNode::emitBytecode): Make sure to copy our function
     13        into a temporary register before evaluating our arguments, since argument
     14        evaluation might include function calls or assignments that overwrite our callee by name.
     15
    1162012-01-11  Michael Saboff  <msaboff@apple.com>
    217
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h

    r102545 r104762  
    275275            }
    276276
    277             return PassRefPtr<RegisterID>(emitNode(n));
     277            return emitNode(n);
    278278        }
    279279
  • trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp

    r102545 r104762  
    366366{
    367367    if (RefPtr<RegisterID> local = generator.registerFor(m_ident)) {
     368        RefPtr<RegisterID> function = generator.emitMove(generator.tempDestination(dst), local.get());
    368369        CallArguments callArguments(generator, m_args);
    369370        generator.emitLoad(callArguments.thisRegister(), jsUndefined());
    370         return generator.emitCall(generator.finalDestinationOrIgnored(dst, callArguments.thisRegister()), local.get(), callArguments, divot(), startOffset(), endOffset());
     371        return generator.emitCall(generator.finalDestinationOrIgnored(dst, callArguments.thisRegister()), function.get(), callArguments, divot(), startOffset(), endOffset());
    371372    }
    372373
     
    506507            if (generator.shouldEmitProfileHooks())
    507508                profileHookRegister = generator.newTemporary();
     509            RefPtr<RegisterID> realFunction = generator.emitMove(generator.tempDestination(dst), base.get());
    508510            RefPtr<RegisterID> thisRegister = generator.emitNode(m_args->m_listNode->m_expr);
    509511            RefPtr<RegisterID> argsRegister;
     
    519521                generator.emitNode(args->m_expr);
    520522
    521             generator.emitCallVarargs(finalDestinationOrIgnored.get(), base.get(), thisRegister.get(), argsRegister.get(), generator.newTemporary(), profileHookRegister.get(), divot(), startOffset(), endOffset());
     523            generator.emitCallVarargs(finalDestinationOrIgnored.get(), realFunction.get(), thisRegister.get(), argsRegister.get(), generator.newTemporary(), profileHookRegister.get(), divot(), startOffset(), endOffset());
    522524        }
    523525        generator.emitJump(end.get());
Note: See TracChangeset for help on using the changeset viewer.