Changeset 33484 in webkit


Ignore:
Timestamp:
May 15, 2008 5:45:33 AM (16 years ago)
Author:
oliver@apple.com
Message:

Revert "Bug 18626: SQUIRRELFISH: support the "slow script" dialog"

This seems to cause a significant perf regression on some systems

Location:
branches/squirrelfish/JavaScriptCore
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • branches/squirrelfish/JavaScriptCore/ChangeLog

    r33483 r33484  
    1 2008-05-15  Oliver Hunt  <oliver@apple.com>
    2 
    3         Reviewed by Maciej.
    4 
    5         Bug 18626: SQUIRRELFISH: support the "slow script" dialog
    6         <https://bugs.webkit.org/show_bug.cgi?id=18626>
    7 
    8         Support the slow script dialog for for(;;), while, and do..while
    9         loops.
    10 
    11         * VM/CodeBlock.cpp:
    12         (KJS::CodeBlock::dump):
    13         * VM/CodeGenerator.cpp:
    14         (KJS::CodeGenerator::emitLoopIfTrue):
    15         * VM/CodeGenerator.h:
    16         * VM/ExceptionHelpers.cpp:
    17         (KJS::InterruptedExecutionError::isWatchdogException):
    18         (KJS::createInterruptedExecutionException):
    19         * VM/ExceptionHelpers.h:
    20         * VM/Machine.cpp:
    21         (KJS::Machine::throwException):
    22         (KJS::Machine::privateExecute):
    23         * VM/Opcode.h:
    24         * kjs/interpreter.cpp:
    25         (KJS::Interpreter::evaluate):
    26         * kjs/nodes.cpp:
    27         (KJS::DoWhileNode::emitCode):
    28         (KJS::WhileNode::emitCode):
    29         (KJS::ForNode::emitCode):
    30         * kjs/object.h:
    31 
    3212008-05-15  Geoffrey Garen  <ggaren@apple.com>
    332
  • branches/squirrelfish/JavaScriptCore/VM/CodeBlock.cpp

    r33483 r33484  
    427427            break;
    428428        }
    429         case op_loop_if_true: {
    430             printConditionalJump(begin, it, location, "loop_if_true");
    431             break;
    432         }
    433429        case op_jfalse: {
    434430            printConditionalJump(begin, it, location, "jfalse");
  • branches/squirrelfish/JavaScriptCore/VM/CodeGenerator.cpp

    r33483 r33484  
    378378}
    379379
    380 PassRefPtr<LabelID> CodeGenerator::emitLoopIfTrue(RegisterID* cond, LabelID* target)
    381 {
    382     instructions().append(machine().getOpcode(op_loop_if_true));
    383     instructions().append(cond->index());
    384     instructions().append(target->offsetFrom(instructions().size()));
    385     return target;
    386 }
    387 
    388380PassRefPtr<LabelID> CodeGenerator::emitJumpIfTrue(RegisterID* cond, LabelID* target)
    389381{
  • branches/squirrelfish/JavaScriptCore/VM/CodeGenerator.h

    r33483 r33484  
    221221        PassRefPtr<LabelID> emitLabel(LabelID*);
    222222        PassRefPtr<LabelID> emitJump(LabelID* target);
    223         PassRefPtr<LabelID> emitLoopIfTrue(RegisterID* cond, LabelID* target);
    224223        PassRefPtr<LabelID> emitJumpIfTrue(RegisterID* cond, LabelID* target);
    225224        PassRefPtr<LabelID> emitJumpIfFalse(RegisterID* cond, LabelID* target);
  • branches/squirrelfish/JavaScriptCore/VM/ExceptionHelpers.cpp

    r33483 r33484  
    7474}
    7575
    76 class InterruptedExecutionError : public JSObject {
    77 public:
    78     virtual bool isWatchdogException() const { return true; }
    79 };
    80 
    81 JSValue* createInterruptedExecutionException(ExecState*)
    82 {
    83     return new InterruptedExecutionError;
    84 }
    85 
    8676JSValue* createUndefinedVariableError(ExecState* exec, const Identifier& ident)
    8777{
  • branches/squirrelfish/JavaScriptCore/VM/ExceptionHelpers.h

    r33483 r33484  
    3939    JSValue* createNotAConstructorError(ExecState* exec, JSValue* value, Node* expr);
    4040    JSValue* createNotAFunctionError(ExecState* exec, JSValue* value, Node* expr);
    41     JSValue* createInterruptedExecutionException(ExecState* exec);
    4241}
    4342
  • branches/squirrelfish/JavaScriptCore/VM/Machine.cpp

    r33483 r33484  
    560560            exception->put(exec, "sourceURL", jsOwnedString(codeBlock->ownerNode->sourceURL()));
    561561        }
    562         if (exception->isWatchdogException())
    563             return 0;
    564562    }
    565563
     
    795793    Instruction* vPC = codeBlock->instructions.begin();
    796794    JSValue** k = codeBlock->jsValues.data();
    797 
     795   
    798796    registerFile->setSafeForReentry(false);
    799797#define VM_CHECK_EXCEPTION() \
     
    16541652        NEXT_OPCODE;
    16551653    }
    1656     BEGIN_OPCODE(op_loop_if_true) {
    1657         /* loop_if_true cond(r) target(offset)
    1658 
    1659           Does a JS timeout check, and immediately terminates execution and sets
    1660           an uncatchable exception on the ExecState.
    1661 
    1662           Assuming the watchdog test indicates it is safe, this jumps to offset
    1663           target from the current instruction, if and only if register cond
    1664           converts to boolean as true.
    1665          */
    1666 
    1667         if (UNLIKELY(exec->dynamicGlobalObject()->timedOut())) {
    1668             exceptionValue = createInterruptedExecutionException(exec);
    1669             goto vm_throw;
    1670         }
    1671 
    1672         int cond = (++vPC)->u.operand;
    1673         int target = (++vPC)->u.operand;
    1674         if (r[cond].u.jsValue->toBoolean(exec)) {
    1675             vPC += target;
    1676             NEXT_OPCODE;
    1677         }
    1678        
    1679         ++vPC;
    1680         NEXT_OPCODE;
    1681     }
    16821654    BEGIN_OPCODE(op_jfalse) {
    16831655        /* jfalse cond(r) target(offset)
  • branches/squirrelfish/JavaScriptCore/VM/Opcode.h

    r33483 r33484  
    9191        \
    9292        macro(op_jmp) \
    93         macro(op_loop_if_true) \
    9493        macro(op_jtrue) \
    9594        macro(op_jfalse) \
  • branches/squirrelfish/JavaScriptCore/kjs/interpreter.cpp

    r33483 r33484  
    8989#endif
    9090
    91     if (exception) {
    92         if (exception->isObject() && static_cast<JSObject*>(exception)->isWatchdogException())
    93             return Completion(Interrupted, result);
    94         return Completion(Throw, exception);
    95     }
    96     return Completion(Normal, result);
     91    return exception ? Completion(Throw, exception) : Completion(Normal, result);
    9792}
    9893
  • branches/squirrelfish/JavaScriptCore/kjs/nodes.cpp

    r33483 r33484  
    48964896    generator.emitLabel(continueTarget.get());
    48974897    RegisterID* cond = generator.emitNode(m_expr.get());
    4898     generator.emitLoopIfTrue(cond, topOfLoop.get());
     4898    generator.emitJumpIfTrue(cond, topOfLoop.get());
    48994899    generator.emitLabel(breakTarget.get());
    49004900    return result.get();
     
    49584958    generator.emitLabel(continueTarget.get());
    49594959    RegisterID* cond = generator.emitNode(m_expr.get());
    4960     generator.emitLoopIfTrue(cond, topOfLoop.get());
     4960    generator.emitJumpIfTrue(cond, topOfLoop.get());
    49614961
    49624962    generator.emitLabel(breakTarget.get());
     
    50265026    generator.emitLabel(beforeCondition.get());
    50275027    RegisterID* cond = generator.emitNode(m_expr2.get());
    5028     generator.emitLoopIfTrue(cond, topOfLoop.get());
     5028    generator.emitJumpIfTrue(cond, topOfLoop.get());
    50295029    generator.emitLabel(breakTarget.get());
    50305030    return result.get();
  • branches/squirrelfish/JavaScriptCore/kjs/object.h

    r33483 r33484  
    432432    virtual bool isVariableObject() const { return false; }
    433433
    434     virtual bool isWatchdogException() const { return false; }
    435434  protected:
    436435    PropertyMap _prop;
Note: See TracChangeset for help on using the changeset viewer.