Changeset 34842 in webkit for trunk/JavaScriptCore/VM/Machine.h


Ignore:
Timestamp:
Jun 27, 2008, 9:02:03 PM (17 years ago)
Author:
[email protected]
Message:

Bug 18626: SQUIRRELFISH: support the "slow script" dialog <https://bugs.webkit.org/show_bug.cgi?id=18626>
<rdar://problem/5973931> Slow script dialog needs to be reimplemented for squirrelfish

Reviewed by Sam

Adds support for the slow script dialog in squirrelfish. This requires the addition
of three new op codes, op_loop, op_loop_if_true, and op_loop_if_less which have the
same behaviour as their simple jump equivalents but have an additional time out check.

Additional assertions were added to other jump instructions to prevent accidentally
creating loops with jump types that do not support time out checks.

Sunspider does not report a regression, however this appears very sensitive to code
layout and hardware, so i would expect up to a 1% regression on other systems.

Part of this required moving the old timeout logic from JSGlobalObject and into Machine
which is the cause of a number of the larger diff blocks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/VM/Machine.h

    r34838 r34842  
    4343    class Instruction;
    4444    class JSFunction;
     45    class JSGlobalObject;
    4546    class ProgramNode;
    4647    class Register;
     
    9798
    9899        void getFunctionAndArguments(Register** registerBase, Register* callFrame, JSFunction*&, Register*& argv, int& argc);
     100        void setTimeoutTime(unsigned timeoutTime) { m_timeoutTime = timeoutTime; }
     101       
     102        void startTimeoutCheck()
     103        {
     104            if (!m_timeoutCheckCount)
     105                resetTimeoutCheck();
     106           
     107            ++m_timeoutCheckCount;
     108        }
     109       
     110        void stopTimeoutCheck()
     111        {
     112            --m_timeoutCheckCount;
     113        }
    99114
     115        inline void initTimeout()
     116        {
     117            resetTimeoutCheck();
     118            m_timeoutTime = 0;
     119            m_timeoutCheckCount = 0;
     120        }
    100121        void mark(Heap* heap) { m_registerFile.mark(heap); }
    101122
     
    119140        void dumpRegisters(const CodeBlock*, RegisterFile*, const Register*);
    120141
     142        JSValue* checkTimeout(JSGlobalObject*);
     143        void resetTimeoutCheck();
     144
    121145        int m_reentryDepth;
     146        unsigned m_timeoutTime;
     147        unsigned m_timeAtLastCheckTimeout;
     148        unsigned m_timeExecuting;
     149        unsigned m_timeoutCheckCount;
     150        unsigned m_ticksUntilNextTimeoutCheck;
     151
    122152        RegisterFile m_registerFile;
    123153
Note: See TracChangeset for help on using the changeset viewer.