Changeset 34335 in webkit for trunk/JavaScriptCore/VM


Ignore:
Timestamp:
Jun 3, 2008, 12:46:41 AM (17 years ago)
Author:
[email protected]
Message:

2008-06-03 Maciej Stachowiak <[email protected]>

Reviewed by Oliver.

  • VM/Machine.cpp: (KJS::Machine::privateExecute): Document throw and catch opcodes.
File:
1 edited

Legend:

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

    r34319 r34335  
    22562256    }
    22572257    BEGIN_OPCODE(op_catch) {
     2258        /* catch ex(r)
     2259
     2260           Retrieves the VMs current exception and puts it in register
     2261           ex. This is only valid after an exception has been raised,
     2262           and usually forms the beginning of an exception handler.
     2263        */
    22582264        ASSERT(exceptionValue);
    22592265        ASSERT(!exec->hadException());
    2260         int r0 = (++vPC)->u.operand;
    2261         r[r0].u.jsValue = exceptionValue;
     2266        int ex = (++vPC)->u.operand;
     2267        r[ex].u.jsValue = exceptionValue;
    22622268        exceptionValue = 0;
     2269
    22632270        ++vPC;
    22642271        NEXT_OPCODE;
    22652272    }
    22662273    BEGIN_OPCODE(op_throw) {
    2267         int e = (++vPC)->u.operand;
    2268         exceptionValue = r[e].u.jsValue;
     2274        /* throw ex(r)
     2275
     2276           Throws register ex as an exception. This involves three
     2277           steps: first, it is set as the current exception in the
     2278           VM's internal state, then the stack is unwound until an
     2279           exception handler or a native code boundary is found, and
     2280           then control resumes at the exception handler if any or
     2281           else the script returns control to the nearest native caller.
     2282        */
     2283
     2284        int ex = (++vPC)->u.operand;
     2285        exceptionValue = r[ex].u.jsValue;
    22692286        handlerVPC = throwException(exec, exceptionValue, registerBase, vPC, codeBlock, k, scopeChain, r);
    22702287        if (!handlerVPC) {
Note: See TracChangeset for help on using the changeset viewer.