Changeset 28887 in webkit


Ignore:
Timestamp:
Dec 20, 2007, 9:42:50 AM (18 years ago)
Author:
Darin Adler
Message:

Reviewed by Eric.

SuSpider shows 2.4% speedup.

Stop using completions in the execution engine.
Instead, the completion type and label target are both
stored in the ExecState.

  • API/JSContextRef.cpp: Removed unneeded include of "completion.h".
  • bindings/runtime_method.cpp: Removed unused execute function.
  • bindings/runtime_method.h: Ditto.
  • kjs/ExecState.h: Added completionType, breakOrContinueTarget, setCompletionType, setNormalCompletion, setBreakCompletion, setContinueCompletion, setReturnValueCompletion, setThrowCompletion, setInterruptedCompletion, m_completionType, and m_breakOrContinueTarget.
  • kjs/completion.h: Removed constructor and getter for target for break and continue from Completion. This class is now only used for the public API to Interpreter and such.
  • kjs/date_object.h: Removed unused execute function.
  • kjs/function.cpp: (KJS::FunctionImp::callAsFunction): Removed some unneeded exception processing. Updated to call the new execute function and to get the completion type from the ExecState. Merged in the execute function, which repeated some of the same logic and was called only from here. (KJS::GlobalFuncImp::callAsFunction): More of the same for eval.
  • kjs/function.h: Removed execute.
  • kjs/interpreter.cpp: (KJS::Interpreter::evaluate): Added code to convert the result of execut into a Completion.
  • kjs/nodes.cpp: (KJS::Node::setErrorCompletion): Renamed from createErrorCompletion. Now sets the completion type in the ExecState. (KJS::Node::rethrowException): Now sets the completion type in the ExecState. (KJS::StatementNode::hitStatement): Now sets the completion type in the ExecState. (KJS::VarStatementNode::execute): Updated to put completion type in the ExecState instead of a Completion object. (KJS::statementListExecute): Ditto. Also changed the for loop to use indices instead of iterators. (KJS::BlockNode::execute): Updated return type. (KJS::EmptyStatementNode::execute): Updated to put completion type in the ExecState instead of a Completion object. (KJS::ExprStatementNode::execute): Ditto. (KJS::IfNode::execute): Ditto. (KJS::DoWhileNode::execute): Ditto. Also streamlined the logic a little to make the normal case a little faster and moved the end outside the loop so that "break" can do a break. (KJS::WhileNode::execute): Ditto. (KJS::ForNode::execute): Ditto. (KJS::ForInNode::execute): Ditto. (KJS::ContinueNode::execute): Updated to put completion type in the ExecState instead of a Completion object. (KJS::BreakNode::execute): Ditto. (KJS::ReturnNode::execute): Ditto. (KJS::WithNode::execute): Ditto. (KJS::CaseClauseNode::executeStatements): Ditto. Also renamed to have execute in its name to reflect the fact that it's a member of the same family of functions. (KJS::CaseBlockNode::executeBlock): Ditto. (KJS::SwitchNode::execute): Ditto. (KJS::LabelNode::execute): Ditto. (KJS::ThrowNode::execute): Ditto. (KJS::TryNode::execute): Ditto. (KJS::ProgramNode::execute): Ditto. (KJS::EvalNode::execute): Ditto. (KJS::FunctionBodyNode::execute): Ditto. (KJS::FuncDeclNode::execute): Ditto.
  • kjs/nodes.h: Renamed setErrorCompletion to createErrorCompletion, made hitStatement protected, changed return value of execute to a JSValue, renamed evalStatements to executeStatements, and evalBlock to executeBlock.
  • kjs/number_object.h: Removed unused execute function.
