Changeset 33484 in webkit
- Timestamp:
- May 15, 2008 5:45:33 AM (16 years ago)
- 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" dialog6 <https://bugs.webkit.org/show_bug.cgi?id=18626>7 8 Support the slow script dialog for for(;;), while, and do..while9 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 32 1 2008-05-15 Geoffrey Garen <ggaren@apple.com> 33 2 -
branches/squirrelfish/JavaScriptCore/VM/CodeBlock.cpp
r33483 r33484 427 427 break; 428 428 } 429 case op_loop_if_true: {430 printConditionalJump(begin, it, location, "loop_if_true");431 break;432 }433 429 case op_jfalse: { 434 430 printConditionalJump(begin, it, location, "jfalse"); -
branches/squirrelfish/JavaScriptCore/VM/CodeGenerator.cpp
r33483 r33484 378 378 } 379 379 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 388 380 PassRefPtr<LabelID> CodeGenerator::emitJumpIfTrue(RegisterID* cond, LabelID* target) 389 381 { -
branches/squirrelfish/JavaScriptCore/VM/CodeGenerator.h
r33483 r33484 221 221 PassRefPtr<LabelID> emitLabel(LabelID*); 222 222 PassRefPtr<LabelID> emitJump(LabelID* target); 223 PassRefPtr<LabelID> emitLoopIfTrue(RegisterID* cond, LabelID* target);224 223 PassRefPtr<LabelID> emitJumpIfTrue(RegisterID* cond, LabelID* target); 225 224 PassRefPtr<LabelID> emitJumpIfFalse(RegisterID* cond, LabelID* target); -
branches/squirrelfish/JavaScriptCore/VM/ExceptionHelpers.cpp
r33483 r33484 74 74 } 75 75 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 86 76 JSValue* createUndefinedVariableError(ExecState* exec, const Identifier& ident) 87 77 { -
branches/squirrelfish/JavaScriptCore/VM/ExceptionHelpers.h
r33483 r33484 39 39 JSValue* createNotAConstructorError(ExecState* exec, JSValue* value, Node* expr); 40 40 JSValue* createNotAFunctionError(ExecState* exec, JSValue* value, Node* expr); 41 JSValue* createInterruptedExecutionException(ExecState* exec);42 41 } 43 42 -
branches/squirrelfish/JavaScriptCore/VM/Machine.cpp
r33483 r33484 560 560 exception->put(exec, "sourceURL", jsOwnedString(codeBlock->ownerNode->sourceURL())); 561 561 } 562 if (exception->isWatchdogException())563 return 0;564 562 } 565 563 … … 795 793 Instruction* vPC = codeBlock->instructions.begin(); 796 794 JSValue** k = codeBlock->jsValues.data(); 797 795 798 796 registerFile->setSafeForReentry(false); 799 797 #define VM_CHECK_EXCEPTION() \ … … 1654 1652 NEXT_OPCODE; 1655 1653 } 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 sets1660 an uncatchable exception on the ExecState.1661 1662 Assuming the watchdog test indicates it is safe, this jumps to offset1663 target from the current instruction, if and only if register cond1664 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 }1682 1654 BEGIN_OPCODE(op_jfalse) { 1683 1655 /* jfalse cond(r) target(offset) -
branches/squirrelfish/JavaScriptCore/VM/Opcode.h
r33483 r33484 91 91 \ 92 92 macro(op_jmp) \ 93 macro(op_loop_if_true) \94 93 macro(op_jtrue) \ 95 94 macro(op_jfalse) \ -
branches/squirrelfish/JavaScriptCore/kjs/interpreter.cpp
r33483 r33484 89 89 #endif 90 90 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); 97 92 } 98 93 -
branches/squirrelfish/JavaScriptCore/kjs/nodes.cpp
r33483 r33484 4896 4896 generator.emitLabel(continueTarget.get()); 4897 4897 RegisterID* cond = generator.emitNode(m_expr.get()); 4898 generator.emit LoopIfTrue(cond, topOfLoop.get());4898 generator.emitJumpIfTrue(cond, topOfLoop.get()); 4899 4899 generator.emitLabel(breakTarget.get()); 4900 4900 return result.get(); … … 4958 4958 generator.emitLabel(continueTarget.get()); 4959 4959 RegisterID* cond = generator.emitNode(m_expr.get()); 4960 generator.emit LoopIfTrue(cond, topOfLoop.get());4960 generator.emitJumpIfTrue(cond, topOfLoop.get()); 4961 4961 4962 4962 generator.emitLabel(breakTarget.get()); … … 5026 5026 generator.emitLabel(beforeCondition.get()); 5027 5027 RegisterID* cond = generator.emitNode(m_expr2.get()); 5028 generator.emit LoopIfTrue(cond, topOfLoop.get());5028 generator.emitJumpIfTrue(cond, topOfLoop.get()); 5029 5029 generator.emitLabel(breakTarget.get()); 5030 5030 return result.get(); -
branches/squirrelfish/JavaScriptCore/kjs/object.h
r33483 r33484 432 432 virtual bool isVariableObject() const { return false; } 433 433 434 virtual bool isWatchdogException() const { return false; }435 434 protected: 436 435 PropertyMap _prop;
Note: See TracChangeset
for help on using the changeset viewer.