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


Ignore:
Timestamp:
May 29, 2008, 10:45:16 PM (17 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

2008-05-29 Maciej Stachowiak <[email protected]>

Reviewed by Oliver.

  • fixed <rdar://problem/5972943> REGRESSION(r33979): Flash clips do not play on cnn.com


Finally blocks could clobber registers that had to remain live
until they returned. This patch takes a conservative approach and
makes sure that finally blocks do not reuse any registers that
were previously allocated for the function. In the future this
could probably be tightened up to be less profligate with the
register allocation.


  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::highestUsedRegister):
  • VM/CodeGenerator.h:
  • kjs/nodes.cpp: (KJS::TryNode::emitCode):

LayoutTests:

2008-05-29 Maciej Stachowiak <[email protected]>

Reviewed by Oliver. Test by Geoff Garen.


  • fixed <rdar://problem/5972943> REGRESSION(r33979): Flash clips do not play on cnn.com
  • fast/js/finally-codegen-failure-expected.txt: Added.
  • fast/js/finally-codegen-failure.html: Added.
File:
1 edited

Legend:

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

    r34192 r34250  
    57465746    if (m_finallyBlock) {
    57475747        generator.popFinallyContext();
     5748        // there may be important registers live at the time we jump
     5749        // to a finally block (such as for a return or throw) so we
     5750        // ref the highest register ever used as a conservative
     5751        // approach to not clobbering anything important
     5752        RefPtr<RegisterID> highestUsedRegister = generator.highestUsedRegister();
    57485753        RefPtr<LabelID> finallyEndLabel = generator.newLabel();
    57495754        generator.emitJumpSubroutine(finallyReturnAddr.get(), finallyStart.get());
Note: See TracChangeset for help on using the changeset viewer.