Changeset 35226 in webkit for trunk/JavaScriptCore/kjs/nodes.cpp


Ignore:
Timestamp:
Jul 17, 2008, 1:39:52 PM (17 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

2008-07-17 Geoffrey Garen <[email protected]>

Reviewed by Oliver Hunt.


Fixed <rdar://problem/6081636> Functions calls use more temporary
registers than necessary


Holding a reference to the last statement result register caused each
successive statement to output its result to an even higher register.


Happily, statements don't actually need to return a result register
at all. I hope to make this clearer in a future cleanup patch,
but this change will fix the major bug for now.

  • kjs/nodes.cpp: (KJS::statementListEmitCode):

LayoutTests:

2008-07-17 Geoffrey Garen <[email protected]>

Reviewed by Oliver Hunt.


Test for <rdar://problem/6081636> Functions calls use more temporary
registers than necessary

  • fast/js/function-call-register-allocation.html: Added.
  • fast/js/function-call-register-allocation-expected.txt: Added.
  • fast/js/resources/function-call-register-allocation.js: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/nodes.cpp

    r35224 r35226  
    990990static inline RegisterID* statementListEmitCode(StatementVector& statements, CodeGenerator& generator, RegisterID* dst = 0)
    991991{
    992     RefPtr<RegisterID> r0 = dst;
    993 
    994992    StatementVector::iterator end = statements.end();
    995993    for (StatementVector::iterator it = statements.begin(); it != end; ++it) {
    996994        StatementNode* n = it->get();
    997995        generator.emitDebugHook(WillExecuteStatement, n->firstLine(), n->lastLine());
    998         if (RegisterID* r1 = generator.emitNode(dst, n))
    999             r0 = r1;
    1000     }
    1001    
    1002     return r0.get();
     996        generator.emitNode(dst, n);
     997    }
     998    return 0;
    1003999}
    10041000
Note: See TracChangeset for help on using the changeset viewer.