Location:
trunk/JavaScriptCore
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/JSContextRef.cpp

    r28468 r28887  
    3232#include "JSClassRef.h"
    3333#include "JSGlobalObject.h"
    34 #include "completion.h"
    3534#include "object.h"
    3635#include <wtf/Platform.h>
  • trunk/JavaScriptCore/ChangeLog

    r28886 r28887  
     12007-12-20  Darin Adler  <[email protected]>
     2
     3        Reviewed by Eric.
     4
     5        - http://bugs.webkit.org/show_bug.cgi?id=16471
     6          Completions need to be smaller (or not exist at all)
     7
     8        SuSpider shows 2.4% speedup.
     9
     10        Stop using completions in the execution engine.
     11        Instead, the completion type and label target are both
     12        stored in the ExecState.
     13
     14        * API/JSContextRef.cpp: Removed unneeded include of "completion.h".
     15        * bindings/runtime_method.cpp: Removed unused execute function.
     16        * bindings/runtime_method.h: Ditto.
     17
     18        * kjs/ExecState.h: Added completionType, breakOrContinueTarget,
     19        setCompletionType, setNormalCompletion, setBreakCompletion,
     20        setContinueCompletion, setReturnValueCompletion, setThrowCompletion,
     21        setInterruptedCompletion, m_completionType, and m_breakOrContinueTarget.
     22
     23        * kjs/completion.h: Removed constructor and getter for target
     24        for break and continue from Completion. This class is now only
     25        used for the public API to Interpreter and such.
     26
     27        * kjs/date_object.h: Removed unused execute function.
     28
     29        * kjs/function.cpp:
     30        (KJS::FunctionImp::callAsFunction): Removed some unneeded
     31        exception processing. Updated to call the new execute function
     32        and to get the completion type from the ExecState. Merged in
     33        the execute function, which repeated some of the same logic and
     34        was called only from here.
     35        (KJS::GlobalFuncImp::callAsFunction): More of the same for eval.
     36        * kjs/function.h: Removed execute.
     37
     38        * kjs/interpreter.cpp:
     39        (KJS::Interpreter::evaluate): Added code to convert the result of
     40        execut into a Completion.
     41
     42        * kjs/nodes.cpp:
     43        (KJS::Node::setErrorCompletion): Renamed from createErrorCompletion.
     44        Now sets the completion type in the ExecState.
     45        (KJS::Node::rethrowException): Now sets the completion type in the
     46        ExecState.
     47        (KJS::StatementNode::hitStatement): Now sets the completion type in
     48        the ExecState.
     49        (KJS::VarStatementNode::execute): Updated to put completion type in
     50        the ExecState instead of a Completion object.
     51        (KJS::statementListExecute): Ditto. Also changed the for loop to use
     52        indices instead of iterators.
     53        (KJS::BlockNode::execute): Updated return type.
     54        (KJS::EmptyStatementNode::execute): Updated to put completion type in
     55        the ExecState instead of a Completion object.
     56        (KJS::ExprStatementNode::execute): Ditto.
     57        (KJS::IfNode::execute): Ditto.
     58        (KJS::DoWhileNode::execute): Ditto. Also streamlined the logic a little
     59        to make the normal case a little faster and moved the end outside the
     60        loop so that "break" can do a break.
     61        (KJS::WhileNode::execute): Ditto.
     62        (KJS::ForNode::execute): Ditto.
     63        (KJS::ForInNode::execute): Ditto.
     64        (KJS::ContinueNode::execute): Updated to put completion type in
     65        the ExecState instead of a Completion object.
     66        (KJS::BreakNode::execute): Ditto.
     67        (KJS::ReturnNode::execute): Ditto.
     68        (KJS::WithNode::execute): Ditto.
     69        (KJS::CaseClauseNode::executeStatements): Ditto. Also renamed to have
     70        execute in its name to reflect the fact that it's a member of the same
     71        family of functions.
     72        (KJS::CaseBlockNode::executeBlock): Ditto.
     73        (KJS::SwitchNode::execute): Ditto.
     74        (KJS::LabelNode::execute): Ditto.
     75        (KJS::ThrowNode::execute): Ditto.
     76        (KJS::TryNode::execute): Ditto.
     77        (KJS::ProgramNode::execute): Ditto.
     78        (KJS::EvalNode::execute): Ditto.
     79        (KJS::FunctionBodyNode::execute): Ditto.
     80        (KJS::FuncDeclNode::execute): Ditto.
     81
     82        * kjs/nodes.h: Renamed setErrorCompletion to createErrorCompletion, made
     83        hitStatement protected, changed return value of execute to a JSValue,
     84        renamed evalStatements to executeStatements, and evalBlock to executeBlock.
     85
     86        * kjs/number_object.h: Removed unused execute function.
     87
    1882007-12-20  Geoffrey Garen  <[email protected]>
    289
  • trunk/JavaScriptCore/bindings/runtime_method.cpp

    r28468 r28887  
    9393    return aValue;
    9494}
    95 
    96 Completion RuntimeMethod::execute(ExecState*)
    97 {
    98     return Completion(Normal, jsUndefined());
    99 }
  • trunk/JavaScriptCore/bindings/runtime_method.h

    r26715 r28887  
    3333namespace KJS {
    3434
    35 
    36 class RuntimeMethod : public InternalFunctionImp
    37 {
     35class RuntimeMethod : public InternalFunctionImp {
    3836public:
    3937    RuntimeMethod(ExecState *exec, const Identifier &n, Bindings::MethodList &methodList);
     
    4240
    4341    virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
    44 
    45     virtual Completion execute(ExecState *exec);
    4642
    4743private:
  • trunk/JavaScriptCore/kjs/ExecState.h

    r28884 r28887  
    109109
    110110        LocalStorage& localStorage() { return *m_localStorage; }
    111    
     111
     112        // These are only valid right after calling execute().
     113        ComplType completionType() const { return m_completionType; }
     114        const Identifier& breakOrContinueTarget() const
     115        {
     116            ASSERT(m_completionType == Break || m_completionType == Continue);
     117            return *m_breakOrContinueTarget;
     118        }
     119
     120        // Only for use in the implementation of execute().
     121        void setCompletionType(ComplType type)
     122        {
     123            ASSERT(type != Break);
     124            ASSERT(type != Continue);
     125            m_completionType = type;
     126        }
     127        JSValue* setNormalCompletion()
     128        {
     129            ASSERT(!hadException());
     130            m_completionType = Normal;
     131            return 0;
     132        }
     133        JSValue* setNormalCompletion(JSValue* value)
     134        {
     135            ASSERT(!hadException());
     136            m_completionType = Normal;
     137            return value;
     138        }
     139        JSValue* setBreakCompletion(const Identifier* target)
     140        {
     141            ASSERT(!hadException());
     142            m_completionType = Break;
     143            m_breakOrContinueTarget = target;
     144            return 0;
     145        }
     146        JSValue* setContinueCompletion(const Identifier* target)
     147        {
     148            ASSERT(!hadException());
     149            m_completionType = Continue;
     150            m_breakOrContinueTarget = target;
     151            return 0;
     152        }
     153        JSValue* setReturnValueCompletion(JSValue* returnValue)
     154        {
     155            ASSERT(!hadException());
     156            ASSERT(returnValue);
     157            m_completionType = ReturnValue;
     158            return returnValue;
     159        }
     160        JSValue* setThrowCompletion(JSValue* exception)
     161        {
     162            ASSERT(!hadException());
     163            ASSERT(exception);
     164            m_completionType = Throw;
     165            return exception;
     166        }
     167        JSValue* setInterruptedCompletion()
     168        {
     169            ASSERT(!hadException());
     170            m_completionType = Interrupted;
     171            return 0;
     172        }
     173
    112174    public:
    113175        ExecState(JSGlobalObject* glob, JSObject* thisV,
     
    142204        int m_switchDepth;
    143205        CodeType m_codeType;
     206
     207        ComplType m_completionType;
     208        const Identifier* m_breakOrContinueTarget;
    144209    };
    145210
  • trunk/JavaScriptCore/kjs/completion.h

    r26832 r28887  
    2727namespace KJS {
    2828
    29   class Identifier;
    3029  class JSValue;
    3130
     
    4544  public:
    4645    Completion(ComplType type = Normal, JSValue* value = 0)
    47         : m_type(type), m_value(value), m_target(0) { }
    48     Completion(ComplType type, const Identifier* target)
    49         : m_type(type), m_value(0), m_target(target) { }
     46        : m_type(type), m_value(value) { }
    5047
    5148    ComplType complType() const { return m_type; }
    5249    JSValue* value() const { return m_value; }
    5350    void setValue(JSValue* v) { m_value = v; }
    54     const Identifier& target() const { return *m_target; }
    5551    bool isValueCompletion() const { return !!m_value; }
    5652
     
    5854    ComplType m_type;
    5955    JSValue* m_value;
    60     const Identifier* m_target;
    6156  };
    6257
  • trunk/JavaScriptCore/kjs/date_object.h

    r27608 r28887  
    133133        virtual JSValue *callAsFunction(ExecState *, JSObject *thisObj, const List &args);
    134134
    135         Completion execute(const List &);
    136135        JSObject *construct(const List &);
    137136    };
  • trunk/JavaScriptCore/kjs/function.cpp

    r28884 r28887  
    7171JSValue* FunctionImp::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
    7272{
    73   // enter a new execution context
    74   ExecState newExec(exec->dynamicGlobalObject(), thisObj, body.get(), FunctionCode, exec, exec->dynamicGlobalObject()->currentExec(), this, &args);
    75   if (exec->hadException())
    76     newExec.setException(exec->exception());
    77 
    78   Completion comp = execute(&newExec);
    79 
    80   // if an exception occured, propogate it back to the previous execution object
    81   if (newExec.hadException())
    82     comp = Completion(Throw, newExec.exception());
    83 
    84   if (comp.complType() == Throw) {
    85     exec->setException(comp.value());
    86     return comp.value();
    87   }
    88   else if (comp.complType() == ReturnValue)
    89     return comp.value();
    90   else
     73    ExecState newExec(exec->dynamicGlobalObject(), thisObj, body.get(), FunctionCode, exec, exec->dynamicGlobalObject()->currentExec(), this, &args);
     74    JSValue* result = body->execute(&newExec);
     75    if (newExec.completionType() == Throw) {
     76        exec->setException(result);
     77        return result;
     78    }
     79    if (newExec.completionType() == ReturnValue)
     80        return result;
    9181    return jsUndefined();
    9282}
     
    213203  else
    214204    return obj;
    215 }
    216 
    217 Completion FunctionImp::execute(ExecState* exec)
    218 {
    219   Completion result = body->execute(exec);
    220 
    221   if (result.complType() == Throw || result.complType() == ReturnValue)
    222       return result;
    223   return Completion(Normal, jsUndefined()); // TODO: or ReturnValue ?
    224205}
    225206
     
    719700        JSObject* thisVal = static_cast<JSObject*>(exec->thisValue());
    720701        ExecState newExec(globalObject, thisVal, evalNode.get(), EvalCode, exec, globalObject->currentExec());
    721         if (exec->hadException())
    722             newExec.setException(exec->exception());
    723702         
    724703        if (switchGlobal) {
     
    726705            newExec.setVariableObject(static_cast<JSGlobalObject*>(thisObj));
    727706        }
    728        
    729         Completion c = evalNode->execute(&newExec);
    730          
     707        JSValue* value = evalNode->execute(&newExec);
    731708        if (switchGlobal)
    732709            newExec.popScope();
    733710
    734         // if an exception occured, propogate it back to the previous execution object
    735         if (newExec.hadException())
    736           exec->setException(newExec.exception());
    737 
    738         res = jsUndefined();
    739         if (c.complType() == Throw)
    740           exec->setException(c.value());
    741         else if (c.isValueCompletion())
    742             res = c.value();
     711        if (exec->completionType() == Throw) {
     712            exec->setException(value);
     713            return value;
     714        }
     715        return value ? value : jsUndefined();
    743716      }
    744       break;
    745717    }
    746718  case ParseInt:
  • trunk/JavaScriptCore/kjs/function.h

    r28545 r28887  
    8383   
    8484    virtual JSValue* callAsFunction(ExecState*, JSObject* thisObj, const List& args);
    85     Completion execute(ExecState*);
    8685
    8786    // Note: unlike body->paramName, this returns Identifier::null for parameters
  • trunk/JavaScriptCore/kjs/interpreter.cpp

    r28595 r28887  
    121121        // execute the code
    122122        ExecState newExec(globalObject, thisObj, progNode.get());
    123         res = progNode->execute(&newExec);
     123        JSValue* value = progNode->execute(&newExec);
     124        res = Completion(newExec.completionType(), value);
    124125    }
    125126   
  • trunk/JavaScriptCore/kjs/nodes.cpp

    r28886 r28887  
    4747#define KJS_BREAKPOINT \
    4848  if (Debugger::debuggersPresent > 0 && !hitStatement(exec)) \
    49     return Completion(Normal);
     49    return 0;
    5050
    5151#define KJS_CHECKEXCEPTION \
     
    272272}
    273273
    274 Completion Node::createErrorCompletion(ExecState* exec, ErrorType e, const char *msg)
    275 {
    276     return Completion(Throw, Error::create(exec, e, msg, lineNo(), currentSourceId(exec), currentSourceURL(exec)));
    277 }
    278 
    279 Completion Node::createErrorCompletion(ExecState *exec, ErrorType e, const char *msg, const Identifier &ident)
     274JSValue* Node::setErrorCompletion(ExecState* exec, ErrorType e, const char* msg)
     275{
     276    return exec->setThrowCompletion(Error::create(exec, e, msg, lineNo(), currentSourceId(exec), currentSourceURL(exec)));
     277}
     278
     279JSValue* Node::setErrorCompletion(ExecState* exec, ErrorType e, const char* msg, const Identifier& ident)
    280280{
    281281    UString message = msg;
    282282    substitute(message, ident.ustring());
    283     return Completion(Throw, Error::create(exec, e, message, lineNo(), currentSourceId(exec), currentSourceURL(exec)));
     283    return exec->setThrowCompletion(Error::create(exec, e, message, lineNo(), currentSourceId(exec), currentSourceURL(exec)));
    284284}
    285285
     
    365365}
    366366
    367 Completion Node::rethrowException(ExecState* exec)
     367JSValue* Node::rethrowException(ExecState* exec)
    368368{
    369369    JSValue* exception = exec->exception();
    370370    exec->clearException();
    371371    handleException(exec, exception);
    372     return Completion(Throw, exception);
     372    return exec->setThrowCompletion(exception);
    373373}
    374374
     
    387387}
    388388
    389 // return true if the debugger wants us to stop at this point
     389// Set normal completion and return false if the debugger wants us to stop at this point.
     390// FIXME: This seems like poor naming and strange design. Why false to stop? Why "hit statement"?
    390391bool StatementNode::hitStatement(ExecState* exec)
    391392{
    392   Debugger *dbg = exec->dynamicGlobalObject()->debugger();
    393   if (dbg)
    394     return dbg->atStatement(exec, currentSourceId(exec), firstLine(), lastLine());
    395   else
    396     return true; // continue
     393    Debugger* debugger = exec->dynamicGlobalObject()->debugger();
     394    if (!debugger || debugger->atStatement(exec, currentSourceId(exec), firstLine(), lastLine()))
     395        return true;
     396    exec->setCompletionType(Normal);
     397    return false;
    397398}
    398399
     
    35493550
    35503551// ECMA 12.2
    3551 Completion VarStatementNode::execute(ExecState *exec)
    3552 {
    3553     KJS_BREAKPOINT;
     3552JSValue* VarStatementNode::execute(ExecState* exec)
     3553{
     3554    KJS_BREAKPOINT
    35543555
    35553556    next->evaluate(exec);
    35563557    KJS_CHECKEXCEPTION
    35573558
    3558     return Completion(Normal);
     3559    return exec->setNormalCompletion();
    35593560}
    35603561
     
    35883589}
    35893590
    3590 static inline Completion statementListExecute(SourceElements& statements, ExecState* exec)
    3591 {
    3592     JSValue* v = 0;
    3593     Completion c(Normal);
    3594     const SourceElements::iterator end = statements.end();
    3595     for (SourceElements::iterator ptr = statements.begin(); ptr != end; ++ptr) {
    3596         c = (*ptr)->execute(exec);
    3597        
    3598         if (JSValue* v2 = c.value())
    3599             v = v2;
    3600         c.setValue(v);
    3601        
    3602         if (c.complType() != Normal)
    3603             return c;
    3604     }
    3605     return c;
    3606 }
    3607    
     3591static inline JSValue* statementListExecute(SourceElements& statements, ExecState* exec)
     3592{
     3593    JSValue* value = 0;
     3594    size_t size = statements.size();
     3595    for (size_t i = 0; i != size; ++i) {
     3596        JSValue* statementValue = statements[i]->execute(exec);
     3597        if (exec->completionType() != Normal)
     3598            return statementValue;
     3599        if (statementValue)
     3600            value = statementValue;
     3601    }
     3602    return exec->setNormalCompletion(value);
     3603}
     3604
    36083605// ------------------------------ BlockNode ------------------------------------
    36093606
     
    36203617
    36213618// ECMA 12.1
    3622 Completion BlockNode::execute(ExecState *exec)
     3619JSValue* BlockNode::execute(ExecState* exec)
    36233620{
    36243621    return statementListExecute(*m_children, exec);
     
    36283625
    36293626// ECMA 12.3
    3630 Completion EmptyStatementNode::execute(ExecState *)
    3631 {
    3632   return Completion(Normal);
     3627JSValue* EmptyStatementNode::execute(ExecState* exec)
     3628{
     3629    return exec->setNormalCompletion();
    36333630}
    36343631
     
    36423639
    36433640// ECMA 12.4
    3644 Completion ExprStatementNode::execute(ExecState *exec)
    3645 {
    3646   KJS_BREAKPOINT;
    3647 
    3648   JSValue *v = expr->evaluate(exec);
    3649   KJS_CHECKEXCEPTION
    3650 
    3651   return Completion(Normal, v);
     3641JSValue* ExprStatementNode::execute(ExecState* exec)
     3642{
     3643    KJS_BREAKPOINT
     3644
     3645    JSValue* value = expr->evaluate(exec);
     3646    KJS_CHECKEXCEPTION
     3647
     3648    return exec->setNormalCompletion(value);
    36523649}
    36533650
     
    36653662
    36663663// ECMA 12.5
    3667 Completion IfNode::execute(ExecState* exec)
    3668 {
    3669     KJS_BREAKPOINT;
     3664JSValue* IfNode::execute(ExecState* exec)
     3665{
     3666    KJS_BREAKPOINT
    36703667
    36713668    bool b = expr->evaluateToBoolean(exec);
     
    36783675    // no else
    36793676    if (!statement2)
    3680         return Completion(Normal);
     3677        return exec->setNormalCompletion();
    36813678
    36823679    // else
     
    36933690
    36943691// ECMA 12.6.1
    3695 Completion DoWhileNode::execute(ExecState *exec)
    3696 {
    3697     KJS_BREAKPOINT;
     3692JSValue* DoWhileNode::execute(ExecState* exec)
     3693{
     3694    KJS_BREAKPOINT
    36983695
    36993696    JSValue* value = 0;
     
    37013698    while (1) {
    37023699        exec->pushIteration();
    3703         Completion c = statement->execute(exec);
     3700        JSValue* statementValue = statement->execute(exec);
    37043701        exec->popIteration();
    37053702
    37063703        if (exec->dynamicGlobalObject()->timedOut())
    3707             return Completion(Interrupted);
    3708 
    3709         if (c.isValueCompletion())
    3710             value = c.value();
    3711 
    3712         if (!((c.complType() == Continue) && ls.contains(c.target()))) {
    3713             if ((c.complType() == Break) && ls.contains(c.target()))
    3714                 return Completion(Normal, value);
    3715             if (c.complType() != Normal)
    3716                 return c;
     3704            exec->setInterruptedCompletion();
     3705
     3706        if (statementValue)
     3707            value = statementValue;
     3708
     3709        if (exec->completionType() != Normal) {
     3710            if (exec->completionType() == Continue && ls.contains(exec->breakOrContinueTarget()))
     3711                goto continueDoWhileLoop;
     3712            if (exec->completionType() == Break && ls.contains(exec->breakOrContinueTarget()))
     3713                break;
     3714            return statementValue;
    37173715        }
    37183716
     3717continueDoWhileLoop:
    37193718        bool b = expr->evaluateToBoolean(exec);
    37203719        KJS_CHECKEXCEPTION
    37213720        if (!b)
    3722             return Completion(Normal, value);
    3723     }
    3724 
    3725     return Completion(); // work around gcc 4.0 bug
     3721            break;
     3722    }
     3723
     3724    return exec->setNormalCompletion(value);
    37263725}
    37273726
     
    37353734
    37363735// ECMA 12.6.2
    3737 Completion WhileNode::execute(ExecState *exec)
    3738 {
    3739     KJS_BREAKPOINT;
     3736JSValue* WhileNode::execute(ExecState* exec)
     3737{
     3738    KJS_BREAKPOINT
    37403739
    37413740    JSValue* value = 0;
     
    37453744        KJS_CHECKEXCEPTION
    37463745        if (!b)
    3747             return Completion(Normal, value);
     3746            break;
    37483747
    37493748        exec->pushIteration();
    3750         Completion c = statement->execute(exec);
     3749        JSValue* statementValue = statement->execute(exec);
    37513750        exec->popIteration();
    37523751
    37533752        if (exec->dynamicGlobalObject()->timedOut())
    3754             return Completion(Interrupted);
    3755    
    3756         if (c.isValueCompletion())
    3757             value = c.value();
    3758 
    3759         if ((c.complType() == Continue) && ls.contains(c.target()))
    3760             continue;
    3761         if ((c.complType() == Break) && ls.contains(c.target()))
    3762             return Completion(Normal, value);
    3763         if (c.complType() != Normal)
    3764             return c;
    3765     }
    3766 
    3767     return Completion(); // work around gcc 4.0 bug
     3753            return exec->setInterruptedCompletion();
     3754   
     3755        if (statementValue)
     3756            value = statementValue;
     3757
     3758        if (exec->completionType() != Normal) {
     3759            if (exec->completionType() == Continue && ls.contains(exec->breakOrContinueTarget()))
     3760                continue;
     3761            if (exec->completionType() == Break && ls.contains(exec->breakOrContinueTarget()))
     3762                break;
     3763            return statementValue;
     3764        }
     3765    }
     3766
     3767    return exec->setNormalCompletion(value);
    37683768}
    37693769
     
    37823782
    37833783// ECMA 12.6.3
    3784 Completion ForNode::execute(ExecState *exec)
    3785 {
    3786     JSValue* cval = 0;
     3784JSValue* ForNode::execute(ExecState *exec)
     3785{
     3786    JSValue* value = 0;
    37873787
    37883788    if (expr1) {
     
    37963796            KJS_CHECKEXCEPTION
    37973797            if (!b)
    3798                 return Completion(Normal, cval);
     3798                break;
    37993799        }
    38003800
    38013801        exec->pushIteration();
    3802         Completion c = statement->execute(exec);
     3802        JSValue* statementValue = statement->execute(exec);
    38033803        exec->popIteration();
    3804         if (c.isValueCompletion())
    3805             cval = c.value();
    3806         if (!((c.complType() == Continue) && ls.contains(c.target()))) {
    3807             if ((c.complType() == Break) && ls.contains(c.target()))
    3808                 return Completion(Normal, cval);
    3809             if (c.complType() != Normal)
    3810                 return c;
     3804        if (statementValue)
     3805            value = statementValue;
     3806
     3807        if (exec->dynamicGlobalObject()->timedOut())
     3808            return exec->setInterruptedCompletion();
     3809
     3810        if (exec->completionType() != Normal) {
     3811            if (exec->completionType() == Continue && ls.contains(exec->breakOrContinueTarget()))
     3812                goto continueForLoop;
     3813            if (exec->completionType() == Break && ls.contains(exec->breakOrContinueTarget()))
     3814                break;
     3815            return statementValue;
    38113816        }
    38123817
    3813         if (exec->dynamicGlobalObject()->timedOut())
    3814             return Completion(Interrupted);
    3815 
     3818continueForLoop:
    38163819        if (expr3) {
    38173820            expr3->evaluate(exec);
     
    38203823    }
    38213824 
    3822     return Completion(); // work around gcc 4.0 bug
     3825    return exec->setNormalCompletion(value);
    38233826}
    38243827
     
    38483851
    38493852// ECMA 12.6.4
    3850 Completion ForInNode::execute(ExecState *exec)
    3851 {
    3852   JSValue *e;
    3853   JSValue *retval = 0;
    3854   JSObject *v;
    3855   Completion c;
    3856   PropertyNameArray propertyNames;
     3853JSValue* ForInNode::execute(ExecState* exec)
     3854{
     3855  JSValue* value = 0;
    38573856
    38583857  if (varDecl) {
     
    38613860  }
    38623861
    3863   e = expr->evaluate(exec);
    3864 
    3865   // for Null and Undefined, we want to make sure not to go through
    3866   // the loop at all, because their object wrappers will have a
    3867   // property list but will throw an exception if you attempt to
    3868   // access any property.
     3862  JSValue* e = expr->evaluate(exec);
     3863
     3864  // For Null and Undefined, we want to make sure not to go through
     3865  // the loop at all, because toObject will throw an exception.
    38693866  if (e->isUndefinedOrNull())
    3870     return Completion(Normal);
     3867    return exec->setNormalCompletion();
    38713868
    38723869  KJS_CHECKEXCEPTION
    3873   v = e->toObject(exec);
     3870  JSObject* v = e->toObject(exec);
     3871  PropertyNameArray propertyNames;
    38743872  v->getPropertyNames(exec, propertyNames);
    38753873 
    38763874  PropertyNameArray::const_iterator end = propertyNames.end();
    38773875  for (PropertyNameArray::const_iterator it = propertyNames.begin(); it != end; ++it) {
    3878       const Identifier &name = *it;
     3876      const Identifier& name = *it;
    38793877      if (!v->hasProperty(exec, name))
    38803878          continue;
     
    39293927
    39303928    exec->pushIteration();
    3931     c = statement->execute(exec);
     3929    JSValue* statementValue = statement->execute(exec);
    39323930    exec->popIteration();
    3933     if (c.isValueCompletion())
    3934       retval = c.value();
    3935 
    3936     if (!((c.complType() == Continue) && ls.contains(c.target()))) {
    3937       if ((c.complType() == Break) && ls.contains(c.target()))
    3938         break;
    3939       if (c.complType() != Normal) {
    3940         return c;
    3941       }
     3931    if (statementValue)
     3932      value = statementValue;
     3933
     3934    if (exec->completionType() != Normal) {
     3935        if (exec->completionType() == Continue && ls.contains(exec->breakOrContinueTarget()))
     3936            continue;
     3937        if (exec->completionType() == Break && ls.contains(exec->breakOrContinueTarget()))
     3938            break;
     3939        return statementValue;
    39423940    }
    39433941  }
    39443942
    3945   return Completion(Normal, retval);
     3943  return exec->setNormalCompletion(value);
    39463944}
    39473945
     
    39493947
    39503948// ECMA 12.7
    3951 Completion ContinueNode::execute(ExecState *exec)
    3952 {
    3953   KJS_BREAKPOINT;
     3949JSValue* ContinueNode::execute(ExecState* exec)
     3950{
     3951  KJS_BREAKPOINT
    39543952
    39553953  if (ident.isEmpty() && !exec->inIteration())
    3956     return createErrorCompletion(exec, SyntaxError, "Invalid continue statement.");
     3954    return setErrorCompletion(exec, SyntaxError, "Invalid continue statement.");
    39573955  if (!ident.isEmpty() && !exec->seenLabels()->contains(ident))
    3958     return createErrorCompletion(exec, SyntaxError, "Label %s not found.", ident);
    3959   return Completion(Continue, &ident);
     3956    return setErrorCompletion(exec, SyntaxError, "Label %s not found.", ident);
     3957  return exec->setContinueCompletion(&ident);
    39603958}
    39613959
     
    39633961
    39643962// ECMA 12.8
    3965 Completion BreakNode::execute(ExecState *exec)
    3966 {
    3967   KJS_BREAKPOINT;
    3968 
    3969   if (ident.isEmpty() && !exec->inIteration() &&
    3970       !exec->inSwitch())
    3971     return createErrorCompletion(exec, SyntaxError, "Invalid break statement.");
     3963JSValue* BreakNode::execute(ExecState *exec)
     3964{
     3965  KJS_BREAKPOINT
     3966
     3967  if (ident.isEmpty() && !exec->inIteration() && !exec->inSwitch())
     3968    return setErrorCompletion(exec, SyntaxError, "Invalid break statement.");
    39723969  if (!ident.isEmpty() && !exec->seenLabels()->contains(ident))
    3973     return createErrorCompletion(exec, SyntaxError, "Label %s not found.");
    3974   return Completion(Break, &ident);
     3970    return setErrorCompletion(exec, SyntaxError, "Label %s not found.");
     3971  return exec->setBreakCompletion(&ident);
    39753972}
    39763973
     
    39843981
    39853982// ECMA 12.9
    3986 Completion ReturnNode::execute(ExecState *exec)
    3987 {
    3988   KJS_BREAKPOINT;
     3983JSValue* ReturnNode::execute(ExecState* exec)
     3984{
     3985  KJS_BREAKPOINT
    39893986
    39903987  CodeType codeType = exec->codeType();
    39913988  if (codeType != FunctionCode)
    3992     return createErrorCompletion(exec, SyntaxError, "Invalid return statement.");
     3989    return setErrorCompletion(exec, SyntaxError, "Invalid return statement.");
    39933990
    39943991  if (!value)
    3995     return Completion(ReturnValue, jsUndefined());
    3996 
    3997   JSValue *v = value->evaluate(exec);
     3992    return exec->setReturnValueCompletion(jsUndefined());
     3993
     3994  JSValue* v = value->evaluate(exec);
    39983995  KJS_CHECKEXCEPTION
    39993996
    4000   return Completion(ReturnValue, v);
     3997  return exec->setReturnValueCompletion(v);
    40013998}
    40023999
     
    40104007
    40114008// ECMA 12.10
    4012 Completion WithNode::execute(ExecState *exec)
    4013 {
    4014   KJS_BREAKPOINT;
     4009JSValue* WithNode::execute(ExecState *exec)
     4010{
     4011  KJS_BREAKPOINT
    40154012
    40164013  JSValue *v = expr->evaluate(exec);
     
    40194016  KJS_CHECKEXCEPTION
    40204017  exec->pushScope(o);
    4021   Completion res = statement->execute(exec);
     4018  JSValue* value = statement->execute(exec);
    40224019  exec->popScope();
    40234020
    4024   return res;
     4021  return value;
    40254022}
    40264023   
     
    40454042
    40464043// ECMA 12.11
    4047 Completion CaseClauseNode::evalStatements(ExecState *exec)
     4044JSValue* CaseClauseNode::executeStatements(ExecState* exec)
    40484045{
    40494046  if (m_children)
    40504047    return statementListExecute(*m_children, exec);
    4051   else
    4052     return Completion(Normal, jsUndefined());
     4048  return exec->setNormalCompletion();
    40534049}
    40544050
     
    40824078
    40834079// ECMA 12.11
    4084 Completion CaseBlockNode::evalBlock(ExecState *exec, JSValue *input)
    4085 {
    4086   JSValue *v;
    4087   Completion res;
    4088   ClauseListNode *a = list1.get();
    4089   ClauseListNode *b = list2.get();
    4090   CaseClauseNode *clause;
    4091 
     4080JSValue* CaseBlockNode::executeBlock(ExecState* exec, JSValue* input)
     4081{
     4082  ClauseListNode* a = list1.get();
    40924083    while (a) {
    4093       clause = a->getClause();
     4084      CaseClauseNode* clause = a->getClause();
    40944085      a = a->getNext();
    4095       v = clause->evaluate(exec);
     4086      JSValue* v = clause->evaluate(exec);
    40964087      KJS_CHECKEXCEPTION
    40974088      if (strictEqual(exec, input, v)) {
    4098         res = clause->evalStatements(exec);
    4099         if (res.complType() != Normal)
     4089        JSValue* res = clause->executeStatements(exec);
     4090        if (exec->completionType() != Normal)
    41004091          return res;
    4101         while (a) {
    4102           res = a->getClause()->evalStatements(exec);
    4103           if (res.complType() != Normal)
     4092        for (; a; a = a->getNext()) {
     4093          JSValue* res = a->getClause()->executeStatements(exec);
     4094          if (exec->completionType() != Normal)
    41044095            return res;
    4105           a = a->getNext();
    41064096        }
    41074097        break;
     
    41094099    }
    41104100
     4101  ClauseListNode* b = list2.get();
    41114102  while (b) {
    4112     clause = b->getClause();
     4103    CaseClauseNode* clause = b->getClause();
    41134104    b = b->getNext();
    4114     v = clause->evaluate(exec);
     4105    JSValue* v = clause->evaluate(exec);
    41154106    KJS_CHECKEXCEPTION
    41164107    if (strictEqual(exec, input, v)) {
    4117       res = clause->evalStatements(exec);
    4118       if (res.complType() != Normal)
     4108      JSValue* res = clause->executeStatements(exec);
     4109      if (exec->completionType() != Normal)
    41194110        return res;
    41204111      goto step18;
     
    41244115  // default clause
    41254116  if (def) {
    4126     res = def->evalStatements(exec);
    4127     if (res.complType() != Normal)
     4117    JSValue* res = def->executeStatements(exec);
     4118    if (exec->completionType() != Normal)
    41284119      return res;
    41294120  }
     
    41314122 step18:
    41324123  while (b) {
    4133     clause = b->getClause();
    4134     res = clause->evalStatements(exec);
    4135     if (res.complType() != Normal)
     4124    CaseClauseNode* clause = b->getClause();
     4125    JSValue* res = clause->executeStatements(exec);
     4126    if (exec->completionType() != Normal)
    41364127      return res;
    41374128    b = b->getNext();
     
    41414132  KJS_CHECKEXCEPTION
    41424133
    4143   return Completion(Normal);
     4134  return exec->setNormalCompletion();
    41444135}
    41454136
     
    41534144
    41544145// ECMA 12.11
    4155 Completion SwitchNode::execute(ExecState *exec)
    4156 {
    4157   KJS_BREAKPOINT;
     4146JSValue* SwitchNode::execute(ExecState* exec)
     4147{
     4148  KJS_BREAKPOINT
    41584149
    41594150  JSValue *v = expr->evaluate(exec);
     
    41614152
    41624153  exec->pushSwitch();
    4163   Completion res = block->evalBlock(exec,v);
     4154  JSValue* result = block->executeBlock(exec, v);
    41644155  exec->popSwitch();
    41654156
    4166   if ((res.complType() == Break) && ls.contains(res.target()))
    4167     return Completion(Normal, res.value());
    4168   return res;
     4157  if (exec->completionType() == Break && ls.contains(exec->breakOrContinueTarget()))
     4158    exec->setCompletionType(Normal);
     4159  return result;
    41694160}
    41704161
     
    41774168
    41784169// ECMA 12.12
    4179 Completion LabelNode::execute(ExecState *exec)
     4170JSValue* LabelNode::execute(ExecState *exec)
    41804171{
    41814172  if (!exec->seenLabels()->push(label))
    4182     return createErrorCompletion(exec, SyntaxError, "Duplicated label %s found.", label);
    4183   Completion e = statement->execute(exec);
     4173    return setErrorCompletion(exec, SyntaxError, "Duplicated label %s found.", label);
     4174  JSValue* result = statement->execute(exec);
    41844175  exec->seenLabels()->pop();
    41854176
    4186   if ((e.complType() == Break) && (e.target() == label))
    4187     return Completion(Normal, e.value());
    4188   return e;
     4177  if (exec->completionType() == Break && exec->breakOrContinueTarget() == label)
     4178    exec->setCompletionType(Normal);
     4179  return result;
    41894180}
    41904181
     
    41974188
    41984189// ECMA 12.13
    4199 Completion ThrowNode::execute(ExecState *exec)
    4200 {
    4201   KJS_BREAKPOINT;
     4190JSValue* ThrowNode::execute(ExecState* exec)
     4191{
     4192  KJS_BREAKPOINT
    42024193
    42034194  JSValue *v = expr->evaluate(exec);
     
    42054196
    42064197  handleException(exec, v);
    4207   return Completion(Throw, v);
     4198  return exec->setThrowCompletion(v);
    42084199}
    42094200
     
    42194210
    42204211// ECMA 12.14
    4221 Completion TryNode::execute(ExecState *exec)
    4222 {
    4223   KJS_BREAKPOINT;
    4224 
    4225   Completion c = tryBlock->execute(exec);
     4212JSValue* TryNode::execute(ExecState *exec)
     4213{
     4214  KJS_BREAKPOINT
     4215
     4216  JSValue* result = tryBlock->execute(exec);
    42264217
    42274218  if (Collector::isOutOfMemory())
    4228       return c; // don't try to catch an out of memory exception thrown by the collector
     4219      return result; // don't try to catch an out of memory exception thrown by the collector
    42294220 
    4230   if (catchBlock && c.complType() == Throw) {
    4231     JSObject *obj = new JSObject;
    4232     obj->put(exec, exceptionIdent, c.value(), DontDelete);
     4221  if (catchBlock && exec->completionType() == Throw) {
     4222    JSObject* obj = new JSObject;
     4223    obj->put(exec, exceptionIdent, result, DontDelete);
    42334224    exec->pushScope(obj);
    4234     c = catchBlock->execute(exec);
     4225    result = catchBlock->execute(exec);
    42354226    exec->popScope();
    42364227  }
    42374228
    42384229  if (finallyBlock) {
    4239     Completion c2 = finallyBlock->execute(exec);
    4240     if (c2.complType() != Normal)
    4241       c = c2;
     4230    ComplType savedCompletionType = exec->completionType();
     4231    JSValue* finallyResult = finallyBlock->execute(exec);
     4232    if (exec->completionType() != Normal)
     4233        result = finallyResult;
     4234    else
     4235        exec->setCompletionType(savedCompletionType);
    42424236  }
    42434237
    4244   return c;
     4238  return result;
    42454239}
    42464240
     
    44974491}
    44984492
    4499 Completion ProgramNode::execute(ExecState* exec)
     4493JSValue* ProgramNode::execute(ExecState* exec)
    45004494{
    45014495    processDeclarations(exec);
     
    45034497}
    45044498
    4505 Completion EvalNode::execute(ExecState* exec)
     4499JSValue* EvalNode::execute(ExecState* exec)
    45064500{
    45074501    processDeclarations(exec);
     
    45094503}
    45104504
    4511 Completion FunctionBodyNode::execute(ExecState* exec)
     4505JSValue* FunctionBodyNode::execute(ExecState* exec)
    45124506{
    45134507    processDeclarations(exec);
     
    45164510        if (!dbg->callEvent(exec, sourceId(), lineNo(), exec->function(), *exec->arguments())) {
    45174511            dbg->imp()->abort();
    4518             return Completion(Interrupted, jsUndefined());
     4512            return exec->setInterruptedCompletion();
    45194513        }
    45204514    }   
    45214515   
    4522     Completion completion = ScopeNode::execute(exec);
     4516    JSValue* result = ScopeNode::execute(exec);
    45234517   
    45244518    if (Debugger* dbg = exec->dynamicGlobalObject()->debugger()) {
    4525         if (completion.complType() == Throw)
    4526             exec->setException(completion.value());
    4527 
     4519        if (exec->completionType() == Throw)
     4520            exec->setException(result);
    45284521        if (!dbg->returnEvent(exec, sourceId(), lineNo(), exec->function())) {
    45294522            dbg->imp()->abort();
    4530             return Completion(Interrupted, jsUndefined());
     4523            return exec->setInterruptedCompletion();
    45314524        }
    45324525    }
    45334526
    45344527   
    4535     return completion;
     4528    return result;
    45364529}
    45374530
     
    45564549}
    45574550
    4558 Completion FuncDeclNode::execute(ExecState *)
    4559 {
    4560     return Completion(Normal);
     4551JSValue* FuncDeclNode::execute(ExecState* exec)
     4552{
     4553    return exec->setNormalCompletion();
    45614554}
    45624555
  • trunk/JavaScriptCore/kjs/nodes.h

    r28884 r28887  
    145145  protected:
    146146    Node(JSType) KJS_FAST_CALL; // used by ExpressionNode
    147     Completion createErrorCompletion(ExecState *, ErrorType, const char *msg) KJS_FAST_CALL;
    148     Completion createErrorCompletion(ExecState *, ErrorType, const char *msg, const Identifier &) KJS_FAST_CALL;
    149 
     147
     148    // for use in execute()
     149    JSValue* setErrorCompletion(ExecState*, ErrorType, const char* msg) KJS_FAST_CALL;
     150    JSValue* setErrorCompletion(ExecState*, ErrorType, const char* msg, const Identifier&) KJS_FAST_CALL;
     151
     152    // for use in evaluate()
    150153    JSValue* throwError(ExecState*, ErrorType, const char* msg) KJS_FAST_CALL;
    151154    JSValue* throwError(ExecState*, ErrorType, const char* msg, const char*) KJS_FAST_CALL;
     
    161164    void handleException(ExecState*, JSValue*) KJS_FAST_CALL;
    162165
    163     Completion rethrowException(ExecState*) KJS_FAST_CALL;
     166    // for use in execute()
     167    JSValue* rethrowException(ExecState*) KJS_FAST_CALL;
    164168
    165169    int m_line : 28;
     
    201205    int firstLine() const KJS_FAST_CALL { return lineNo(); }
    202206    int lastLine() const KJS_FAST_CALL { return m_lastLine; }
    203     bool hitStatement(ExecState*) KJS_FAST_CALL;
    204     virtual Completion execute(ExecState *exec) KJS_FAST_CALL = 0;
     207    virtual JSValue* execute(ExecState *exec) KJS_FAST_CALL = 0;
    205208    void pushLabel(const Identifier &id) KJS_FAST_CALL { ls.push(id); }
    206209    virtual Precedence precedence() const { ASSERT_NOT_REACHED(); return PrecExpression; }
    207210  protected:
     211    bool hitStatement(ExecState*) KJS_FAST_CALL;
    208212    LabelStack ls;
    209213  private:
     
    17251729    VarStatementNode(VarDeclNode* l) KJS_FAST_CALL : next(l) { }
    17261730    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1727     virtual Completion execute(ExecState*) KJS_FAST_CALL;
     1731    virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
    17281732    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    17291733  private:
     
    17441748    }
    17451749    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL { ASSERT_NOT_REACHED(); }
    1746     virtual Completion execute(ExecState*) KJS_FAST_CALL  { ASSERT_NOT_REACHED(); return Completion(); }
     1750    virtual JSValue* execute(ExecState*) KJS_FAST_CALL  { ASSERT_NOT_REACHED(); return 0; }
    17471751    virtual void streamTo(SourceStream&) const KJS_FAST_CALL  { ASSERT_NOT_REACHED(); }
    17481752    virtual Precedence precedence() const { ASSERT_NOT_REACHED(); return PrecExpression; }
     
    17551759    BlockNode(SourceElements* children) KJS_FAST_CALL;
    17561760    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1757     virtual Completion execute(ExecState*) KJS_FAST_CALL;
     1761    virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
    17581762    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    17591763  protected:
     
    17641768  public:
    17651769    EmptyStatementNode() KJS_FAST_CALL { } // debug
    1766     virtual Completion execute(ExecState*) KJS_FAST_CALL;
     1770    virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
    17671771    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    17681772  };
     
    17721776    ExprStatementNode(ExpressionNode* e) KJS_FAST_CALL : expr(e) { }
    17731777    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1774     virtual Completion execute(ExecState*) KJS_FAST_CALL;
     1778    virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
    17751779    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    17761780  private:
     
    17831787      : expr(e), statement1(s1), statement2(s2) { }
    17841788    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1785     virtual Completion execute(ExecState*) KJS_FAST_CALL;
     1789    virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
    17861790    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    17871791  private:
     
    17951799    DoWhileNode(StatementNode *s, ExpressionNode* e) KJS_FAST_CALL : statement(s), expr(e) { }
    17961800    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1797     virtual Completion execute(ExecState*) KJS_FAST_CALL;
     1801    virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
    17981802    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    17991803  private:
     
    18061810    WhileNode(ExpressionNode* e, StatementNode *s) KJS_FAST_CALL : expr(e), statement(s) { }
    18071811    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1808     virtual Completion execute(ExecState*) KJS_FAST_CALL;
     1812    virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
    18091813    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    18101814  private:
     
    18251829
    18261830    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1827     virtual Completion execute(ExecState*) KJS_FAST_CALL;
     1831    virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
    18281832    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    18291833  private:
     
    18391843    ForInNode(const Identifier &i, AssignExprNode *in, ExpressionNode* e, StatementNode *s) KJS_FAST_CALL;
    18401844    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1841     virtual Completion execute(ExecState*) KJS_FAST_CALL;
     1845    virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
    18421846    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    18431847    VarDeclNode* getVarDecl() { return varDecl.get(); }
     
    18551859    ContinueNode() KJS_FAST_CALL { }
    18561860    ContinueNode(const Identifier &i) KJS_FAST_CALL : ident(i) { }
    1857     virtual Completion execute(ExecState*) KJS_FAST_CALL;
     1861    virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
    18581862    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    18591863  private:
     
    18651869    BreakNode() KJS_FAST_CALL { }
    18661870    BreakNode(const Identifier &i) KJS_FAST_CALL : ident(i) { }
    1867     virtual Completion execute(ExecState*) KJS_FAST_CALL;
     1871    virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
    18681872    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    18691873  private:
     
    18751879    ReturnNode(ExpressionNode* v) KJS_FAST_CALL : value(v) {}
    18761880    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1877     virtual Completion execute(ExecState*) KJS_FAST_CALL;
     1881    virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
    18781882    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    18791883  private:
     
    18851889    WithNode(ExpressionNode* e, StatementNode* s) KJS_FAST_CALL : expr(e), statement(s) { }
    18861890    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1887     virtual Completion execute(ExecState*) KJS_FAST_CALL;
     1891    virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
    18881892    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    18891893  private:
     
    18961900    LabelNode(const Identifier &l, StatementNode *s) KJS_FAST_CALL : label(l), statement(s) { }
    18971901    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1898     virtual Completion execute(ExecState*) KJS_FAST_CALL;
     1902    virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
    18991903    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    19001904  private:
     
    19071911    ThrowNode(ExpressionNode* e) KJS_FAST_CALL : expr(e) {}
    19081912    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1909     virtual Completion execute(ExecState*) KJS_FAST_CALL;
     1913    virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
    19101914    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    19111915  private:
     
    19181922      : tryBlock(b), exceptionIdent(e), catchBlock(c), finallyBlock(f) { }
    19191923    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1920     virtual Completion execute(ExecState*) KJS_FAST_CALL;
     1924    virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
    19211925    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    19221926  private:
     
    19651969  public:
    19661970    ProgramNode(SourceElements*, DeclarationStacks::VarStack*, DeclarationStacks::FunctionStack*) KJS_FAST_CALL;
    1967     virtual Completion execute(ExecState*) KJS_FAST_CALL;
     1971    virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
    19681972   
    19691973  private:
     
    19781982  public:
    19791983    EvalNode(SourceElements*, DeclarationStacks::VarStack*, DeclarationStacks::FunctionStack*) KJS_FAST_CALL;
    1980     virtual Completion execute(ExecState*) KJS_FAST_CALL;
     1984    virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
    19811985   
    19821986  private:
     
    19881992    FunctionBodyNode(SourceElements*, DeclarationStacks::VarStack*, DeclarationStacks::FunctionStack*) KJS_FAST_CALL;
    19891993
    1990     virtual Completion execute(ExecState*) KJS_FAST_CALL;
     1994    virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
    19911995
    19921996    SymbolTable& symbolTable() KJS_FAST_CALL { return m_symbolTable; }
     
    20262030    FuncDeclNode(const Identifier& i, ParameterNode* p, FunctionBodyNode* b) KJS_FAST_CALL
    20272031      : ident(i), param(p), body(b) { addParams(); }
    2028     virtual Completion execute(ExecState*) KJS_FAST_CALL;
     2032    virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
    20292033    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    20302034    ALWAYS_INLINE FunctionImp* makeFunction(ExecState*) KJS_FAST_CALL;
     
    20462050
    20472051      JSValue* evaluate(ExecState*) KJS_FAST_CALL;
    2048       Completion evalStatements(ExecState*) KJS_FAST_CALL;
     2052      JSValue* executeStatements(ExecState*) KJS_FAST_CALL;
    20492053
    20502054  private:
     
    20742078      CaseBlockNode(ClauseListNode* l1, CaseClauseNode* d, ClauseListNode* l2) KJS_FAST_CALL;
    20752079      virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    2076       Completion evalBlock(ExecState *exec, JSValue *input) KJS_FAST_CALL;
     2080      JSValue* executeBlock(ExecState*, JSValue *input) KJS_FAST_CALL;
    20772081      virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    20782082      virtual Precedence precedence() const { ASSERT_NOT_REACHED(); return PrecExpression; }
     
    20872091      SwitchNode(ExpressionNode* e, CaseBlockNode *b) KJS_FAST_CALL : expr(e), block(b) { }
    20882092      virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    2089       virtual Completion execute(ExecState*) KJS_FAST_CALL;
     2093      virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
    20902094      virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    20912095  private:
  • trunk/JavaScriptCore/kjs/number_object.h

    r15846 r28887  
    8989    enum { NaNValue, NegInfinity, PosInfinity, MaxValue, MinValue };
    9090
    91     Completion execute(const List &);
    9291    JSObject *construct(const List &);
    9392  };
Note: See TracChangeset for help on using the changeset viewer.