Changeset 41544 in webkit for trunk/JavaScriptCore/assembler


Ignore:
Timestamp:
Mar 9, 2009, 6:09:44 PM (16 years ago)
Author:
[email protected]
Message:

Bug 24447: REGRESSION (r41508): Google Maps does not complete initialization
<rdar://problem/6657774>

Reviewed by Gavin Barraclough

r41508 actually exposed a pre-existing bug where we were not invalidating the result
register cache at jump targets. This causes problems when condition loads occur in an

expression -- namely through the ?: and
operators. This patch corrects these issues

by marking the target of all forward jumps as being a jump target, and then clears the
result register cache when ever it starts generating code for a targeted instruction.

I do not believe it is possible to cause this class of failure outside of a single
expression, and expressions only provide forward branches, so this should resolve this
entire class of bug. That said i've included a test case that gets as close as possible
to hitting this bug with a back branch, to hopefully prevent anyone from introducing the
problem in future.

Location:
trunk/JavaScriptCore/assembler
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/assembler/AbstractMacroAssembler.h

    r41089 r41544  
    207207        }
    208208       
     209        bool isUsed() const { return m_label.isUsed(); }
     210        void used() { m_label.used(); }
    209211    private:
    210212        JmpDst m_label;
  • trunk/JavaScriptCore/assembler/X86Assembler.h

    r41474 r41544  
    242242        JmpDst()
    243243            : m_offset(-1)
    244         {
    245         }
    246 
     244            , m_used(false)
     245        {
     246        }
     247
     248        bool isUsed() const { return m_used; }
     249        void used() { m_used = true; }
    247250    private:
    248251        JmpDst(int offset)
    249252            : m_offset(offset)
    250         {
    251         }
    252 
    253         int m_offset;
     253            , m_used(false)
     254        {
     255            ASSERT(m_offset == offset);
     256        }
     257
     258        int m_offset : 31;
     259        bool m_used : 1;
    254260    };
    255261
Note: See TracChangeset for help on using the changeset viewer.